Compare commits

..

3 Commits

Author SHA1 Message Date
2b8c4422de Release candidate 2024-06-23 22:48:01 +02:00
a686432c65 Shell: true for windows 2024-06-23 22:47:45 +02:00
449e625877 Fix storybook build 2024-06-23 22:39:29 +02:00
3 changed files with 33 additions and 34 deletions

View File

@ -1,6 +1,6 @@
{
"name": "keycloakify",
"version": "10.0.0-rc.91",
"version": "10.0.0-rc.92",
"description": "Create Keycloak themes using React",
"repository": {
"type": "git",

View File

@ -204,6 +204,7 @@ export function getBuildContext(params: {
const parsedPackageJson = z
.object({
name: z.string().optional(),
dependencies: z.record(z.string()).optional(),
devDependencies: z.record(z.string()).optional()
})
@ -211,7 +212,8 @@ export function getBuildContext(params: {
if (
parsedPackageJson.dependencies?.keycloakify === undefined &&
parsedPackageJson.devDependencies?.keycloakify === undefined
parsedPackageJson.devDependencies?.keycloakify === undefined &&
parsedPackageJson.name !== "keycloakify" // NOTE: For local storybook build
) {
break success;
}

View File

@ -34,7 +34,9 @@ async function appBuild_vite(params: {
assert(buildContext.bundler.type === "vite");
const dResult = new Deferred<{ isSuccess: boolean }>();
const dIsSuccess = new Deferred<boolean>();
console.log(chalk.blue("Running: 'npx vite build'"));
const child = child_process.spawn("npx", ["vite", "build"], {
cwd: buildContext.projectDirPath,
@ -51,9 +53,9 @@ async function appBuild_vite(params: {
child.stderr.on("data", data => process.stderr.write(data));
child.on("exit", code => dResult.resolve({ isSuccess: code === 0 }));
child.on("exit", code => dIsSuccess.resolve(code === 0));
const { isSuccess } = await dResult.pr;
const isSuccess = await dIsSuccess.pr;
return { isAppBuildSuccess: isSuccess };
}
@ -123,9 +125,11 @@ async function appBuild_webpack(params: {
for (const subCommand of appBuildSubCommands) {
const dIsSuccess = new Deferred<boolean>();
child_process.exec(
subCommand,
{
console.log(chalk.blue(`Running: '${subCommand}'`));
const [command, ...args] = subCommand.split(" ");
const child = child_process.spawn(command, args, {
cwd: buildContext.bundler.packageJsonDirPath,
env: {
...process.env,
@ -141,22 +145,15 @@ async function appBuild_webpack(params: {
...(process.env.PATH ?? "").split(separator)
].join(separator);
})()
}
},
(error, stdout, stderr) => {
if (error) {
dIsSuccess.resolve(false);
shell: true
});
console.log(chalk.red(`Error running: '${subCommand}'`));
console.log(stdout);
console.log(stderr);
child.stdout.on("data", data => process.stdout.write(data));
return;
}
child.stderr.on("data", data => process.stderr.write(data));
dIsSuccess.resolve(true);
}
);
child.on("exit", code => dIsSuccess.resolve(code === 0));
const isSuccess = await dIsSuccess.pr;