ignore dev caches in example tool configs

This commit is contained in:
2026-08-09 20:22:55 +05:30
parent 9fd80b7cef
commit 3f5ec8696f
7 changed files with 57 additions and 15 deletions
+2
View File
@@ -1,6 +1,8 @@
node_modules/ node_modules/
dist/ dist/
.wrnexus/ .wrnexus/
.wrnexus-*/
**/.wrnexus-*/
.wirefw/ .wirefw/
**/.wirefw/ **/.wirefw/
**/*.gen.ts **/*.gen.ts
+8 -1
View File
@@ -7,7 +7,14 @@ const tsconfigRootDir = dirname(fileURLToPath(import.meta.url));
export default tseslint.config( export default tseslint.config(
{ {
ignores: ["node_modules/**", "dist/**", ".wrnexus/**", "**/.wrnexus/**"], ignores: [
"node_modules/**",
"dist/**",
".wrnexus/**",
"**/.wrnexus/**",
".wrnexus-*/**",
"**/.wrnexus-*/**",
],
}, },
{ {
languageOptions: { languageOptions: {
+2 -1
View File
@@ -3,5 +3,6 @@
"compilerOptions": { "compilerOptions": {
"lib": ["ESNext", "DOM", "DOM.Iterable"] "lib": ["ESNext", "DOM", "DOM.Iterable"]
}, },
"include": ["app"] "include": ["app"],
"exclude": ["node_modules", "dist", ".wrnexus-*", "**/.wrnexus-*"]
} }
@@ -2,5 +2,7 @@ node_modules/
dist/ dist/
.wrnexus/ .wrnexus/
**/.wrnexus/ **/.wrnexus/
.wrnexus-*/
**/.wrnexus-*/
*.log *.log
**/CLAUDE.md **/CLAUDE.md
@@ -6,7 +6,17 @@ import tseslint from "typescript-eslint";
const tsconfigRootDir = dirname(fileURLToPath(import.meta.url)); const tsconfigRootDir = dirname(fileURLToPath(import.meta.url));
export default tseslint.config( export default tseslint.config(
{ ignores: ["node_modules/**", "dist/**", "**/dist/**", ".wrnexus/**", "**/.wrnexus/**"] }, {
ignores: [
"node_modules/**",
"dist/**",
"**/dist/**",
".wrnexus/**",
"**/.wrnexus/**",
".wrnexus-*/**",
"**/.wrnexus-*/**",
],
},
{ languageOptions: { parserOptions: { tsconfigRootDir } } }, { languageOptions: { parserOptions: { tsconfigRootDir } } },
js.configs.recommended, js.configs.recommended,
...tseslint.configs.recommended, ...tseslint.configs.recommended,
@@ -11,5 +11,5 @@
"allowImportingTsExtensions": true "allowImportingTsExtensions": true
}, },
"include": ["wrnexus.workspace.ts", "packages/**/*.ts"], "include": ["wrnexus.workspace.ts", "packages/**/*.ts"],
"exclude": ["node_modules", "dist", "apps"] "exclude": ["node_modules", "dist", "apps", ".wrnexus-*", "**/.wrnexus-*"]
} }
@@ -4,7 +4,7 @@ import { join, resolve } from "node:path";
const root = resolve(import.meta.dir, "../../.."); const root = resolve(import.meta.dir, "../../..");
test("per-process dev caches are excluded from every repository-wide tool", () => { test("per-process dev caches are excluded from root and example project tools", () => {
const eslint = readFileSync(join(root, "eslint.config.js"), "utf8"); const eslint = readFileSync(join(root, "eslint.config.js"), "utf8");
const tsconfig = JSON.parse(readFileSync(join(root, "tsconfig.json"), "utf8")) as { const tsconfig = JSON.parse(readFileSync(join(root, "tsconfig.json"), "utf8")) as {
exclude?: string[]; exclude?: string[];
@@ -15,26 +15,46 @@ test("per-process dev caches are excluded from every repository-wide tool", () =
expect(tsconfig.exclude).toContain("**/.wrnexus-*"); expect(tsconfig.exclude).toContain("**/.wrnexus-*");
expect(prettier).toContain("**/.wrnexus-*/**"); expect(prettier).toContain("**/.wrnexus-*/**");
const cache = join(root, "packages", "dev-server", "test", ".tmp-cache-ignore", ".wrnexus-123"); const projects = ["basic-app", "inter-app-api-showcase"].map((name) =>
mkdirSync(cache, { recursive: true }); join(root, "examples", name),
writeFileSync(join(cache, "broken.client.mjs"), "const = ;\n", "utf8"); );
writeFileSync(join(cache, "broken.d.ts"), "type = ;\n", "utf8"); const caches = projects.map((project) => join(project, ".wrnexus-123"));
for (const project of projects) {
const projectEslint = readFileSync(join(project, "eslint.config.js"), "utf8");
const projectTsconfig = JSON.parse(readFileSync(join(project, "tsconfig.json"), "utf8")) as {
exclude?: string[];
};
const projectPrettier = readFileSync(join(project, ".prettierignore"), "utf8");
expect(projectEslint).toContain('".wrnexus-*/**"');
expect(projectEslint).toContain('"**/.wrnexus-*/**"');
expect(projectTsconfig.exclude).toContain(".wrnexus-*");
expect(projectTsconfig.exclude).toContain("**/.wrnexus-*");
expect(projectPrettier).toContain(".wrnexus-*/");
expect(projectPrettier).toContain("**/.wrnexus-*/");
}
for (const cache of caches) {
mkdirSync(cache, { recursive: true });
writeFileSync(join(cache, "broken.client.mjs"), "const = ;\n", "utf8");
writeFileSync(join(cache, "broken.d.ts"), "type = ;\n", "utf8");
}
try { try {
const lint = Bun.spawnSync( const lint = Bun.spawnSync(
[ [
"bunx", "bunx",
"eslint", "eslint",
"--no-warn-ignored", "--no-warn-ignored",
join(cache, "broken.client.mjs"), ...caches.flatMap((cache) => [
join(cache, "broken.d.ts"), join(cache, "broken.client.mjs"),
join(cache, "broken.d.ts"),
]),
], ],
{ cwd: root }, { cwd: root },
); );
expect(lint.exitCode).toBe(0); expect(lint.exitCode).toBe(0);
} finally { } finally {
rmSync(join(root, "packages", "dev-server", "test", ".tmp-cache-ignore"), { for (const cache of caches) rmSync(cache, { recursive: true, force: true });
recursive: true,
force: true,
});
} }
}); });