mirror of
https://github.com/morluto/rea
synced 2026-10-28 23:11:11 -04:00
fix(ci): invalidate caches for imported declarations
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
@@ -239,6 +239,27 @@ it.each([
|
||||
diagnostic: "TS2322",
|
||||
invalidatesCompile: false,
|
||||
},
|
||||
{
|
||||
label: "source declaration",
|
||||
path: "src/types.d.mts",
|
||||
content: "export type SourceValue = 2;\n",
|
||||
diagnostic: "TS2322",
|
||||
invalidatesCompile: true,
|
||||
},
|
||||
{
|
||||
label: "test declaration",
|
||||
path: "tests/types.d.cts",
|
||||
content: 'export type TestValue = "shadow";\n',
|
||||
diagnostic: "TS2322",
|
||||
invalidatesCompile: false,
|
||||
},
|
||||
{
|
||||
label: "script declaration",
|
||||
path: "scripts/value.d.cts",
|
||||
content: 'export type ScriptValue = "shadow";\n',
|
||||
diagnostic: "TS2322",
|
||||
invalidatesCompile: false,
|
||||
},
|
||||
])(
|
||||
"rejects a changed $label after warming real compiler tasks",
|
||||
async ({ path, content, diagnostic, invalidatesCompile }) => {
|
||||
@@ -275,7 +296,11 @@ it.each([
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "src/main.ts"),
|
||||
"export const value: number = 1;\n",
|
||||
'import type { SourceValue } from "./types.mjs";\nexport const value: SourceValue = 1;\n',
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "src/types.d.mts"),
|
||||
"export type SourceValue = 1;\n",
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "docs/.vitepress/helper.ts"),
|
||||
@@ -299,7 +324,15 @@ it.each([
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "tests/use-script.ts"),
|
||||
'import type { ApiScope } from "../scripts/api.mjs";\nexport const scope: ApiScope = "root";\n',
|
||||
'import type { ApiScope } from "../scripts/api.mjs";\nimport type { TestValue } from "./types.cjs";\nimport type { ScriptValue } from "../scripts/value.cjs";\nexport const scope: ApiScope = "root";\nexport const testValue: TestValue = "root";\nexport const scriptValue: ScriptValue = "root";\n',
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "tests/types.d.cts"),
|
||||
'export type TestValue = "root";\n',
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "scripts/value.d.cts"),
|
||||
'export type ScriptValue = "root";\n',
|
||||
);
|
||||
await workflowGit(root, ["init", "--initial-branch=main"]);
|
||||
await workflowGit(root, ["add", "."]);
|
||||
|
||||
+4
-4
@@ -14,7 +14,7 @@
|
||||
"scripts/clean-build-output.mjs",
|
||||
"scripts/bundle-runtime.mjs",
|
||||
"scripts/generate-package-metadata.mjs",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.{cts,mts,ts,tsx}",
|
||||
"src/**/package.json",
|
||||
"!src/**/*.test.ts",
|
||||
"!src/**/*.fixture.ts",
|
||||
@@ -27,14 +27,14 @@
|
||||
"inputs": [
|
||||
"package.json",
|
||||
"package-lock.json",
|
||||
"src/**/*.ts",
|
||||
"src/**/*.{cts,mts,ts,tsx}",
|
||||
"src/**/package.json",
|
||||
"tests/**/*.ts",
|
||||
"tests/**/*.{cts,mts,ts,tsx}",
|
||||
"tests/**/package.json",
|
||||
"tsconfig.json",
|
||||
"tsconfig.build.json",
|
||||
"vitest.config.ts",
|
||||
"scripts/**/*.d.mts",
|
||||
"scripts/**/*.d.{cts,mts,ts}",
|
||||
"scripts/**/package.json",
|
||||
"docs/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
|
||||
"docs/**/package.json",
|
||||
|
||||
Reference in New Issue
Block a user