fix(container): exclude generated files from pruned build
This commit is contained in:
parent
3e46a2c0cc
commit
74e70cf714
3 changed files with 35 additions and 1 deletions
|
|
@ -11,3 +11,12 @@ storybook-static
|
||||||
test-results
|
test-results
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
apps/*/.turbo
|
||||||
|
apps/*/build
|
||||||
|
apps/*/data
|
||||||
|
apps/*/dist
|
||||||
|
apps/*/playwright-report
|
||||||
|
apps/*/test-results
|
||||||
|
packages/*/.turbo
|
||||||
|
packages/*/dist
|
||||||
|
packages/*/storybook-static
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bun src/server/dev.ts",
|
"dev": "bun src/server/dev.ts",
|
||||||
"build": "vite build && bun build src/server/index.ts --target bun --outdir build",
|
"build": "rm -rf build && vite build && bun build src/server/index.ts --target bun --outdir build",
|
||||||
"preview": "HOST=0.0.0.0 PORT=4173 bun build/index.js",
|
"preview": "HOST=0.0.0.0 PORT=4173 bun build/index.js",
|
||||||
"check": "tsc --noEmit",
|
"check": "tsc --noEmit",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
|
|
|
||||||
|
|
@ -151,10 +151,35 @@ describe("workspace boundaries", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("keeps local turbo prune output out of git and container contexts", () => {
|
test("keeps local turbo prune output out of git and container contexts", () => {
|
||||||
|
const webPackage = JSON.parse(
|
||||||
|
readFileSync(join(root, "apps/web/package.json"), "utf8"),
|
||||||
|
) as { scripts?: Record<string, string> };
|
||||||
const gitignore = readFileSync(join(root, ".gitignore"), "utf8");
|
const gitignore = readFileSync(join(root, ".gitignore"), "utf8");
|
||||||
const containerignore = readFileSync(join(root, ".containerignore"), "utf8");
|
const containerignore = readFileSync(join(root, ".containerignore"), "utf8");
|
||||||
|
const containerIgnoreRules = new Set(
|
||||||
|
containerignore
|
||||||
|
.split(/\r?\n/)
|
||||||
|
.map((line) => line.trim())
|
||||||
|
.filter(Boolean),
|
||||||
|
);
|
||||||
|
|
||||||
expect(gitignore).toContain("out/");
|
expect(gitignore).toContain("out/");
|
||||||
expect(containerignore).toContain("out");
|
expect(containerignore).toContain("out");
|
||||||
|
expect([...containerIgnoreRules]).toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
"apps/*/.turbo",
|
||||||
|
"apps/*/build",
|
||||||
|
"apps/*/data",
|
||||||
|
"apps/*/dist",
|
||||||
|
"apps/*/playwright-report",
|
||||||
|
"apps/*/test-results",
|
||||||
|
"packages/*/.turbo",
|
||||||
|
"packages/*/dist",
|
||||||
|
"packages/*/storybook-static",
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
expect(webPackage.scripts?.build).toBe(
|
||||||
|
"rm -rf build && vite build && bun build src/server/index.ts --target bun --outdir build",
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue