sv 0.10.2 → 0.10.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/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
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-
|
|
2
|
+
import { $ as et, A as parseSvelte, B as isVersionUnsupportedBelow, C as dist, G as De, J, K as Fe, O as parseJson, Q as We, T as resolveCommand, X as T, Y as Ke, Z as Ue, a as getUserAgent, at as Option, b as detect, c as packageManagerPrompt, d as from, et as ke, f as commonFilePaths, g as getPackageJson, h as getHighlighter, i as addPnpmBuildDependencies, it as Command, k as parseScript, lt as __toESM, m as formatFiles, n as templates, nt as Vu, o as installDependencies, ot as program, q as Ge, r as AGENT_NAMES, rt as require_picocolors, s as installOption, t as create$1, tt as ze, u as up$1, w as getSharedFiles } from "./create-DJeT6Cfe.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-6J55LDIW.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.
|
|
15
|
+
var version = "0.10.4";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region ../../node_modules/.pnpm/empathic@1.1.0/node_modules/empathic/package.mjs
|
|
@@ -1607,26 +1607,31 @@ async function confirmExternalDependencies(dependencies) {
|
|
|
1607
1607
|
return installDeps;
|
|
1608
1608
|
}
|
|
1609
1609
|
async function createVirtualWorkspace({ cwd, template, packageManager, type }) {
|
|
1610
|
+
const override = { dependencies: {} };
|
|
1611
|
+
if (template === "minimal" || template === "demo" || template === "library") override.kit = {
|
|
1612
|
+
routesDirectory: "src/routes",
|
|
1613
|
+
libDirectory: "src/lib"
|
|
1614
|
+
};
|
|
1615
|
+
const { data: packageJson } = getPackageJson(dist(`templates/${template}`));
|
|
1616
|
+
override.dependencies = {
|
|
1617
|
+
...packageJson.devDependencies,
|
|
1618
|
+
...packageJson.dependencies,
|
|
1619
|
+
...override.dependencies
|
|
1620
|
+
};
|
|
1610
1621
|
const tentativeWorkspace = await createWorkspace({
|
|
1611
1622
|
cwd,
|
|
1612
|
-
packageManager
|
|
1623
|
+
packageManager,
|
|
1624
|
+
override
|
|
1613
1625
|
});
|
|
1614
|
-
|
|
1626
|
+
return {
|
|
1615
1627
|
...tentativeWorkspace,
|
|
1616
1628
|
typescript: type === "typescript",
|
|
1617
1629
|
files: {
|
|
1618
1630
|
...tentativeWorkspace.files,
|
|
1619
1631
|
viteConfig: type === "typescript" ? commonFilePaths.viteConfigTS : commonFilePaths.viteConfig,
|
|
1620
|
-
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"
|
|
1632
|
+
svelteConfig: commonFilePaths.svelteConfig
|
|
1633
|
+
}
|
|
1628
1634
|
};
|
|
1629
|
-
return virtualWorkspace;
|
|
1630
1635
|
}
|
|
1631
1636
|
|
|
1632
1637
|
//#endregion
|
|
@@ -32447,4 +32447,4 @@ function to_valid_package_name(name) {
|
|
|
32447
32447
|
}
|
|
32448
32448
|
|
|
32449
32449
|
//#endregion
|
|
32450
|
-
export {
|
|
32450
|
+
export { et$1 as $, parseSvelte as A, isVersionUnsupportedBelow as B, dist as C, parseHtml as D, parseCss as E, serializeScript as F, De as G, dedent_default as H, stripAst as I, J, Fe as K, Element as L, import_picocolors$1 as M, parseHtml$1 as N, parseJson as O, parseScript$1 as P, We as Q, Tag as R, ve as S, resolveCommand as T, defineAddon as U, createPrinter as V, defineAddonOptions as W, T as X, Ke as Y, Ue as Z, installPackages as _, getUserAgent as a, Option as at, detect as b, packageManagerPrompt as c, __require as ct, from as d, ke as et, commonFilePaths as f, getPackageJson as g, getHighlighter as h, addPnpmBuildDependencies as i, Command as it, MagicString as j, parseScript as k, any as l, __toESM as lt, formatFiles as m, templates as n, Vu as nt, installDependencies as o, program as ot, fileExists as p, Ge as q, AGENT_NAMES as r, require_picocolors as rt, installOption as s, __commonJS as st, create as t, ze as tt, up as u, readFile as v, getSharedFiles as w, be as x, writeFile as y, walk as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as parseSvelte, D as parseHtml, E as parseCss, F as serializeScript, H as dedent_default, I as stripAst, L as Element, M as import_picocolors$1, N as parseHtml$1, O as parseJson, P as parseScript$1, R as Tag, T as resolveCommand, U as defineAddon, V as createPrinter, W as defineAddonOptions, X as T, _ as installPackages, a as getUserAgent, b as detect, f as commonFilePaths, g as getPackageJson, h as getHighlighter, j as MagicString, k as parseScript, l as any, lt as __toESM, p as fileExists, rt as require_picocolors, v as readFile, w as getSharedFiles, x as be, y as writeFile, z as walk } from "./create-DJeT6Cfe.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import process from "node:process";
|
|
@@ -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,
|
|
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 ??=
|
|
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,31 +2932,34 @@ 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
|
|
2941
|
-
const svelteConfig = fs.existsSync(
|
|
2940
|
+
const svelteConfigPath = path.join(resolvedCwd, commonFilePaths.svelteConfigTS);
|
|
2941
|
+
const svelteConfig = fs.existsSync(svelteConfigPath) ? commonFilePaths.svelteConfigTS : commonFilePaths.svelteConfig;
|
|
2942
2942
|
let dependencies = {};
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2943
|
+
if (override?.dependencies) dependencies = override.dependencies;
|
|
2944
|
+
else {
|
|
2945
|
+
let directory = resolvedCwd;
|
|
2946
|
+
const workspaceRoot = findWorkspaceRoot(directory);
|
|
2947
|
+
const { root } = path.parse(directory);
|
|
2948
|
+
while (directory && directory.length >= workspaceRoot.length) {
|
|
2949
|
+
if (fs.existsSync(path.join(directory, commonFilePaths.packageJson))) {
|
|
2950
|
+
const { data: packageJson } = getPackageJson(directory);
|
|
2951
|
+
dependencies = {
|
|
2952
|
+
...packageJson.devDependencies,
|
|
2953
|
+
...packageJson.dependencies,
|
|
2954
|
+
...dependencies
|
|
2955
|
+
};
|
|
2956
|
+
}
|
|
2957
|
+
if (root === directory) break;
|
|
2958
|
+
directory = path.dirname(directory);
|
|
2954
2959
|
}
|
|
2955
|
-
if (root === directory) break;
|
|
2956
|
-
directory = path.dirname(directory);
|
|
2957
2960
|
}
|
|
2958
2961
|
for (const [key, value] of Object.entries(dependencies)) dependencies[key] = value.replaceAll(/[^\d|.]/g, "");
|
|
2959
|
-
const kit = dependencies["@sveltejs/kit"] ? parseKitOptions(resolvedCwd) : void 0;
|
|
2962
|
+
const kit = override?.kit ? override.kit : dependencies["@sveltejs/kit"] ? parseKitOptions(resolvedCwd) : void 0;
|
|
2960
2963
|
const stylesheet = kit ? `${kit.routesDirectory}/layout.css` : "src/app.css";
|
|
2961
2964
|
return {
|
|
2962
2965
|
cwd: resolvedCwd,
|
package/dist/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as create } from "../create-
|
|
2
|
-
import { c as officialAddons, n as installAddon } from "../install-
|
|
1
|
+
import { t as create } from "../create-DJeT6Cfe.js";
|
|
2
|
+
import { c as officialAddons, n as installAddon } from "../install-6J55LDIW.js";
|
|
3
3
|
|
|
4
4
|
export { create, installAddon, officialAddons };
|
package/dist/lib/testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as ve, ct as
|
|
1
|
+
import { S as ve, ct as __require, i as addPnpmBuildDependencies, lt as __toESM, st as __commonJS, t as create, x as be } from "../create-DJeT6Cfe.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import process$1 from "node:process";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sv",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A CLI for creating and updating SvelteKit projects",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"ps-tree": "^1.2.0",
|
|
37
37
|
"tinyexec": "^0.3.2",
|
|
38
38
|
"valibot": "^0.41.0",
|
|
39
|
+
"@sveltejs/create": "0.0.0",
|
|
39
40
|
"@sveltejs/addons": "0.0.0",
|
|
40
|
-
"@sveltejs/cli-core": "0.0.0"
|
|
41
|
-
"@sveltejs/create": "0.0.0"
|
|
41
|
+
"@sveltejs/cli-core": "0.0.0"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"create",
|