sv 0.9.13 → 0.9.15
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.js +18 -18
- package/dist/{create-Bt2-1pFJ.js → create-BOEKhcVU.js} +268 -279
- package/dist/{install-b9th3u8C.js → install-BoYywMIH.js} +243 -163
- package/dist/lib/index.d.ts +121 -8
- package/dist/lib/index.js +2 -2
- package/dist/lib/testing.js +1 -1
- package/dist/shared.json +12 -4
- package/dist/templates/demo/files.types=checkjs.json +4 -4
- package/dist/templates/demo/files.types=none.json +4 -4
- package/dist/templates/demo/files.types=typescript.json +4 -4
- package/dist/templates/demo/package.json +3 -3
- package/dist/templates/library/package.json +5 -5
- package/dist/templates/minimal/package.json +3 -3
- package/package.json +3 -3
- /package/dist/templates/demo/assets/src/{app.css → routes/layout.css} +0 -0
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as We, F as Ge, H as ke, I as J, J as require_picocolors, K as up$1, L as Ke, N as De, O as isVersionUnsupportedBelow, P as Fe, R as T, U as ze, V as et, W as Vu, X as Option, Y as Command, Z as program, _ as parseScript, a as
|
|
3
|
-
import { a as
|
|
2
|
+
import { B as We, F as Ge, H as ke, I as J, J as require_picocolors, K as up$1, L as Ke, N as De, O as isVersionUnsupportedBelow, P as Fe, R as T, U as ze, V as et, W as Vu, X as Option, Y as Command, Z as program, _ as parseScript, a as getUserAgent, c as packageManagerPrompt, et as __toESM, f as getSharedFiles, g as parseJson, i as addPnpmBuildDependencies, l as detect, n as templates, o as installDependencies, p as resolveCommand, q as from, r as AGENT_NAMES, s as installOption, t as create$1, v as parseSvelte, z as Ue } from "./create-BOEKhcVU.js";
|
|
3
|
+
import { a as communityAddonIds, c as officialAddons, d as createDefault, f as addDefault, i as createWorkspace, l as formatFiles, m as overrideProperties, o as getCommunityAddon, p as create$2, r as setupAddons, s as getAddonDetails, t as applyAddons, u as getHighlighter } from "./install-BoYywMIH.js";
|
|
4
4
|
import { exec, execSync } from "node:child_process";
|
|
5
5
|
import path, { dirname, join } from "node:path";
|
|
6
6
|
import fs, { existsSync } from "node:fs";
|
|
@@ -12,10 +12,10 @@ import { pipeline } from "node:stream/promises";
|
|
|
12
12
|
|
|
13
13
|
//#region package.json
|
|
14
14
|
var name = "sv";
|
|
15
|
-
var version = "0.9.
|
|
15
|
+
var version = "0.9.15";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region ../../node_modules/.pnpm/valibot@0.41.0_typescript@5.
|
|
18
|
+
//#region ../../node_modules/.pnpm/valibot@0.41.0_typescript@5.9.3/node_modules/valibot/dist/index.js
|
|
19
19
|
var import_picocolors$3 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
20
20
|
var store;
|
|
21
21
|
function getGlobalConfig(config2) {
|
|
@@ -1245,9 +1245,7 @@ function setupPlaygroundProject(url, playground, cwd, installDependencies$1, typ
|
|
|
1245
1245
|
fs.writeFileSync(filePath$1, file.content, "utf8");
|
|
1246
1246
|
}
|
|
1247
1247
|
{
|
|
1248
|
-
const
|
|
1249
|
-
const { files } = JSON.parse(fs.readFileSync(shared, "utf-8"));
|
|
1250
|
-
const playgroundFiles = files.filter((file) => file.include.includes("playground"));
|
|
1248
|
+
const playgroundFiles = getSharedFiles().filter((file) => file.include.includes("playground"));
|
|
1251
1249
|
for (const file of playgroundFiles) {
|
|
1252
1250
|
let contentToWrite = file.contents;
|
|
1253
1251
|
if (file.name === "src/lib/PlaygroundLayout.svelte") {
|
|
@@ -1326,9 +1324,10 @@ const OptionsSchema = strictObject({
|
|
|
1326
1324
|
addOns: boolean(),
|
|
1327
1325
|
install: union([boolean(), picklist(AGENT_NAMES)]),
|
|
1328
1326
|
template: optional(picklist(templateChoices)),
|
|
1329
|
-
fromPlayground: optional(string())
|
|
1327
|
+
fromPlayground: optional(string()),
|
|
1328
|
+
dirCheck: boolean()
|
|
1330
1329
|
});
|
|
1331
|
-
const create = new Command("create").description("scaffolds a new SvelteKit project").argument("[path]", "where the project will be created").addOption(templateOption).addOption(langOption).option("--no-types").option("--no-add-ons", "skips interactive add-on installer").option("--no-install", "skip installing dependencies").option("--from-playground <url>", "create a project from the svelte playground").addOption(installOption).configureHelp(helpConfig).action((projectPath, opts) => {
|
|
1330
|
+
const create = new Command("create").description("scaffolds a new SvelteKit project").argument("[path]", "where the project will be created").addOption(templateOption).addOption(langOption).option("--no-types").option("--no-add-ons", "skips interactive add-on installer").option("--no-install", "skip installing dependencies").option("--from-playground <url>", "create a project from the svelte playground").option("--no-dir-check", "even if the folder is not empty, no prompt will be shown").addOption(installOption).configureHelp(helpConfig).action((projectPath, opts) => {
|
|
1332
1331
|
const cwd = parse(ProjectPathSchema, projectPath);
|
|
1333
1332
|
const options$1 = parse(OptionsSchema, opts);
|
|
1334
1333
|
if (options$1.fromPlayground && !validatePlaygroundUrl(options$1.fromPlayground)) {
|
|
@@ -1382,15 +1381,16 @@ async function createProject(cwd, options$1) {
|
|
|
1382
1381
|
});
|
|
1383
1382
|
},
|
|
1384
1383
|
force: async ({ results: { directory: directory$1 } }) => {
|
|
1385
|
-
if (
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1384
|
+
if (!options$1.dirCheck) return;
|
|
1385
|
+
if (!fs.existsSync(directory$1)) return;
|
|
1386
|
+
if (!fs.readdirSync(directory$1).some((file) => !file.startsWith(".git"))) return;
|
|
1387
|
+
const force = await ke({
|
|
1388
|
+
message: "Directory not empty. Continue?",
|
|
1389
|
+
initialValue: false
|
|
1390
|
+
});
|
|
1391
|
+
if (Vu(force) || !force) {
|
|
1392
|
+
De("Exiting.");
|
|
1393
|
+
process.exit(0);
|
|
1394
1394
|
}
|
|
1395
1395
|
},
|
|
1396
1396
|
template: () => {
|