sv 0.14.1 → 0.15.0

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/shared.json CHANGED
@@ -36,7 +36,7 @@
36
36
  "checkjs"
37
37
  ],
38
38
  "exclude": [],
39
- "contents": "{\n\t\"scripts\": {\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"svelte-check\": \"^4.4.2\",\n\t\t\"typescript\": \"^5.9.3\"\n\t}\n}\n"
39
+ "contents": "{\n\t\"scripts\": {\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"svelte-check\": \"^4.4.6\",\n\t\t\"typescript\": \"^6.0.2\"\n\t}\n}\n"
40
40
  },
41
41
  {
42
42
  "name": "README.md",
@@ -52,7 +52,7 @@
52
52
  "mcp"
53
53
  ],
54
54
  "exclude": [],
55
- "contents": "You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:\n\n## Available MCP Tools:\n\n### 1. list-sections\n\nUse this FIRST to discover all available documentation sections. Returns a structured list with titles, use_cases, and paths.\nWhen asked about Svelte or SvelteKit topics, ALWAYS use this tool at the start of the chat to find relevant sections.\n\n### 2. get-documentation\n\nRetrieves full documentation content for specific sections. Accepts single or multiple sections.\nAfter calling the list-sections tool, you MUST analyze the returned documentation sections (especially the use_cases field) and then use the get-documentation tool to fetch ALL documentation sections that are relevant for the user's task.\n\n### 3. svelte-autofixer\n\nAnalyzes Svelte code and returns issues and suggestions.\nYou MUST use this tool whenever writing Svelte code before sending it to the user. Keep calling it until no issues or suggestions are returned.\n\n### 4. playground-link\n\nGenerates a Svelte Playground link with the provided code.\nAfter completing the code, ask the user if they want a playground link. Only call this tool after user confirmation and NEVER if code was written to files in their project.\n"
55
+ "contents": "You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:\n\n## Available Svelte MCP Tools:\n\n### 1. list-sections\n\nUse this FIRST to discover all available documentation sections. Returns a structured list with titles, use_cases, and paths.\nWhen asked about Svelte or SvelteKit topics, ALWAYS use this tool at the start of the chat to find relevant sections.\n\n### 2. get-documentation\n\nRetrieves full documentation content for specific sections. Accepts single or multiple sections.\nAfter calling the list-sections tool, you MUST analyze the returned documentation sections (especially the use_cases field) and then use the get-documentation tool to fetch ALL documentation sections that are relevant for the user's task.\n\n### 3. svelte-autofixer\n\nAnalyzes Svelte code and returns issues and suggestions.\nYou MUST use this tool whenever writing Svelte code before sending it to the user. Keep calling it until no issues or suggestions are returned.\n\n### 4. playground-link\n\nGenerates a Svelte Playground link with the provided code.\nAfter completing the code, ask the user if they want a playground link. Only call this tool after user confirmation and NEVER if code was written to files in their project.\n"
56
56
  },
57
57
  {
58
58
  "name": "jsconfig.json",
@@ -76,7 +76,7 @@
76
76
  "typescript"
77
77
  ],
78
78
  "exclude": [],
79
- "contents": "{\n\t\"scripts\": {\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"svelte-check\": \"^4.4.2\",\n\t\t\"typescript\": \"^5.9.3\"\n\t}\n}\n"
79
+ "contents": "{\n\t\"scripts\": {\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"svelte-check\": \"^4.4.6\",\n\t\t\"typescript\": \"^6.0.2\"\n\t}\n}\n"
80
80
  },
81
81
  {
82
82
  "name": "svelte.config.js",
@@ -1,4 +1,4 @@
1
- import { A as BooleanQuestion, C as defineAddon, D as WorkspaceOptions, E as Workspace, F as Question, I as SelectQuestion, L as StringQuestion, M as NumberQuestion, N as OptionDefinition, O as createWorkspace, P as OptionValues, R as officialAddons, S as Verification, T as getErrorHint, _ as Scripts, a as Addon, b as TestDefinition, c as AddonReference, d as ConditionDefinition, f as ConfiguredAddon, g as PreparedAddon, h as PackageDefinition, i as add, j as MultiSelectQuestion, k as BaseQuestion, 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 SetupResult, w as defineAddonOptions, x as Tests, y as SvApi } from "../engine-BdGJvT03.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-3mrtB4nw.mjs";
2
2
 
3
3
  //#region src/create/index.d.ts
4
4
  type TemplateType = (typeof templateTypes)[number];
@@ -6,11 +6,11 @@ type LanguageType = (typeof languageTypes)[number];
6
6
  declare const templateTypes: readonly ["minimal", "demo", "library", "addon", "svelte"];
7
7
  declare const languageTypes: readonly ["typescript", "checkjs", "none"];
8
8
  type Options = {
9
+ cwd: string;
9
10
  name: string;
10
11
  template: TemplateType;
11
12
  types: LanguageType;
12
13
  };
13
- declare function create(cwd: string, options: Options): void;
14
14
  //#endregion
15
15
  //#region src/core/processors.d.ts
16
16
  type FileEditor = Workspace & {
@@ -22,4 +22,9 @@ type FileType = {
22
22
  content: (editor: FileEditor) => string;
23
23
  };
24
24
  //#endregion
25
- export { Addon, AddonDefinition, AddonInput, type AddonMap, AddonReference, AddonResult, AddonSource, BaseQuestion, BooleanQuestion, ConditionDefinition, ConfiguredAddon, FileEditor, FileType, type InstallOptions, type LanguageType, LoadedAddon, MultiSelectQuestion, NumberQuestion, OptionBuilder, OptionDefinition, type OptionMap, OptionValues, PackageDefinition, PreparedAddon, Question, Scripts, SelectQuestion, SetupResult, StringQuestion, SvApi, type TemplateType, TestDefinition, Tests, Verification, Workspace, WorkspaceOptions, add, create, createWorkspace, defineAddon, defineAddonOptions, getErrorHint, officialAddons };
25
+ //#region src/index.d.ts
26
+ /** @deprecated use `create({ cwd, ...options })` instead. */
27
+ declare function create(cwd: string, options: Omit<Options, "cwd">): void;
28
+ declare function create(options: Options): void;
29
+ //#endregion
30
+ export { type Addon, type AddonDefinition, type AddonInput, type AddonMap, type AddonReference, type AddonResult, type AddonSource, type BaseQuestion, type BooleanQuestion, type ConfiguredAddon, type FileEditor, type FileType, type InstallOptions, type LanguageType, type LoadedAddon, type MultiSelectQuestion, type NumberQuestion, type OptionBuilder, type OptionDefinition, type OptionMap, type OptionValues, type PreparedAddon, type Question, type SelectQuestion, type SetupResult, type StringQuestion, type SvApi, type TemplateType, type Workspace, type WorkspaceOptions, add, create, defineAddon, defineAddonOptions, officialAddons };
@@ -1,2 +1,13 @@
1
- import { d as defineAddon, f as defineAddonOptions, t as add, u as officialAddons, v as create } from "../engine-CK31LRlH.mjs";
1
+ import { c as defineAddonOptions, m as create$1, o as officialAddons, s as defineAddon, t as add, y as svDeprecated } from "../engine-CzIdz0uO.mjs";
2
+ //#region src/index.ts
3
+ function create(cwdOrOptions, legacyOptions) {
4
+ if (typeof cwdOrOptions === "string") {
5
+ svDeprecated("use `create({ cwd, ...options })` instead of `create(cwd, options)`");
6
+ create$1({
7
+ cwd: cwdOrOptions,
8
+ ...legacyOptions
9
+ });
10
+ } else create$1(cwdOrOptions);
11
+ }
12
+ //#endregion
2
13
  export { add, create, defineAddon, defineAddonOptions, officialAddons };
@@ -1,13 +1,9 @@
1
- import { r as OptionMap, t as AddonMap } from "../engine-BdGJvT03.mjs";
2
- import { AgentName } from "@sveltejs/sv-utils";
3
- import * as _playwright_test0 from "@playwright/test";
1
+ import { r as OptionMap, t as AddonMap } from "../engine-3mrtB4nw.mjs";
2
+ import * as _$_playwright_test0 from "@playwright/test";
4
3
  import { Page } from "@playwright/test";
5
- import * as vitest from "vitest";
4
+ import * as _$vitest from "vitest";
6
5
  import { TestProject } from "vitest/node";
7
6
 
8
- //#region src/core/package-manager.d.ts
9
- declare function addPnpmBuildDependencies(cwd: string, packageManager: AgentName | null | undefined, allowedPackages: string[]): Promise<void>;
10
- //#endregion
11
7
  //#region src/testing.d.ts
12
8
  type ProjectVariant = "kit-js" | "kit-ts" | "vite-js" | "vite-ts";
13
9
  declare const variants: ProjectVariant[];
@@ -16,39 +12,6 @@ type CreateProject = (options: {
16
12
  variant: ProjectVariant; /** @default true */
17
13
  clean?: boolean;
18
14
  }) => string;
19
- type SetupOptions = {
20
- cwd: string;
21
- variants: readonly ProjectVariant[]; /** @default false */
22
- clean?: boolean;
23
- };
24
- declare function setup({
25
- cwd,
26
- clean,
27
- variants
28
- }: SetupOptions): {
29
- templatesDir: string;
30
- };
31
- type CreateOptions = {
32
- cwd: string;
33
- testName: string;
34
- templatesDir: string;
35
- };
36
- declare function createProject({
37
- cwd,
38
- testName,
39
- templatesDir
40
- }: CreateOptions): CreateProject;
41
- type PreviewOptions = {
42
- cwd: string;
43
- command?: string;
44
- };
45
- declare function startPreview({
46
- cwd,
47
- command
48
- }: PreviewOptions): Promise<{
49
- url: string;
50
- close: () => Promise<void>;
51
- }>;
52
15
  declare module "vitest" {
53
16
  interface ProvidedContext {
54
17
  testDir: string;
@@ -103,12 +66,12 @@ declare function prepareServer({
103
66
  buildCommand,
104
67
  previewCommand
105
68
  }: PrepareServerOptions): Promise<PrepareServerReturn>;
106
- type PlaywrightContext = Pick<typeof _playwright_test0, "chromium">;
107
- type VitestContext = Pick<typeof vitest, "inject" | "test" | "beforeAll" | "beforeEach">;
69
+ type PlaywrightContext = Pick<typeof _$_playwright_test0, "chromium">;
70
+ type VitestContext = Pick<typeof _$vitest, "inject" | "test" | "beforeAll" | "beforeEach">;
108
71
  declare function createSetupTest(vitest: VitestContext, playwright?: PlaywrightContext): <Addons extends AddonMap>(addons: Addons, options?: SetupTestOptions<Addons>) => {
109
- test: vitest.TestAPI<Fixtures>;
72
+ test: _$vitest.TestAPI<Fixtures>;
110
73
  testCases: Array<AddonTestCase<AddonMap>>;
111
74
  prepareServer: typeof prepareServer;
112
75
  };
113
76
  //#endregion
114
- export { AddonTestCase, CreateProject, Fixtures, PlaywrightContext, PrepareServerOptions, PrepareServerReturn, ProjectVariant, SetupTestOptions, VitestContext, addPnpmBuildDependencies, createProject, createSetupTest, prepareServer, setup, setupGlobal, startPreview, variants };
77
+ export { AddonTestCase, CreateProject, Fixtures, PlaywrightContext, PrepareServerOptions, PrepareServerReturn, ProjectVariant, SetupTestOptions, VitestContext, createSetupTest, prepareServer, setupGlobal, variants };
@@ -1,4 +1,4 @@
1
- import { _ as z, b as __require, g as R, i as addPnpmBuildDependencies, t as add, v as create, x as __toESM, y as __commonJSMin } from "../engine-CK31LRlH.mjs";
1
+ import { S as __toESM, b as __commonJSMin, f as R, i as addPnpmOnlyBuiltDependencies, m as create, p as z, t as add, x as __require } from "../engine-CzIdz0uO.mjs";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import process$1 from "node:process";
@@ -618,22 +618,26 @@ function setup({ cwd, clean = false, variants }) {
618
618
  for (const variant of variants) {
619
619
  const templatePath = path.resolve(templatesDir, variant);
620
620
  if (fs.existsSync(templatePath)) continue;
621
- if (variant === "kit-js") create(templatePath, {
621
+ if (variant === "kit-js") create({
622
+ cwd: templatePath,
622
623
  name: variant,
623
624
  template: "minimal",
624
625
  types: "checkjs"
625
626
  });
626
- else if (variant === "kit-ts") create(templatePath, {
627
+ else if (variant === "kit-ts") create({
628
+ cwd: templatePath,
627
629
  name: variant,
628
630
  template: "minimal",
629
631
  types: "typescript"
630
632
  });
631
- else if (variant === "vite-js") create(templatePath, {
633
+ else if (variant === "vite-js") create({
634
+ cwd: templatePath,
632
635
  name: variant,
633
636
  template: "svelte",
634
637
  types: "none"
635
638
  });
636
- else if (variant === "vite-ts") create(templatePath, {
639
+ else if (variant === "vite-ts") create({
640
+ cwd: templatePath,
637
641
  name: variant,
638
642
  template: "svelte",
639
643
  types: "typescript"
@@ -812,13 +816,13 @@ function createSetupTest(vitest, playwright) {
812
816
  addonTestCase,
813
817
  cwd
814
818
  });
815
- const { pnpmBuildDependencies } = await add({
819
+ await add({
816
820
  cwd,
817
821
  addons,
818
822
  options: kind.options,
819
823
  packageManager: "pnpm"
820
824
  });
821
- await addPnpmBuildDependencies(cwd, "pnpm", ["esbuild", ...pnpmBuildDependencies]);
825
+ addPnpmOnlyBuiltDependencies(cwd, "pnpm", "esbuild");
822
826
  }
823
827
  execSync("pnpm install", {
824
828
  cwd: path.resolve(cwd, testName),
@@ -846,4 +850,4 @@ function createSetupTest(vitest, playwright) {
846
850
  };
847
851
  }
848
852
  //#endregion
849
- export { addPnpmBuildDependencies, createProject, createSetupTest, prepareServer, setup, setupGlobal, startPreview, variants };
853
+ export { createSetupTest, prepareServer, setupGlobal, variants };
@@ -1,5 +1,5 @@
1
- import { transforms } from '@sveltejs/sv-utils';
2
1
  import { defineAddon, defineAddonOptions } from 'sv';
2
+ import { transforms } from './sv-utils.js';
3
3
 
4
4
  const options = defineAddonOptions()
5
5
  .add('who', {
@@ -0,0 +1,3 @@
1
+ // This file is a separate entry point (see tsdown.config.js) so that
2
+ // the addon's utilities are published as their own module on npm.
3
+ export * from '@sveltejs/sv-utils';
@@ -1,6 +1,6 @@
1
1
  import { defineConfig } from 'tsdown';
2
2
 
3
3
  export default defineConfig({
4
- entry: ['src/index.js'],
4
+ entry: ['src/index.js', 'src/sv-utils.js'],
5
5
  format: 'esm'
6
6
  });
@@ -27,10 +27,10 @@
27
27
  "devDependencies": {
28
28
  "sv": "latest",
29
29
  "@sveltejs/sv-utils": "latest",
30
- "@playwright/test": "^1.58.2",
31
- "@types/node": "^25.2.1",
32
- "tsdown": "^0.21.4",
33
- "vitest": "^4.1.0"
30
+ "@playwright/test": "^1.59.1",
31
+ "@types/node": "^25.5.2",
32
+ "tsdown": "^0.21.7",
33
+ "vitest": "^4.1.3"
34
34
  },
35
35
  "keywords": ["sv-add", "svelte", "sveltekit"]
36
36
  }
@@ -12,10 +12,10 @@
12
12
  "devDependencies": {
13
13
  "@fontsource/fira-mono": "^5.2.7",
14
14
  "@neoconfetti/svelte": "^2.2.2",
15
- "@sveltejs/adapter-auto": "^7.0.0",
16
- "@sveltejs/kit": "^2.50.2",
17
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
18
- "svelte": "^5.54.0",
19
- "vite": "^7.3.1"
15
+ "@sveltejs/adapter-auto": "^7.0.1",
16
+ "@sveltejs/kit": "^2.57.0",
17
+ "@sveltejs/vite-plugin-svelte": "^7.0.0",
18
+ "svelte": "^5.55.2",
19
+ "vite": "^8.0.7"
20
20
  }
21
21
  }
@@ -23,14 +23,14 @@
23
23
  "svelte": "^5.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@sveltejs/adapter-auto": "^7.0.0",
27
- "@sveltejs/kit": "^2.50.2",
26
+ "@sveltejs/adapter-auto": "^7.0.1",
27
+ "@sveltejs/kit": "^2.57.0",
28
28
  "@sveltejs/package": "^2.5.7",
29
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
30
- "publint": "^0.3.17",
31
- "svelte": "^5.54.0",
32
- "typescript": "^5.9.3",
33
- "vite": "^7.3.1"
29
+ "@sveltejs/vite-plugin-svelte": "^7.0.0",
30
+ "publint": "^0.3.18",
31
+ "svelte": "^5.55.2",
32
+ "typescript": "^6.0.2",
33
+ "vite": "^8.0.7"
34
34
  },
35
35
  "keywords": ["svelte"]
36
36
  }
@@ -10,10 +10,10 @@
10
10
  "prepare": "svelte-kit sync || echo ''"
11
11
  },
12
12
  "devDependencies": {
13
- "@sveltejs/adapter-auto": "^7.0.0",
14
- "@sveltejs/kit": "^2.50.2",
15
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
16
- "svelte": "^5.54.0",
17
- "vite": "^7.3.1"
13
+ "@sveltejs/adapter-auto": "^7.0.1",
14
+ "@sveltejs/kit": "^2.57.0",
15
+ "@sveltejs/vite-plugin-svelte": "^7.0.0",
16
+ "svelte": "^5.55.2",
17
+ "vite": "^8.0.7"
18
18
  }
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
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": "0.1.0"
28
+ "@sveltejs/sv-utils": "0.2.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@clack/prompts": "1.0.0",