.github
.storybook
patches
scripts
build-storybook.ts
build.ts
dump-keycloak-realm.ts
generate-i18n-messages.ts
grant-exec-perms.ts
link-in-app.ts
link-in-starter.ts
start-storybook.ts
startRebuildOnSrcChange.ts
src
stories
test
.all-contributorsrc
.gitattributes
.gitignore
.prettierignore
.prettierrc.json
CONTRIBUTING.md
LICENSE
README.md
package.json
renovate.json
tsproject.json
vitest.config.ts
yarn.lock
32 lines
850 B
TypeScript
32 lines
850 B
TypeScript
import * as child_process from "child_process";
|
|
import * as fs from "fs";
|
|
import { join } from "path";
|
|
import { startRebuildOnSrcChange } from "./startRebuildOnSrcChange";
|
|
|
|
run("yarn build");
|
|
|
|
run(`node ${join("dist", "bin", "main.js")} copy-keycloak-resources-to-public`, {
|
|
env: {
|
|
...process.env,
|
|
PUBLIC_DIR_PATH: join(".storybook", "static")
|
|
}
|
|
});
|
|
|
|
{
|
|
const child = child_process.spawn("npx", ["start-storybook", "-p", "6006"]);
|
|
|
|
child.stdout.on("data", data => process.stdout.write(data));
|
|
|
|
child.stderr.on("data", data => process.stderr.write(data));
|
|
|
|
child.on("exit", process.exit.bind(process));
|
|
}
|
|
|
|
startRebuildOnSrcChange();
|
|
|
|
function run(command: string, options?: { env?: NodeJS.ProcessEnv }) {
|
|
console.log(`$ ${command}`);
|
|
|
|
child_process.execSync(command, { stdio: "inherit", ...options });
|
|
}
|