@srcroot/ui 0.0.22 → 0.0.24
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 +5 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -969,6 +969,7 @@ async function add(components, options) {
|
|
|
969
969
|
name: "items",
|
|
970
970
|
message: "Which components would you like to add?",
|
|
971
971
|
hint: "Space to select. A to toggle all. Enter to submit.",
|
|
972
|
+
instructions: false,
|
|
972
973
|
choices: Object.keys(REGISTRY).map((name) => ({
|
|
973
974
|
title: name,
|
|
974
975
|
value: name
|
|
@@ -1020,18 +1021,6 @@ async function add(components, options) {
|
|
|
1020
1021
|
});
|
|
1021
1022
|
}
|
|
1022
1023
|
console.log();
|
|
1023
|
-
if (!options.yes) {
|
|
1024
|
-
const response = await prompts2({
|
|
1025
|
-
type: "confirm",
|
|
1026
|
-
name: "proceed",
|
|
1027
|
-
message: "Continue?",
|
|
1028
|
-
initial: true
|
|
1029
|
-
});
|
|
1030
|
-
if (!response.proceed) {
|
|
1031
|
-
console.log(chalk2.yellow("Cancelled."));
|
|
1032
|
-
process.exit(0);
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
1024
|
const spinner = ora2("Adding components...").start();
|
|
1036
1025
|
const hasSrc = fs2.existsSync(path2.join(cwd, "src"));
|
|
1037
1026
|
const srcPath = hasSrc ? path2.join(cwd, "src") : cwd;
|
|
@@ -1055,11 +1044,14 @@ async function add(components, options) {
|
|
|
1055
1044
|
const content = await fs2.readFile(registryPath, "utf-8");
|
|
1056
1045
|
await fs2.writeFile(targetPath, content);
|
|
1057
1046
|
if (componentsToAdd.length > 10) {
|
|
1058
|
-
spinner.text = `
|
|
1047
|
+
spinner.text = `Adding ${chalk2.cyan(comp.file)}...`;
|
|
1059
1048
|
} else {
|
|
1060
1049
|
spinner.succeed(`Added ${chalk2.cyan(comp.file)}`);
|
|
1061
1050
|
}
|
|
1062
1051
|
}
|
|
1052
|
+
if (componentsToAdd.length > 10) {
|
|
1053
|
+
spinner.succeed(`Added ${componentsToAdd.length} components`);
|
|
1054
|
+
}
|
|
1063
1055
|
console.log(chalk2.green("\n\u2705 Components added successfully!\n"));
|
|
1064
1056
|
} catch (error) {
|
|
1065
1057
|
spinner.fail("Failed to add components");
|