@squiz/dxp-cli-next 5.4.0-develop.1 → 5.4.0-develop.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.
Files changed (2) hide show
  1. package/lib/cmp/init.js +6 -1
  2. package/package.json +2 -2
package/lib/cmp/init.js CHANGED
@@ -24,6 +24,7 @@ var componentTypes;
24
24
  const initCommand = new commander_1.Command()
25
25
  .name('init')
26
26
  .argument('<path>', 'Destination directory for component')
27
+ .description('Create a new component from a template')
27
28
  .addOption(new commander_1.Option('-t, --type <string>', 'Type of component to create.')
28
29
  .choices(['basic', 'advanced'])
29
30
  .default('basic'))
@@ -33,10 +34,14 @@ const initCommand = new commander_1.Command()
33
34
  initCommand.error(cli_color_1.default.red('Invalid component type. Must be one of: basic, advanced'));
34
35
  return;
35
36
  }
37
+ if (install && componentType === 'basic') {
38
+ initCommand.error(cli_color_1.default.red('Component type "basic" does not come with a package.json file, install is not a valid option'));
39
+ return;
40
+ }
36
41
  console.log(`Creating ${componentType} component in ${destination}...`);
37
42
  try {
38
43
  yield (0, component_cli_lib_1.componentInit)({ componentType, destination });
39
- if (install && componentType === 'advanced') {
44
+ if (install) {
40
45
  console.log('Installing dependencies');
41
46
  (0, child_process_1.execSync)('npm i', {
42
47
  cwd: destination,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/dxp-cli-next",
3
- "version": "5.4.0-develop.1",
3
+ "version": "5.4.0-develop.2",
4
4
  "repository": {
5
5
  "url": "https://gitlab.squiz.net/developer-experience/dxp-cli-next"
6
6
  },
@@ -39,7 +39,7 @@
39
39
  "codecov"
40
40
  ],
41
41
  "dependencies": {
42
- "@squiz/component-cli-lib": "1.15.0",
42
+ "@squiz/component-cli-lib": "1.16.0",
43
43
  "axios": "1.1.3",
44
44
  "cli-color": "2.0.3",
45
45
  "commander": "9.4.0",