sv 0.9.0 → 0.9.2

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.
@@ -1,4 +1,4 @@
1
- import { Element, T, Tag, __commonJS, __export, __toESM as __toESM$1, __toESM$1 as __toESM, 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";
1
+ import { Element, T, Tag, __commonJS, __export, __toESM as __toESM$1, __toESM$1 as __toESM, be, detect, esm_exports, getUserAgent, parseCss$1, parseHtml, parseHtml$1, parseJson$1, parseScript, parseScript$1, parseSvelte, require_picocolors as require_picocolors$1, require_picocolors$1 as require_picocolors, 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(), 1);
892
+ var import_picocolors$5 = __toESM(require_picocolors(), 1);
893
893
  function getPackageJson(cwd) {
894
894
  const packageText = readFile(cwd, commonFilePaths.packageJson);
895
895
  if (!packageText) {
@@ -960,6 +960,7 @@ const commonFilePaths = {
960
960
  packageJson: "package.json",
961
961
  svelteConfig: "svelte.config.js",
962
962
  tsconfig: "tsconfig.json",
963
+ viteConfig: "vite.config.js",
963
964
  viteConfigTS: "vite.config.ts"
964
965
  };
965
966
  function getHighlighter() {
@@ -978,6 +979,7 @@ async function createWorkspace({ cwd, options: options$6 = {}, packageManager })
978
979
  const resolvedCwd = path.resolve(cwd);
979
980
  const viteConfigPath = path.join(resolvedCwd, commonFilePaths.viteConfigTS);
980
981
  let usesTypescript = fs.existsSync(viteConfigPath);
982
+ const viteConfigFile = usesTypescript ? commonFilePaths.viteConfigTS : commonFilePaths.viteConfig;
981
983
  if (TESTING) usesTypescript ||= fs.existsSync(path.join(resolvedCwd, commonFilePaths.tsconfig));
982
984
  else usesTypescript ||= up(commonFilePaths.tsconfig, { cwd }) !== undefined;
983
985
  let dependencies = {};
@@ -1000,6 +1002,7 @@ else usesTypescript ||= up(commonFilePaths.tsconfig, { cwd }) !== undefined;
1000
1002
  options: options$6,
1001
1003
  packageManager: packageManager ?? (await detect({ cwd }))?.name ?? getUserAgent() ?? "npm",
1002
1004
  typescript: usesTypescript,
1005
+ viteConfigFile,
1003
1006
  kit: dependencies["@sveltejs/kit"] ? parseKitOptions(resolvedCwd) : undefined,
1004
1007
  dependencyVersion: (pkg) => dependencies[pkg]
1005
1008
  };
@@ -1060,7 +1063,7 @@ function parseKitOptions(cwd) {
1060
1063
 
1061
1064
  //#endregion
1062
1065
  //#region packages/cli/lib/install.ts
1063
- var import_picocolors$4 = __toESM(require_picocolors$1(), 1);
1066
+ var import_picocolors$4 = __toESM(require_picocolors(), 1);
1064
1067
  async function installAddon({ addons, cwd, options: options$6, packageManager = "npm" }) {
1065
1068
  const workspace = await createWorkspace({
1066
1069
  cwd,
@@ -1254,7 +1257,7 @@ else if (y > 0) ret += `${CSI}${y}B`;
1254
1257
  };
1255
1258
  } });
1256
1259
  var import_src$1 = __toESM$1(require_src(), 1);
1257
- var import_picocolors$3 = __toESM$1(require_picocolors(), 1);
1260
+ var import_picocolors$3 = __toESM$1(require_picocolors$1(), 1);
1258
1261
  function hu({ onlyFirst: e$1 = !1 } = {}) {
1259
1262
  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("|");
1260
1263
  return new RegExp(t, e$1 ? void 0 : "g");
@@ -1989,8 +1992,8 @@ B$1 = new WeakMap(), k$1 = new WeakMap(), I = new WeakMap(), v$1 = new WeakMap()
1989
1992
  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());
1990
1993
  }
1991
1994
  };
1992
- var import_picocolors$1 = __toESM$1(require_picocolors(), 1);
1993
- var import_picocolors$2 = __toESM$1(require_picocolors(), 1);
1995
+ var import_picocolors$1 = __toESM$1(require_picocolors$1(), 1);
1996
+ var import_picocolors$2 = __toESM$1(require_picocolors$1(), 1);
1994
1997
  var import_src = __toESM$1(require_src(), 1);
1995
1998
  function Pe() {
1996
1999
  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";
@@ -2691,7 +2694,7 @@ else return true;
2691
2694
  if (version.patch === below.patch) return false;
2692
2695
  return undefined;
2693
2696
  }
2694
- var import_picocolors = __toESM$1(require_picocolors(), 1);
2697
+ var import_picocolors = __toESM$1(require_picocolors$1(), 1);
2695
2698
  var colors = import_picocolors.default;
2696
2699
 
2697
2700
  //#endregion
@@ -2701,10 +2704,9 @@ var devtools_json_default = defineAddon({
2701
2704
  shortDescription: "devtools json",
2702
2705
  homepage: "https://github.com/ChromeDevTools/vite-plugin-devtools-json",
2703
2706
  options: {},
2704
- run: ({ sv, typescript }) => {
2705
- const ext = typescript ? "ts" : "js";
2706
- sv.devDependency("vite-plugin-devtools-json", "^0.2.0");
2707
- sv.file(`vite.config.${ext}`, (content) => {
2707
+ run: ({ sv, viteConfigFile }) => {
2708
+ sv.devDependency("vite-plugin-devtools-json", "^1.0.0");
2709
+ sv.file(viteConfigFile, (content) => {
2708
2710
  const { ast, generateCode } = parseScript$1(content);
2709
2711
  const vitePluginName = "devtoolsJson";
2710
2712
  imports_exports.addDefault(ast, {
@@ -5048,7 +5050,7 @@ var paraglide_default = defineAddon({
5048
5050
  setup: ({ kit, unsupported }) => {
5049
5051
  if (!kit) unsupported("Requires SvelteKit");
5050
5052
  },
5051
- run: ({ sv, options: options$6, typescript, kit }) => {
5053
+ run: ({ sv, options: options$6, viteConfigFile, typescript, kit }) => {
5052
5054
  const ext = typescript ? "ts" : "js";
5053
5055
  if (!kit) throw new Error("SvelteKit is required");
5054
5056
  const paraglideOutDir = "src/lib/paraglide";
@@ -5063,7 +5065,7 @@ var paraglide_default = defineAddon({
5063
5065
  data.locales = validLanguageTags$1;
5064
5066
  return generateCode();
5065
5067
  });
5066
- sv.file(`vite.config.${ext}`, (content) => {
5068
+ sv.file(viteConfigFile, (content) => {
5067
5069
  const { ast, generateCode } = parseScript$1(content);
5068
5070
  const vitePluginName = "paraglideVitePlugin";
5069
5071
  imports_exports.addNamed(ast, {
@@ -5479,8 +5481,7 @@ var tailwindcss_default = defineAddon({
5479
5481
  shortDescription: "css framework",
5480
5482
  homepage: "https://tailwindcss.com",
5481
5483
  options: options$1,
5482
- run: ({ sv, options: options$6, typescript, kit, dependencyVersion }) => {
5483
- const ext = typescript ? "ts" : "js";
5484
+ run: ({ sv, options: options$6, viteConfigFile, typescript, kit, dependencyVersion }) => {
5484
5485
  const prettierInstalled = Boolean(dependencyVersion("prettier"));
5485
5486
  sv.devDependency("tailwindcss", "^4.0.0");
5486
5487
  sv.devDependency("@tailwindcss/vite", "^4.0.0");
@@ -5489,7 +5490,7 @@ var tailwindcss_default = defineAddon({
5489
5490
  if (!options$6.plugins.includes(plugin.id)) continue;
5490
5491
  sv.devDependency(plugin.package, plugin.version);
5491
5492
  }
5492
- sv.file(`vite.config.${ext}`, (content) => {
5493
+ sv.file(viteConfigFile, (content) => {
5493
5494
  const { ast, generateCode } = parseScript$1(content);
5494
5495
  const vitePluginName = "tailwindcss";
5495
5496
  imports_exports.addDefault(ast, {
@@ -5576,7 +5577,7 @@ var vitest_addon_default = defineAddon({
5576
5577
  shortDescription: "unit testing",
5577
5578
  homepage: "https://vitest.dev",
5578
5579
  options,
5579
- run: ({ sv, typescript, kit, options: options$6 }) => {
5580
+ run: ({ sv, viteConfigFile, typescript, kit, options: options$6 }) => {
5580
5581
  const ext = typescript ? "ts" : "js";
5581
5582
  const unitTesting = options$6.usages.includes("unit");
5582
5583
  const componentTesting = options$6.usages.includes("component");
@@ -5637,10 +5638,10 @@ var vitest_addon_default = defineAddon({
5637
5638
  `;
5638
5639
  });
5639
5640
  }
5640
- sv.file(`vite.config.${ext}`, (content) => {
5641
+ sv.file(viteConfigFile, (content) => {
5641
5642
  const { ast, generateCode } = parseScript$1(content);
5642
5643
  const clientObjectExpression = object_exports.create({
5643
- extends: `./vite.config.${ext}`,
5644
+ extends: `./${viteConfigFile}`,
5644
5645
  test: {
5645
5646
  name: "client",
5646
5647
  environment: "browser",
@@ -5655,7 +5656,7 @@ var vitest_addon_default = defineAddon({
5655
5656
  }
5656
5657
  });
5657
5658
  const serverObjectExpression = object_exports.create({
5658
- extends: `./vite.config.${ext}`,
5659
+ extends: `./${viteConfigFile}`,
5659
5660
  test: {
5660
5661
  name: "server",
5661
5662
  environment: "node",
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-ZFgzq16L.js";
3
+ import { applyAddons, communityAddonIds, createWorkspace, formatFiles, getAddonDetails, getCommunityAddon, getHighlighter, isVersionUnsupportedBelow, officialAddons, setupAddons } from "./addons-Ck_pRCRU.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.0";
15
+ var version = "0.9.2";
16
16
  var type = "module";
17
17
  var description = "A CLI for creating and updating SvelteKit projects";
18
18
  var license = "MIT";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { create } from "./package-manager-DO5R9a6p.js";
2
- import { installAddon, officialAddons } from "./addons-ZFgzq16L.js";
2
+ import { installAddon, officialAddons } from "./addons-Ck_pRCRU.js";
3
3
 
4
4
  export { create, installAddon, officialAddons };
package/dist/shared.json CHANGED
@@ -60,7 +60,7 @@
60
60
  "typescript"
61
61
  ],
62
62
  "exclude": [],
63
- "contents": "{\n\t\"extends\": \"./.svelte-kit/tsconfig.json\",\n\t\"compilerOptions\": {\n\t\t\"allowJs\": true,\n\t\t\"checkJs\": true,\n\t\t\"esModuleInterop\": true,\n\t\t\"forceConsistentCasingInFileNames\": true,\n\t\t\"resolveJsonModule\": true,\n\t\t\"skipLibCheck\": true,\n\t\t\"sourceMap\": true,\n\t\t\"strict\": true,\n\t\t\"moduleResolution\": \"bundler\"\n\t}\n\t// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias\n\t// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files\n\t//\n\t// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes\n\t// from the referenced tsconfig.json - TypeScript does not merge them in\n}\n"
63
+ "contents": "{\n\t\"extends\": \"./.svelte-kit/tsconfig.json\",\n\t\"compilerOptions\": {\n\t\t\"allowJs\": true,\n\t\t\"checkJs\": true,\n\t\t\"esModuleInterop\": true,\n\t\t\"forceConsistentCasingInFileNames\": true,\n\t\t\"resolveJsonModule\": true,\n\t\t\"skipLibCheck\": true,\n\t\t\"sourceMap\": true,\n\t\t\"strict\": true,\n\t\t\"moduleResolution\": \"bundler\"\n\t}\n\t// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias\n\t// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files\n\t//\n\t// To make changes to top-level options such as include and exclude, we recommend extending\n\t// the generated config; see https://svelte.dev/docs/kit/configuration#typescript\n}\n"
64
64
  },
65
65
  {
66
66
  "name": "svelte.config.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "description": "A CLI for creating and updating SvelteKit projects",
6
6
  "license": "MIT",
@@ -37,8 +37,8 @@
37
37
  "tinyexec": "^0.3.2",
38
38
  "valibot": "^0.41.0",
39
39
  "@sveltejs/addons": "0.0.0",
40
- "@sveltejs/cli-core": "0.0.0",
41
- "@sveltejs/create": "0.0.0"
40
+ "@sveltejs/create": "0.0.0",
41
+ "@sveltejs/cli-core": "0.0.0"
42
42
  },
43
43
  "keywords": [
44
44
  "create",