shadcn-svelte 0.4.2 → 0.5.0

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/index.js CHANGED
@@ -6737,9 +6737,16 @@ var update = new Command3().command("update").description("update components in
6737
6737
  const component = registryIndex.find(
6738
6738
  (comp) => comp.name === file.name
6739
6739
  );
6740
- component && existingComponents.push(component);
6740
+ if (component) {
6741
+ existingComponents.push(component);
6742
+ }
6741
6743
  }
6742
6744
  }
6745
+ existingComponents.push({
6746
+ name: "utils",
6747
+ type: "components:ui",
6748
+ files: []
6749
+ });
6743
6750
  let selectedComponents = options.all ? existingComponents : [];
6744
6751
  if (!selectedComponents.length && components !== void 0) {
6745
6752
  selectedComponents = existingComponents.filter(
@@ -6759,19 +6766,32 @@ var update = new Command3().command("update").description("update components in
6759
6766
  "Which component(s) would you like to update?"
6760
6767
  );
6761
6768
  }
6769
+ const spinner = ora3(
6770
+ `Updating ${selectedComponents.length} component(s) and dependencies...`
6771
+ ).start();
6762
6772
  if (selectedComponents.length === 0) {
6763
- logger.info("No components selected. Nothing to update.");
6773
+ spinner.info("No components selected. Nothing to update.");
6764
6774
  process.exitCode = 0;
6765
6775
  return;
6766
6776
  }
6777
+ if (selectedComponents.find((item2) => item2.name === "utils")) {
6778
+ const utilsPath = config.resolvedPaths.utils + ".ts";
6779
+ if (!existsSync5(utilsPath)) {
6780
+ spinner.fail(
6781
+ `utils at ${logger.highlight(
6782
+ utilsPath
6783
+ )} does not exist.`
6784
+ );
6785
+ process.exitCode = 1;
6786
+ return;
6787
+ }
6788
+ await fs4.writeFile(utilsPath, UTILS);
6789
+ }
6767
6790
  const tree = await resolveTree(
6768
6791
  registryIndex,
6769
6792
  selectedComponents.map((com) => com.name)
6770
6793
  );
6771
6794
  const payload = await fetchTree(config.style, tree);
6772
- const spinner = ora3(
6773
- `Updating ${selectedComponents.length} component(s) and dependencies...`
6774
- ).start();
6775
6795
  for (const item2 of payload) {
6776
6796
  spinner.text = `Updating ${item2.name}...`;
6777
6797
  const targetDir = await getItemTargetPath(config, item2);