sv 1.0.0-next.1 → 1.0.0-next.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.mjs +11 -3
- package/dist/{engine-Cbq-kxIr.mjs → engine-CJqhBXva.mjs} +4 -11
- package/dist/shared.json +5 -5
- package/dist/src/index.mjs +1 -1
- package/dist/src/testing.mjs +1 -1
- package/dist/templates/addon/package.json +3 -3
- package/dist/templates/demo/package.json +1 -1
- package/dist/templates/library/package.json +1 -1
- package/dist/templates/minimal/package.json +1 -1
- package/package.json +2 -2
package/dist/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as Command, B as name, C as pipe, D as union, E as transform, F as forwardExitCode, G as ge, H as Ce, I as helpConfig, J as we, K as le, L as normalizePosix, O as from, P as errorAndExit, R as runAndValidateVerifications, S as picklist, T as string, U as Ee, V as version, W as R$1, Y as R, _ as array, a as verifyCleanWorkingDirectory, b as optional, c as AGENT_NAMES, d as installDependencies, f as installOption, i as create, k as program, n as prepareSvApi, o as formatFiles, p as packageManagerPrompt, q as vt, r as add, s as createWorkspace, u as detectPackageManager, v as boolean, w as strictObject, x as parse$1, y as literal, z as runCommand } from "./engine-
|
|
2
|
+
import { A as Command, B as name, C as pipe, D as union, E as transform, F as forwardExitCode, G as ge, H as Ce, I as helpConfig, J as we, K as le, L as normalizePosix, O as from, P as errorAndExit, R as runAndValidateVerifications, S as picklist, T as string, U as Ee, V as version, W as R$1, Y as R, _ as array, a as verifyCleanWorkingDirectory, b as optional, c as AGENT_NAMES, d as installDependencies, f as installOption, i as create, k as program, n as prepareSvApi, o as formatFiles, p as packageManagerPrompt, q as vt, r as add, s as createWorkspace, u as detectPackageManager, v as boolean, w as strictObject, x as parse$1, y as literal, z as runCommand } from "./engine-CJqhBXva.mjs";
|
|
3
3
|
import { Walker, coerceVersion, color, isVersionUnsupportedBelow, js, loadPackageJson, parse, resolveCommandArray, svelteConfig, transforms } from "@sveltejs/sv-utils";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1419,6 +1419,7 @@ function migrateComments(comments) {
|
|
|
1419
1419
|
//#endregion
|
|
1420
1420
|
//#region src/migrate/migrations/sveltekit-3/tasks/lib-alias.ts
|
|
1421
1421
|
const LIB_ALIAS = /(?<=['"`])\$lib(\/(.+)['"`]|['"`])/g;
|
|
1422
|
+
const STYLE_TAG = /(<style\b[^>]*>)([\s\S]*?)(<\/style\s*>)/gi;
|
|
1422
1423
|
function libSubpathImports(libDir) {
|
|
1423
1424
|
return {
|
|
1424
1425
|
"#lib": `./${libDir}/index.js`,
|
|
@@ -1438,8 +1439,10 @@ var lib_alias_default = defineMigrationTask({
|
|
|
1438
1439
|
sv.files({
|
|
1439
1440
|
include: `${directory.src}/**/*.{svelte,svelte.ts,svelte.js,ts,js,svx,md}`,
|
|
1440
1441
|
where: (content) => content.includes("$lib")
|
|
1441
|
-
}, (content) => {
|
|
1442
|
-
|
|
1442
|
+
}, (content, file) => {
|
|
1443
|
+
let styleLibPath = path.posix.relative(path.posix.dirname(file.replaceAll("\\", "/")), directory.lib.replaceAll("\\", "/"));
|
|
1444
|
+
if (!styleLibPath.startsWith(".")) styleLibPath = `./${styleLibPath}`;
|
|
1445
|
+
const rewritten = content.replace(STYLE_TAG, (_, open, css, close) => `${open}${css.replace(LIB_ALIAS, (match) => match.replace("$lib", styleLibPath))}${close}`).replace(LIB_ALIAS, (match, _, import_path) => {
|
|
1443
1446
|
match = match.replace("$lib", "#lib");
|
|
1444
1447
|
if (import_path && !import_path.endsWith(".js") && !import_path.endsWith(".ts")) {
|
|
1445
1448
|
for (const ending of [
|
|
@@ -1912,6 +1915,7 @@ function withoutLeadingSlash(expression) {
|
|
|
1912
1915
|
function removeStaticLeadingSlash(expression) {
|
|
1913
1916
|
if (expression.type === "Literal" && typeof expression.value === "string") {
|
|
1914
1917
|
if (!expression.value.startsWith("/")) return false;
|
|
1918
|
+
if (expression.value === "/") return false;
|
|
1915
1919
|
expression.value = expression.value.slice(1);
|
|
1916
1920
|
expression.raw = void 0;
|
|
1917
1921
|
return true;
|
|
@@ -1919,6 +1923,7 @@ function removeStaticLeadingSlash(expression) {
|
|
|
1919
1923
|
if (expression.type === "TemplateLiteral") {
|
|
1920
1924
|
const quasi = expression.quasis[0];
|
|
1921
1925
|
if (!quasi?.value.raw.startsWith("/")) return false;
|
|
1926
|
+
if (quasi.value.raw === "/") return false;
|
|
1922
1927
|
quasi.value.raw = quasi.value.raw.slice(1);
|
|
1923
1928
|
if (quasi.value.cooked !== void 0 && quasi.value.cooked !== null) quasi.value.cooked = quasi.value.cooked.slice(1);
|
|
1924
1929
|
return true;
|
|
@@ -2142,6 +2147,8 @@ var svelte_config_default = defineMigrationTask({
|
|
|
2142
2147
|
sv,
|
|
2143
2148
|
cwd
|
|
2144
2149
|
}, ({ ast, override, comments }) => {
|
|
2150
|
+
const existingAttachments = collectComments(ast, comments);
|
|
2151
|
+
comments.remove(() => true);
|
|
2145
2152
|
const configDeclaration = originalConfigObject.ast.body.find((node) => node.type === "VariableDeclaration" && node.declarations.some((d) => d.init === originalConfigObject.config));
|
|
2146
2153
|
const originalImports = [];
|
|
2147
2154
|
const originalStatements = [];
|
|
@@ -2226,6 +2233,7 @@ var svelte_config_default = defineMigrationTask({
|
|
|
2226
2233
|
};
|
|
2227
2234
|
let rootConfig;
|
|
2228
2235
|
forEachNode(ast, (node) => {
|
|
2236
|
+
apply(node, existingAttachments.get(node));
|
|
2229
2237
|
apply(node, attachments.get(node));
|
|
2230
2238
|
if (node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "sveltekit" && node.arguments[0]?.type === "ObjectExpression") rootConfig = node.arguments[0];
|
|
2231
2239
|
});
|
|
@@ -1339,7 +1339,7 @@ ${i ? styleText("cyan", x$1) : ""}
|
|
|
1339
1339
|
//#endregion
|
|
1340
1340
|
//#region package.json
|
|
1341
1341
|
var name = "sv";
|
|
1342
|
-
var version = "1.0.0-next.
|
|
1342
|
+
var version = "1.0.0-next.3";
|
|
1343
1343
|
//#endregion
|
|
1344
1344
|
//#region src/core/errors.ts
|
|
1345
1345
|
var UnsupportedError = class extends Error {
|
|
@@ -1444,7 +1444,7 @@ async function runCommand(action) {
|
|
|
1444
1444
|
try {
|
|
1445
1445
|
console.log(color.hidden("HINT: Run \"sv --help\" to get the full list of commands, add-ons, and examples to one-shot and skip interactive prompts."));
|
|
1446
1446
|
ye(`Welcome to the Svelte CLI! ${color.optional(`(v${version})`)}`);
|
|
1447
|
-
const minimumVersion = "
|
|
1447
|
+
const minimumVersion = "22.17.0";
|
|
1448
1448
|
if (isVersionUnsupportedBelow(V.versions.node, minimumVersion)) R$1.warn(`You are using Node.js ${color.error(V.versions.node)}, please upgrade to Node.js ${color.success(minimumVersion)} or higher.`);
|
|
1449
1449
|
await action();
|
|
1450
1450
|
fe("You're all set!");
|
|
@@ -6711,7 +6711,7 @@ var drizzle_default = defineAddon({
|
|
|
6711
6711
|
if (options.postgresql === "postgres.js") sv.devDependency("postgres", "^3.4.9");
|
|
6712
6712
|
if (options.sqlite === "better-sqlite3") {
|
|
6713
6713
|
sv.dependency("better-sqlite3", "^13.0.2");
|
|
6714
|
-
sv.devDependency("@types/better-sqlite3", "^
|
|
6714
|
+
sv.devDependency("@types/better-sqlite3", "^9.6.0");
|
|
6715
6715
|
}
|
|
6716
6716
|
if (options.sqlite === "libsql" || options.sqlite === "turso") sv.devDependency("@libsql/client", "^0.17.3");
|
|
6717
6717
|
sv.file(".env", generateEnv(options, false));
|
|
@@ -9216,14 +9216,7 @@ async function packageManagerPrompt(cwd) {
|
|
|
9216
9216
|
options: [{
|
|
9217
9217
|
label: "None",
|
|
9218
9218
|
value: void 0
|
|
9219
|
-
}, ...AGENT_NAMES.map((agent) => {
|
|
9220
|
-
const installed = isInstalled(agent);
|
|
9221
|
-
return {
|
|
9222
|
-
value: agent,
|
|
9223
|
-
label: installed ? agent : color.dim(`${agent} (not installed)`),
|
|
9224
|
-
installed
|
|
9225
|
-
};
|
|
9226
|
-
}).sort((a, b) => Number(b.installed) - Number(a.installed))],
|
|
9219
|
+
}, ...AGENT_NAMES.filter(isInstalled).map((agent) => ({ value: agent }))],
|
|
9227
9220
|
initialValue: agent
|
|
9228
9221
|
});
|
|
9229
9222
|
if (R$2(pm)) {
|
package/dist/shared.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"checkjs"
|
|
37
37
|
],
|
|
38
38
|
"exclude": [],
|
|
39
|
-
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"
|
|
39
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"name": "package.json",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"none"
|
|
69
69
|
],
|
|
70
70
|
"exclude": [],
|
|
71
|
-
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"
|
|
71
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"name": "src/lib/PlaygroundLayout.svelte",
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"typescript"
|
|
181
181
|
],
|
|
182
182
|
"exclude": [],
|
|
183
|
-
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"
|
|
183
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
"name": "vite.config.ts",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"typescript"
|
|
216
216
|
],
|
|
217
217
|
"exclude": [],
|
|
218
|
-
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"
|
|
218
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
"name": "vite.config.js",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"typescript",
|
|
236
236
|
"checkjs"
|
|
237
237
|
],
|
|
238
|
-
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"
|
|
238
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
239
239
|
}
|
|
240
240
|
]
|
|
241
241
|
}
|
package/dist/src/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { N as create, g as defineAddonOptions, h as defineAddon, m as officialAddons, t as add } from "../engine-
|
|
1
|
+
import { N as create, g as defineAddonOptions, h as defineAddon, m as officialAddons, t as add } from "../engine-CJqhBXva.mjs";
|
|
2
2
|
export { add, create, defineAddon, defineAddonOptions, officialAddons };
|
package/dist/src/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as z, N as create, Q as __toESM, X as __commonJSMin, Z as __require, j as R, l as addPnpmAllowBuilds, t as add } from "../engine-
|
|
1
|
+
import { M as z, N as create, Q as __toESM, X as __commonJSMin, Z as __require, j as R, l as addPnpmAllowBuilds, t as add } from "../engine-CJqhBXva.mjs";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import V from "node:process";
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"sv": "^1.0.0-next.
|
|
25
|
+
"sv": "^1.0.0-next.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"sv": "^1.0.0-next.
|
|
29
|
-
"@sveltejs/sv-utils": "^1.0.0-next.
|
|
28
|
+
"sv": "^1.0.0-next.3",
|
|
29
|
+
"@sveltejs/sv-utils": "^1.0.0-next.2",
|
|
30
30
|
"@playwright/test": "^1.60.0",
|
|
31
31
|
"@types/node": "^25.9.1",
|
|
32
32
|
"tsdown": "^0.22.1",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@fontsource/fira-mono": "^5.2.7",
|
|
14
14
|
"@neoconfetti/svelte": "^2.2.2",
|
|
15
|
-
"@sveltejs/adapter-auto": "^
|
|
15
|
+
"@sveltejs/adapter-auto": "^8.0.0-next.3",
|
|
16
16
|
"@sveltejs/kit": "^3.0.0-next.0",
|
|
17
17
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
18
18
|
"svelte": "^5.56.7",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"prepare": "svelte-kit sync || echo ''"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@sveltejs/adapter-auto": "^
|
|
13
|
+
"@sveltejs/adapter-auto": "^8.0.0-next.3",
|
|
14
14
|
"@sveltejs/kit": "^3.0.0-next.0",
|
|
15
15
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
16
16
|
"svelte": "^5.56.7",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sv",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A command line interface (CLI) for creating and maintaining Svelte applications",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sveltejs/sv-utils": "1.0.0-next.
|
|
28
|
+
"@sveltejs/sv-utils": "1.0.0-next.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@clack/prompts": "1.5.0",
|