fix(turbo): hash local env inputs
This commit is contained in:
parent
3ff41e771b
commit
24e7e8eda0
2 changed files with 17 additions and 0 deletions
|
|
@ -74,6 +74,21 @@ describe("workspace boundaries", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("accounts for local env files in cacheable Vite and Storybook task hashes", () => {
|
||||||
|
const turboConfig = JSON.parse(
|
||||||
|
readFileSync(join(root, "turbo.json"), "utf8"),
|
||||||
|
) as {
|
||||||
|
tasks?: Record<string, { inputs?: string[] }>;
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const taskName of ["build", "build-storybook"]) {
|
||||||
|
expect(turboConfig.tasks?.[taskName]?.inputs).toEqual([
|
||||||
|
"$TURBO_DEFAULT$",
|
||||||
|
".env*",
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test("keeps the website app and reusable UI library as separate packages", () => {
|
test("keeps the website app and reusable UI library as separate packages", () => {
|
||||||
const webPackage = JSON.parse(
|
const webPackage = JSON.parse(
|
||||||
readFileSync(join(root, "apps/web/package.json"), "utf8"),
|
readFileSync(join(root, "apps/web/package.json"), "utf8"),
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"build": {
|
"build": {
|
||||||
"dependsOn": ["^build"],
|
"dependsOn": ["^build"],
|
||||||
|
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
||||||
"outputs": ["dist/**", "build/**"],
|
"outputs": ["dist/**", "build/**"],
|
||||||
"env": ["NODE_ENV", "VITE_*"]
|
"env": ["NODE_ENV", "VITE_*"]
|
||||||
},
|
},
|
||||||
|
|
@ -29,6 +30,7 @@
|
||||||
},
|
},
|
||||||
"build-storybook": {
|
"build-storybook": {
|
||||||
"dependsOn": ["^build"],
|
"dependsOn": ["^build"],
|
||||||
|
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
||||||
"outputs": ["storybook-static/**"],
|
"outputs": ["storybook-static/**"],
|
||||||
"env": ["NODE_ENV", "STORYBOOK_*", "VITE_*"]
|
"env": ["NODE_ENV", "STORYBOOK_*", "VITE_*"]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue