sv 1.0.0-next.0 → 1.0.0-next.1

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 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-DlJ4-99M.mjs";
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-Cbq-kxIr.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";
@@ -1263,14 +1263,16 @@ const MOVED_EXPORTS = /* @__PURE__ */ new Map([
1263
1263
  ["RemoteQueryUpdate", "$app/server"],
1264
1264
  ["RemoteResource", "$app/server"],
1265
1265
  ["RequestedEntry", "$app/server"],
1266
+ ["LiveRequestedEntry", "$app/server"],
1266
1267
  ["RequestedResult", "$app/server"],
1268
+ ["QueryRequestedResult", "$app/server"],
1269
+ ["LiveQueryRequestedResult", "$app/server"],
1267
1270
  ["Reroute", "@sveltejs/kit/hooks"],
1268
1271
  ["ResolveOptions", "@sveltejs/kit/hooks"],
1269
1272
  ["ServerInit", "@sveltejs/kit/hooks"],
1270
1273
  ["SubmitFunction", "$app/forms"],
1271
1274
  ["Transport", "@sveltejs/kit/hooks"],
1272
1275
  ["Transporter", "@sveltejs/kit/hooks"],
1273
- ["ValidationError", "$app/server"],
1274
1276
  ["defineParams", "@sveltejs/kit/params"]
1275
1277
  ]);
1276
1278
  var imports_default = defineMigrationTask({
@@ -1522,7 +1524,7 @@ var params_default = defineMigrationTask({
1522
1524
  const content = parts.join("\n");
1523
1525
  sv.file(target, () => content);
1524
1526
  if (foreignEntries.length > 0) return;
1525
- for (const file of matcherFiles) fs.unlinkSync(path.join(cwd, file));
1527
+ for (const file of matcherFiles) sv.removeFile(file);
1526
1528
  if (fs.readdirSync(absoluteParamsDirectory).length === 0) fs.rmdirSync(absoluteParamsDirectory);
1527
1529
  }
1528
1530
  });
@@ -2040,7 +2042,7 @@ function gotoOptions(replace, state) {
2040
2042
  return js.object.create({
2041
2043
  shallow: js.common.createLiteral(true),
2042
2044
  replace: replace ? js.common.createLiteral(true) : void 0,
2043
- state
2045
+ state: state?.type === "ObjectExpression" && state.properties.length === 0 ? void 0 : state
2044
2046
  });
2045
2047
  }
2046
2048
  function migrateNavigationHook(call) {
@@ -2135,7 +2137,7 @@ var svelte_config_default = defineMigrationTask({
2135
2137
  if (configSource.kind === "vite") return;
2136
2138
  const originalConfigObject = svelteConfig.read(cwd);
2137
2139
  if (!originalConfigObject) return;
2138
- fs.unlinkSync(path.join(cwd, configSource.path));
2140
+ sv.removeFile(configSource.path);
2139
2141
  svelteConfig.edit({
2140
2142
  sv,
2141
2143
  cwd
@@ -2705,7 +2707,10 @@ async function applyTasks(options, tasks, legacyMigration) {
2705
2707
  }
2706
2708
  }
2707
2709
  if (!legacyMigration) stop("All tasks applied successfully!");
2708
- if (allUnmodifiedFiles.size > 0) Ce(`The following files were modified by the migration,\nbut their content was not saved:\n- ${Array.from(allUnmodifiedFiles).join("\n- ")}`, "Unmodified files", { format: (line) => line });
2710
+ if (allUnmodifiedFiles.size > 0) {
2711
+ const skippedFiles = Array.from(allUnmodifiedFiles).map((file) => `- ${color.path(file)}`).join("\n");
2712
+ Ce(`Changes to these files were skipped because they did not\nmatch the ${color.command("--files")} filter:\n${skippedFiles}`, color.warning("Skipped changes"), { format: (line) => line });
2713
+ }
2709
2714
  return allModifiedFiles;
2710
2715
  }
2711
2716
  //#endregion
@@ -122,7 +122,8 @@ type SvApi = {
122
122
  *
123
123
  * Return `false` from the callback to abort - the original content is returned unchanged.
124
124
  */
125
- file: (path: string, edit: FileEdit) => void;
125
+ file: (path: string, edit: FileEdit) => void; /** Remove a file from the workspace. Respects the migration file filter. */
126
+ removeFile: (path: string) => void;
126
127
  /**
127
128
  * Edits matching files in the workspace.
128
129
  * The `include` and `exclude` patterns are glob patterns relative to the workspace root.
@@ -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.0";
1342
+ var version = "1.0.0-next.1";
1343
1343
  //#endregion
1344
1344
  //#region src/core/errors.ts
1345
1345
  var UnsupportedError = class extends Error {
@@ -6224,7 +6224,7 @@ var better_auth_default = defineAddon({
6224
6224
  }
6225
6225
  sv.file(`${directory.lib}/server/auth.${language}`, transforms.script(({ ast, comments, js }) => {
6226
6226
  js.imports.addNamed(ast, {
6227
- from: `${lib}/server/db`,
6227
+ from: `${lib}/server/db/index.${language}`,
6228
6228
  imports: [d1 ? "getDb" : "db"]
6229
6229
  });
6230
6230
  js.imports.addNamed(ast, {
@@ -6320,7 +6320,7 @@ var better_auth_default = defineAddon({
6320
6320
  sv.file("src/app.d.ts", transforms.script(({ ast, comments, js }) => {
6321
6321
  if (d1) js.imports.addNamed(ast, {
6322
6322
  imports: ["createAuth"],
6323
- from: `${lib}/server/auth`
6323
+ from: `${lib}/server/auth.${language}`
6324
6324
  });
6325
6325
  js.imports.addNamed(ast, {
6326
6326
  imports: ["User", "Session"],
@@ -6344,7 +6344,7 @@ var better_auth_default = defineAddon({
6344
6344
  });
6345
6345
  js.imports.addNamed(ast, {
6346
6346
  imports: [d1 ? "createAuth" : "auth"],
6347
- from: `${lib}/server/auth`
6347
+ from: `${lib}/server/auth.${language}`
6348
6348
  });
6349
6349
  env.importEnv(ast, js, ["building"]);
6350
6350
  const handleContent = dedent`
@@ -6452,7 +6452,7 @@ var better_auth_default = defineAddon({
6452
6452
  import { fail, redirect } from '@sveltejs/kit';
6453
6453
  ${ts("import type { Actions } from './$types';")}
6454
6454
  ${ts("import type { PageServerLoad } from './$types';")}
6455
- ${!d1 ? `import { auth } from '${lib}/server/auth';` : ""}
6455
+ ${!d1 ? `import { auth } from '${lib}/server/auth.${language}';` : ""}
6456
6456
  ${needsAPIError ? "import { APIError } from 'better-auth/api';" : ""}
6457
6457
 
6458
6458
  export const load${ts(": PageServerLoad")} = (event) => {
@@ -6521,7 +6521,7 @@ var better_auth_default = defineAddon({
6521
6521
  import { redirect } from '@sveltejs/kit';
6522
6522
  ${ts("import type { Actions } from './$types';")}
6523
6523
  ${ts("import type { PageServerLoad } from './$types';")}
6524
- ${!d1 ? `import { auth } from '${lib}/server/auth';` : ""}
6524
+ ${!d1 ? `import { auth } from '${lib}/server/auth.${language}';` : ""}
6525
6525
 
6526
6526
  export const load${ts(": PageServerLoad")} = (event) => {
6527
6527
  if (!event.locals.user) {
@@ -7369,7 +7369,7 @@ var paraglide_default = defineAddon({
7369
7369
  }));
7370
7370
  sv.file(`src/hooks.${language}`, transforms.script(({ ast, comments, js }) => {
7371
7371
  js.imports.addNamed(ast, {
7372
- from: `${lib}/paraglide/runtime`,
7372
+ from: `${lib}/paraglide/runtime.js`,
7373
7373
  imports: ["deLocalizeUrl"]
7374
7374
  });
7375
7375
  const expression = js.common.parseExpression("(request) => deLocalizeUrl(request.url).pathname");
@@ -7384,19 +7384,19 @@ var paraglide_default = defineAddon({
7384
7384
  });
7385
7385
  if (existingExport.declaration !== rerouteIdentifier) R$1.warn("Adding the reroute hook automatically failed. Add it manually");
7386
7386
  if (language === "ts") js.imports.addNamed(ast, {
7387
- from: "@sveltejs/kit",
7387
+ from: "@sveltejs/kit/hooks",
7388
7388
  imports: ["Reroute"],
7389
7389
  isType: true
7390
7390
  });
7391
- else js.common.addJsDocTypeComment(existingExport, comments, { type: "import('@sveltejs/kit').Reroute" });
7391
+ else js.common.addJsDocTypeComment(existingExport, comments, { type: "import('@sveltejs/kit/hooks').Reroute" });
7392
7392
  }));
7393
7393
  sv.file(`src/hooks.server.${language}`, transforms.script(({ ast, comments, js }) => {
7394
7394
  js.imports.addNamed(ast, {
7395
- from: `${lib}/paraglide/server`,
7395
+ from: `${lib}/paraglide/server.js`,
7396
7396
  imports: ["paraglideMiddleware"]
7397
7397
  });
7398
7398
  js.imports.addNamed(ast, {
7399
- from: `${lib}/paraglide/runtime`,
7399
+ from: `${lib}/paraglide/runtime.js`,
7400
7400
  imports: ["getTextDirection"]
7401
7401
  });
7402
7402
  js.kit.addHooksHandle(ast, {
@@ -7435,7 +7435,7 @@ var paraglide_default = defineAddon({
7435
7435
  sv.file(`${directory.kitRoutes}/+layout.svelte`, transforms.svelteScript({ language }, ({ ast, svelte, js }) => {
7436
7436
  js.imports.addNamed(ast.instance.content, {
7437
7437
  imports: ["locales", "localizeHref"],
7438
- from: `${lib}/paraglide/runtime`
7438
+ from: `${lib}/paraglide/runtime.js`
7439
7439
  });
7440
7440
  js.imports.addNamed(ast.instance.content, {
7441
7441
  imports: ["page"],
@@ -7466,7 +7466,7 @@ var paraglide_default = defineAddon({
7466
7466
  });
7467
7467
  js.imports.addNamed(ast.instance.content, {
7468
7468
  imports: { setLocale: "setLocale" },
7469
- from: `${lib}/paraglide/runtime`
7469
+ from: `${lib}/paraglide/runtime.js`
7470
7470
  });
7471
7471
  let templateCode = "<h1>{m.hello_world({ name: 'SvelteKit User' })}</h1>";
7472
7472
  const { validLanguageTags } = parseLanguageTagInput(options.languageTags);
@@ -7652,32 +7652,32 @@ const adapters = [
7652
7652
  {
7653
7653
  id: "auto",
7654
7654
  package: "@sveltejs/adapter-auto",
7655
- version: "^7.0.1"
7655
+ version: "^8.0.0-next.3"
7656
7656
  },
7657
7657
  {
7658
7658
  id: "node",
7659
7659
  package: "@sveltejs/adapter-node",
7660
- version: "^5.5.4"
7660
+ version: "^6.0.0-next.10"
7661
7661
  },
7662
7662
  {
7663
7663
  id: "static",
7664
7664
  package: "@sveltejs/adapter-static",
7665
- version: "^3.0.10"
7665
+ version: "^4.0.0-next.4"
7666
7666
  },
7667
7667
  {
7668
7668
  id: "vercel",
7669
7669
  package: "@sveltejs/adapter-vercel",
7670
- version: "^6.3.3"
7670
+ version: "^7.0.0-next.6"
7671
7671
  },
7672
7672
  {
7673
7673
  id: "cloudflare",
7674
7674
  package: "@sveltejs/adapter-cloudflare",
7675
- version: "^7.2.8"
7675
+ version: "^8.0.0-next.6"
7676
7676
  },
7677
7677
  {
7678
7678
  id: "netlify",
7679
7679
  package: "@sveltejs/adapter-netlify",
7680
- version: "^6.0.4"
7680
+ version: "^7.0.0-next.8"
7681
7681
  }
7682
7682
  ];
7683
7683
  var sveltekit_adapter_default = defineAddon({
@@ -10789,7 +10789,7 @@ function editFile(file, edit, workspace, modifiedFiles, unmodifiedFiles, options
10789
10789
  if (include === void 0 ? false : !include(content)) return;
10790
10790
  const editedContent = edit(content);
10791
10791
  if (editedContent === "" || editedContent === false) return;
10792
- if (options.filesFilter && !path.matchesGlob(file, options.filesFilter)) {
10792
+ if (!matchesFilesFilter(file, options)) {
10793
10793
  unmodifiedFiles.add(file);
10794
10794
  return;
10795
10795
  }
@@ -10801,6 +10801,9 @@ function editFile(file, edit, workspace, modifiedFiles, unmodifiedFiles, options
10801
10801
  throw e;
10802
10802
  }
10803
10803
  }
10804
+ function matchesFilesFilter(file, options) {
10805
+ return !options.filesFilter || path.matchesGlob(file, options.filesFilter);
10806
+ }
10804
10807
  function prepareSvApi(workspace, options = {
10805
10808
  filesFilter: void 0,
10806
10809
  executeOutputPrefix: void 0,
@@ -10814,6 +10817,13 @@ function prepareSvApi(workspace, options = {
10814
10817
  file: (path, edit) => {
10815
10818
  editFile(path, edit, workspace, modifiedFiles, unmodifiedFiles, options);
10816
10819
  },
10820
+ removeFile: (file) => {
10821
+ if (!matchesFilesFilter(file, options)) {
10822
+ unmodifiedFiles.add(file);
10823
+ return;
10824
+ }
10825
+ fs.unlinkSync(path.resolve(workspace.cwd, file));
10826
+ },
10817
10827
  files: (opts, edit) => {
10818
10828
  const { include, exclude } = opts;
10819
10829
  const globbedFiles = fs.globSync(include, {
@@ -10830,7 +10840,7 @@ function prepareSvApi(workspace, options = {
10830
10840
  ]
10831
10841
  });
10832
10842
  for (const file of globbedFiles) {
10833
- if (options.filesFilter && !path.matchesGlob(file, options.filesFilter)) continue;
10843
+ if (!matchesFilesFilter(file, options)) continue;
10834
10844
  const singleFileEdit = (content) => edit(content, file);
10835
10845
  editFile(file, singleFileEdit, workspace, modifiedFiles, unmodifiedFiles, options, opts.where);
10836
10846
  }
@@ -1,4 +1,4 @@
1
- import { A as StringQuestion, C as BooleanQuestion, D as OptionValues, E as OptionDefinition, O as Question, S as BaseQuestion, T as NumberQuestion, _ as SvApi, a as Addon, b as Workspace, c as AddonReference, d as ConditionDefinition, f as ConfiguredAddon, g as SetupResult, h as PreparedAddon, i as add, j as officialAddons, k as SelectQuestion, l as AddonResult, m as OptionBuilder, n as InstallOptions, o as AddonDefinition, p as LoadedAddon, r as OptionMap, s as AddonInput, t as AddonMap, u as AddonSource, v as defineAddon, w as MultiSelectQuestion, x as WorkspaceOptions, y as defineAddonOptions } from "../engine-BrvAeCUj.mjs";
1
+ import { A as StringQuestion, C as BooleanQuestion, D as OptionValues, E as OptionDefinition, O as Question, S as BaseQuestion, T as NumberQuestion, _ as SvApi, a as Addon, b as Workspace, c as AddonReference, d as ConditionDefinition, f as ConfiguredAddon, g as SetupResult, h as PreparedAddon, i as add, j as officialAddons, k as SelectQuestion, l as AddonResult, m as OptionBuilder, n as InstallOptions, o as AddonDefinition, p as LoadedAddon, r as OptionMap, s as AddonInput, t as AddonMap, u as AddonSource, v as defineAddon, w as MultiSelectQuestion, x as WorkspaceOptions, y as defineAddonOptions } from "../engine-0wnzAQ2W.mjs";
2
2
 
3
3
  //#region src/create/index.d.ts
4
4
  type TemplateType = (typeof templateTypes)[number];
@@ -1,2 +1,2 @@
1
- import { N as create, g as defineAddonOptions, h as defineAddon, m as officialAddons, t as add } from "../engine-DlJ4-99M.mjs";
1
+ import { N as create, g as defineAddonOptions, h as defineAddon, m as officialAddons, t as add } from "../engine-Cbq-kxIr.mjs";
2
2
  export { add, create, defineAddon, defineAddonOptions, officialAddons };
@@ -1,4 +1,4 @@
1
- import { r as OptionMap, t as AddonMap } from "../engine-BrvAeCUj.mjs";
1
+ import { r as OptionMap, t as AddonMap } from "../engine-0wnzAQ2W.mjs";
2
2
  import { Page } from "@playwright/test";
3
3
  import { TestProject } from "vitest/node";
4
4
 
@@ -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-DlJ4-99M.mjs";
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-Cbq-kxIr.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.0"
25
+ "sv": "^1.0.0-next.1"
26
26
  },
27
27
  "devDependencies": {
28
- "sv": "^1.0.0-next.0",
29
- "@sveltejs/sv-utils": "^1.0.0-next.0",
28
+ "sv": "^1.0.0-next.1",
29
+ "@sveltejs/sv-utils": "^1.0.0-next.1",
30
30
  "@playwright/test": "^1.60.0",
31
31
  "@types/node": "^25.9.1",
32
32
  "tsdown": "^0.22.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "1.0.0-next.0",
3
+ "version": "1.0.0-next.1",
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.0"
28
+ "@sveltejs/sv-utils": "1.0.0-next.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@clack/prompts": "1.5.0",
@@ -38,7 +38,7 @@
38
38
  "modern-tar": "^0.7.7",
39
39
  "ps-tree": "^1.2.0",
40
40
  "sucrase": "^3.35.1",
41
- "svelte": "^5.56.7",
41
+ "svelte": "^5.56.9",
42
42
  "tiny-glob": "^0.2.9",
43
43
  "tinyexec": "^1.2.4",
44
44
  "valibot": "^1.4.1"