@citolab/tspci 2.3.0 → 2.3.2
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/package.json +2 -2
- package/preset/base/package.json +1 -1
- package/src/cli.js +20 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citolab/tspci",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "an opiniated typescript ims-pci builder with tao integration",
|
|
5
5
|
"author": "patrick <patrick.deklein@cito.nl>",
|
|
6
6
|
"repository": "@citolab/tspci",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"help": "tspci --help",
|
|
47
47
|
"init": "tspci init --force --path=../../pcis"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c63a67329ca62048c5b7f003cf918e2c3741b1a3"
|
|
50
50
|
}
|
package/preset/base/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -208,17 +208,17 @@ const run = async () => {
|
|
|
208
208
|
const init = args.indexOf("init") >= 0;
|
|
209
209
|
|
|
210
210
|
if (help) {
|
|
211
|
-
console.log(`•\t${chalk.
|
|
212
|
-
console.log(`•\t${chalk.
|
|
213
|
-
console.log(`•\t${chalk.
|
|
214
|
-
console.log(`•\t${chalk.
|
|
211
|
+
console.log(`•\t${chalk.blueBright("--help -h")} list these commands`);
|
|
212
|
+
console.log(`•\t${chalk.blueBright("--build")} build the project`);
|
|
213
|
+
console.log(`•\t${chalk.blueBright("--watch")} watch the files`);
|
|
214
|
+
console.log(`•\t${chalk.blueBright("--target")} build a prod item and bundle for platform`);
|
|
215
215
|
console.log("\n");
|
|
216
216
|
console.log(
|
|
217
|
-
`${chalk.blueBright("tspci init")} creates a new project \n•\t${chalk.
|
|
217
|
+
`${chalk.blueBright("tspci init")} creates a new project \n•\t${chalk.blueBright(
|
|
218
218
|
"--force"
|
|
219
|
-
)} deletes the directory if it already exists \n•\t${chalk.
|
|
219
|
+
)} deletes the directory if it already exists \n•\t${chalk.blueBright(
|
|
220
220
|
"--no-install"
|
|
221
|
-
)} don't install dependencies \n•\t${chalk.
|
|
221
|
+
)} don't install dependencies \n•\t${chalk.blueBright("--path")} path to create the project in`
|
|
222
222
|
);
|
|
223
223
|
console.log(
|
|
224
224
|
`${chalk.blueBright("tspci add --target")} adds a new target to the project. E.g. tspci add --target=tao`
|
|
@@ -232,7 +232,7 @@ const run = async () => {
|
|
|
232
232
|
console.log(chalk.green(figlet.textSync("@citolab/tspci", { horizontalLayout: "full" })));
|
|
233
233
|
|
|
234
234
|
// prompt for name
|
|
235
|
-
|
|
235
|
+
let pciName = (await askOption("What your pci identifier (typeIdentifier) (default: myPci) ")) || "myPci";
|
|
236
236
|
let destinationFolder = path.join(process.cwd(), pciName);
|
|
237
237
|
if (args.find((arg) => arg.startsWith("--path"))) {
|
|
238
238
|
const pathIndex = args.findIndex((arg) => arg.startsWith("--path"));
|
|
@@ -338,7 +338,7 @@ const run = async () => {
|
|
|
338
338
|
packageJsonContentJson.dependencies = {
|
|
339
339
|
...packageJsonContentJson.dependencies,
|
|
340
340
|
preact: "^10.13.2",
|
|
341
|
-
"@citolab/preact-store": "
|
|
341
|
+
"@citolab/preact-store": "latest",
|
|
342
342
|
};
|
|
343
343
|
packageJsonContentJson = { ...packageJsonContentJson, source: "src/index.tsx" };
|
|
344
344
|
const newPackageJsonContent = JSON.stringify(packageJsonContentJson, null, 2);
|
|
@@ -349,7 +349,11 @@ const run = async () => {
|
|
|
349
349
|
if (args.indexOf("--no-install") === -1) {
|
|
350
350
|
console.log(chalk.green("📦 Installing dependencies"));
|
|
351
351
|
execSync("npm install", { cwd: destinationFolder, stdio: [0, 1, 2] });
|
|
352
|
-
console.log(chalk.green(`📦 Done
|
|
352
|
+
console.log(chalk.green(`📦 Done!`));
|
|
353
|
+
console.log(chalk.blueBright(`Navigate to ${destinationFolder} or open this folder (e.g. with vscode).`));
|
|
354
|
+
console.log(chalk.blueBright(`Start the dev server with: npm run dev`));
|
|
355
|
+
console.log(chalk.blueBright(`Add support for TAO with: npm run tspci -- add --target tao`));
|
|
356
|
+
|
|
353
357
|
return;
|
|
354
358
|
} else {
|
|
355
359
|
console.log(chalk.yellow("Skipping npm install, run npm install in the project folder to install dependencies"));
|
|
@@ -362,7 +366,7 @@ const run = async () => {
|
|
|
362
366
|
console.error("Missing target name. Use tspci add --target target");
|
|
363
367
|
return;
|
|
364
368
|
}
|
|
365
|
-
const version = args.indexOf("--next") ? "next" : "latest";
|
|
369
|
+
const version = args.indexOf("--next") !== -1 ? "next" : "latest";
|
|
366
370
|
const targetname = args[targetIndex + 1];
|
|
367
371
|
const packageFileContent = fs.readFileSync(path.join(PACKAGE_ROOT_PATH, "package.json"), "utf8");
|
|
368
372
|
const packageJson = JSON.parse(packageFileContent);
|
|
@@ -380,12 +384,14 @@ const run = async () => {
|
|
|
380
384
|
init = true;
|
|
381
385
|
console.log(chalk.green(`Running init script for @citolab/tspci-${targetname}`));
|
|
382
386
|
script.init();
|
|
387
|
+
} else {
|
|
388
|
+
if (!init) {
|
|
389
|
+
console.log(chalk.red(`No init script found for @citolab/tspci-${targetname}`));
|
|
390
|
+
}
|
|
383
391
|
}
|
|
384
392
|
});
|
|
385
393
|
}
|
|
386
|
-
|
|
387
|
-
console.log(chalk.green(`No init script found for @citolab/tspci-${targetname}`));
|
|
388
|
-
}
|
|
394
|
+
|
|
389
395
|
};
|
|
390
396
|
|
|
391
397
|
// check if `@citolab/tspci-${targetname}]}` is already in devDependencies
|