fix(update): Update tasks + lock in deno.json (#2987)

Noticed that we don't update these.
This commit is contained in:
Marvin Hagemeister
2025-05-21 15:23:41 +02:00
committed by GitHub
parent 750ab35499
commit d5a2afd7ac
2 changed files with 67 additions and 0 deletions
+35
View File
@@ -9,6 +9,8 @@ export const PREACT_VERSION = "10.26.6";
export const PREACT_SIGNALS_VERSION = "2.0.4";
export interface DenoJson {
lock?: boolean;
tasks?: Record<string, string>;
name?: string;
version?: string;
imports?: Record<string, string>;
@@ -90,6 +92,39 @@ export async function updateProject(dir: string) {
delete config.imports["$fresh/"];
delete config.imports["@preact/signals-core"];
delete config.imports["preact-render-to-string"];
// We should always use a lockfile going forwards
if ("lock" in config) {
delete config.lock;
}
// Update Fresh 1.x tasks
const tasks = config.tasks;
if (tasks !== undefined) {
if (tasks.manifest === "deno task cli manifest $(pwd)") {
delete tasks.manifest;
}
if (
tasks.cli ===
"echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -" ||
tasks.cli ===
"echo \"import '$fresh/src/dev/cli.ts'\" | deno run --unstable -A -"
) {
delete tasks.cli;
}
if (tasks.update === "deno run -A -r https://fresh.deno.dev/update .") {
tasks.update = "deno run -A -r jsr:@fresh/update .";
}
if (
tasks.check ===
"deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx"
) {
tasks.check = "deno fmt --check && deno lint && deno check";
}
}
});
// Update routes folder