sv 0.9.11 → 0.9.13
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.js +47 -115
- package/dist/{create-CdiXN6U7.js → create-Bt2-1pFJ.js} +42 -72
- package/dist/{install-CA9o73JK.js → install-b9th3u8C.js} +54 -58
- package/dist/lib/index.js +2 -2
- package/dist/lib/testing.js +32 -67
- package/dist/shared.json +2 -2
- package/dist/templates/demo/files.types=checkjs.json +2 -2
- package/dist/templates/demo/files.types=none.json +2 -2
- package/dist/templates/demo/files.types=typescript.json +2 -2
- package/dist/templates/library/assets/src/app.html +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { B as We, F as Ge, H as ke, I as J, J as require_picocolors, K as up$1, L as Ke, N as De, O as isVersionUnsupportedBelow, P as Fe, R as T, U as ze, V as et, W as Vu, X as Option, Y as Command, Z as program, _ as parseScript, a as addPnpmBuildDependencies, c as installOption, et as __toESM, f as detect, g as parseJson, i as AGENT_NAMES, l as packageManagerPrompt, n as templates, o as getUserAgent, p as resolveCommand, q as from, r as dist, s as installDependencies, t as create$1, v as parseSvelte, z as Ue } from "./create-Bt2-1pFJ.js";
|
|
3
|
+
import { a as formatFiles, c as getCommunityAddon, d as createDefault, f as addDefault, i as createWorkspace, l as getAddonDetails, m as overrideProperties, o as getHighlighter, p as create$2, r as setupAddons, s as communityAddonIds, t as applyAddons, u as officialAddons } from "./install-b9th3u8C.js";
|
|
4
4
|
import { exec, execSync } from "node:child_process";
|
|
5
5
|
import path, { dirname, join } from "node:path";
|
|
6
6
|
import fs, { existsSync } from "node:fs";
|
|
@@ -12,74 +12,7 @@ import { pipeline } from "node:stream/promises";
|
|
|
12
12
|
|
|
13
13
|
//#region package.json
|
|
14
14
|
var name = "sv";
|
|
15
|
-
var version = "0.9.
|
|
16
|
-
var type = "module";
|
|
17
|
-
var description = "A CLI for creating and updating SvelteKit projects";
|
|
18
|
-
var license = "MIT";
|
|
19
|
-
var repository = {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/sveltejs/cli.git",
|
|
22
|
-
"directory": "packages/cli"
|
|
23
|
-
};
|
|
24
|
-
var homepage = "https://svelte.dev";
|
|
25
|
-
var scripts = {
|
|
26
|
-
"check": "tsc",
|
|
27
|
-
"format": "pnpm lint --write",
|
|
28
|
-
"lint": "prettier --check . --config ../../prettier.config.js --ignore-path ../../.gitignore --ignore-path .gitignore --ignore-path ../../.prettierignore"
|
|
29
|
-
};
|
|
30
|
-
var files = ["dist"];
|
|
31
|
-
var bin = "./dist/bin.js";
|
|
32
|
-
var exports = {
|
|
33
|
-
".": {
|
|
34
|
-
"types": "./dist/lib/index.d.ts",
|
|
35
|
-
"default": "./dist/lib/index.js"
|
|
36
|
-
},
|
|
37
|
-
"./testing": {
|
|
38
|
-
"types": "./dist/lib/testing.d.ts",
|
|
39
|
-
"default": "./dist/lib/testing.js"
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var devDependencies = {
|
|
43
|
-
"@clack/prompts": "1.0.0-alpha.1",
|
|
44
|
-
"@sveltejs/addons": "workspace:*",
|
|
45
|
-
"@sveltejs/cli-core": "workspace:*",
|
|
46
|
-
"@sveltejs/create": "workspace:*",
|
|
47
|
-
"@types/degit": "^2.8.6",
|
|
48
|
-
"@types/ps-tree": "^1.1.6",
|
|
49
|
-
"commander": "^13.1.0",
|
|
50
|
-
"degit": "^2.8.4",
|
|
51
|
-
"empathic": "^1.1.0",
|
|
52
|
-
"package-manager-detector": "^0.2.11",
|
|
53
|
-
"picocolors": "^1.1.1",
|
|
54
|
-
"ps-tree": "^1.2.0",
|
|
55
|
-
"tinyexec": "^0.3.2",
|
|
56
|
-
"valibot": "^0.41.0"
|
|
57
|
-
};
|
|
58
|
-
var keywords = [
|
|
59
|
-
"create",
|
|
60
|
-
"new",
|
|
61
|
-
"project",
|
|
62
|
-
"starter",
|
|
63
|
-
"svelte",
|
|
64
|
-
"sveltekit",
|
|
65
|
-
"template",
|
|
66
|
-
"wizard"
|
|
67
|
-
];
|
|
68
|
-
var package_default = {
|
|
69
|
-
name,
|
|
70
|
-
version,
|
|
71
|
-
type,
|
|
72
|
-
description,
|
|
73
|
-
license,
|
|
74
|
-
repository,
|
|
75
|
-
homepage,
|
|
76
|
-
scripts,
|
|
77
|
-
files,
|
|
78
|
-
bin,
|
|
79
|
-
exports,
|
|
80
|
-
devDependencies,
|
|
81
|
-
keywords
|
|
82
|
-
};
|
|
15
|
+
var version = "0.9.13";
|
|
83
16
|
|
|
84
17
|
//#endregion
|
|
85
18
|
//#region ../../node_modules/.pnpm/valibot@0.41.0_typescript@5.8.3/node_modules/valibot/dist/index.js
|
|
@@ -106,11 +39,11 @@ function getSpecificMessage(reference, lang) {
|
|
|
106
39
|
return store4?.get(reference)?.get(lang);
|
|
107
40
|
}
|
|
108
41
|
function _stringify(input) {
|
|
109
|
-
const type
|
|
110
|
-
if (type
|
|
111
|
-
if (type
|
|
112
|
-
if (type
|
|
113
|
-
return type
|
|
42
|
+
const type = typeof input;
|
|
43
|
+
if (type === "string") return `"${input}"`;
|
|
44
|
+
if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
|
|
45
|
+
if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
46
|
+
return type;
|
|
114
47
|
}
|
|
115
48
|
function _addIssue(context, label, dataset, config2, other) {
|
|
116
49
|
const input = other && "input" in other ? other.input : dataset.value;
|
|
@@ -563,7 +496,7 @@ function formatDescription(arg) {
|
|
|
563
496
|
}
|
|
564
497
|
async function runCommand(action) {
|
|
565
498
|
try {
|
|
566
|
-
Ge(`Welcome to the Svelte CLI! ${import_picocolors$3.default.gray(`(v${
|
|
499
|
+
Ge(`Welcome to the Svelte CLI! ${import_picocolors$3.default.gray(`(v${version})`)}`);
|
|
567
500
|
const minimumVersion = "18.3.0";
|
|
568
501
|
if (isVersionUnsupportedBelow(process.versions.node, minimumVersion)) T.warn(`You are using Node.js ${import_picocolors$3.default.red(process.versions.node)}, please upgrade to Node.js ${import_picocolors$3.default.green(minimumVersion)} or higher.`);
|
|
569
502
|
await action();
|
|
@@ -764,8 +697,8 @@ const add = new Command("add").description("applies specified add-ons into a pro
|
|
|
764
697
|
formatHelp(cmd, helper) {
|
|
765
698
|
const termWidth = helper.padWidth(cmd, helper);
|
|
766
699
|
const helpWidth = helper.helpWidth ?? 80;
|
|
767
|
-
function callFormatItem(term, description
|
|
768
|
-
return helper.formatItem(term, termWidth, description
|
|
700
|
+
function callFormatItem(term, description) {
|
|
701
|
+
return helper.formatItem(term, termWidth, description, helper);
|
|
769
702
|
}
|
|
770
703
|
let output = [`${helper.styleTitle("Usage:")} ${helper.styleUsage(helper.commandUsage(cmd))}`, ""];
|
|
771
704
|
const commandDescription = helper.commandDescription(cmd);
|
|
@@ -779,8 +712,8 @@ const add = new Command("add").description("applies specified add-ons into a pro
|
|
|
779
712
|
""
|
|
780
713
|
]);
|
|
781
714
|
const addonList = addonOptions.map((option) => {
|
|
782
|
-
const description
|
|
783
|
-
return callFormatItem(helper.styleArgumentTerm(option.id), helper.styleArgumentDescription(description
|
|
715
|
+
const description = option.choices;
|
|
716
|
+
return callFormatItem(helper.styleArgumentTerm(option.id), helper.styleArgumentDescription(description));
|
|
784
717
|
});
|
|
785
718
|
if (addonList.length > 0) output = output.concat([
|
|
786
719
|
helper.styleTitle("Add-On Options:"),
|
|
@@ -836,8 +769,7 @@ const add = new Command("add").description("applies specified add-ons into a pro
|
|
|
836
769
|
const selectedAddons = transformAliases(addonArgs);
|
|
837
770
|
selectedAddons.forEach((addon) => options$1.addons[addon.id] = addon.options);
|
|
838
771
|
runCommand(async () => {
|
|
839
|
-
const
|
|
840
|
-
const { nextSteps } = await runAddCommand(options$1, selectedAddonIds);
|
|
772
|
+
const { nextSteps } = await runAddCommand(options$1, selectedAddons.map(({ id }) => id));
|
|
841
773
|
if (nextSteps.length > 0) Ke(nextSteps.join("\n"), "Next steps", { format: (line) => line });
|
|
842
774
|
});
|
|
843
775
|
});
|
|
@@ -859,9 +791,20 @@ async function runAddCommand(options$1, selectedAddonIds) {
|
|
|
859
791
|
});
|
|
860
792
|
official[addonId] ??= {};
|
|
861
793
|
const optionEntries = Object.entries(details$1.options);
|
|
794
|
+
const specifiedOptionsObject = Object.fromEntries(specifiedOptions.map((option) => option.split(":", 2)));
|
|
862
795
|
for (const option of specifiedOptions) {
|
|
863
796
|
let [optionId, optionValue] = option.split(":", 2);
|
|
864
|
-
const optionEntry = optionEntries.find(([id, question$1]) =>
|
|
797
|
+
const optionEntry = optionEntries.find(([id, question$1]) => {
|
|
798
|
+
if (id === optionId) return true;
|
|
799
|
+
if (question$1.group === optionId) {
|
|
800
|
+
if (question$1.type === "select" || question$1.type === "multiselect") {
|
|
801
|
+
if (!question$1.options.some((opt) => opt.value === optionValue)) return false;
|
|
802
|
+
}
|
|
803
|
+
if (question$1.condition) return question$1.condition(specifiedOptionsObject);
|
|
804
|
+
return true;
|
|
805
|
+
}
|
|
806
|
+
return false;
|
|
807
|
+
});
|
|
865
808
|
if (!optionEntry) {
|
|
866
809
|
const { choices } = getOptionChoices(details$1);
|
|
867
810
|
throw new Error(`Invalid '${addonId}' option: '${option}'\nAvailable options: ${choices.join(", ")}`);
|
|
@@ -920,10 +863,7 @@ async function runAddCommand(options$1, selectedAddonIds) {
|
|
|
920
863
|
const paddingName = getPadding(pkgs.map(({ pkg }) => pkg.name));
|
|
921
864
|
const paddingVersion = getPadding(pkgs.map(({ pkg }) => `(v${pkg.version})`));
|
|
922
865
|
const packageInfos = pkgs.map(({ pkg, repo: _repo }) => {
|
|
923
|
-
|
|
924
|
-
const version$1 = import_picocolors$2.default.dim(`(v${pkg.version})`.padEnd(paddingVersion));
|
|
925
|
-
const repo = import_picocolors$2.default.dim(`(${_repo})`);
|
|
926
|
-
return `${name$1} ${version$1} ${repo}`;
|
|
866
|
+
return `${import_picocolors$2.default.yellowBright(pkg.name.padEnd(paddingName))} ${import_picocolors$2.default.dim(`(v${pkg.version})`.padEnd(paddingVersion))} ${import_picocolors$2.default.dim(`(${_repo})`)}`;
|
|
927
867
|
});
|
|
928
868
|
T.message(packageInfos.join("\n"));
|
|
929
869
|
if (await ke({ message: "Would you like to continue?" }) !== true) {
|
|
@@ -950,10 +890,10 @@ async function runAddCommand(options$1, selectedAddonIds) {
|
|
|
950
890
|
let workspace = await createWorkspace({ cwd: options$1.cwd });
|
|
951
891
|
if (selectedAddons.length === 0) {
|
|
952
892
|
const allSetupResults = setupAddons(officialAddons$1, workspace);
|
|
953
|
-
const addonOptions$1 = officialAddons$1.filter(({ id }) => allSetupResults[id].unsupported.length === 0).map(({ id, homepage
|
|
893
|
+
const addonOptions$1 = officialAddons$1.filter(({ id }) => allSetupResults[id].unsupported.length === 0).map(({ id, homepage, shortDescription }) => ({
|
|
954
894
|
label: id,
|
|
955
895
|
value: id,
|
|
956
|
-
hint: `${shortDescription} - ${homepage
|
|
896
|
+
hint: `${shortDescription} - ${homepage}`
|
|
957
897
|
}));
|
|
958
898
|
const selected = await Ue({
|
|
959
899
|
message: `What would you like to add to your project? ${import_picocolors$2.default.dim("(use arrow keys / space bar)")}`,
|
|
@@ -974,8 +914,7 @@ async function runAddCommand(options$1, selectedAddonIds) {
|
|
|
974
914
|
}
|
|
975
915
|
for (const { addon } of selectedAddons) {
|
|
976
916
|
workspace = await createWorkspace(workspace);
|
|
977
|
-
const
|
|
978
|
-
const missingDependencies = setupAddons(setups, workspace)[addon.id].dependsOn.filter((depId) => !selectedAddons.some((a) => a.addon.id === depId));
|
|
917
|
+
const missingDependencies = setupAddons(selectedAddons.map(({ addon: addon$1 }) => addon$1), workspace)[addon.id].dependsOn.filter((depId) => !selectedAddons.some((a) => a.addon.id === depId));
|
|
979
918
|
for (const depId of missingDependencies) {
|
|
980
919
|
const dependency = getAddonDetails(depId);
|
|
981
920
|
if (!dependency) throw new Error(`'${addon.id}' depends on an invalid add-on: '${depId}'`);
|
|
@@ -1012,15 +951,15 @@ async function runAddCommand(options$1, selectedAddonIds) {
|
|
|
1012
951
|
process.exit(1);
|
|
1013
952
|
}
|
|
1014
953
|
}
|
|
1015
|
-
for (const { addon, type
|
|
954
|
+
for (const { addon, type } of selectedAddons) {
|
|
1016
955
|
const addonId = addon.id;
|
|
1017
956
|
const questionPrefix = selectedAddons.length > 1 ? `${addon.id}: ` : "";
|
|
1018
957
|
let values = {};
|
|
1019
|
-
if (type
|
|
958
|
+
if (type === "official") {
|
|
1020
959
|
official[addonId] ??= {};
|
|
1021
960
|
values = official[addonId];
|
|
1022
961
|
}
|
|
1023
|
-
if (type
|
|
962
|
+
if (type === "community") {
|
|
1024
963
|
community[addonId] ??= {};
|
|
1025
964
|
values = community[addonId];
|
|
1026
965
|
}
|
|
@@ -1221,22 +1160,20 @@ function validatePlaygroundUrl(link) {
|
|
|
1221
1160
|
function parsePlaygroundUrl(link) {
|
|
1222
1161
|
const url = new URL(link);
|
|
1223
1162
|
const [, playgroundId] = url.pathname.match(/\/playground\/([^/]+)/) || [];
|
|
1224
|
-
const hash = url.hash !== "" ? url.hash.slice(1) : void 0;
|
|
1225
|
-
const svelteVersion = url.searchParams.get("version") || void 0;
|
|
1226
1163
|
return {
|
|
1227
1164
|
playgroundId,
|
|
1228
|
-
hash,
|
|
1229
|
-
svelteVersion
|
|
1165
|
+
hash: url.hash !== "" ? url.hash.slice(1) : void 0,
|
|
1166
|
+
svelteVersion: url.searchParams.get("version") || void 0
|
|
1230
1167
|
};
|
|
1231
1168
|
}
|
|
1232
1169
|
async function downloadPlaygroundData({ playgroundId, hash, svelteVersion }) {
|
|
1233
1170
|
let data = [];
|
|
1234
1171
|
if (hash) data = JSON.parse(await decodeAndDecompressText(hash));
|
|
1235
1172
|
else data = await (await fetch(`https://svelte.dev/playground/api/${playgroundId}.json`)).json();
|
|
1236
|
-
const files
|
|
1173
|
+
const files = data.components !== void 0 ? data.components : data.files;
|
|
1237
1174
|
return {
|
|
1238
1175
|
name: data.name,
|
|
1239
|
-
files: files
|
|
1176
|
+
files: files.map((file) => {
|
|
1240
1177
|
return {
|
|
1241
1178
|
name: file.name + (file.type !== "file" ? `.${file.type}` : ""),
|
|
1242
1179
|
content: file.source || file.contents
|
|
@@ -1255,7 +1192,7 @@ async function decodeAndDecompressText(input) {
|
|
|
1255
1192
|
/**
|
|
1256
1193
|
* @returns A Map of packages with it's name as the key, and it's version as the value.
|
|
1257
1194
|
*/
|
|
1258
|
-
function detectPlaygroundDependencies(files
|
|
1195
|
+
function detectPlaygroundDependencies(files) {
|
|
1259
1196
|
const packages = /* @__PURE__ */ new Map();
|
|
1260
1197
|
const excludedPrefixes = [
|
|
1261
1198
|
"$",
|
|
@@ -1263,7 +1200,7 @@ function detectPlaygroundDependencies(files$1) {
|
|
|
1263
1200
|
"svelte",
|
|
1264
1201
|
"@sveltejs/"
|
|
1265
1202
|
];
|
|
1266
|
-
for (const file of files
|
|
1203
|
+
for (const file of files) {
|
|
1267
1204
|
let ast;
|
|
1268
1205
|
if (file.name.endsWith(".svelte")) ast = parseSvelte(file.content).script.ast;
|
|
1269
1206
|
else if (file.name.endsWith(".js") || file.name.endsWith(".ts")) ast = parseScript(file.content).ast;
|
|
@@ -1309,8 +1246,8 @@ function setupPlaygroundProject(url, playground, cwd, installDependencies$1, typ
|
|
|
1309
1246
|
}
|
|
1310
1247
|
{
|
|
1311
1248
|
const shared = dist("shared.json");
|
|
1312
|
-
const { files
|
|
1313
|
-
const playgroundFiles = files
|
|
1249
|
+
const { files } = JSON.parse(fs.readFileSync(shared, "utf-8"));
|
|
1250
|
+
const playgroundFiles = files.filter((file) => file.include.includes("playground"));
|
|
1314
1251
|
for (const file of playgroundFiles) {
|
|
1315
1252
|
let contentToWrite = file.contents;
|
|
1316
1253
|
if (file.name === "src/lib/PlaygroundLayout.svelte") {
|
|
@@ -1326,8 +1263,7 @@ function setupPlaygroundProject(url, playground, cwd, installDependencies$1, typ
|
|
|
1326
1263
|
}
|
|
1327
1264
|
}
|
|
1328
1265
|
const filePath = path.join(cwd, "src/routes/+page.svelte");
|
|
1329
|
-
const
|
|
1330
|
-
const { script, generateCode } = parseSvelte(content, { typescript });
|
|
1266
|
+
const { script, generateCode } = parseSvelte(fs.readFileSync(filePath, "utf-8"), { typescript });
|
|
1331
1267
|
addDefault(script.ast, {
|
|
1332
1268
|
as: "App",
|
|
1333
1269
|
from: `$lib/playground/${mainFile.name}`
|
|
@@ -1344,8 +1280,7 @@ function setupPlaygroundProject(url, playground, cwd, installDependencies$1, typ
|
|
|
1344
1280
|
});
|
|
1345
1281
|
fs.writeFileSync(filePath, newContent, "utf-8");
|
|
1346
1282
|
const pkgPath = path.join(cwd, "package.json");
|
|
1347
|
-
const
|
|
1348
|
-
const pkgJson = parseJson(pkgSource);
|
|
1283
|
+
const pkgJson = parseJson(fs.readFileSync(pkgPath, "utf-8"));
|
|
1349
1284
|
let updatePackageJson = false;
|
|
1350
1285
|
if (installDependencies$1 && dependencies.size >= 0) {
|
|
1351
1286
|
updatePackageJson = true;
|
|
@@ -1355,8 +1290,7 @@ function setupPlaygroundProject(url, playground, cwd, installDependencies$1, typ
|
|
|
1355
1290
|
let experimentalAsyncNeeded = true;
|
|
1356
1291
|
const addExperimentalAsync = () => {
|
|
1357
1292
|
const svelteConfigPath = path.join(cwd, "svelte.config.js");
|
|
1358
|
-
const
|
|
1359
|
-
const { ast, generateCode: generateCode$1 } = parseScript(svelteConfig);
|
|
1293
|
+
const { ast, generateCode: generateCode$1 } = parseScript(fs.readFileSync(svelteConfigPath, "utf-8"));
|
|
1360
1294
|
const { value: config } = createDefault(ast, { fallback: create$2({}) });
|
|
1361
1295
|
overrideProperties(config, { compilerOptions: { experimental: { async: true } } });
|
|
1362
1296
|
fs.writeFileSync(svelteConfigPath, generateCode$1(), "utf-8");
|
|
@@ -1531,11 +1465,9 @@ async function createProject(cwd, options$1) {
|
|
|
1531
1465
|
};
|
|
1532
1466
|
}
|
|
1533
1467
|
async function createProjectFromPlayground(url, cwd, typescript) {
|
|
1534
|
-
const
|
|
1535
|
-
const playground = await downloadPlaygroundData(urlData);
|
|
1468
|
+
const playground = await downloadPlaygroundData(parsePlaygroundUrl(url));
|
|
1536
1469
|
const dependencies = detectPlaygroundDependencies(playground.files);
|
|
1537
|
-
|
|
1538
|
-
setupPlaygroundProject(url, playground, cwd, installDependencies$1, typescript);
|
|
1470
|
+
setupPlaygroundProject(url, playground, cwd, await confirmExternalDependencies(Array.from(dependencies.keys())), typescript);
|
|
1539
1471
|
}
|
|
1540
1472
|
async function confirmExternalDependencies(dependencies) {
|
|
1541
1473
|
if (dependencies.length === 0) return false;
|
|
@@ -1604,7 +1536,7 @@ function runCheck(cwd, args) {
|
|
|
1604
1536
|
//#endregion
|
|
1605
1537
|
//#region bin.ts
|
|
1606
1538
|
console.log();
|
|
1607
|
-
program.name(
|
|
1539
|
+
program.name(name).version(version, "-v, --version").configureHelp(helpConfig);
|
|
1608
1540
|
program.addCommand(create).addCommand(add).addCommand(migrate).addCommand(check);
|
|
1609
1541
|
program.parse();
|
|
1610
1542
|
|
|
@@ -1569,12 +1569,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1569
1569
|
this.setOptionValueWithSource(name, val, valueSource);
|
|
1570
1570
|
};
|
|
1571
1571
|
this.on("option:" + oname, (val) => {
|
|
1572
|
-
|
|
1573
|
-
handleOptionValue(val, invalidValueMessage, "cli");
|
|
1572
|
+
handleOptionValue(val, `error: option '${option.flags}' argument '${val}' is invalid.`, "cli");
|
|
1574
1573
|
});
|
|
1575
1574
|
if (option.envVar) this.on("optionEnv:" + oname, (val) => {
|
|
1576
|
-
|
|
1577
|
-
handleOptionValue(val, invalidValueMessage, "env");
|
|
1575
|
+
handleOptionValue(val, `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`, "env");
|
|
1578
1576
|
});
|
|
1579
1577
|
return this;
|
|
1580
1578
|
}
|
|
@@ -1914,11 +1912,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1914
1912
|
*/
|
|
1915
1913
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
1916
1914
|
if (fs$1.existsSync(executableFile)) return;
|
|
1917
|
-
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
1918
1915
|
const executableMissing = `'${executableFile}' does not exist
|
|
1919
1916
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
1920
1917
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
1921
|
-
- ${
|
|
1918
|
+
- ${executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory"}`;
|
|
1922
1919
|
throw new Error(executableMissing);
|
|
1923
1920
|
}
|
|
1924
1921
|
/**
|
|
@@ -3039,8 +3036,7 @@ function absolute(input, root$1) {
|
|
|
3039
3036
|
}
|
|
3040
3037
|
function from(root$1, ident, silent) {
|
|
3041
3038
|
try {
|
|
3042
|
-
|
|
3043
|
-
return createRequire(r).resolve(ident);
|
|
3039
|
+
return createRequire(root$1 instanceof URL || root$1.startsWith("file://") ? join(fileURLToPath(root$1), "noop.js") : join(absolute(root$1), "noop.js")).resolve(ident);
|
|
3044
3040
|
} catch (err) {
|
|
3045
3041
|
if (!silent) throw err;
|
|
3046
3042
|
}
|
|
@@ -4302,11 +4298,11 @@ ${import_picocolors$2.default.cyan(f)}
|
|
|
4302
4298
|
try {
|
|
4303
4299
|
let s;
|
|
4304
4300
|
return existsSync(r) ? lstatSync(r).isDirectory() ? s = r : s = dirname(r) : s = dirname(r), readdirSync(s).map((n$1) => {
|
|
4305
|
-
const a = join(s, n$1)
|
|
4301
|
+
const a = join(s, n$1);
|
|
4306
4302
|
return {
|
|
4307
4303
|
name: n$1,
|
|
4308
4304
|
path: a,
|
|
4309
|
-
isDirectory:
|
|
4305
|
+
isDirectory: lstatSync(a).isDirectory()
|
|
4310
4306
|
};
|
|
4311
4307
|
}).filter(({ path: n$1, isDirectory: a }) => n$1.startsWith(r) && (t.directory || !a)).map((n$1) => ({ value: n$1.path }));
|
|
4312
4308
|
} catch {
|
|
@@ -4571,11 +4567,10 @@ function defineAddonOptions() {
|
|
|
4571
4567
|
function createOptionBuilder(options) {
|
|
4572
4568
|
return {
|
|
4573
4569
|
add(key, question) {
|
|
4574
|
-
|
|
4570
|
+
return createOptionBuilder({
|
|
4575
4571
|
...options,
|
|
4576
4572
|
[key]: question
|
|
4577
|
-
};
|
|
4578
|
-
return createOptionBuilder(newOptions);
|
|
4573
|
+
});
|
|
4579
4574
|
},
|
|
4580
4575
|
build() {
|
|
4581
4576
|
return options;
|
|
@@ -5229,8 +5224,7 @@ var DomHandler = class {
|
|
|
5229
5224
|
if (this.elementCB) this.elementCB(elem);
|
|
5230
5225
|
}
|
|
5231
5226
|
onopentag(name, attribs) {
|
|
5232
|
-
const
|
|
5233
|
-
const element = new Element(name, attribs, void 0, type);
|
|
5227
|
+
const element = new Element(name, attribs, void 0, this.options.xmlMode ? ElementType.Tag : void 0);
|
|
5234
5228
|
this.addNode(element);
|
|
5235
5229
|
this.tagStack.push(element);
|
|
5236
5230
|
}
|
|
@@ -6985,6 +6979,12 @@ const attributeNames = new Map([
|
|
|
6985
6979
|
|
|
6986
6980
|
//#endregion
|
|
6987
6981
|
//#region ../../node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/index.js
|
|
6982
|
+
/**
|
|
6983
|
+
* Mixed-case SVG and MathML tags & attributes
|
|
6984
|
+
* recognized by the HTML parser.
|
|
6985
|
+
*
|
|
6986
|
+
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
|
6987
|
+
*/
|
|
6988
6988
|
const unencodedElements = new Set([
|
|
6989
6989
|
"style",
|
|
6990
6990
|
"script",
|
|
@@ -10327,9 +10327,7 @@ var require_source_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
10327
10327
|
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
|
10328
10328
|
var remainingLinesIndex = 0;
|
|
10329
10329
|
var shiftNextLine = function() {
|
|
10330
|
-
|
|
10331
|
-
var newLine = getNextLine() || "";
|
|
10332
|
-
return lineContents + newLine;
|
|
10330
|
+
return getNextLine() + (getNextLine() || "");
|
|
10333
10331
|
function getNextLine() {
|
|
10334
10332
|
return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
|
|
10335
10333
|
}
|
|
@@ -11744,8 +11742,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postc
|
|
|
11744
11742
|
let Input$2 = require_input();
|
|
11745
11743
|
let Parser$2 = require_parser$1();
|
|
11746
11744
|
function parse$6(css, opts) {
|
|
11747
|
-
let
|
|
11748
|
-
let parser$2 = new Parser$2(input);
|
|
11745
|
+
let parser$2 = new Parser$2(new Input$2(css, opts));
|
|
11749
11746
|
try {
|
|
11750
11747
|
parser$2.parse();
|
|
11751
11748
|
} catch (e$1) {
|
|
@@ -12139,10 +12136,7 @@ var require_lazy_result = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
12139
12136
|
if (this.processed) return this.result;
|
|
12140
12137
|
this.processed = true;
|
|
12141
12138
|
if (this.processing) throw this.getAsyncError();
|
|
12142
|
-
for (let plugin$1 of this.plugins)
|
|
12143
|
-
let promise = this.runOnRoot(plugin$1);
|
|
12144
|
-
if (isPromise(promise)) throw this.getAsyncError();
|
|
12145
|
-
}
|
|
12139
|
+
for (let plugin$1 of this.plugins) if (isPromise(this.runOnRoot(plugin$1))) throw this.getAsyncError();
|
|
12146
12140
|
this.prepareVisitors();
|
|
12147
12141
|
if (this.hasListener) {
|
|
12148
12142
|
let root$1 = this.result.root;
|
|
@@ -12795,8 +12789,7 @@ var require_silver_fleece_umd = /* @__PURE__ */ __commonJS({ "../../node_modules
|
|
|
12795
12789
|
return Parser$6;
|
|
12796
12790
|
}();
|
|
12797
12791
|
function evaluate(str, opts) {
|
|
12798
|
-
|
|
12799
|
-
return getValue(ast);
|
|
12792
|
+
return getValue(parse$8(str, opts));
|
|
12800
12793
|
}
|
|
12801
12794
|
function getValue(node) {
|
|
12802
12795
|
if (node.type === "Literal") return node.value;
|
|
@@ -12810,8 +12803,7 @@ var require_silver_fleece_umd = /* @__PURE__ */ __commonJS({ "../../node_modules
|
|
|
12810
12803
|
}
|
|
12811
12804
|
}
|
|
12812
12805
|
function stringify$13(value, options) {
|
|
12813
|
-
|
|
12814
|
-
return stringifyValue(value, "\n", indentString, true);
|
|
12806
|
+
return stringifyValue(value, "\n", options && options.spaces ? spaces(options.spaces) : " ", true);
|
|
12815
12807
|
}
|
|
12816
12808
|
function stringifyProperty(key, value, indentation, indentString, newlines) {
|
|
12817
12809
|
return JSON.stringify(key) + ": " + stringifyValue(value, indentation, indentString, newlines);
|
|
@@ -14187,6 +14179,8 @@ function encode(decoded) {
|
|
|
14187
14179
|
|
|
14188
14180
|
//#endregion
|
|
14189
14181
|
//#region ../../node_modules/.pnpm/esrap@1.4.9/node_modules/esrap/src/index.js
|
|
14182
|
+
/** @import { TSESTree } from '@typescript-eslint/types' */
|
|
14183
|
+
/** @import { Command, PrintOptions, State } from './types' */
|
|
14190
14184
|
/** @type {(str: string) => string} str */
|
|
14191
14185
|
let btoa$2 = () => {
|
|
14192
14186
|
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
@@ -20740,8 +20734,7 @@ function tsPlugin(options) {
|
|
|
20740
20734
|
return this.type === acornTypeScript.tokTypes[type];
|
|
20741
20735
|
}
|
|
20742
20736
|
ts_eatWithState(type, nextCount, state) {
|
|
20743
|
-
|
|
20744
|
-
if (type === targetType) {
|
|
20737
|
+
if (type === state.type) {
|
|
20745
20738
|
for (let i$1 = 0; i$1 < nextCount; i$1++) this.next();
|
|
20746
20739
|
return true;
|
|
20747
20740
|
} else return false;
|
|
@@ -24808,9 +24801,7 @@ var require_Pair = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/yaml@2
|
|
|
24808
24801
|
var addPairToJSMap$1 = require_addPairToJSMap();
|
|
24809
24802
|
var identity$20 = require_identity();
|
|
24810
24803
|
function createPair(key, value, ctx) {
|
|
24811
|
-
|
|
24812
|
-
const v$2 = createNode$2.createNode(value, void 0, ctx);
|
|
24813
|
-
return new Pair$7(k$2, v$2);
|
|
24804
|
+
return new Pair$7(createNode$2.createNode(key, void 0, ctx), createNode$2.createNode(value, void 0, ctx));
|
|
24814
24805
|
}
|
|
24815
24806
|
var Pair$7 = class Pair$7 {
|
|
24816
24807
|
constructor(key, value = null) {
|
|
@@ -25251,8 +25242,7 @@ var require_bool$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/yaml
|
|
|
25251
25242
|
resolve: (str) => new Scalar$11.Scalar(str[0] === "t" || str[0] === "T"),
|
|
25252
25243
|
stringify({ source, value }, ctx) {
|
|
25253
25244
|
if (source && boolTag.test.test(source)) {
|
|
25254
|
-
|
|
25255
|
-
if (value === sv) return source;
|
|
25245
|
+
if (value === (source[0] === "t" || source[0] === "T")) return source;
|
|
25256
25246
|
}
|
|
25257
25247
|
return value ? ctx.options.trueStr : ctx.options.falseStr;
|
|
25258
25248
|
}
|
|
@@ -27180,8 +27170,7 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJS({ "../../node_modu
|
|
|
27180
27170
|
length += token.source.length;
|
|
27181
27171
|
break;
|
|
27182
27172
|
default: {
|
|
27183
|
-
|
|
27184
|
-
onError(token, "UNEXPECTED_TOKEN", message);
|
|
27173
|
+
onError(token, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${token.type}`);
|
|
27185
27174
|
const ts = token.source;
|
|
27186
27175
|
if (ts && typeof ts === "string") length += ts.length;
|
|
27187
27176
|
}
|
|
@@ -27467,12 +27456,7 @@ var require_compose_scalar = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
27467
27456
|
const tag = schema$6.tags.find((tag$1) => (tag$1.default === true || atKey && tag$1.default === "key") && tag$1.test?.test(value)) || schema$6[identity$5.SCALAR];
|
|
27468
27457
|
if (schema$6.compat) {
|
|
27469
27458
|
const compat = schema$6.compat.find((tag$1) => tag$1.default && tag$1.test?.test(value)) ?? schema$6[identity$5.SCALAR];
|
|
27470
|
-
if (tag.tag !== compat.tag) {
|
|
27471
|
-
const ts = directives$2.tagString(tag.tag);
|
|
27472
|
-
const cs = directives$2.tagString(compat.tag);
|
|
27473
|
-
const msg = `Value may be parsed as either ${ts} or ${cs}`;
|
|
27474
|
-
onError(token, "TAG_RESOLVE_FAILED", msg, true);
|
|
27475
|
-
}
|
|
27459
|
+
if (tag.tag !== compat.tag) onError(token, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${directives$2.tagString(tag.tag)} or ${directives$2.tagString(compat.tag)}`, true);
|
|
27476
27460
|
}
|
|
27477
27461
|
return tag;
|
|
27478
27462
|
}
|
|
@@ -27543,12 +27527,10 @@ var require_compose_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
27543
27527
|
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
|
|
27544
27528
|
if (anchor) node.anchor = anchor.source.substring(1);
|
|
27545
27529
|
break;
|
|
27546
|
-
default:
|
|
27547
|
-
|
|
27548
|
-
onError(token, "UNEXPECTED_TOKEN", message);
|
|
27530
|
+
default:
|
|
27531
|
+
onError(token, "UNEXPECTED_TOKEN", token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`);
|
|
27549
27532
|
node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError);
|
|
27550
27533
|
isSrcToken = false;
|
|
27551
|
-
}
|
|
27552
27534
|
}
|
|
27553
27535
|
if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
27554
27536
|
if (atKey && ctx.options.stringKeys && (!identity$4.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) onError(tag ?? token, "NON_STRING_KEY", "With stringKeys, all keys must be strings");
|
|
@@ -29262,8 +29244,7 @@ var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/yaml
|
|
|
29262
29244
|
}
|
|
29263
29245
|
*scalar(scalar) {
|
|
29264
29246
|
if (this.type === "map-value-ind") {
|
|
29265
|
-
const
|
|
29266
|
-
const start = getFirstKeyStartProps(prev);
|
|
29247
|
+
const start = getFirstKeyStartProps(getPrevProps(this.peek(2)));
|
|
29267
29248
|
let sep$1;
|
|
29268
29249
|
if (scalar.end) {
|
|
29269
29250
|
sep$1 = scalar.end;
|
|
@@ -29628,8 +29609,7 @@ var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/yaml
|
|
|
29628
29609
|
yield* this.pop();
|
|
29629
29610
|
yield* this.step();
|
|
29630
29611
|
} else if (this.type === "map-value-ind" && parent.type !== "flow-collection") {
|
|
29631
|
-
const
|
|
29632
|
-
const start = getFirstKeyStartProps(prev);
|
|
29612
|
+
const start = getFirstKeyStartProps(getPrevProps(parent));
|
|
29633
29613
|
fixFlowSeqItems(fc);
|
|
29634
29614
|
const sep$1 = fc.end.splice(1, fc.end.length);
|
|
29635
29615
|
sep$1.push(this.sourceToken);
|
|
@@ -29693,8 +29673,7 @@ var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/yaml
|
|
|
29693
29673
|
};
|
|
29694
29674
|
case "explicit-key-ind": {
|
|
29695
29675
|
this.onKeyLine = true;
|
|
29696
|
-
const
|
|
29697
|
-
const start = getFirstKeyStartProps(prev);
|
|
29676
|
+
const start = getFirstKeyStartProps(getPrevProps(parent));
|
|
29698
29677
|
start.push(this.sourceToken);
|
|
29699
29678
|
return {
|
|
29700
29679
|
type: "block-map",
|
|
@@ -29708,8 +29687,7 @@ var require_parser = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/yaml
|
|
|
29708
29687
|
}
|
|
29709
29688
|
case "map-value-ind": {
|
|
29710
29689
|
this.onKeyLine = true;
|
|
29711
|
-
const
|
|
29712
|
-
const start = getFirstKeyStartProps(prev);
|
|
29690
|
+
const start = getFirstKeyStartProps(getPrevProps(parent));
|
|
29713
29691
|
return {
|
|
29714
29692
|
type: "block-map",
|
|
29715
29693
|
offset: this.offset,
|
|
@@ -30251,10 +30229,9 @@ function getLocator(source) {
|
|
|
30251
30229
|
else i$1 = m$1 + 1;
|
|
30252
30230
|
}
|
|
30253
30231
|
const line = i$1 - 1;
|
|
30254
|
-
const column = index - lineOffsets[line];
|
|
30255
30232
|
return {
|
|
30256
30233
|
line,
|
|
30257
|
-
column
|
|
30234
|
+
column: index - lineOffsets[line]
|
|
30258
30235
|
};
|
|
30259
30236
|
};
|
|
30260
30237
|
}
|
|
@@ -31039,9 +31016,7 @@ function parseSvelte(source, options) {
|
|
|
31039
31016
|
const generateCode = (code) => {
|
|
31040
31017
|
const ms = new MagicString(source);
|
|
31041
31018
|
if (code.script !== void 0) if (scriptSource.length === 0) {
|
|
31042
|
-
const
|
|
31043
|
-
const indented = code.script.split("\n").join("\n ");
|
|
31044
|
-
const script$1 = `<script${ts}>\n\t${indented}\n<\/script>\n\n`;
|
|
31019
|
+
const script$1 = `<script${options?.typescript ? " lang=\"ts\"" : ""}>\n\t${code.script.split("\n").join("\n ")}\n<\/script>\n\n`;
|
|
31045
31020
|
ms.prepend(script$1);
|
|
31046
31021
|
} else {
|
|
31047
31022
|
const { start, end } = locations(source, scriptSource);
|
|
@@ -31049,9 +31024,7 @@ function parseSvelte(source, options) {
|
|
|
31049
31024
|
ms.update(start, end, formatted);
|
|
31050
31025
|
}
|
|
31051
31026
|
if (code.module !== void 0) if (moduleSource.length === 0) {
|
|
31052
|
-
const
|
|
31053
|
-
const indented = code.module.split("\n").join("\n ");
|
|
31054
|
-
const module$2 = `<script${ts} context="module">\n\t${indented}\n<\/script>\n\n`;
|
|
31027
|
+
const module$2 = `<script${options?.typescript ? " lang=\"ts\"" : ""} context="module">\n\t${code.module.split("\n").join("\n ")}\n<\/script>\n\n`;
|
|
31055
31028
|
ms.prepend(module$2);
|
|
31056
31029
|
} else {
|
|
31057
31030
|
const { start, end } = locations(source, moduleSource);
|
|
@@ -31095,10 +31068,9 @@ function parseSvelte(source, options) {
|
|
|
31095
31068
|
}
|
|
31096
31069
|
function locations(source, search) {
|
|
31097
31070
|
const start = source.indexOf(search);
|
|
31098
|
-
const end = start + search.length;
|
|
31099
31071
|
return {
|
|
31100
31072
|
start,
|
|
31101
|
-
end
|
|
31073
|
+
end: start + search.length
|
|
31102
31074
|
};
|
|
31103
31075
|
}
|
|
31104
31076
|
function indent(content, indent$2) {
|
|
@@ -31812,8 +31784,8 @@ var et = l((Re, tt) => {
|
|
|
31812
31784
|
typeof e$1 == "function" && (n$1 = e$1, e$1 = {}), e$1 || (e$1 = {});
|
|
31813
31785
|
let { pathEnv: r, pathExt: s, pathExtExe: o$1 } = Q$1(t, e$1), i$1 = [], a = (u) => new Promise((f$2, p$2) => {
|
|
31814
31786
|
if (u === r.length) return e$1.all && i$1.length ? f$2(i$1) : p$2(J$2(t));
|
|
31815
|
-
let d$1 = r[u], w$1 = /^".*"$/.test(d$1) ? d$1.slice(1, -1) : d$1, m$1 = Y$1.join(w$1, t)
|
|
31816
|
-
f$2(c$2(
|
|
31787
|
+
let d$1 = r[u], w$1 = /^".*"$/.test(d$1) ? d$1.slice(1, -1) : d$1, m$1 = Y$1.join(w$1, t);
|
|
31788
|
+
f$2(c$2(!w$1 && /^\.[\\\/]/.test(t) ? t.slice(0, 2) + m$1 : m$1, u, 0));
|
|
31817
31789
|
}), c$2 = (u, f$2, p$2) => new Promise((d$1, w$1) => {
|
|
31818
31790
|
if (p$2 === s.length) return d$1(a(f$2 + 1));
|
|
31819
31791
|
let m$1 = s[p$2];
|
|
@@ -32346,10 +32318,8 @@ function write_common_files(cwd$1, options, name) {
|
|
|
32346
32318
|
sort_files(files).forEach((file) => {
|
|
32347
32319
|
const include = file.include.every((condition) => matches_condition(condition, options));
|
|
32348
32320
|
if (file.exclude.some((condition) => matches_condition(condition, options)) || !include) return;
|
|
32349
|
-
if (file.name === "package.json")
|
|
32350
|
-
|
|
32351
|
-
merge(pkg, new_pkg);
|
|
32352
|
-
} else {
|
|
32321
|
+
if (file.name === "package.json") merge(pkg, JSON.parse(file.contents));
|
|
32322
|
+
else {
|
|
32353
32323
|
const dest = path.join(cwd$1, file.name);
|
|
32354
32324
|
mkdirp(path.dirname(dest));
|
|
32355
32325
|
fs.writeFileSync(dest, file.contents);
|
|
@@ -32398,4 +32368,4 @@ function to_valid_package_name(name) {
|
|
|
32398
32368
|
}
|
|
32399
32369
|
|
|
32400
32370
|
//#endregion
|
|
32401
|
-
export {
|
|
32371
|
+
export { __require as $, dedent_default as A, We as B, serializeScript as C, walk as D, Tag as E, Ge as F, any as G, ke as H, J as I, require_picocolors as J, up as K, Ke as L, defineAddonOptions as M, De as N, isVersionUnsupportedBelow as O, Fe as P, __commonJS as Q, T as R, parseScript$1 as S, Element as T, ze as U, et$1 as V, Vu as W, Option as X, Command as Y, program as Z, parseScript as _, addPnpmBuildDependencies as a, import_picocolors as b, installOption as c, ve as d, __toESM as et, detect as f, parseJson as g, parseHtml as h, AGENT_NAMES as i, defineAddon as j, createPrinter as k, packageManagerPrompt as l, parseCss as m, templates as n, getUserAgent as o, resolveCommand as p, from as q, dist as r, installDependencies as s, create as t, be as u, parseSvelte as v, stripAst as w, parseHtml$1 as x, MagicString as y, Ue as z };
|