sv 0.12.8 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +14 -18
- package/dist/{engine-DUNH7ELq.mjs → engine-DOKagHfI.mjs} +1003 -876
- package/dist/{engine-BZ0rj9tz.d.mts → engine-M8NNzIgv.d.mts} +29 -48
- package/dist/{package-manager-BYzDyeam.mjs → package-manager-BU-MLhop.mjs} +946 -1503
- package/dist/shared.json +2 -2
- package/dist/src/index.d.mts +1 -1
- package/dist/src/index.mjs +3 -4
- package/dist/src/testing.d.mts +3 -6
- package/dist/src/testing.mjs +33 -47
- package/dist/templates/demo/files.types=checkjs.json +1 -1
- package/dist/templates/demo/files.types=none.json +1 -1
- package/dist/templates/demo/files.types=typescript.json +1 -1
- package/dist/templates/demo/package.json +1 -1
- package/dist/templates/library/package.json +1 -1
- package/dist/templates/minimal/package.json +1 -1
- package/dist/templates/svelte/files.types=none.json +1 -1
- package/dist/templates/svelte/files.types=typescript.json +1 -1
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { f as program, l as from, r as detectPackageManager, u as Command } from "./package-manager-
|
|
3
|
-
import { a as helpConfig, i as forwardExitCode, n as add, o as name, r as create, s as version } from "./engine-
|
|
2
|
+
import { f as program, l as from, r as detectPackageManager, u as Command } from "./package-manager-BU-MLhop.mjs";
|
|
3
|
+
import { a as helpConfig, i as forwardExitCode, n as add, o as name, r as create, s as version } from "./engine-DOKagHfI.mjs";
|
|
4
4
|
import { color, resolveCommand } from "@sveltejs/sv-utils";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { execSync } from "node:child_process";
|
|
7
|
-
|
|
8
7
|
//#region src/cli/check.ts
|
|
9
|
-
const check = new Command("check").description("a CLI for checking your Svelte code").allowUnknownOption(true).allowExcessArguments(true).option("-C, --cwd <path>", "path to working directory", process.cwd()).helpOption(false).action(async (options, check
|
|
10
|
-
const cwd
|
|
11
|
-
const args = check
|
|
12
|
-
await runCheck(cwd
|
|
8
|
+
const check = new Command("check").description("a CLI for checking your Svelte code").allowUnknownOption(true).allowExcessArguments(true).option("-C, --cwd <path>", "path to working directory", process.cwd()).helpOption(false).action(async (options, check) => {
|
|
9
|
+
const cwd = options.cwd;
|
|
10
|
+
const args = check.args;
|
|
11
|
+
await runCheck(cwd, args);
|
|
13
12
|
});
|
|
14
|
-
async function runCheck(cwd
|
|
15
|
-
const pm = await detectPackageManager(cwd
|
|
16
|
-
if (!from(cwd
|
|
13
|
+
async function runCheck(cwd, args) {
|
|
14
|
+
const pm = await detectPackageManager(cwd);
|
|
15
|
+
if (!from(cwd, "svelte-check", true)) {
|
|
17
16
|
const cmd = resolveCommand(pm, "add", ["-D", "svelte-check"]);
|
|
18
17
|
console.error(`'svelte-check' is not installed locally. Install it with: ${color.command(`${cmd.command} ${cmd.args.join(" ")}`)}`);
|
|
19
18
|
process.exit(1);
|
|
@@ -26,7 +25,7 @@ async function runCheck(cwd$1, args) {
|
|
|
26
25
|
const cmd = resolveCommand(pm, "execute-local", ["svelte-check", ...args]);
|
|
27
26
|
execSync(`${cmd.command} ${cmd.args.join(" ")}`, {
|
|
28
27
|
stdio: "inherit",
|
|
29
|
-
cwd
|
|
28
|
+
cwd
|
|
30
29
|
});
|
|
31
30
|
} catch (error) {
|
|
32
31
|
forwardExitCode(error);
|
|
@@ -34,27 +33,25 @@ async function runCheck(cwd$1, args) {
|
|
|
34
33
|
if (args.includes("--help")) check.help();
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
|
-
|
|
38
36
|
//#endregion
|
|
39
37
|
//#region src/cli/migrate.ts
|
|
40
38
|
const migrate = new Command("migrate").description("a CLI for migrating Svelte(Kit) codebases").argument("[migration]", "migration to run").option("-C, --cwd <path>", "path to working directory", process.cwd()).action(async (migration, options) => {
|
|
41
39
|
await runMigrate(options.cwd, [migration]);
|
|
42
40
|
});
|
|
43
|
-
async function runMigrate(cwd
|
|
44
|
-
const pm = await detectPackageManager(cwd
|
|
41
|
+
async function runMigrate(cwd, args) {
|
|
42
|
+
const pm = await detectPackageManager(cwd);
|
|
45
43
|
try {
|
|
46
44
|
const cmdArgs = ["svelte-migrate@latest", ...args];
|
|
47
45
|
if (pm === "npm") cmdArgs.unshift("--yes");
|
|
48
46
|
const cmd = resolveCommand(pm, "execute", cmdArgs);
|
|
49
47
|
execSync(`${cmd.command} ${cmd.args.join(" ")}`, {
|
|
50
48
|
stdio: "inherit",
|
|
51
|
-
cwd
|
|
49
|
+
cwd
|
|
52
50
|
});
|
|
53
51
|
} catch (error) {
|
|
54
52
|
forwardExitCode(error);
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
|
-
|
|
58
55
|
//#endregion
|
|
59
56
|
//#region bin.ts
|
|
60
57
|
console.log();
|
|
@@ -62,6 +59,5 @@ program.name(name).version(version, "-v, --version").configureHelp(helpConfig);
|
|
|
62
59
|
program.addCommand(create).addCommand(add).addCommand(migrate).addCommand(check);
|
|
63
60
|
if (process.argv.includes("--help") || process.argv.includes("-h")) program.addHelpText("after", () => "\n" + create.helpInformation());
|
|
64
61
|
program.parse();
|
|
65
|
-
|
|
66
62
|
//#endregion
|
|
67
|
-
export {
|
|
63
|
+
export {};
|