Unify package files for JS adapter (#9789)

This commit is contained in:
Jon Koops 2022-02-08 19:52:46 +01:00 committed by GitHub
parent 2c238b9f04
commit 90fe97133c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 103 additions and 85 deletions

View file

@ -1,2 +1,4 @@
node node
node_modules node_modules
dist/*
!dist/*.d.ts

View file

@ -1,24 +1,27 @@
{ {
"name": "keycloak-js-adapter", "name": "keycloak-js",
"version": "${project.version}",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "keycloak-js-adapter", "name": "keycloak-js",
"version": "${project.version}",
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"base64-js": "^1.5.1", "base64-js": "^1.5.1",
"es6-promise": "^4.2.8",
"js-sha256": "^0.9.0" "js-sha256": "^0.9.0"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-inject": "^4.0.3", "@rollup/plugin-inject": "^4.0.4",
"@rollup/plugin-node-resolve": "^13.1.1", "@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-typescript": "^8.3.0", "@rollup/plugin-typescript": "^8.3.0",
"@types/node": "^17.0.5", "@types/node": "^17.0.16",
"rollup": "^2.62.0", "es6-promise": "^4.2.8",
"rollup": "^2.67.1",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"typescript": "^4.5.4" "typescript": "^4.5.5"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
@ -84,9 +87,9 @@
"dev": true "dev": true
}, },
"node_modules/@rollup/plugin-inject": { "node_modules/@rollup/plugin-inject": {
"version": "4.0.3", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.3.tgz", "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz",
"integrity": "sha512-lzMXmj0LZjd67MI+M8H9dk/oCxR0TYqYAdZ6ZOejWQLSUtud+FUPu4NCMAO8KyWWAalFo8ean7yFHCMvCNsCZw==", "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@rollup/pluginutils": "^3.1.0", "@rollup/pluginutils": "^3.1.0",
@ -104,9 +107,9 @@
"dev": true "dev": true
}, },
"node_modules/@rollup/plugin-node-resolve": { "node_modules/@rollup/plugin-node-resolve": {
"version": "13.1.1", "version": "13.1.3",
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.1.tgz", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz",
"integrity": "sha512-6QKtRevXLrmEig9UiMYt2fSvee9TyltGRfw+qSs6xjUnxwjOzTOqy+/Lpxsgjb8mJn1EQNbCDAvt89O4uzL5kw==", "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@rollup/pluginutils": "^3.1.0", "@rollup/pluginutils": "^3.1.0",
@ -165,9 +168,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "17.0.5", "version": "17.0.16",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.16.tgz",
"integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", "integrity": "sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA==",
"dev": true "dev": true
}, },
"node_modules/@types/resolve": { "node_modules/@types/resolve": {
@ -303,7 +306,8 @@
"node_modules/es6-promise": { "node_modules/es6-promise": {
"version": "4.2.8", "version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
"dev": true
}, },
"node_modules/escape-string-regexp": { "node_modules/escape-string-regexp": {
"version": "1.0.5", "version": "1.0.5",
@ -548,9 +552,9 @@
} }
}, },
"node_modules/rollup": { "node_modules/rollup": {
"version": "2.62.0", "version": "2.67.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.62.0.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.67.1.tgz",
"integrity": "sha512-cJEQq2gwB0GWMD3rYImefQTSjrPYaC6s4J9pYqnstVLJ1CHa/aZNVkD4Epuvg4iLeMA4KRiq7UM7awKK6j7jcw==", "integrity": "sha512-1Sbcs4OuW+aD+hhqpIRl+RqooIpF6uQcfzU/QSI7vGkwADY6cM4iLsBGRM2CGLXDTDN5y/yShohFmnKegSPWzg==",
"dev": true, "dev": true,
"bin": { "bin": {
"rollup": "dist/bin/rollup" "rollup": "dist/bin/rollup"
@ -685,9 +689,9 @@
"peer": true "peer": true
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "4.5.4", "version": "4.5.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz",
"integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
@ -755,9 +759,9 @@
} }
}, },
"@rollup/plugin-inject": { "@rollup/plugin-inject": {
"version": "4.0.3", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.3.tgz", "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz",
"integrity": "sha512-lzMXmj0LZjd67MI+M8H9dk/oCxR0TYqYAdZ6ZOejWQLSUtud+FUPu4NCMAO8KyWWAalFo8ean7yFHCMvCNsCZw==", "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@rollup/pluginutils": "^3.1.0", "@rollup/pluginutils": "^3.1.0",
@ -774,9 +778,9 @@
} }
}, },
"@rollup/plugin-node-resolve": { "@rollup/plugin-node-resolve": {
"version": "13.1.1", "version": "13.1.3",
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.1.tgz", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz",
"integrity": "sha512-6QKtRevXLrmEig9UiMYt2fSvee9TyltGRfw+qSs6xjUnxwjOzTOqy+/Lpxsgjb8mJn1EQNbCDAvt89O4uzL5kw==", "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@rollup/pluginutils": "^3.1.0", "@rollup/pluginutils": "^3.1.0",
@ -815,9 +819,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "17.0.5", "version": "17.0.16",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.16.tgz",
"integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", "integrity": "sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA==",
"dev": true "dev": true
}, },
"@types/resolve": { "@types/resolve": {
@ -924,7 +928,8 @@
"es6-promise": { "es6-promise": {
"version": "4.2.8", "version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
"dev": true
}, },
"escape-string-regexp": { "escape-string-regexp": {
"version": "1.0.5", "version": "1.0.5",
@ -1129,9 +1134,9 @@
} }
}, },
"rollup": { "rollup": {
"version": "2.62.0", "version": "2.67.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.62.0.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.67.1.tgz",
"integrity": "sha512-cJEQq2gwB0GWMD3rYImefQTSjrPYaC6s4J9pYqnstVLJ1CHa/aZNVkD4Epuvg4iLeMA4KRiq7UM7awKK6j7jcw==", "integrity": "sha512-1Sbcs4OuW+aD+hhqpIRl+RqooIpF6uQcfzU/QSI7vGkwADY6cM4iLsBGRM2CGLXDTDN5y/yShohFmnKegSPWzg==",
"dev": true, "dev": true,
"requires": { "requires": {
"fsevents": "~2.3.2" "fsevents": "~2.3.2"
@ -1222,9 +1227,9 @@
"peer": true "peer": true
}, },
"typescript": { "typescript": {
"version": "4.5.4", "version": "4.5.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz",
"integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==",
"dev": true "dev": true
}, },
"wrappy": { "wrappy": {

View file

@ -1,22 +1,43 @@
{ {
"name": "keycloak-js-adapter", "name": "keycloak-js",
"private": true, "version": "${project.version}",
"description": "Keycloak Adapter",
"main": "dist/keycloak.js",
"module": "dist/keycloak.mjs",
"types": "dist/keycloak.d.ts",
"files": [
"dist"
],
"scripts": { "scripts": {
"build": "rollup --config --configPlugin typescript" "build": "rollup --config --configPlugin typescript"
}, },
"repository": {
"type": "git",
"url": "https://github.com/keycloak/keycloak"
},
"author": "Keycloak",
"license": "Apache-2.0",
"homepage": "https://www.keycloak.org",
"keywords": [
"keycloak",
"sso",
"oauth",
"oauth2",
"authentication"
],
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-inject": "^4.0.3", "@rollup/plugin-inject": "^4.0.4",
"@rollup/plugin-node-resolve": "^13.1.1", "@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-typescript": "^8.3.0", "@rollup/plugin-typescript": "^8.3.0",
"@types/node": "^17.0.5", "@types/node": "^17.0.16",
"rollup": "^2.62.0", "es6-promise": "^4.2.8",
"rollup": "^2.67.1",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"typescript": "^4.5.4" "typescript": "^4.5.5"
}, },
"dependencies": { "dependencies": {
"base64-js": "^1.5.1", "base64-js": "^1.5.1",
"es6-promise": "^4.2.8",
"js-sha256": "^0.9.0" "js-sha256": "^0.9.0"
} }
} }

View file

@ -29,7 +29,29 @@
<name>Keycloak JS Integration</name> <name>Keycloak JS Integration</name>
<build> <build>
<resources>
<resource>
<directory>static</directory>
</resource>
<resource>
<directory>dist</directory>
</resource>
</resources>
<plugins> <plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>dist</directory>
<excludes>
<exclude>*.d.ts</exclude>
</excludes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>com.github.eirslett</groupId> <groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId> <artifactId>frontend-maven-plugin</artifactId>

View file

@ -17,8 +17,8 @@ function defineOptions({
name, name,
amdId, amdId,
}: DefineOptionsArgs): RollupOptions[] { }: DefineOptionsArgs): RollupOptions[] {
const sourceDir = "src/main/js"; const sourceDir = "src";
const targetDir = "target/classes"; const targetDir = "dist";
const commonOptions: RollupOptions = { const commonOptions: RollupOptions = {
input: path.join(sourceDir, `${file}.js`), input: path.join(sourceDir, `${file}.js`),
plugins: [commonjs(), nodeResolve()], plugins: [commonjs(), nodeResolve()],

View file

@ -25,7 +25,7 @@
<files> <files>
<file> <file>
<source>src/main/resources/package.json</source> <source>../../../adapters/oidc/js/package.json</source>
<outputDirectory>/</outputDirectory> <outputDirectory>/</outputDirectory>
<filtered>true</filtered> <filtered>true</filtered>
</file> </file>

View file

@ -1,29 +0,0 @@
{
"name": "keycloak-js",
"version": "${project.version}",
"description": "Keycloak Adapter",
"main": "dist/keycloak.js",
"module": "dist/keycloak.mjs",
"typings": "dist/keycloak.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/keycloak/keycloak"
},
"author": "Keycloak",
"license": "Apache-2.0",
"homepage": "https://www.keycloak.org",
"keywords": [
"keycloak",
"sso",
"oauth",
"oauth2",
"authentication"
],
"dependencies": {
"base64-js": "^1.5.1",
"js-sha256": "^0.9.0"
}
}

View file

@ -215,7 +215,7 @@
<server.output.dir.version>${project.version}</server.output.dir.version> <server.output.dir.version>${project.version}</server.output.dir.version>
<!-- Frontend --> <!-- Frontend -->
<node.version>v16.13.1</node.version> <node.version>v16.13.2</node.version>
</properties> </properties>
<url>http://keycloak.org</url> <url>http://keycloak.org</url>

View file

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {KeycloakLoginOptions} from "../../../../../../../../../../adapters/oidc/js/src/main/resources/keycloak"; import {KeycloakLoginOptions} from "../../../../../../../../../../adapters/oidc/js";
declare const baseUrl: string; declare const baseUrl: string;
export type KeycloakClient = Keycloak.KeycloakInstance; export type KeycloakClient = Keycloak.KeycloakInstance;

View file

@ -15,8 +15,5 @@
}, },
"include": [ "include": [
"./app/**/*.ts?" "./app/**/*.ts?"
],
"files": [
"../../../../../../../../adapters/oidc/js/src/main/resources/keycloak.d.ts"
] ]
} }