refactor: make this repo a Deno workspace (#2719)

This commit is contained in:
Luca Casonato
2024-12-10 13:41:18 +01:00
committed by GitHub
parent f1b6b4c401
commit 4a25ac385f
13 changed files with 133 additions and 1744 deletions
+5 -11
View File
@@ -17,21 +17,15 @@ async function withTmpDir(fn: (dir: string) => void | Promise<void>) {
}
}
// TODO: Patch project dependencies until there is an easier way
// to link JSR dependencies
async function patchProject(dir: string): Promise<void> {
const jsonPath = path.join(dir, "deno.json");
const json = JSON.parse(await Deno.readTextFile(jsonPath));
const rootJson = JSON.parse(
await Deno.readTextFile(
path.join(import.meta.dirname!, "..", "..", "deno.json"),
),
);
json.imports = rootJson.imports;
json.imports["fresh"] = "../src/mod.ts";
json.imports["fresh/dev"] = "../src/dev/mod.ts";
json.imports["@fresh/plugin-tailwind"] = "../plugin-tailwindcss/src/mod.ts";
json.workspace = [];
// See https://github.com/denoland/deno/issues/27313
// json.patch = [path.fromFileURL(new URL("../..", import.meta.url))];
json.patch = [new URL("../..", import.meta.url).href];
// assert with this stricter rule, before adding it to initialized projects
json.lint.rules.include = ["verbatim-module-syntax"];