sv 0.13.0 → 0.13.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 +1 -2
- package/dist/{engine-M8NNzIgv.d.mts → engine-fG9K-byo.d.mts} +20 -11
- package/dist/{engine-DOKagHfI.mjs → engine-lCnxwqd0.mjs} +5713 -478
- package/dist/shared.json +3 -3
- package/dist/src/index.d.mts +1 -1
- package/dist/src/index.mjs +1 -2
- package/dist/src/testing.d.mts +9 -2
- package/dist/src/testing.mjs +93 -2
- package/dist/templates/addon/assets/src/index.js +35 -35
- package/dist/templates/addon/assets/tests/setup/suite.js +3 -128
- package/dist/templates/addon/assets/tsdown.config.js +6 -0
- package/dist/templates/addon/package.json +16 -8
- package/dist/templates/demo/assets/src/app.html +1 -0
- package/dist/templates/library/assets/src/app.html +1 -0
- package/dist/templates/minimal/assets/src/app.html +1 -0
- package/package.json +2 -2
- package/dist/package-manager-BU-MLhop.mjs +0 -5407
package/dist/bin.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { a as helpConfig, i as forwardExitCode, n as add, o as name, r as create, s as version } from "./engine-DOKagHfI.mjs";
|
|
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-lCnxwqd0.mjs";
|
|
4
3
|
import { color, resolveCommand } from "@sveltejs/sv-utils";
|
|
5
4
|
import process from "node:process";
|
|
6
5
|
import { execSync } from "node:child_process";
|
|
@@ -81,9 +81,10 @@ type Workspace = {
|
|
|
81
81
|
*/
|
|
82
82
|
dependencyVersion: (pkg: string) => string | undefined; /** to know if the workspace is using typescript or javascript */
|
|
83
83
|
language: "ts" | "js";
|
|
84
|
-
|
|
84
|
+
file: {
|
|
85
85
|
viteConfig: "vite.config.js" | "vite.config.ts";
|
|
86
|
-
svelteConfig: "svelte.config.js" | "svelte.config.ts";
|
|
86
|
+
svelteConfig: "svelte.config.js" | "svelte.config.ts";
|
|
87
|
+
typeConfig: "jsconfig.json" | "tsconfig.json" | undefined; /** `${directory.routes}/layout.css` or `src/app.css` */
|
|
87
88
|
stylesheet: `${string}/layout.css` | "src/app.css";
|
|
88
89
|
package: "package.json";
|
|
89
90
|
gitignore: ".gitignore";
|
|
@@ -99,18 +100,21 @@ type Workspace = {
|
|
|
99
100
|
from?: string;
|
|
100
101
|
to: string;
|
|
101
102
|
}) => string;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
};
|
|
104
|
+
isKit: boolean;
|
|
105
|
+
directory: {
|
|
106
|
+
src: string; /** In SvelteKit taking `kit.files.lib` automatically. Falls back to `src/lib` in non-Kit projects */
|
|
107
|
+
lib: string; /** In SvelteKit taking `kit.files.routes` automatically. Falls back to `src/routes` in non-Kit projects */
|
|
108
|
+
kitRoutes: string;
|
|
109
|
+
}; /** The package manager used to install dependencies */
|
|
107
110
|
packageManager: AgentName;
|
|
108
111
|
};
|
|
109
112
|
type CreateWorkspaceOptions = {
|
|
110
113
|
cwd: string;
|
|
111
114
|
packageManager?: AgentName;
|
|
112
115
|
override?: {
|
|
113
|
-
|
|
116
|
+
isKit?: boolean;
|
|
117
|
+
directory?: Workspace["directory"];
|
|
114
118
|
dependencies: Record<string, string>;
|
|
115
119
|
};
|
|
116
120
|
};
|
|
@@ -138,8 +142,13 @@ type SvApi = {
|
|
|
138
142
|
/** Add a package to the pnpm build dependencies. */pnpmBuildDependency: (pkg: string) => void; /** Add a package to the dependencies. */
|
|
139
143
|
dependency: (pkg: string, version: string) => void; /** Add a package to the dev dependencies. */
|
|
140
144
|
devDependency: (pkg: string, version: string) => void; /** Execute a command in the workspace. */
|
|
141
|
-
execute: (args: string[], stdio: "inherit" | "pipe") => Promise<void>;
|
|
142
|
-
|
|
145
|
+
execute: (args: string[], stdio: "inherit" | "pipe") => Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Edit a file in the workspace. (will create it if it doesn't exist)
|
|
148
|
+
*
|
|
149
|
+
* Return `false` from the callback to abort - the original content is returned unchanged.
|
|
150
|
+
*/
|
|
151
|
+
file: (path: string, edit: (content: string) => string | false) => void;
|
|
143
152
|
};
|
|
144
153
|
type Addon<Args extends OptionDefinition, Id extends string = string> = {
|
|
145
154
|
id: Id;
|
|
@@ -153,7 +162,7 @@ type Addon<Args extends OptionDefinition, Id extends string = string> = {
|
|
|
153
162
|
/** Why is this addon not supported?
|
|
154
163
|
*
|
|
155
164
|
* @example
|
|
156
|
-
* if (!
|
|
165
|
+
* if (!isKit) unsupported('Requires SvelteKit');
|
|
157
166
|
*/
|
|
158
167
|
unsupported: (reason: string) => void; /** On what official addons does this addon run after? */
|
|
159
168
|
runsAfter: (name: keyof typeof officialAddons) => void;
|