sv 0.9.3 → 0.9.4
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/{addons-uHDStNUk.js → addons-DT8tgFSU.js} +35 -39
- package/dist/bin.js +7 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Element, T, Tag, __commonJS, __export, __toESM
|
|
1
|
+
import { Element, T, Tag, __commonJS, __export, __toESM, __toESM$1, be, detect, esm_exports, getUserAgent, parseCss$1, parseHtml, parseHtml$1, parseJson$1, parseScript, parseScript$1, parseSvelte, require_picocolors, require_picocolors$1, resolveCommand, serializeScript, stripAst, up, walk, walk_exports } from "./package-manager-DO5R9a6p.js";
|
|
2
2
|
import fs, { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
3
3
|
import path, { dirname, join } from "node:path";
|
|
4
4
|
import process$1, { stdin, stdout } from "node:process";
|
|
@@ -889,7 +889,7 @@ const addPlugin = (ast, options$6) => {
|
|
|
889
889
|
|
|
890
890
|
//#endregion
|
|
891
891
|
//#region packages/cli/commands/add/utils.ts
|
|
892
|
-
var import_picocolors$5 = __toESM(require_picocolors(), 1);
|
|
892
|
+
var import_picocolors$5 = __toESM$1(require_picocolors$1(), 1);
|
|
893
893
|
function getPackageJson(cwd) {
|
|
894
894
|
const packageText = readFile(cwd, commonFilePaths.packageJson);
|
|
895
895
|
if (!packageText) {
|
|
@@ -1063,7 +1063,7 @@ function parseKitOptions(cwd) {
|
|
|
1063
1063
|
|
|
1064
1064
|
//#endregion
|
|
1065
1065
|
//#region packages/cli/lib/install.ts
|
|
1066
|
-
var import_picocolors$4 = __toESM(require_picocolors(), 1);
|
|
1066
|
+
var import_picocolors$4 = __toESM$1(require_picocolors$1(), 1);
|
|
1067
1067
|
async function installAddon({ addons, cwd, options: options$6, packageManager = "npm" }) {
|
|
1068
1068
|
const workspace = await createWorkspace({
|
|
1069
1069
|
cwd,
|
|
@@ -1173,7 +1173,7 @@ async function runAddon({ addon, multiple, workspace }) {
|
|
|
1173
1173
|
dev: true
|
|
1174
1174
|
});
|
|
1175
1175
|
},
|
|
1176
|
-
|
|
1176
|
+
pnpmBuildDependency: (pkg) => {
|
|
1177
1177
|
pnpmBuildDependencies.push(pkg);
|
|
1178
1178
|
}
|
|
1179
1179
|
};
|
|
@@ -1202,7 +1202,7 @@ function defineAddon(config) {
|
|
|
1202
1202
|
function defineAddonOptions() {
|
|
1203
1203
|
return createOptionBuilder({});
|
|
1204
1204
|
}
|
|
1205
|
-
function createOptionBuilder(options$6
|
|
1205
|
+
function createOptionBuilder(options$6) {
|
|
1206
1206
|
return {
|
|
1207
1207
|
add(key, question) {
|
|
1208
1208
|
const newOptions = {
|
|
@@ -1270,8 +1270,8 @@ else if (y > 0) ret += `${CSI}${y}B`;
|
|
|
1270
1270
|
beep
|
|
1271
1271
|
};
|
|
1272
1272
|
} });
|
|
1273
|
-
var import_src$1 = __toESM
|
|
1274
|
-
var import_picocolors$3 = __toESM
|
|
1273
|
+
var import_src$1 = __toESM(require_src(), 1);
|
|
1274
|
+
var import_picocolors$3 = __toESM(require_picocolors(), 1);
|
|
1275
1275
|
function hu({ onlyFirst: e$1 = !1 } = {}) {
|
|
1276
1276
|
const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
1277
1277
|
return new RegExp(t, e$1 ? void 0 : "g");
|
|
@@ -2006,9 +2006,9 @@ B$1 = new WeakMap(), k$1 = new WeakMap(), I = new WeakMap(), v$1 = new WeakMap()
|
|
|
2006
2006
|
e$1 ? this.filteredOptions = D$1.filter((t) => x$1(this, I).call(this, e$1, t)) : this.filteredOptions = [...D$1], m(this, B$1, FD(this.focusedValue, this.filteredOptions)), this.focusedValue = this.filteredOptions[x$1(this, B$1)]?.value, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
2007
2007
|
}
|
|
2008
2008
|
};
|
|
2009
|
-
var import_picocolors$1 = __toESM
|
|
2010
|
-
var import_picocolors$2 = __toESM
|
|
2011
|
-
var import_src = __toESM
|
|
2009
|
+
var import_picocolors$1 = __toESM(require_picocolors(), 1);
|
|
2010
|
+
var import_picocolors$2 = __toESM(require_picocolors(), 1);
|
|
2011
|
+
var import_src = __toESM(require_src(), 1);
|
|
2012
2012
|
function Pe() {
|
|
2013
2013
|
return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2014
2014
|
}
|
|
@@ -2708,7 +2708,7 @@ else return true;
|
|
|
2708
2708
|
if (version.patch === below.patch) return false;
|
|
2709
2709
|
return undefined;
|
|
2710
2710
|
}
|
|
2711
|
-
var import_picocolors = __toESM
|
|
2711
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
2712
2712
|
var colors = import_picocolors.default;
|
|
2713
2713
|
|
|
2714
2714
|
//#endregion
|
|
@@ -2886,7 +2886,7 @@ var drizzle_default = defineAddon({
|
|
|
2886
2886
|
},
|
|
2887
2887
|
run: ({ sv, typescript, options: options$6, kit, dependencyVersion }) => {
|
|
2888
2888
|
const ext = typescript ? "ts" : "js";
|
|
2889
|
-
sv.
|
|
2889
|
+
sv.devDependency("drizzle-orm", "^0.40.0");
|
|
2890
2890
|
sv.devDependency("drizzle-kit", "^0.30.2");
|
|
2891
2891
|
sv.devDependency("@types/node", getNodeTypesVersion());
|
|
2892
2892
|
if (options$6.mysql === "mysql2") sv.dependency("mysql2", "^3.12.0");
|
|
@@ -2896,9 +2896,9 @@ var drizzle_default = defineAddon({
|
|
|
2896
2896
|
if (options$6.sqlite === "better-sqlite3") {
|
|
2897
2897
|
sv.dependency("better-sqlite3", "^11.8.0");
|
|
2898
2898
|
sv.devDependency("@types/better-sqlite3", "^7.6.12");
|
|
2899
|
-
sv.
|
|
2899
|
+
sv.pnpmBuildDependency("better-sqlite3");
|
|
2900
2900
|
}
|
|
2901
|
-
if (options$6.sqlite === "libsql" || options$6.sqlite === "turso") sv.
|
|
2901
|
+
if (options$6.sqlite === "libsql" || options$6.sqlite === "turso") sv.devDependency("@libsql/client", "^0.14.0");
|
|
2902
2902
|
sv.file(".env", (content) => generateEnvFileContent(content, options$6));
|
|
2903
2903
|
sv.file(".env.example", (content) => generateEnvFileContent(content, options$6));
|
|
2904
2904
|
if (options$6.docker && (options$6.mysql === "mysql2" || options$6.postgresql === "postgres.js")) sv.file("docker-compose.yml", (content) => {
|
|
@@ -4368,8 +4368,8 @@ var lucia_default = defineAddon({
|
|
|
4368
4368
|
},
|
|
4369
4369
|
run: ({ sv, typescript, options: options$6, kit, dependencyVersion }) => {
|
|
4370
4370
|
const ext = typescript ? "ts" : "js";
|
|
4371
|
-
sv.
|
|
4372
|
-
sv.
|
|
4371
|
+
sv.devDependency("@oslojs/crypto", "^1.0.1");
|
|
4372
|
+
sv.devDependency("@oslojs/encoding", "^1.1.0");
|
|
4373
4373
|
if (options$6.demo) sv.dependency("@node-rs/argon2", "^2.0.2");
|
|
4374
4374
|
sv.file(`drizzle.config.${ext}`, (content) => {
|
|
4375
4375
|
const { ast, generateCode } = parseScript$1(content);
|
|
@@ -5059,7 +5059,7 @@ var paraglide_default = defineAddon({
|
|
|
5059
5059
|
const ext = typescript ? "ts" : "js";
|
|
5060
5060
|
if (!kit) throw new Error("SvelteKit is required");
|
|
5061
5061
|
const paraglideOutDir = "src/lib/paraglide";
|
|
5062
|
-
sv.
|
|
5062
|
+
sv.devDependency("@inlang/paraglide-js", "^2.0.0");
|
|
5063
5063
|
sv.file("project.inlang/settings.json", (content) => {
|
|
5064
5064
|
if (content) return content;
|
|
5065
5065
|
const { data, generateCode } = parseJson$1(content);
|
|
@@ -5398,12 +5398,12 @@ const adapters = [
|
|
|
5398
5398
|
const options$2 = defineAddonOptions().add("adapter", {
|
|
5399
5399
|
type: "select",
|
|
5400
5400
|
question: "Which SvelteKit adapter would you like to use?",
|
|
5401
|
+
default: "auto",
|
|
5401
5402
|
options: adapters.map((p$1) => ({
|
|
5402
5403
|
value: p$1.id,
|
|
5403
5404
|
label: p$1.id,
|
|
5404
5405
|
hint: p$1.package
|
|
5405
|
-
}))
|
|
5406
|
-
default: "auto"
|
|
5406
|
+
}))
|
|
5407
5407
|
}).build();
|
|
5408
5408
|
var sveltekit_adapter_default = defineAddon({
|
|
5409
5409
|
id: "sveltekit-adapter",
|
|
@@ -5458,25 +5458,21 @@ var sveltekit_adapter_default = defineAddon({
|
|
|
5458
5458
|
|
|
5459
5459
|
//#endregion
|
|
5460
5460
|
//#region packages/addons/tailwindcss/index.ts
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
package: "@tailwindcss/forms",
|
|
5471
|
-
version: "^0.5.9"
|
|
5472
|
-
}
|
|
5473
|
-
};
|
|
5461
|
+
const plugins = [{
|
|
5462
|
+
id: "typography",
|
|
5463
|
+
package: "@tailwindcss/typography",
|
|
5464
|
+
version: "^0.5.15"
|
|
5465
|
+
}, {
|
|
5466
|
+
id: "forms",
|
|
5467
|
+
package: "@tailwindcss/forms",
|
|
5468
|
+
version: "^0.5.9"
|
|
5469
|
+
}];
|
|
5474
5470
|
const options$1 = defineAddonOptions().add("plugins", {
|
|
5475
5471
|
type: "multiselect",
|
|
5476
5472
|
question: "Which plugins would you like to add?",
|
|
5477
|
-
options:
|
|
5478
|
-
value: id,
|
|
5479
|
-
label: id,
|
|
5473
|
+
options: plugins.map((p$1) => ({
|
|
5474
|
+
value: p$1.id,
|
|
5475
|
+
label: p$1.id,
|
|
5480
5476
|
hint: p$1.package
|
|
5481
5477
|
})),
|
|
5482
5478
|
default: [],
|
|
@@ -5493,8 +5489,8 @@ var tailwindcss_default = defineAddon({
|
|
|
5493
5489
|
sv.devDependency("tailwindcss", "^4.0.0");
|
|
5494
5490
|
sv.devDependency("@tailwindcss/vite", "^4.0.0");
|
|
5495
5491
|
if (prettierInstalled) sv.devDependency("prettier-plugin-tailwindcss", "^0.6.11");
|
|
5496
|
-
for (const
|
|
5497
|
-
if (!options$6.plugins.includes(id)) continue;
|
|
5492
|
+
for (const plugin of plugins) {
|
|
5493
|
+
if (!options$6.plugins.includes(plugin.id)) continue;
|
|
5498
5494
|
sv.devDependency(plugin.package, plugin.version);
|
|
5499
5495
|
}
|
|
5500
5496
|
sv.file(viteConfigFile, (content) => {
|
|
@@ -5521,8 +5517,8 @@ var tailwindcss_default = defineAddon({
|
|
|
5521
5517
|
}
|
|
5522
5518
|
const lastAtRule = atRules.findLast((rule) => ["plugin", "import"].includes(rule.name));
|
|
5523
5519
|
const pluginPos = lastAtRule.source.end.offset;
|
|
5524
|
-
for (const
|
|
5525
|
-
if (!options$6.plugins.includes(id)) continue;
|
|
5520
|
+
for (const plugin of plugins) {
|
|
5521
|
+
if (!options$6.plugins.includes(plugin.id)) continue;
|
|
5526
5522
|
const pluginRule = findAtRule("plugin", plugin.package);
|
|
5527
5523
|
if (!pluginRule) {
|
|
5528
5524
|
const pluginImport = `\n@plugin '${plugin.package}';`;
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { AGENT_NAMES, Command, De, Fe, Ge, J, Ke, Option, T, Ue, Vu, We, __toESM$1 as __toESM, addPnpmBuildDependencies, create, detect, et, from, getUserAgent, installDependencies, installOption, ke, packageManagerPrompt, program, require_picocolors$1 as require_picocolors, resolveCommand, templates, up, ze } from "./package-manager-DO5R9a6p.js";
|
|
3
|
-
import { applyAddons, communityAddonIds, createWorkspace, formatFiles, getAddonDetails, getCommunityAddon, getHighlighter, isVersionUnsupportedBelow, officialAddons, setupAddons } from "./addons-
|
|
3
|
+
import { applyAddons, communityAddonIds, createWorkspace, formatFiles, getAddonDetails, getCommunityAddon, getHighlighter, isVersionUnsupportedBelow, officialAddons, setupAddons } from "./addons-DT8tgFSU.js";
|
|
4
4
|
import fs, { existsSync } from "node:fs";
|
|
5
5
|
import path, { dirname, join } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -12,7 +12,7 @@ import { pipeline } from "node:stream/promises";
|
|
|
12
12
|
|
|
13
13
|
//#region packages/cli/package.json
|
|
14
14
|
var name = "sv";
|
|
15
|
-
var version = "0.9.
|
|
15
|
+
var version = "0.9.4";
|
|
16
16
|
var type = "module";
|
|
17
17
|
var description = "A CLI for creating and updating SvelteKit projects";
|
|
18
18
|
var license = "MIT";
|
|
@@ -959,10 +959,9 @@ else if (official[addonId][id] !== undefined) throw new Error(`Incompatible '${a
|
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
let workspace = await createWorkspace({ cwd: options$1.cwd });
|
|
962
|
-
const setups = selectedAddons.length ? selectedAddons.map(({ addon }) => addon) : officialAddons;
|
|
963
|
-
const addonSetupResults = setupAddons(setups, workspace);
|
|
964
962
|
if (selectedAddons.length === 0) {
|
|
965
|
-
const
|
|
963
|
+
const allSetupResults = setupAddons(officialAddons, workspace);
|
|
964
|
+
const addonOptions$1 = officialAddons.filter(({ id }) => allSetupResults[id].unsupported.length === 0).map(({ id, homepage: homepage$1, shortDescription }) => ({
|
|
966
965
|
label: id,
|
|
967
966
|
value: id,
|
|
968
967
|
hint: `${shortDescription} - ${homepage$1}`
|
|
@@ -986,7 +985,8 @@ else if (official[addonId][id] !== undefined) throw new Error(`Incompatible '${a
|
|
|
986
985
|
}
|
|
987
986
|
for (const { addon } of selectedAddons) {
|
|
988
987
|
workspace = await createWorkspace(workspace);
|
|
989
|
-
const
|
|
988
|
+
const setups = selectedAddons.map(({ addon: addon$1 }) => addon$1);
|
|
989
|
+
const setupResult = setupAddons(setups, workspace)[addon.id];
|
|
990
990
|
const missingDependencies = setupResult.dependsOn.filter((depId) => !selectedAddons.some((a) => a.addon.id === depId));
|
|
991
991
|
for (const depId of missingDependencies) {
|
|
992
992
|
const dependency = officialAddons.find((a) => a.id === depId);
|
|
@@ -1003,6 +1003,7 @@ else if (official[addonId][id] !== undefined) throw new Error(`Incompatible '${a
|
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
const addons = selectedAddons.map(({ addon }) => addon);
|
|
1006
|
+
const addonSetupResults = setupAddons(addons, workspace);
|
|
1006
1007
|
const verifications = [...verifyCleanWorkingDirectory(options$1.cwd, options$1.gitCheck), ...verifyUnsupportedAddons(addons, addonSetupResults)];
|
|
1007
1008
|
const fails = [];
|
|
1008
1009
|
for (const verification of verifications) {
|
package/dist/index.js
CHANGED