sv 0.10.2 → 0.10.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { $ as ke, C as getSharedFiles, D as parseJson, G as Fe, J as Ke, K as Ge, O as parseScript, Q as et, W as De, X as Ue, Y as T, Z as We, a as getUserAgent, at as program, b as detect, c as packageManagerPrompt, ct as __toESM, d as from, et as ze, f as commonFilePaths, h as getHighlighter, i as addPnpmBuildDependencies, it as Option, k as parseSvelte, m as formatFiles, n as templates, nt as require_picocolors, o as installDependencies, q as J, r as AGENT_NAMES, rt as Command, s as installOption, t as create$1, tt as Vu, u as up$1, w as resolveCommand, z as isVersionUnsupportedBelow } from "./create-BN4H6Ywy.js";
3
- import { a as communityAddonIds, c as officialAddons, d as create$2, f as overrideProperties, i as createWorkspace, l as createDefault, o as getCommunityAddon, r as setupAddons, s as getAddonDetails, t as applyAddons, u as addDefault } from "./install-DGNvl1vK.js";
3
+ import { a as communityAddonIds, c as officialAddons, d as create$2, f as overrideProperties, i as createWorkspace, l as createDefault, o as getCommunityAddon, r as setupAddons, s as getAddonDetails, t as applyAddons, u as addDefault } from "./install-CmSN8tEu.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,7 +12,7 @@ import { pipeline } from "node:stream/promises";
12
12
 
13
13
  //#region package.json
14
14
  var name = "sv";
15
- var version = "0.10.2";
15
+ var version = "0.10.3";
16
16
 
17
17
  //#endregion
18
18
  //#region ../../node_modules/.pnpm/empathic@1.1.0/node_modules/empathic/package.mjs
@@ -1607,26 +1607,26 @@ async function confirmExternalDependencies(dependencies) {
1607
1607
  return installDeps;
1608
1608
  }
1609
1609
  async function createVirtualWorkspace({ cwd, template, packageManager, type }) {
1610
+ const override = {};
1611
+ if (template === "minimal" || template === "demo" || template === "library") override.kit = {
1612
+ routesDirectory: "src/routes",
1613
+ libDirectory: "src/lib"
1614
+ };
1610
1615
  const tentativeWorkspace = await createWorkspace({
1611
1616
  cwd,
1612
- packageManager
1617
+ packageManager,
1618
+ override
1613
1619
  });
1614
- const virtualWorkspace = {
1620
+ return {
1615
1621
  ...tentativeWorkspace,
1616
1622
  typescript: type === "typescript",
1623
+ dependencyVersion: () => void 0,
1617
1624
  files: {
1618
1625
  ...tentativeWorkspace.files,
1619
1626
  viteConfig: type === "typescript" ? commonFilePaths.viteConfigTS : commonFilePaths.viteConfig,
1620
- svelteConfig: type === "typescript" ? commonFilePaths.svelteConfigTS : commonFilePaths.svelteConfig
1621
- },
1622
- kit: void 0,
1623
- dependencyVersion: () => void 0
1624
- };
1625
- if (template === "minimal" || template === "demo" || template === "library") virtualWorkspace.kit = {
1626
- routesDirectory: "src/routes",
1627
- libDirectory: "src/lib"
1627
+ svelteConfig: commonFilePaths.svelteConfig
1628
+ }
1628
1629
  };
1629
- return virtualWorkspace;
1630
1630
  }
1631
1631
 
1632
1632
  //#endregion
@@ -2425,7 +2425,7 @@ var prettier_default = defineAddon({
2425
2425
  shortDescription: "formatter",
2426
2426
  homepage: "https://prettier.io",
2427
2427
  options: {},
2428
- run: ({ sv, dependencyVersion, kit, files }) => {
2428
+ run: ({ sv, dependencyVersion, files }) => {
2429
2429
  const tailwindcssInstalled = Boolean(dependencyVersion("tailwindcss"));
2430
2430
  if (tailwindcssInstalled) sv.devDependency("prettier-plugin-tailwindcss", "^0.7.1");
2431
2431
  sv.devDependency("prettier", "^3.6.2");
@@ -2462,7 +2462,7 @@ var prettier_default = defineAddon({
2462
2462
  const plugins$1 = data.plugins;
2463
2463
  if (tailwindcssInstalled) {
2464
2464
  if (!plugins$1.includes("prettier-plugin-tailwindcss")) data.plugins.unshift("prettier-plugin-tailwindcss");
2465
- data.tailwindStylesheet ??= kit ? `${kit?.routesDirectory}/layout.css` : "./src/app.css";
2465
+ data.tailwindStylesheet ??= files.getRelative({ to: files.stylesheet });
2466
2466
  }
2467
2467
  if (!plugins$1.includes("prettier-plugin-svelte")) data.plugins.unshift("prettier-plugin-svelte");
2468
2468
  data.overrides ??= [];
@@ -2932,13 +2932,13 @@ const TESTING = process.env.NODE_ENV?.toLowerCase() === "test";
2932
2932
 
2933
2933
  //#endregion
2934
2934
  //#region commands/add/workspace.ts
2935
- async function createWorkspace({ cwd, packageManager }) {
2935
+ async function createWorkspace({ cwd, packageManager, override }) {
2936
2936
  const resolvedCwd = path.resolve(cwd);
2937
2937
  const usesTypescript = !any([commonFilePaths.jsconfig, commonFilePaths.tsconfig], { cwd })?.endsWith(commonFilePaths.jsconfig);
2938
2938
  const viteConfigPath = path.join(resolvedCwd, commonFilePaths.viteConfigTS);
2939
2939
  const viteConfig = fs.existsSync(viteConfigPath) ? commonFilePaths.viteConfigTS : commonFilePaths.viteConfig;
2940
- const sveteConfigPath = path.join(resolvedCwd, commonFilePaths.svelteConfigTS);
2941
- const svelteConfig = fs.existsSync(sveteConfigPath) ? commonFilePaths.svelteConfigTS : commonFilePaths.svelteConfig;
2940
+ const svelteConfigPath = path.join(resolvedCwd, commonFilePaths.svelteConfigTS);
2941
+ const svelteConfig = fs.existsSync(svelteConfigPath) ? commonFilePaths.svelteConfigTS : commonFilePaths.svelteConfig;
2942
2942
  let dependencies = {};
2943
2943
  let directory = resolvedCwd;
2944
2944
  const workspaceRoot = findWorkspaceRoot(directory);
@@ -2956,7 +2956,7 @@ async function createWorkspace({ cwd, packageManager }) {
2956
2956
  directory = path.dirname(directory);
2957
2957
  }
2958
2958
  for (const [key, value] of Object.entries(dependencies)) dependencies[key] = value.replaceAll(/[^\d|.]/g, "");
2959
- const kit = dependencies["@sveltejs/kit"] ? parseKitOptions(resolvedCwd) : void 0;
2959
+ const kit = override?.kit ? override.kit : dependencies["@sveltejs/kit"] ? parseKitOptions(resolvedCwd) : void 0;
2960
2960
  const stylesheet = kit ? `${kit.routesDirectory}/layout.css` : "src/app.css";
2961
2961
  return {
2962
2962
  cwd: resolvedCwd,
package/dist/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { t as create } from "../create-BN4H6Ywy.js";
2
- import { c as officialAddons, n as installAddon } from "../install-DGNvl1vK.js";
2
+ import { c as officialAddons, n as installAddon } from "../install-CmSN8tEu.js";
3
3
 
4
4
  export { create, installAddon, officialAddons };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
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",