@typix-editor/cli 3.0.0 → 3.0.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.
- package/dist/index.js +6 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -124,7 +124,7 @@ import { fileURLToPath } from "url";
|
|
|
124
124
|
var __filename = fileURLToPath(import.meta.url);
|
|
125
125
|
var __dirname = path2.dirname(__filename);
|
|
126
126
|
function getTemplatesDir() {
|
|
127
|
-
return path2.resolve(__dirname, "
|
|
127
|
+
return path2.resolve(__dirname, "templates");
|
|
128
128
|
}
|
|
129
129
|
async function writeComponent(entry, config) {
|
|
130
130
|
const templatesDir = getTemplatesDir();
|
|
@@ -165,9 +165,7 @@ async function addCommand(components, options) {
|
|
|
165
165
|
} else {
|
|
166
166
|
if (components.length === 0) {
|
|
167
167
|
logger.error("Please specify a component name or use --all.");
|
|
168
|
-
logger.info(
|
|
169
|
-
"Available: " + getComponentNames().join(", ")
|
|
170
|
-
);
|
|
168
|
+
logger.info("Available: " + getComponentNames().join(", "));
|
|
171
169
|
process.exit(1);
|
|
172
170
|
}
|
|
173
171
|
entries = [];
|
|
@@ -197,9 +195,7 @@ async function addCommand(components, options) {
|
|
|
197
195
|
if (deps.length > 0) {
|
|
198
196
|
logger.break();
|
|
199
197
|
logger.info("Install required dependencies:");
|
|
200
|
-
console.log(
|
|
201
|
-
chalk2.cyan(` pnpm add ${deps.join(" ")}`)
|
|
202
|
-
);
|
|
198
|
+
console.log(chalk2.cyan(` pnpm add ${deps.join(" ")}`));
|
|
203
199
|
}
|
|
204
200
|
}
|
|
205
201
|
|
|
@@ -211,9 +207,7 @@ async function listCommand() {
|
|
|
211
207
|
console.log(chalk3.bold("Available components:"));
|
|
212
208
|
logger.break();
|
|
213
209
|
const nameWidth = 20;
|
|
214
|
-
const header = chalk3.gray(
|
|
215
|
-
" " + "Name".padEnd(nameWidth) + "Description"
|
|
216
|
-
);
|
|
210
|
+
const header = chalk3.gray(" " + "Name".padEnd(nameWidth) + "Description");
|
|
217
211
|
console.log(header);
|
|
218
212
|
console.log(chalk3.gray(" " + "\u2500".repeat(55)));
|
|
219
213
|
for (const component of components) {
|
|
@@ -221,12 +215,8 @@ async function listCommand() {
|
|
|
221
215
|
console.log(` ${name}${component.description}`);
|
|
222
216
|
}
|
|
223
217
|
logger.break();
|
|
224
|
-
logger.info(
|
|
225
|
-
|
|
226
|
-
);
|
|
227
|
-
logger.info(
|
|
228
|
-
`Add all components: ${chalk3.cyan("typix add --all")}`
|
|
229
|
-
);
|
|
218
|
+
logger.info(`Add a component: ${chalk3.cyan("typix add <component>")}`);
|
|
219
|
+
logger.info(`Add all components: ${chalk3.cyan("typix add --all")}`);
|
|
230
220
|
}
|
|
231
221
|
|
|
232
222
|
// src/index.ts
|
package/package.json
CHANGED