major: import Fresh 2.0 code (#2449)

🎉
This commit is contained in:
Marvin Hagemeister
2024-05-24 09:40:08 +02:00
committed by GitHub
parent 990357629e
commit 287929e4d2
958 changed files with 15794 additions and 28287 deletions
+48
View File
@@ -0,0 +1,48 @@
import { parseArgs } from "@std/cli/parse-args";
import * as path from "@std/path";
import { ensureMinDenoVersion, error } from "./utils.ts";
import { updateProject } from "./update.ts";
import * as colors from "@std/fmt/colors";
const MIN_DENO_VERSION = "1.43.1";
const HELP = `@fresh/update
Update a Fresh project. This updates dependencies and optionally performs code
mods to update a project's source code to the latest recommended patterns.
To upgrade a project in the current directory, run:
deno run -A jsr:@fresh/update .
USAGE:
@fresh/update [DIRECTORY]
`;
ensureMinDenoVersion(MIN_DENO_VERSION);
const flags = parseArgs(Deno.args, {});
console.log(colors.bgRgb8(
colors.rgb8(" 🍋 Fresh Updater ", 0),
121,
));
console.log();
console.log(
colors.italic(
"Note: Breaking changes may require additional manual updates.",
),
);
console.log();
let unresolvedDirectory = Deno.args[0];
if (flags._.length !== 1) {
const userInput = prompt("Where is the project directory?", ".");
if (!userInput) {
error(HELP);
}
unresolvedDirectory = userInput;
}
const dir = path.resolve(unresolvedDirectory);
await updateProject(dir);