sv 0.11.0 → 0.11.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,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { i as __toESM } from "./chunk-BjMGrMj9.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { E as templates, O as dist, S as resolveCommand, T as create$1, a as installOption, b as from, c as Option, f as formatFiles, i as installDependencies, k as getSharedFiles, l as program, m as getPackageJson, n as addPnpmBuildDependencies, o as packageManagerPrompt, p as getHighlighter, r as getUserAgent, s as Command, t as AGENT_NAMES, u as commonFilePaths, x as detect, y as up$1 } from "./package-manager-DIyCRHTJ.mjs";
|
|
4
4
|
import { $ as Fe, F as create$2, I as overrideProperties, O as addDefault, Q as De, X as walk, a as toFragment, at as We, ct as ke, dt as require_picocolors, et as Ge, g as parseSvelte, h as parseScript, it as Ue, lt as ze, m as parseJson, nt as Ke, o as isVersionUnsupportedBelow, r as ensureScript, rt as T, st as et, tt as J, ut as Vu, w as createDefault } from "./core-D6dTS6c8.mjs";
|
|
5
|
-
import { a as setupAddons, n as officialAddons, o as createWorkspace, r as applyAddons, t as getAddonDetails } from "./official-
|
|
5
|
+
import { a as setupAddons, n as officialAddons, o as createWorkspace, r as applyAddons, t as getAddonDetails } from "./official-D8xLy36N.mjs";
|
|
6
6
|
import fs, { existsSync } from "node:fs";
|
|
7
7
|
import path, { dirname, join } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
@@ -14,7 +14,7 @@ import { pipeline } from "node:stream/promises";
|
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
16
|
var name = "sv";
|
|
17
|
-
var version = "0.11.
|
|
17
|
+
var version = "0.11.1";
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region lib/addons/_config/community.ts
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as create } from "../package-manager-
|
|
1
|
+
import { T as create } from "../package-manager-DIyCRHTJ.mjs";
|
|
2
2
|
import "../core-D6dTS6c8.mjs";
|
|
3
|
-
import { i as installAddon, n as officialAddons } from "../official-
|
|
3
|
+
import { i as installAddon, n as officialAddons } from "../official-D8xLy36N.mjs";
|
|
4
4
|
|
|
5
5
|
export { create, installAddon, officialAddons };
|
package/dist/lib/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "../chunk-BjMGrMj9.mjs";
|
|
2
|
-
import { C as K, T as create, n as addPnpmBuildDependencies, w as q } from "../package-manager-
|
|
2
|
+
import { C as K, T as create, n as addPnpmBuildDependencies, w as q } from "../package-manager-DIyCRHTJ.mjs";
|
|
3
3
|
import "../core-D6dTS6c8.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM } from "./chunk-BjMGrMj9.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { D as sanitizeName, S as resolveCommand, _ as writeFile, d as fileExists, g as readFile, h as installPackages, k as getSharedFiles, m as getPackageJson, p as getHighlighter, r as getUserAgent, u as commonFilePaths, v as any, w as q, x as detect } from "./package-manager-DIyCRHTJ.mjs";
|
|
3
3
|
import { A as addNamed, B as addJsDocTypeComment, C as addHooksHandle, D as declaration, E as createIdentifier, F as create, G as hasTypeProperty, H as contains, I as overrideProperties, J as dedent_default, K as parseExpression, L as property, M as find, N as remove, O as addDefault, P as createCall, R as append, S as addGlobalAppInterface, T as createNamed, U as createLiteral, V as appendStatement, W as createSpread, X as walk, Y as MagicString, _ as parseToml, a as toFragment, b as addPlugin, c as createPrinter, d as defineAddonOptions, dt as require_picocolors, f as parseCss, g as parseSvelte, h as parseScript, j as addNamespace, k as addEmpty, m as parseJson, n as addSlot, p as parseHtml, q as parseStatement, r as ensureScript, rt as T, t as import_picocolors$1, u as defineAddon, w as createDefault, x as getConfig, z as create$1 } from "./core-D6dTS6c8.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -2199,7 +2199,7 @@ var sveltekit_adapter_default = defineAddon({
|
|
|
2199
2199
|
sv.file(`wrangler.${configFormat}`, (content) => {
|
|
2200
2200
|
const { data, generateCode } = configFormat === "jsonc" ? parseJson(content) : parseToml(content);
|
|
2201
2201
|
if (configFormat === "jsonc") data.$schema ??= "./node_modules/wrangler/config-schema.json";
|
|
2202
|
-
if (!data.name) data.name = parseJson(readFile(cwd$1, files.package)).data.name;
|
|
2202
|
+
if (!data.name) data.name = sanitizeName(parseJson(readFile(cwd$1, files.package)).data.name, "wrangler");
|
|
2203
2203
|
data.compatibility_date ??= (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
2204
2204
|
data.compatibility_flags ??= [];
|
|
2205
2205
|
if (!data.compatibility_flags.includes("nodejs_compat") && !data.compatibility_flags.includes("nodejs_als")) data.compatibility_flags.push("nodejs_als");
|
|
@@ -44,6 +44,26 @@ function getSharedFiles() {
|
|
|
44
44
|
return files;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region lib/core/sanitize.ts
|
|
49
|
+
/**
|
|
50
|
+
* @param name - The name to sanitize.
|
|
51
|
+
* @param style - The sanitization style.
|
|
52
|
+
* - `package` for package.json
|
|
53
|
+
* - `wrangler` for Cloudflare Wrangler compatibility
|
|
54
|
+
* @returns The sanitized name.
|
|
55
|
+
*/
|
|
56
|
+
function sanitizeName(name, style) {
|
|
57
|
+
let sanitized = name.trim().toLowerCase().replace(/\s+/g, "-");
|
|
58
|
+
if (style === "package") {
|
|
59
|
+
const hasLeadingAt = sanitized.startsWith("@");
|
|
60
|
+
sanitized = sanitized.replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9~./-]+/g, "-");
|
|
61
|
+
if (hasLeadingAt) sanitized = "@" + sanitized.slice(1);
|
|
62
|
+
} else if (style === "wrangler") sanitized = sanitized.replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").slice(0, 63).replace(/^-|-$/g, "");
|
|
63
|
+
else throw new Error(`Invalid kind: ${style}`);
|
|
64
|
+
return sanitized || "undefined-sv-name";
|
|
65
|
+
}
|
|
66
|
+
|
|
47
67
|
//#endregion
|
|
48
68
|
//#region lib/create/index.ts
|
|
49
69
|
const templateTypes = [
|
|
@@ -97,7 +117,7 @@ function write_common_files(cwd$1, options, name) {
|
|
|
97
117
|
});
|
|
98
118
|
pkg.dependencies = sort_keys(pkg.dependencies);
|
|
99
119
|
pkg.devDependencies = sort_keys(pkg.devDependencies);
|
|
100
|
-
pkg.name =
|
|
120
|
+
pkg.name = sanitizeName(name, "package");
|
|
101
121
|
fs.writeFileSync(pkg_file, JSON.stringify(pkg, null, " ") + "\n");
|
|
102
122
|
}
|
|
103
123
|
function matches_condition(condition, options) {
|
|
@@ -133,9 +153,6 @@ function sort_files(files) {
|
|
|
133
153
|
return f1_more_generic && f2_more_generic || !f1_more_generic && !f2_more_generic ? 0 : f1_more_generic ? -1 : 1;
|
|
134
154
|
});
|
|
135
155
|
}
|
|
136
|
-
function to_valid_package_name(name) {
|
|
137
|
-
return name.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9~.-]+/g, "-");
|
|
138
|
-
}
|
|
139
156
|
|
|
140
157
|
//#endregion
|
|
141
158
|
//#region ../../node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.js
|
|
@@ -4617,4 +4634,4 @@ async function getPnpmVersion() {
|
|
|
4617
4634
|
}
|
|
4618
4635
|
|
|
4619
4636
|
//#endregion
|
|
4620
|
-
export { K as C,
|
|
4637
|
+
export { K as C, sanitizeName as D, templates as E, dist as O, resolveCommand as S, create as T, writeFile as _, installOption as a, from as b, Option as c, fileExists as d, formatFiles as f, readFile as g, installPackages as h, installDependencies as i, getSharedFiles as k, program as l, getPackageJson as m, addPnpmBuildDependencies as n, packageManagerPrompt as o, getHighlighter as p, getUserAgent as r, Command as s, AGENT_NAMES as t, commonFilePaths as u, any as v, q as w, detect as x, up as y };
|