sv 0.12.2 → 0.12.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 +5 -5
- package/dist/engine-BZ0rj9tz.d.mts +359 -0
- package/dist/{add-RNKqR0_d.mjs → engine-BmcQ5Tk6.mjs} +2252 -2101
- package/dist/{package-manager-B3sMOeTk.mjs → package-manager-BYzDyeam.mjs} +2650 -231
- package/dist/shared.json +3 -3
- package/dist/src/index.d.mts +25 -0
- package/dist/src/index.mjs +4 -0
- package/dist/{lib → src}/testing.d.mts +4 -5
- package/dist/{lib → src}/testing.mjs +2 -4
- package/dist/templates/addon/assets/src/index.js +2 -1
- package/dist/templates/addon/package.json +2 -1
- package/dist/templates/demo/assets/DOT-vscode/extensions.json +3 -0
- package/dist/templates/library/assets/DOT-vscode/extensions.json +3 -0
- package/dist/templates/minimal/assets/DOT-vscode/extensions.json +3 -0
- package/package.json +11 -22
- package/dist/add-BP-WJ6Sw.d.mts +0 -38
- package/dist/chunk-BcJDCUAU.mjs +0 -45
- package/dist/core-VSHdSalh.d.mts +0 -788
- package/dist/lib/core.d.mts +0 -2
- package/dist/lib/core.mjs +0 -3
- package/dist/lib/index.d.mts +0 -16
- package/dist/lib/index.mjs +0 -5
- package/dist/utils-D-OWcBXG.mjs +0 -41170
package/dist/shared.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"addon"
|
|
13
13
|
],
|
|
14
14
|
"exclude": [],
|
|
15
|
-
"contents": "# Contributing Guide\n\nCheatsheet: [All official add-ons source code](https://github.com/sveltejs/cli/tree/
|
|
15
|
+
"contents": "# Contributing Guide\n\nCheatsheet: [All official add-ons source code](https://github.com/sveltejs/cli/tree/main/packages/sv/src/addons)\n\n---\n\nSome convenient scripts are provided to help develop the add-on.\n\n```sh\n## create a new minimal project in the `demo` directory\nnpm run demo-create\n\n## add your current add-on to the demo project\nnpm run demo-add\n\n## run the tests\nnpm run test\n```\n\n## Key things to note\n\nYour `add-on` should:\n\n- export a function that returns a `defineAddon` object.\n- have a `package.json` with an `exports` field that points to the main entry point of the add-on.\n\n## Sharing your add-on\n\nWhen you're ready to publish your add-on to npm, run:\n\n```shell\nnpm login\nnpm publish\n```\n\n## Things to be aware of\n\nCommunity add-ons are **not permitted** to have any external dependencies outside of `sv`. If the use of a dependency is absolutely necessary, then they can be bundled using a bundler of your choosing (e.g. Rollup, Rolldown, tsup, etc.).\n"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"name": "README.md",
|
|
@@ -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.
|
|
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"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"name": "README.md",
|
|
@@ -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.
|
|
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"
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
"name": "svelte.config.js",
|
|
@@ -0,0 +1,25 @@
|
|
|
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-BZ0rj9tz.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/create/index.d.ts
|
|
4
|
+
type TemplateType = (typeof templateTypes)[number];
|
|
5
|
+
type LanguageType = (typeof languageTypes)[number];
|
|
6
|
+
declare const templateTypes: readonly ["minimal", "demo", "library", "addon", "svelte"];
|
|
7
|
+
declare const languageTypes: readonly ["typescript", "checkjs", "none"];
|
|
8
|
+
type Options = {
|
|
9
|
+
name: string;
|
|
10
|
+
template: TemplateType;
|
|
11
|
+
types: LanguageType;
|
|
12
|
+
};
|
|
13
|
+
declare function create(cwd: string, options: Options): void;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/core/processors.d.ts
|
|
16
|
+
type FileEditor = Workspace & {
|
|
17
|
+
content: string;
|
|
18
|
+
};
|
|
19
|
+
type FileType = {
|
|
20
|
+
name: (options: Workspace) => string;
|
|
21
|
+
condition?: ConditionDefinition;
|
|
22
|
+
content: (editor: FileEditor) => string;
|
|
23
|
+
};
|
|
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 };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import {
|
|
3
|
-
import { AgentName } from "package-manager-detector";
|
|
1
|
+
import { r as OptionMap, t as AddonMap } from "../engine-BZ0rj9tz.mjs";
|
|
2
|
+
import { AgentName } from "@sveltejs/sv-utils";
|
|
4
3
|
import { Page } from "@playwright/test";
|
|
5
4
|
import { TestProject } from "vitest/node";
|
|
6
5
|
|
|
7
|
-
//#region
|
|
6
|
+
//#region src/core/package-manager.d.ts
|
|
8
7
|
|
|
9
8
|
declare function addPnpmBuildDependencies(cwd: string, packageManager: AgentName | null | undefined, allowedPackages: string[]): Promise<void>;
|
|
10
9
|
//#endregion
|
|
11
|
-
//#region
|
|
10
|
+
//#region src/testing.d.ts
|
|
12
11
|
type ProjectVariant = "kit-js" | "kit-ts" | "vite-js" | "vite-ts";
|
|
13
12
|
declare const variants: ProjectVariant[];
|
|
14
13
|
type CreateProject = (options: {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ft as K, pt as q } from "../utils-D-OWcBXG.mjs";
|
|
3
|
-
import { n as addPnpmBuildDependencies, p as create } from "../package-manager-B3sMOeTk.mjs";
|
|
1
|
+
import { B as __toESM, R as __commonJSMin, T as q, n as addPnpmBuildDependencies, p as create, w as K, z as __require } from "../package-manager-BYzDyeam.mjs";
|
|
4
2
|
import fs from "node:fs";
|
|
5
3
|
import path from "node:path";
|
|
6
4
|
import process$1 from "node:process";
|
|
@@ -613,7 +611,7 @@ var require_ps_tree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
613
611
|
}));
|
|
614
612
|
|
|
615
613
|
//#endregion
|
|
616
|
-
//#region
|
|
614
|
+
//#region src/testing.ts
|
|
617
615
|
var import_ps_tree = /* @__PURE__ */ __toESM(require_ps_tree(), 1);
|
|
618
616
|
const variants = [
|
|
619
617
|
"kit-js",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sv",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A command line interface (CLI) for creating and maintaining Svelte applications",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/sveltejs/cli.git",
|
|
10
|
-
"directory": "packages/
|
|
10
|
+
"directory": "packages/sv"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://svelte.dev",
|
|
13
13
|
"files": [
|
|
@@ -16,44 +16,33 @@
|
|
|
16
16
|
"bin": "./dist/bin.mjs",
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
19
|
-
"types": "./dist/
|
|
20
|
-
"default": "./dist/
|
|
19
|
+
"types": "./dist/src/index.d.mts",
|
|
20
|
+
"default": "./dist/src/index.mjs"
|
|
21
21
|
},
|
|
22
22
|
"./testing": {
|
|
23
|
-
"types": "./dist/
|
|
24
|
-
"default": "./dist/
|
|
25
|
-
},
|
|
26
|
-
"./core": {
|
|
27
|
-
"types": "./dist/lib/core.d.mts",
|
|
28
|
-
"default": "./dist/lib/core.mjs"
|
|
23
|
+
"types": "./dist/src/testing.d.mts",
|
|
24
|
+
"default": "./dist/src/testing.mjs"
|
|
29
25
|
}
|
|
30
26
|
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@sveltejs/sv-utils": "0.0.2"
|
|
29
|
+
},
|
|
31
30
|
"devDependencies": {
|
|
32
31
|
"@clack/prompts": "1.0.0",
|
|
33
|
-
"@types/estree": "^1.0.8",
|
|
34
32
|
"@types/gitignore-parser": "^0.0.3",
|
|
35
33
|
"@types/ps-tree": "^1.1.6",
|
|
36
34
|
"@types/tar-fs": "^2.0.4",
|
|
37
35
|
"commander": "^14.0.2",
|
|
38
36
|
"create-vite": "^8.2.0",
|
|
39
|
-
"decircular": "^1.0.0",
|
|
40
|
-
"dedent": "^1.7.0",
|
|
41
37
|
"empathic": "^2.0.0",
|
|
42
|
-
"esrap": "^2.2.2",
|
|
43
38
|
"gitignore-parser": "^0.0.2",
|
|
44
|
-
"magic-string": "^0.30.21",
|
|
45
|
-
"package-manager-detector": "^1.6.0",
|
|
46
39
|
"ps-tree": "^1.2.0",
|
|
47
|
-
"silver-fleece": "^1.2.1",
|
|
48
|
-
"smol-toml": "^1.5.2",
|
|
49
40
|
"sucrase": "^3.35.1",
|
|
50
|
-
"svelte": "^5.
|
|
41
|
+
"svelte": "^5.53.0",
|
|
51
42
|
"tar-fs": "^3.1.1",
|
|
52
43
|
"tiny-glob": "^0.2.9",
|
|
53
44
|
"tinyexec": "^1.0.2",
|
|
54
|
-
"valibot": "^1.2.0"
|
|
55
|
-
"yaml": "^2.8.2",
|
|
56
|
-
"zimmerframe": "^1.1.4"
|
|
45
|
+
"valibot": "^1.2.0"
|
|
57
46
|
},
|
|
58
47
|
"keywords": [
|
|
59
48
|
"create",
|
package/dist/add-BP-WJ6Sw.d.mts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { H as Workspace, N as SetupResult, O as LoadedAddon, V as PackageManager, Y as OptionValues, b as Addon } from "./core-VSHdSalh.mjs";
|
|
2
|
-
|
|
3
|
-
//#region lib/addons/_engine/add.d.ts
|
|
4
|
-
type InstallOptions<Addons extends AddonMap> = {
|
|
5
|
-
cwd: string;
|
|
6
|
-
addons: Addons;
|
|
7
|
-
options: OptionMap<Addons>;
|
|
8
|
-
packageManager?: PackageManager;
|
|
9
|
-
};
|
|
10
|
-
type AddonMap = Record<string, Addon<any, any>>;
|
|
11
|
-
type AddonById<Addons extends AddonMap, Id$1 extends string> = Extract<Addons[keyof Addons], {
|
|
12
|
-
id: Id$1;
|
|
13
|
-
}>;
|
|
14
|
-
type OptionMap<Addons extends AddonMap> = { [Id in Addons[keyof Addons]["id"]]: Partial<OptionValues<AddonById<Addons, Id>["options"]>> };
|
|
15
|
-
declare function add<Addons extends AddonMap>({
|
|
16
|
-
addons,
|
|
17
|
-
cwd,
|
|
18
|
-
options,
|
|
19
|
-
packageManager
|
|
20
|
-
}: InstallOptions<Addons>): Promise<ReturnType<typeof applyAddons>>;
|
|
21
|
-
type ApplyAddonOptions = {
|
|
22
|
-
loadedAddons: LoadedAddon[];
|
|
23
|
-
options: OptionMap<AddonMap>;
|
|
24
|
-
workspace: Workspace;
|
|
25
|
-
setupResults: Record<string, SetupResult>;
|
|
26
|
-
};
|
|
27
|
-
declare function applyAddons({
|
|
28
|
-
loadedAddons,
|
|
29
|
-
workspace,
|
|
30
|
-
setupResults,
|
|
31
|
-
options
|
|
32
|
-
}: ApplyAddonOptions): Promise<{
|
|
33
|
-
filesToFormat: string[];
|
|
34
|
-
pnpmBuildDependencies: string[];
|
|
35
|
-
status: Record<string, string[] | "success">;
|
|
36
|
-
}>;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { add as i, InstallOptions as n, OptionMap as r, AddonMap as t };
|
package/dist/chunk-BcJDCUAU.mjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
|
-
var __exportAll = (all, symbols) => {
|
|
12
|
-
let target = {};
|
|
13
|
-
for (var name in all) {
|
|
14
|
-
__defProp(target, name, {
|
|
15
|
-
get: all[name],
|
|
16
|
-
enumerable: true
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
if (symbols) {
|
|
20
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
21
|
-
}
|
|
22
|
-
return target;
|
|
23
|
-
};
|
|
24
|
-
var __copyProps = (to, from, except, desc) => {
|
|
25
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
27
|
-
key = keys[i];
|
|
28
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
29
|
-
__defProp(to, key, {
|
|
30
|
-
get: ((k) => from[k]).bind(null, key),
|
|
31
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return to;
|
|
37
|
-
};
|
|
38
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
39
|
-
value: mod,
|
|
40
|
-
enumerable: true
|
|
41
|
-
}) : target, mod));
|
|
42
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
|