sv 0.10.0 → 0.10.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.
Files changed (2) hide show
  1. package/dist/bin.js +15 -17
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -12,7 +12,7 @@ import { pipeline } from "node:stream/promises";
12
12
 
13
13
  //#region package.json
14
14
  var name = "sv";
15
- var version = "0.10.0";
15
+ var version = "0.10.1";
16
16
 
17
17
  //#endregion
18
18
  //#region ../../node_modules/.pnpm/empathic@1.1.0/node_modules/empathic/package.mjs
@@ -532,15 +532,16 @@ function parseAddonOptions(optionFlags) {
532
532
  }
533
533
  return options$1;
534
534
  }
535
- function logArgs(agent, actionName, args) {
536
- const defaultArgs = [
535
+ function logArgs(agent, command, args, lastArgs = []) {
536
+ const allArgs = [
537
537
  "sv",
538
- actionName,
538
+ command,
539
539
  ...args
540
540
  ];
541
- const res = resolveCommand(agent, "execute", defaultArgs);
542
- if (res) T.message(import_picocolors$3.default.dim([res.command, ...res.args].join(" ")));
543
- else T.message(import_picocolors$3.default.dim([`npx`, ...defaultArgs].join(" ")));
541
+ if (agent === null || agent === void 0) allArgs.push("--no-install");
542
+ else allArgs.push("--install", agent);
543
+ const res = resolveCommand(agent ?? "npm", "execute", [...allArgs, ...lastArgs]);
544
+ T.message(import_picocolors$3.default.dim([res.command, ...res.args].join(" ")));
544
545
  }
545
546
  function errorAndExit(message) {
546
547
  T.error(message);
@@ -768,7 +769,7 @@ const add = new Command("add").description("applies specified add-ons into a pro
768
769
  options: options$1,
769
770
  selectedAddons,
770
771
  workspace,
771
- withLogArgs: true
772
+ fromCommand: "add"
772
773
  });
773
774
  if (nextSteps.length > 0) Ke(nextSteps.join("\n"), "Next steps", { format: (line) => line });
774
775
  });
@@ -979,7 +980,7 @@ async function promptAddonQuestions({ options: options$1, selectedAddonIds, work
979
980
  answersCommunity
980
981
  };
981
982
  }
982
- async function runAddonsApply({ answersOfficial, answersCommunity, options: options$1, selectedAddons, addonSetupResults, workspace, withLogArgs }) {
983
+ async function runAddonsApply({ answersOfficial, answersCommunity, options: options$1, selectedAddons, addonSetupResults, workspace, fromCommand }) {
983
984
  if (!addonSetupResults) addonSetupResults = setupAddons(selectedAddons.length ? selectedAddons.map(({ addon }) => addon) : officialAddons$1, workspace);
984
985
  if (selectedAddons.length === 0) return {
985
986
  nextSteps: [],
@@ -1033,9 +1034,7 @@ async function runAddonsApply({ answersOfficial, answersCommunity, options: opti
1033
1034
  if (optionParts.length > 0) argsFormattedAddons.push(`${addonId}="${optionParts.join("+")}"`);
1034
1035
  else argsFormattedAddons.push(addonId);
1035
1036
  }
1036
- if (packageManager === null || packageManager === void 0) argsFormattedAddons.push("--no-install");
1037
- else argsFormattedAddons.push("--install", packageManager);
1038
- if (withLogArgs) logArgs(packageManager ?? "npm", "add", argsFormattedAddons);
1037
+ if (fromCommand === "add") logArgs(packageManager, "add", argsFormattedAddons);
1039
1038
  if (packageManager) {
1040
1039
  workspace.packageManager = packageManager;
1041
1040
  await installDependencies(packageManager, options$1.cwd);
@@ -1566,21 +1565,20 @@ async function createProject(cwd, options$1) {
1566
1565
  },
1567
1566
  selectedAddons,
1568
1567
  addonSetupResults: void 0,
1569
- workspace
1568
+ workspace,
1569
+ fromCommand: "create"
1570
1570
  });
1571
1571
  argsFormattedAddons = argsFormatted$1;
1572
1572
  addOnNextSteps = nextSteps;
1573
1573
  }
1574
1574
  const packageManager = options$1.install === false ? null : options$1.install === true ? await packageManagerPrompt(projectPath) : options$1.install;
1575
- const argsFormatted = [cwd ?? defaultPath];
1575
+ const argsFormatted = [];
1576
1576
  argsFormatted.push("--template", template);
1577
1577
  if (language === "typescript") argsFormatted.push("--types", "ts");
1578
1578
  else if (language === "checkjs") argsFormatted.push("--types", "jsdoc");
1579
1579
  else if (language === "none") argsFormatted.push("--no-types");
1580
1580
  if (argsFormattedAddons.length > 0) argsFormatted.push("--add", ...argsFormattedAddons);
1581
- if (packageManager === null || packageManager === void 0) argsFormatted.push("--no-install");
1582
- else argsFormatted.push("--install", packageManager);
1583
- logArgs(packageManager ?? "npm", "create", argsFormatted);
1581
+ logArgs(packageManager, "create", argsFormatted, [cwd ?? defaultPath]);
1584
1582
  await addPnpmBuildDependencies(projectPath, packageManager, ["esbuild"]);
1585
1583
  if (packageManager) await installDependencies(packageManager, projectPath);
1586
1584
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sv",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "description": "A CLI for creating and updating SvelteKit projects",
6
6
  "license": "MIT",