diff --git a/adapters/oidc/js/.gitignore b/adapters/oidc/js/.gitignore index 6b7940261b..ecc15fae0f 100644 --- a/adapters/oidc/js/.gitignore +++ b/adapters/oidc/js/.gitignore @@ -1,2 +1,4 @@ node node_modules +dist/* +!dist/*.d.ts diff --git a/adapters/oidc/js/src/main/resources/keycloak-authz.d.ts b/adapters/oidc/js/dist/keycloak-authz.d.ts similarity index 100% rename from adapters/oidc/js/src/main/resources/keycloak-authz.d.ts rename to adapters/oidc/js/dist/keycloak-authz.d.ts diff --git a/adapters/oidc/js/src/main/resources/keycloak.d.ts b/adapters/oidc/js/dist/keycloak.d.ts similarity index 100% rename from adapters/oidc/js/src/main/resources/keycloak.d.ts rename to adapters/oidc/js/dist/keycloak.d.ts diff --git a/adapters/oidc/js/package-lock.json b/adapters/oidc/js/package-lock.json index e0ac963a3e..ebfbe14e84 100644 --- a/adapters/oidc/js/package-lock.json +++ b/adapters/oidc/js/package-lock.json @@ -1,24 +1,27 @@ { - "name": "keycloak-js-adapter", + "name": "keycloak-js", + "version": "${project.version}", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "keycloak-js-adapter", + "name": "keycloak-js", + "version": "${project.version}", + "license": "Apache-2.0", "dependencies": { "base64-js": "^1.5.1", - "es6-promise": "^4.2.8", "js-sha256": "^0.9.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-inject": "^4.0.3", - "@rollup/plugin-node-resolve": "^13.1.1", + "@rollup/plugin-inject": "^4.0.4", + "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-typescript": "^8.3.0", - "@types/node": "^17.0.5", - "rollup": "^2.62.0", + "@types/node": "^17.0.16", + "es6-promise": "^4.2.8", + "rollup": "^2.67.1", "rollup-plugin-terser": "^7.0.2", - "typescript": "^4.5.4" + "typescript": "^4.5.5" } }, "node_modules/@babel/code-frame": { @@ -84,9 +87,9 @@ "dev": true }, "node_modules/@rollup/plugin-inject": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.3.tgz", - "integrity": "sha512-lzMXmj0LZjd67MI+M8H9dk/oCxR0TYqYAdZ6ZOejWQLSUtud+FUPu4NCMAO8KyWWAalFo8ean7yFHCMvCNsCZw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz", + "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", @@ -104,9 +107,9 @@ "dev": true }, "node_modules/@rollup/plugin-node-resolve": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.1.tgz", - "integrity": "sha512-6QKtRevXLrmEig9UiMYt2fSvee9TyltGRfw+qSs6xjUnxwjOzTOqy+/Lpxsgjb8mJn1EQNbCDAvt89O4uzL5kw==", + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz", + "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", @@ -165,9 +168,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", - "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", + "version": "17.0.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.16.tgz", + "integrity": "sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA==", "dev": true }, "node_modules/@types/resolve": { @@ -303,7 +306,8 @@ "node_modules/es6-promise": { "version": "4.2.8", "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": { "version": "1.0.5", @@ -548,9 +552,9 @@ } }, "node_modules/rollup": { - "version": "2.62.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.62.0.tgz", - "integrity": "sha512-cJEQq2gwB0GWMD3rYImefQTSjrPYaC6s4J9pYqnstVLJ1CHa/aZNVkD4Epuvg4iLeMA4KRiq7UM7awKK6j7jcw==", + "version": "2.67.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.67.1.tgz", + "integrity": "sha512-1Sbcs4OuW+aD+hhqpIRl+RqooIpF6uQcfzU/QSI7vGkwADY6cM4iLsBGRM2CGLXDTDN5y/yShohFmnKegSPWzg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -685,9 +689,9 @@ "peer": true }, "node_modules/typescript": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", - "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -755,9 +759,9 @@ } }, "@rollup/plugin-inject": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.3.tgz", - "integrity": "sha512-lzMXmj0LZjd67MI+M8H9dk/oCxR0TYqYAdZ6ZOejWQLSUtud+FUPu4NCMAO8KyWWAalFo8ean7yFHCMvCNsCZw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz", + "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -774,9 +778,9 @@ } }, "@rollup/plugin-node-resolve": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.1.tgz", - "integrity": "sha512-6QKtRevXLrmEig9UiMYt2fSvee9TyltGRfw+qSs6xjUnxwjOzTOqy+/Lpxsgjb8mJn1EQNbCDAvt89O4uzL5kw==", + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz", + "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -815,9 +819,9 @@ "dev": true }, "@types/node": { - "version": "17.0.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", - "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", + "version": "17.0.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.16.tgz", + "integrity": "sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA==", "dev": true }, "@types/resolve": { @@ -924,7 +928,8 @@ "es6-promise": { "version": "4.2.8", "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": { "version": "1.0.5", @@ -1129,9 +1134,9 @@ } }, "rollup": { - "version": "2.62.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.62.0.tgz", - "integrity": "sha512-cJEQq2gwB0GWMD3rYImefQTSjrPYaC6s4J9pYqnstVLJ1CHa/aZNVkD4Epuvg4iLeMA4KRiq7UM7awKK6j7jcw==", + "version": "2.67.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.67.1.tgz", + "integrity": "sha512-1Sbcs4OuW+aD+hhqpIRl+RqooIpF6uQcfzU/QSI7vGkwADY6cM4iLsBGRM2CGLXDTDN5y/yShohFmnKegSPWzg==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -1222,9 +1227,9 @@ "peer": true }, "typescript": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", - "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "wrappy": { diff --git a/adapters/oidc/js/package.json b/adapters/oidc/js/package.json index b58febff3a..9e60e86cee 100644 --- a/adapters/oidc/js/package.json +++ b/adapters/oidc/js/package.json @@ -1,22 +1,43 @@ { - "name": "keycloak-js-adapter", - "private": true, + "name": "keycloak-js", + "version": "${project.version}", + "description": "Keycloak Adapter", + "main": "dist/keycloak.js", + "module": "dist/keycloak.mjs", + "types": "dist/keycloak.d.ts", + "files": [ + "dist" + ], "scripts": { "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": { "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-inject": "^4.0.3", - "@rollup/plugin-node-resolve": "^13.1.1", + "@rollup/plugin-inject": "^4.0.4", + "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-typescript": "^8.3.0", - "@types/node": "^17.0.5", - "rollup": "^2.62.0", + "@types/node": "^17.0.16", + "es6-promise": "^4.2.8", + "rollup": "^2.67.1", "rollup-plugin-terser": "^7.0.2", - "typescript": "^4.5.4" + "typescript": "^4.5.5" }, "dependencies": { "base64-js": "^1.5.1", - "es6-promise": "^4.2.8", "js-sha256": "^0.9.0" } } diff --git a/adapters/oidc/js/pom.xml b/adapters/oidc/js/pom.xml index c9cd3245cb..e658712ca1 100755 --- a/adapters/oidc/js/pom.xml +++ b/adapters/oidc/js/pom.xml @@ -29,7 +29,29 @@ Keycloak JS Integration + + + static + + + dist + + + + maven-clean-plugin + 3.1.0 + + + + dist + + *.d.ts + + + + + com.github.eirslett frontend-maven-plugin diff --git a/adapters/oidc/js/rollup.config.ts b/adapters/oidc/js/rollup.config.ts index 6734c89a09..45b50b328b 100644 --- a/adapters/oidc/js/rollup.config.ts +++ b/adapters/oidc/js/rollup.config.ts @@ -17,8 +17,8 @@ function defineOptions({ name, amdId, }: DefineOptionsArgs): RollupOptions[] { - const sourceDir = "src/main/js"; - const targetDir = "target/classes"; + const sourceDir = "src"; + const targetDir = "dist"; const commonOptions: RollupOptions = { input: path.join(sourceDir, `${file}.js`), plugins: [commonjs(), nodeResolve()], diff --git a/adapters/oidc/js/src/main/js/keycloak-authz.js b/adapters/oidc/js/src/keycloak-authz.js similarity index 100% rename from adapters/oidc/js/src/main/js/keycloak-authz.js rename to adapters/oidc/js/src/keycloak-authz.js diff --git a/adapters/oidc/js/src/main/js/keycloak.js b/adapters/oidc/js/src/keycloak.js similarity index 100% rename from adapters/oidc/js/src/main/js/keycloak.js rename to adapters/oidc/js/src/keycloak.js diff --git a/adapters/oidc/js/src/main/resources/3p-cookies-step1.html b/adapters/oidc/js/static/3p-cookies-step1.html similarity index 100% rename from adapters/oidc/js/src/main/resources/3p-cookies-step1.html rename to adapters/oidc/js/static/3p-cookies-step1.html diff --git a/adapters/oidc/js/src/main/resources/3p-cookies-step2.html b/adapters/oidc/js/static/3p-cookies-step2.html similarity index 100% rename from adapters/oidc/js/src/main/resources/3p-cookies-step2.html rename to adapters/oidc/js/static/3p-cookies-step2.html diff --git a/adapters/oidc/js/src/main/resources/login-status-iframe.html b/adapters/oidc/js/static/login-status-iframe.html similarity index 100% rename from adapters/oidc/js/src/main/resources/login-status-iframe.html rename to adapters/oidc/js/static/login-status-iframe.html diff --git a/distribution/adapters/js-adapter-npm-zip/assembly.xml b/distribution/adapters/js-adapter-npm-zip/assembly.xml index ee91332a6c..7b5803b314 100755 --- a/distribution/adapters/js-adapter-npm-zip/assembly.xml +++ b/distribution/adapters/js-adapter-npm-zip/assembly.xml @@ -25,7 +25,7 @@ - src/main/resources/package.json + ../../../adapters/oidc/js/package.json / true diff --git a/distribution/adapters/js-adapter-npm-zip/src/main/resources/package.json b/distribution/adapters/js-adapter-npm-zip/src/main/resources/package.json deleted file mode 100644 index 19ddb0b599..0000000000 --- a/distribution/adapters/js-adapter-npm-zip/src/main/resources/package.json +++ /dev/null @@ -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" - } -} diff --git a/pom.xml b/pom.xml index d317ec9bc0..b85e376308 100644 --- a/pom.xml +++ b/pom.xml @@ -215,7 +215,7 @@ ${project.version} - v16.13.1 + v16.13.2 http://keycloak.org diff --git a/themes/src/main/resources/theme/keycloak.v2/account/src/app/keycloak-service/keycloak.service.ts b/themes/src/main/resources/theme/keycloak.v2/account/src/app/keycloak-service/keycloak.service.ts index 8864263fcd..78051f05ba 100644 --- a/themes/src/main/resources/theme/keycloak.v2/account/src/app/keycloak-service/keycloak.service.ts +++ b/themes/src/main/resources/theme/keycloak.v2/account/src/app/keycloak-service/keycloak.service.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {KeycloakLoginOptions} from "../../../../../../../../../../adapters/oidc/js/src/main/resources/keycloak"; +import {KeycloakLoginOptions} from "../../../../../../../../../../adapters/oidc/js"; declare const baseUrl: string; export type KeycloakClient = Keycloak.KeycloakInstance; diff --git a/themes/src/main/resources/theme/keycloak.v2/account/src/tsconfig.json b/themes/src/main/resources/theme/keycloak.v2/account/src/tsconfig.json index e4e327363d..c449aeaafe 100644 --- a/themes/src/main/resources/theme/keycloak.v2/account/src/tsconfig.json +++ b/themes/src/main/resources/theme/keycloak.v2/account/src/tsconfig.json @@ -15,8 +15,5 @@ }, "include": [ "./app/**/*.ts?" - ], - "files": [ - "../../../../../../../../adapters/oidc/js/src/main/resources/keycloak.d.ts" ] }