Compare commits

...

19 Commits

Author SHA1 Message Date
b5b3af4659 Bump version 2023-02-07 01:32:36 +01:00
6cd231426d Import Blob from node builtins 2023-02-07 01:32:20 +01:00
0c7cd1cd75 Bump version 2023-02-07 01:21:17 +01:00
2425704ead Merge branch 'main' of https://github.com/InseeFrLab/keycloakify 2023-02-07 01:20:33 +01:00
4e22159206 Bump version 2023-02-07 01:20:26 +01:00
52cf1ba02c Fix tsafe related warnings 2023-02-07 01:20:12 +01:00
516e84182f fix(deps): update dependency powerhooks to ^0.26.0 2023-02-05 15:10:42 +00:00
a3a9853e18 bump version 2023-02-05 14:58:53 +01:00
08e26600fd Use keycloakify as bundler by default 2023-02-05 14:58:38 +01:00
7793c2c6ba Update package.json 2023-02-05 14:41:32 +01:00
9e826d16dd Merge pull request #241 from lordvlad/mvn-begone
Mvn begone addendum
2023-02-05 14:41:13 +01:00
80618bbd9c Merge branch 'main' into mvn-begone 2023-02-05 13:36:52 +01:00
38ad47ea75 use hand-crafted promise, pipeline does not resolve properly 2023-02-05 13:32:24 +01:00
45ed359bef fix keycloak theme source path for internal bundler 2023-02-05 13:31:34 +01:00
fcc26c3e7a now that main is a promise, we shuold catch errors 2023-02-05 13:31:03 +01:00
d4ff6b1f40 fix: bundler fix missing directory 2023-02-05 12:59:05 +01:00
557de34eea fix: bundler fix missing change 2023-02-05 12:56:01 +01:00
e034dc4d90 Merge branch 'mvn-begone' of github.com:lordvlad/keycloakify into mvn-begone
* 'mvn-begone' of github.com:lordvlad/keycloakify:
  fix(deps): update garronej_modules_update
  Update README.md
  Rollback via update
  Bump version
  keycloak test script: use env to launch bash
  fix(deps): update dependency powerhooks to ^0.22.0
  Update dependency powerhooks to ^0.21.0
  Relase candidate
  fmt
  Update README.md
  Bump version
  Update src/bin/tools/downloadAndUnzip.ts
  Bump version
  #232
  Bump version
  keycloak test script: use env to launch bash
  fix(deps): update dependency powerhooks to ^0.22.0
  Update dependency powerhooks to ^0.21.0
2023-02-05 12:35:15 +01:00
cfbd1e5e4b fix(bundler): fix type mismatch introduced in last-minute 'fixes' 2023-02-05 12:34:48 +01:00
8 changed files with 39 additions and 31 deletions

View File

@ -49,9 +49,9 @@
# Changelog highlights # Changelog highlights
## 6.11.0 ## 6.11.4
- <del>You no longer need to have Maven installed to build the theme. Thanks to @lordvlad, [see PR](https://github.com/InseeFrLab/keycloakify/pull/239)</del>. - You no longer need to have Maven installed to build the theme. Thanks to @lordvlad, [see PR](https://github.com/InseeFrLab/keycloakify/pull/239).
- Feature new build options: [`bundler`](https://docs.keycloakify.dev/build-options#keycloakify.bundler), [`groupId`](https://docs.keycloakify.dev/build-options#keycloakify.groupid), [`artifactId`](https://docs.keycloakify.dev/build-options#keycloakify.artifactid), [`version`](https://docs.keycloakify.dev/build-options#version). - Feature new build options: [`bundler`](https://docs.keycloakify.dev/build-options#keycloakify.bundler), [`groupId`](https://docs.keycloakify.dev/build-options#keycloakify.groupid), [`artifactId`](https://docs.keycloakify.dev/build-options#keycloakify.artifactid), [`version`](https://docs.keycloakify.dev/build-options#version).
Theses options can be user to customize the output name of the .jar. You can use environnement variables to overrides the values read in the package.json. Thanks to @lordvlad. Theses options can be user to customize the output name of the .jar. You can use environnement variables to overrides the values read in the package.json. Thanks to @lordvlad.

View File

@ -1,6 +1,6 @@
{ {
"name": "keycloakify", "name": "keycloakify",
"version": "6.11.2", "version": "6.11.7",
"description": "Keycloak theme generator for Reacts app", "description": "Keycloak theme generator for Reacts app",
"repository": { "repository": {
"type": "git", "type": "git",
@ -82,11 +82,11 @@
"minimal-polyfills": "^2.2.2", "minimal-polyfills": "^2.2.2",
"minimist": "^1.2.6", "minimist": "^1.2.6",
"path-browserify": "^1.0.1", "path-browserify": "^1.0.1",
"powerhooks": "^0.22.1", "powerhooks": "^0.26.0",
"react-markdown": "^5.0.3", "react-markdown": "^5.0.3",
"rfc4648": "^1.5.2", "rfc4648": "^1.5.2",
"scripting-tools": "^0.19.13", "scripting-tools": "^0.19.13",
"tsafe": "^1.4.2", "tsafe": "^1.4.3",
"tss-react": "4.4.1-rc.0", "tss-react": "4.4.1-rc.0",
"zod": "^3.17.10" "zod": "^3.17.10"
} }

View File

@ -139,7 +139,7 @@ export function readBuildOptions(params: {
`${symToStr({ KEYCLOAKIFY_BUNDLER })} should be one of ${bundlers.join(", ")}` `${symToStr({ KEYCLOAKIFY_BUNDLER })} should be one of ${bundlers.join(", ")}`
); );
return KEYCLOAKIFY_BUNDLER ?? bundler ?? "mvn"; return KEYCLOAKIFY_BUNDLER ?? bundler ?? "keycloakify";
})(), })(),
"artifactId": process.env.KEYCLOAKIFY_ARTIFACT_ID ?? artifactId ?? `${themeName}-keycloak-theme`, "artifactId": process.env.KEYCLOAKIFY_ARTIFACT_ID ?? artifactId ?? `${themeName}-keycloak-theme`,
"groupId": (() => { "groupId": (() => {

View File

@ -4,5 +4,5 @@ export * from "./keycloakify";
import { main } from "./keycloakify"; import { main } from "./keycloakify";
if (require.main === module) { if (require.main === module) {
main(); main().catch(e => console.error(e));
} }

View File

@ -60,10 +60,10 @@ export async function main() {
case "keycloakify": case "keycloakify":
logger.log("🫶 Let keycloakify do its thang"); logger.log("🫶 Let keycloakify do its thang");
await jar({ await jar({
"rootPath": keycloakThemeBuildingDirPath, "rootPath": pathJoin(keycloakThemeBuildingDirPath, "src", "main", "resources"),
"version": buildOptions.version, "version": buildOptions.version,
"groupId": buildOptions.groupId, "groupId": buildOptions.groupId,
"artifactId": buildOptions.artifactId || `${buildOptions.themeName}-keycloak-theme`, "artifactId": buildOptions.artifactId,
"targetPath": jarFilePath "targetPath": jarFilePath
}); });
break; break;

View File

@ -1,11 +1,11 @@
import { Readable, Transform } from "stream"; import { Readable, Transform } from "stream";
import { pipeline } from "stream/promises"; import { dirname, relative, sep } from "path";
import { relative, sep } from "path";
import { createWriteStream } from "fs"; import { createWriteStream } from "fs";
import walk from "./walk"; import walk from "./walk";
import type { ZipSource } from "./zip"; import type { ZipSource } from "./zip";
import zip from "./zip"; import zip from "./zip";
import { mkdir } from "fs/promises";
/** Trim leading whitespace from every line */ /** Trim leading whitespace from every line */
const trimIndent = (s: string) => s.replace(/(\n)\s+/g, "$1"); const trimIndent = (s: string) => s.replace(/(\n)\s+/g, "$1");
@ -57,9 +57,9 @@ export default async function jar({ groupId, artifactId, version, rootPath, targ
const pathToRecord = () => const pathToRecord = () =>
new Transform({ new Transform({
objectMode: true, objectMode: true,
transform: function (path, _, cb) { transform: function (fsPath, _, cb) {
const filename = relative(rootPath, path).split(sep).join("/"); const path = relative(rootPath, fsPath).split(sep).join("/");
this.push({ filename, path }); this.push({ path, fsPath });
cb(); cb();
}, },
final: function () { final: function () {
@ -69,19 +69,21 @@ export default async function jar({ groupId, artifactId, version, rootPath, targ
} }
}); });
/** await mkdir(dirname(targetPath), { recursive: true });
* Create an async pipeline, wait until everything is fully processed
*/ // Create an async pipeline, wait until everything is fully processed
await pipeline( await new Promise<void>((resolve, reject) => {
// walk all files in `rootPath` recursively // walk all files in `rootPath` recursively
Readable.from(walk(rootPath)), Readable.from(walk(rootPath))
// transform every path into a ZipSource object // transform every path into a ZipSource object
pathToRecord(), .pipe(pathToRecord())
// let the zip lib convert all ZipSource objects into a byte stream // let the zip lib convert all ZipSource objects into a byte stream
zip(), .pipe(zip())
// write that byte stream to targetPath // write that byte stream to targetPath
createWriteStream(targetPath, { encoding: "binary" }) .pipe(createWriteStream(targetPath, { encoding: "binary" }))
); .on("finish", () => resolve())
.on("error", e => reject(e));
});
} }
/** /**

View File

@ -1,6 +1,7 @@
import { Transform, TransformOptions } from "stream"; import { Transform, TransformOptions } from "stream";
import { createReadStream } from "fs"; import { createReadStream } from "fs";
import { stat } from "fs/promises"; import { stat } from "fs/promises";
import { Blob } from "buffer";
import { deflateBuffer, deflateStream } from "./deflate"; import { deflateBuffer, deflateStream } from "./deflate";
@ -216,7 +217,7 @@ export default function zip() {
const writeRecord = async (source: ZipSource) => { const writeRecord = async (source: ZipSource) => {
if ("fsPath" in source) await writeFromPath(source.path, source.fsPath); if ("fsPath" in source) await writeFromPath(source.path, source.fsPath);
else if ("data" in source) await writeFromBuffer(source.path, source.data); else if ("data" in source) await writeFromBuffer(source.path, source.data);
else throw new Error("Illegal argument " + typeof source + " " + source); else throw new Error("Illegal argument " + typeof source + " " + JSON.stringify(source));
}; };
/** /**

View File

@ -1639,10 +1639,10 @@ please-upgrade-node@^3.2.0:
dependencies: dependencies:
semver-compare "^1.0.0" semver-compare "^1.0.0"
powerhooks@^0.22.1: powerhooks@^0.26.0:
version "0.22.1" version "0.26.0"
resolved "https://registry.yarnpkg.com/powerhooks/-/powerhooks-0.22.1.tgz#4e6c720e702e138c0869447e0d04bd0550530bbb" resolved "https://registry.yarnpkg.com/powerhooks/-/powerhooks-0.26.0.tgz#260f8e5c019ea117911c880bf3b371ecd09786df"
integrity sha512-wR/gVPtpOeVAkjJXAHbTB6IBAIWL3RZo69DqxPZ2rXV108cwzOW978KZKd2h7m0QHJdg4ZXYwOsZ13E1EGrTFA== integrity sha512-FvoEuj340Jm9HPGV98gjDVVdlolaIYXvQ4Xg7fiNtYdeClAJk264uFHAwFo9isXP92OW2ksvy9wVMCwMhFUGGQ==
dependencies: dependencies:
evt "^2.4.13" evt "^2.4.13"
memoizee "^0.4.15" memoizee "^0.4.15"
@ -2007,6 +2007,11 @@ tsafe@^1.4.2:
resolved "https://registry.yarnpkg.com/tsafe/-/tsafe-1.4.2.tgz#1cc597f6e286ef8a64b918a0a6284bd04347e11f" resolved "https://registry.yarnpkg.com/tsafe/-/tsafe-1.4.2.tgz#1cc597f6e286ef8a64b918a0a6284bd04347e11f"
integrity sha512-KfP0PYzRjl1LY1DnJPNlD4a0tZSg4uUuZxI4aG04T+j7WJvKZbh1zpaukphhSmtoJMgX1RV8eZVKTEiH8wOGbA== integrity sha512-KfP0PYzRjl1LY1DnJPNlD4a0tZSg4uUuZxI4aG04T+j7WJvKZbh1zpaukphhSmtoJMgX1RV8eZVKTEiH8wOGbA==
tsafe@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/tsafe/-/tsafe-1.4.3.tgz#a98ce83616f0d9c01e3c6167a2ead45ba455b2ae"
integrity sha512-KjCdgjIqsbKW9oeJGSMVC23jhWm/VXJwkaZ7jffo/WaTioLGTHJqliHe9dECEVzIACNVNs/fwtKwU8wWK4jY4g==
tslib@^2.1.0: tslib@^2.1.0:
version "2.4.0" version "2.4.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"