@srcroot/ui 0.0.23 → 0.0.25

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/index.js +12 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1021,18 +1021,6 @@ async function add(components, options) {
1021
1021
  });
1022
1022
  }
1023
1023
  console.log();
1024
- if (!options.yes) {
1025
- const response = await prompts2({
1026
- type: "confirm",
1027
- name: "proceed",
1028
- message: "Continue?",
1029
- initial: true
1030
- });
1031
- if (!response.proceed) {
1032
- console.log(chalk2.yellow("Cancelled."));
1033
- process.exit(0);
1034
- }
1035
- }
1036
1024
  const spinner = ora2("Adding components...").start();
1037
1025
  const hasSrc = fs2.existsSync(path2.join(cwd, "src"));
1038
1026
  const srcPath = hasSrc ? path2.join(cwd, "src") : cwd;
@@ -1043,10 +1031,19 @@ async function add(components, options) {
1043
1031
  const comp = REGISTRY[name];
1044
1032
  const targetPath = path2.join(componentsDir, comp.file);
1045
1033
  if (fs2.existsSync(targetPath) && !options.overwrite) {
1046
- if (componentsToAdd.length <= 10) {
1047
- spinner.info(`${chalk2.cyan(comp.file)} already exists, skipping`);
1034
+ spinner.stop();
1035
+ const { overwrite } = await prompts2({
1036
+ type: "confirm",
1037
+ name: "overwrite",
1038
+ message: `${chalk2.cyan(comp.file)} already exists. Overwrite?`,
1039
+ initial: false
1040
+ });
1041
+ if (!overwrite) {
1042
+ spinner.info(`Skipped ${chalk2.cyan(comp.file)}`);
1043
+ spinner.start("Adding components...");
1044
+ continue;
1048
1045
  }
1049
- continue;
1046
+ spinner.start("Adding components...");
1050
1047
  }
1051
1048
  const registryPath = path2.resolve(__dirname3, "..", "registry", comp.file);
1052
1049
  if (!fs2.existsSync(registryPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srcroot/ui",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "A shadcn-style CLI UI library with polymorphic, accessible React components",
5
5
  "type": "module",
6
6
  "bin": {