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/bin.mjs +1 -1
- package/dist/{engine-BdGJvT03.d.mts → engine-3mrtB4nw.d.mts} +12 -57
- package/dist/{engine-CK31LRlH.mjs → engine-CzIdz0uO.mjs} +530 -513
- package/dist/shared.json +3 -3
- package/dist/src/index.d.mts +8 -3
- package/dist/src/index.mjs +12 -1
- package/dist/src/testing.d.mts +7 -44
- package/dist/src/testing.mjs +12 -8
- package/dist/templates/addon/assets/src/index.js +1 -1
- package/dist/templates/addon/assets/src/sv-utils.js +3 -0
- package/dist/templates/addon/assets/tsdown.config.js +1 -1
- package/dist/templates/addon/package.json +4 -4
- package/dist/templates/demo/package.json +5 -5
- package/dist/templates/library/package.json +7 -7
- package/dist/templates/minimal/package.json +5 -5
- package/package.json +2 -2
package/dist/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { _ as name, a as detectPackageManager, d as program, g as helpConfig, h as forwardExitCode, l as from, n as add, r as create, u as Command, v as version } from "./engine-CzIdz0uO.mjs";
|
|
3
3
|
import { color, resolveCommandArray } from "@sveltejs/sv-utils";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { execSync } from "node:child_process";
|
|
@@ -8,7 +8,6 @@ type OfficialAddons = {
|
|
|
8
8
|
playwright: Addon<any>;
|
|
9
9
|
tailwindcss: Addon<any>;
|
|
10
10
|
sveltekitAdapter: Addon<any>;
|
|
11
|
-
devtoolsJson: Addon<any>;
|
|
12
11
|
drizzle: Addon<any>;
|
|
13
12
|
betterAuth: Addon<any>;
|
|
14
13
|
mdsvex: Addon<any>;
|
|
@@ -87,11 +86,11 @@ type Workspace = {
|
|
|
87
86
|
typeConfig: "jsconfig.json" | "tsconfig.json" | undefined; /** `${directory.routes}/layout.css` or `src/app.css` */
|
|
88
87
|
stylesheet: `${string}/layout.css` | "src/app.css";
|
|
89
88
|
package: "package.json";
|
|
90
|
-
gitignore: ".gitignore";
|
|
91
|
-
prettierignore: ".prettierignore";
|
|
92
|
-
prettierrc: ".prettierrc";
|
|
93
|
-
eslintConfig: "eslint.config.js";
|
|
94
|
-
vscodeSettings: ".vscode/settings.json";
|
|
89
|
+
gitignore: ".gitignore"; /** @deprecated use the string `.prettierignore` instead. */
|
|
90
|
+
prettierignore: ".prettierignore"; /** @deprecated use the string `.prettierrc` instead. */
|
|
91
|
+
prettierrc: ".prettierrc"; /** @deprecated use the string `eslint.config.js` instead. */
|
|
92
|
+
eslintConfig: "eslint.config.js"; /** @deprecated use the string `.vscode/settings.json` instead. */
|
|
93
|
+
vscodeSettings: ".vscode/settings.json"; /** @deprecated use the string `.vscode/extensions.json` instead. */
|
|
95
94
|
vscodeExtensions: ".vscode/extensions.json"; /** Get the relative path between two files */
|
|
96
95
|
getRelative: ({
|
|
97
96
|
from,
|
|
@@ -100,6 +99,11 @@ type Workspace = {
|
|
|
100
99
|
from?: string;
|
|
101
100
|
to: string;
|
|
102
101
|
}) => string;
|
|
102
|
+
/**
|
|
103
|
+
* Find a file by walking up the directory tree from cwd.
|
|
104
|
+
* Returns the relative path from cwd, or the filename itself if not found.
|
|
105
|
+
*/
|
|
106
|
+
findUp: (filename: string) => string;
|
|
103
107
|
};
|
|
104
108
|
isKit: boolean;
|
|
105
109
|
directory: {
|
|
@@ -109,37 +113,11 @@ type Workspace = {
|
|
|
109
113
|
}; /** The package manager used to install dependencies */
|
|
110
114
|
packageManager: AgentName;
|
|
111
115
|
};
|
|
112
|
-
type CreateWorkspaceOptions = {
|
|
113
|
-
cwd: string;
|
|
114
|
-
packageManager?: AgentName;
|
|
115
|
-
override?: {
|
|
116
|
-
isKit?: boolean;
|
|
117
|
-
directory?: Workspace["directory"];
|
|
118
|
-
dependencies: Record<string, string>;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
declare function createWorkspace({
|
|
122
|
-
cwd,
|
|
123
|
-
packageManager,
|
|
124
|
-
override
|
|
125
|
-
}: CreateWorkspaceOptions): Promise<Workspace>;
|
|
126
116
|
//#endregion
|
|
127
117
|
//#region src/core/config.d.ts
|
|
128
118
|
type ConditionDefinition = (Workspace: Workspace) => boolean;
|
|
129
|
-
type PackageDefinition = {
|
|
130
|
-
name: string;
|
|
131
|
-
version: string;
|
|
132
|
-
dev: boolean;
|
|
133
|
-
condition?: ConditionDefinition;
|
|
134
|
-
};
|
|
135
|
-
type Scripts = {
|
|
136
|
-
description: string;
|
|
137
|
-
args: string[];
|
|
138
|
-
stdio: "inherit" | "pipe";
|
|
139
|
-
condition?: ConditionDefinition;
|
|
140
|
-
};
|
|
141
119
|
type SvApi = {
|
|
142
|
-
/**
|
|
120
|
+
/** @deprecated use `pnpm.onlyBuiltDependencies` from `@sveltejs/sv-utils` instead */pnpmBuildDependency: (pkg: string) => void; /** Add a package to the dependencies. */
|
|
143
121
|
dependency: (pkg: string, version: string) => void; /** Add a package to the dev dependencies. */
|
|
144
122
|
devDependency: (pkg: string, version: string) => void; /** Execute a command in the workspace. */
|
|
145
123
|
execute: (args: string[], stdio: "inherit" | "pipe") => Promise<void>;
|
|
@@ -241,35 +219,13 @@ type AddonResult = {
|
|
|
241
219
|
};
|
|
242
220
|
readonly files: string[];
|
|
243
221
|
};
|
|
244
|
-
/**
|
|
245
|
-
* Generates an inline error hint based on the addon source
|
|
246
|
-
*/
|
|
247
|
-
declare function getErrorHint(source: AddonSource): string;
|
|
248
222
|
type SetupResult = {
|
|
249
223
|
dependsOn: string[];
|
|
250
224
|
unsupported: string[];
|
|
251
225
|
runsAfter: string[];
|
|
252
226
|
};
|
|
253
227
|
type AddonDefinition<Id extends string = string> = Addon<Record<string, Question<any>>, Id>;
|
|
254
|
-
type Tests = {
|
|
255
|
-
expectProperty: (selector: string, property: string, expectedValue: string) => Promise<void>;
|
|
256
|
-
elementExists: (selector: string) => Promise<void>;
|
|
257
|
-
click: (selector: string, path?: string) => Promise<void>;
|
|
258
|
-
expectUrlPath: (path: string) => void;
|
|
259
|
-
};
|
|
260
|
-
type TestDefinition<Args extends OptionDefinition> = {
|
|
261
|
-
name: string;
|
|
262
|
-
run: (tests: Tests) => Promise<void>;
|
|
263
|
-
condition?: (options: OptionValues<Args>) => boolean;
|
|
264
|
-
};
|
|
265
228
|
type MaybePromise<T> = Promise<T> | T;
|
|
266
|
-
type Verification = {
|
|
267
|
-
name: string;
|
|
268
|
-
run: () => MaybePromise<{
|
|
269
|
-
success: boolean;
|
|
270
|
-
message: string | undefined;
|
|
271
|
-
}>;
|
|
272
|
-
};
|
|
273
229
|
type Prettify<T> = { [K in keyof T]: T[K] } & unknown;
|
|
274
230
|
type OptionBuilder<T extends OptionDefinition> = {
|
|
275
231
|
/**
|
|
@@ -342,8 +298,7 @@ declare function applyAddons({
|
|
|
342
298
|
options
|
|
343
299
|
}: ApplyAddonOptions): Promise<{
|
|
344
300
|
filesToFormat: string[];
|
|
345
|
-
pnpmBuildDependencies: string[];
|
|
346
301
|
status: Record<string, string[] | "success">;
|
|
347
302
|
}>;
|
|
348
303
|
//#endregion
|
|
349
|
-
export {
|
|
304
|
+
export { StringQuestion as A, BooleanQuestion as C, OptionValues as D, OptionDefinition as E, Question as O, BaseQuestion as S, NumberQuestion as T, SvApi as _, Addon as a, Workspace as b, AddonReference as c, ConditionDefinition as d, ConfiguredAddon as f, SetupResult as g, PreparedAddon as h, add as i, officialAddons as j, SelectQuestion as k, AddonResult as l, OptionBuilder as m, InstallOptions as n, AddonDefinition as o, LoadedAddon as p, OptionMap as r, AddonInput as s, AddonMap as t, AddonSource as u, defineAddon as v, MultiSelectQuestion as w, WorkspaceOptions as x, defineAddonOptions as y };
|