@citolab/tspci 2.3.1 → 2.3.3

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/package.json +2 -2
  2. package/src/cli.js +17 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citolab/tspci",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
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": "32377e27a791cc3198b1fdf35b9680b35c5814f0"
49
+ "gitHead": "270e2fcc7145d6a972812c9392c1366116569e3c"
50
50
  }
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.blue("--help -h")} list these commands`);
212
- console.log(`•\t${chalk.blue("--build")} build the project`);
213
- console.log(`•\t${chalk.blue("--watch")} watch the files`);
214
- console.log(`•\t${chalk.blue("--target")} build a prod item and bundle for platform`);
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.blue(
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.blue(
219
+ )} deletes the directory if it already exists \n•\t${chalk.blueBright(
220
220
  "--no-install"
221
- )} don't install dependencies \n•\t${chalk.blue("--path")} path to create the project in`
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
- const pciName = (await askOption("What your pci identifier (typeIdentifier) (default: myPci) ")) || "myPci";
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"));
@@ -350,9 +350,9 @@ const run = async () => {
350
350
  console.log(chalk.green("📦 Installing dependencies"));
351
351
  execSync("npm install", { cwd: destinationFolder, stdio: [0, 1, 2] });
352
352
  console.log(chalk.green(`📦 Done!`));
353
- console.log(chalk.blue(`Navigate to ${destinationFolder} or open this folder (e.g. with vscode).`));
354
- console.log(chalk.blue(`Start the dev server with: npm run dev`));
355
- console.log(chalk.blue(`Add support for TAO with: npm run tspci -- add --target tao`));
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
356
 
357
357
  return;
358
358
  } else {
@@ -366,7 +366,7 @@ const run = async () => {
366
366
  console.error("Missing target name. Use tspci add --target target");
367
367
  return;
368
368
  }
369
- const version = args.indexOf("--next") ? "next" : "latest";
369
+ const version = args.indexOf("--next") !== -1 ? "next" : "latest";
370
370
  const targetname = args[targetIndex + 1];
371
371
  const packageFileContent = fs.readFileSync(path.join(PACKAGE_ROOT_PATH, "package.json"), "utf8");
372
372
  const packageJson = JSON.parse(packageFileContent);
@@ -384,12 +384,14 @@ const run = async () => {
384
384
  init = true;
385
385
  console.log(chalk.green(`Running init script for @citolab/tspci-${targetname}`));
386
386
  script.init();
387
+ } else {
388
+ if (!init) {
389
+ console.log(chalk.red(`No init script found for @citolab/tspci-${targetname}`));
390
+ }
387
391
  }
388
392
  });
389
393
  }
390
- if (!init) {
391
- console.log(chalk.green(`No init script found for @citolab/tspci-${targetname}`));
392
- }
394
+
393
395
  };
394
396
 
395
397
  // check if `@citolab/tspci-${targetname}]}` is already in devDependencies