sv 0.14.1 → 0.15.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 detectPackageManager, c as name, h as program, l as version, m as Command, n as add, o as forwardExitCode, p as from, r as create, s as helpConfig } from "./engine-CK31LRlH.mjs";
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-Cq2kv_P1.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
- /** Add a package to the pnpm onlyBuiltDependencies. */pnpmBuildDependency: (pkg: string) => void; /** Add a package to the dependencies. */
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 { BooleanQuestion as A, defineAddon as C, WorkspaceOptions as D, Workspace as E, Question as F, SelectQuestion as I, StringQuestion as L, NumberQuestion as M, OptionDefinition as N, createWorkspace as O, OptionValues as P, officialAddons as R, Verification as S, getErrorHint as T, Scripts as _, Addon as a, TestDefinition as b, AddonReference as c, ConditionDefinition as d, ConfiguredAddon as f, PreparedAddon as g, PackageDefinition as h, add as i, MultiSelectQuestion as j, BaseQuestion 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, SetupResult as v, defineAddonOptions as w, Tests as x, SvApi as y };
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 };