diff --git a/deno.lock b/deno.lock index 789c51a1..bdb7ec6e 100644 --- a/deno.lock +++ b/deno.lock @@ -89,6 +89,7 @@ "npm:autoprefixer@^10.4.21": "10.4.21_postcss@8.5.6", "npm:cssnano@^6.1.2": "6.1.2_postcss@8.5.6", "npm:esbuild-wasm@0.25.7": "0.25.7", + "npm:esbuild-wasm@~0.25.11": "0.25.11", "npm:esbuild@0.25.7": "0.25.7", "npm:esbuild@~0.25.5": "0.25.7", "npm:feed@^5.1.0": "5.1.0", @@ -2250,6 +2251,10 @@ "es-errors" ] }, + "esbuild-wasm@0.25.11": { + "integrity": "sha512-60gllbYFIRGzB6KALBB5Va9Wy3VeCi2U0NgmM7r+TFnRgzeEyoCn2D7fhacW2zWbd7MUeTKLDE7RlfYGBQ00bw==", + "bin": true + }, "esbuild-wasm@0.25.7": { "integrity": "sha512-x3t1BlU59YOMtpwzayHxF4LPVujOvNKqm7y6jPvFKC13J8FmJRCdHPJwHq86er7ik+f7uwGcMbe+6KVzLGmsGw==", "bin": true @@ -3874,6 +3879,7 @@ "jsr:@std/uuid@^1.0.9", "npm:@opentelemetry/api@^1.9.0", "npm:@types/node@^24.2.1", + "npm:esbuild-wasm@~0.25.11", "npm:preact-render-to-string@^6.6.3", "npm:preact@^10.27.2" ] diff --git a/packages/fresh/deno.json b/packages/fresh/deno.json index ef071b2c..6c89dc2a 100644 --- a/packages/fresh/deno.json +++ b/packages/fresh/deno.json @@ -25,6 +25,7 @@ "@std/semver": "jsr:@std/semver@^1.0.6", "@std/uuid": "jsr:@std/uuid@^1.0.9", "@types/node": "npm:@types/node@^24.2.1", + "esbuild-wasm": "npm:esbuild-wasm@^0.25.11", "preact": "npm:preact@^10.27.2", "preact-render-to-string": "npm:preact-render-to-string@^6.6.3" } diff --git a/packages/init/src/init_test.ts b/packages/init/src/init_test.ts index 52d0980a..5d869219 100644 --- a/packages/init/src/init_test.ts +++ b/packages/init/src/init_test.ts @@ -62,7 +62,11 @@ async function patchProject(dir: string): Promise { } } - const ignore = /[/\\]+(.|[^/\\]+_test\..*|tests[^/\\])/; + const ignore = (entry: Deno.DirEntry, _full: string) => { + return /^(\.|tmp_)/.test(entry.name) || + /_test\.[tj]sx?$/.test(entry.name) || + entry.name === "tests" || entry.name === "test"; + }; await copyRecursive( path.join(import.meta.dirname!, "..", "..", "fresh"), @@ -77,6 +81,7 @@ async function patchProject(dir: string): Promise { ); json.workspace = ["./_linked/*"]; + json.exclude = [...json.exclude ?? [], "**/_linked/*"]; // assert with this stricter rule, before adding it to initialized projects json.lint.rules.include = ["verbatim-module-syntax"]; @@ -101,13 +106,15 @@ async function patchProject(dir: string): Promise { async function copyRecursive( from: string, to: string, - ignore?: RegExp, + ignore?: (entry: Deno.DirEntry, full: string) => boolean, ): Promise { for await (const entry of Deno.readDir(from)) { const source = path.join(from, entry.name); const target = path.join(to, entry.name); - if (ignore && ignore.test(source)) continue; + if (ignore && ignore(entry, source)) { + continue; + } if (entry.isFile) { try { @@ -119,7 +126,7 @@ async function copyRecursive( } await Deno.copyFile(source, target); } else if (entry.isDirectory) { - await copyRecursive(source, target); + await copyRecursive(source, target, ignore); } } }