diff --git a/package.json b/package.json index 5d58e1e3..d727a3e4 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "author": "u/garronej", "license": "MIT", "files": [ - "src/", "dist/", "!dist/tsconfig.tsbuildinfo", "!dist/bin/", @@ -94,7 +93,6 @@ "@types/react": "^18.0.35", "@types/react-dom": "^18.0.11", "@types/yauzl": "^2.10.3", - "@types/yazl": "^2.4.5", "@vercel/ncc": "^0.38.1", "chalk": "^4.1.2", "cheerio": "^1.0.0-rc.12", @@ -123,7 +121,6 @@ "vite": "^5.2.11", "vitest": "^0.29.8", "yauzl": "^2.10.0", - "yazl": "^2.5.1", "zod": "^3.17.10" } } diff --git a/scripts/build.ts b/scripts/build.ts index 41dbeb6b..d31655ac 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -107,6 +107,10 @@ fs.rmSync(join("dist", "ncc_out"), { recursive: true }); patchDeprecatedBufferApiUsage(join("dist", "vite-plugin", "index.js")); +fs.rmSync(join("dist", "src"), { recursive: true, force: true }); + +fs.cpSync("src", join("dist", "src"), { recursive: true }); + console.log(chalk.green(`✓ built in ${((Date.now() - startTime) / 1000).toFixed(2)}s`)); function run(command: string) { diff --git a/src/bin/start-keycloak/start-keycloak.ts b/src/bin/start-keycloak/start-keycloak.ts index af6d5b42..70c49a28 100644 --- a/src/bin/start-keycloak/start-keycloak.ts +++ b/src/bin/start-keycloak/start-keycloak.ts @@ -26,7 +26,6 @@ import { getThisCodebaseRootDirPath } from "../tools/getThisCodebaseRootDirPath" import { Deferred } from "evt/tools/Deferred"; import { getAbsoluteAndInOsFormatPath } from "../tools/getAbsoluteAndInOsFormatPath"; import cliSelect from "cli-select"; -import { isInside } from "../tools/isInside"; import * as runExclusive from "run-exclusive"; export type CliCommandOptions = CliCommandOptions_common & { @@ -404,8 +403,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions }) const dResult = new Deferred<{ isSuccess: boolean }>(); const child = child_process.spawn("npx", ["vite", "build"], { - cwd: buildOptions.reactAppRootDirPath, - env: process.env + cwd: buildOptions.reactAppRootDirPath }); child.stdout.on("data", data => { @@ -461,30 +459,13 @@ export async function command(params: { cliCommandOptions: CliCommandOptions }) } }); - const { waitForDebounce } = waitForDebounceFactory({ delay: 400 }); + const { waitForDebounce } = waitForDebounceFactory({ delay: 1_000 }); chokidar - .watch([srcDirPath, getThisCodebaseRootDirPath()], { + .watch([srcDirPath, pathJoin(getThisCodebaseRootDirPath(), "src")], { ignoreInitial: true }) - .on("all", async (...[, filePath]) => { - for (const dir1 of ["src", "."]) { - for (const dir2 of ["bin", "vite-plugin"]) { - if ( - isInside({ - dirPath: pathJoin( - getThisCodebaseRootDirPath(), - dir1, - dir2 - ), - filePath - }) - ) { - return; - } - } - } - + .on("all", async () => { await waitForDebounce(); runBuildKeycloakTheme();