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 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 addPnpmBuildDependencies, c as installOption, et as __toESM, f as detect, g as parseJson, i as AGENT_NAMES, l as packageManagerPrompt, n as templates, o as getUserAgent, p as resolveCommand, q as from, r as dist, s as installDependencies, t as create$1, v as parseSvelte, z as Ue } from "./create-Bt2-1pFJ.js";
3
- import { a as formatFiles, c as getCommunityAddon, d as createDefault, f as addDefault, i as createWorkspace, l as getAddonDetails, m as overrideProperties, o as getHighlighter, p as create$2, r as setupAddons, s as communityAddonIds, t as applyAddons, u as officialAddons } from "./install-b9th3u8C.js";
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.13";
15
+ var version = "0.9.15";
16
16
 
17
17
  //#endregion
18
- //#region ../../node_modules/.pnpm/valibot@0.41.0_typescript@5.8.3/node_modules/valibot/dist/index.js
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 shared = dist("shared.json");
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 (fs.existsSync(directory$1) && fs.readdirSync(directory$1).filter((x) => !x.startsWith(".git")).length > 0) {
1386
- const force = await ke({
1387
- message: "Directory not empty. Continue?",
1388
- initialValue: false
1389
- });
1390
- if (Vu(force) || !force) {
1391
- De("Exiting.");
1392
- process.exit(0);
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: () => {