@vcmap/plugin-cli 4.0.0-rc.1 → 4.0.0-rc.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/plugin-cli",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.2",
4
4
  "description": "A CLI to help develop and build plugins for the VC Map",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { logger } from '@vcsuite/cli-logger';
2
+ import { LOG_LEVEL, logger } from '@vcsuite/cli-logger';
3
3
  import { setContext } from './context.js';
4
4
 
5
5
  Command.prototype.defaultOptions = function defaultOptions() {
@@ -12,6 +12,16 @@ Command.prototype.defaultOptions = function defaultOptions() {
12
12
  },
13
13
  );
14
14
 
15
+ this.option(
16
+ '--log-level [LOG_LEVEL]',
17
+ 'debug logging',
18
+ (value) => {
19
+ logger.setLevel(value);
20
+ return value;
21
+ },
22
+ LOG_LEVEL.INFO,
23
+ );
24
+
15
25
  return this;
16
26
  };
17
27
 
package/src/update.js CHANGED
@@ -33,7 +33,11 @@ export async function updatePeerDependencies(
33
33
  );
34
34
  options.mapVersion = 'latest';
35
35
  }
36
- const { stdout, stderr } = await promiseExec('npm view @vcmap/ui --json');
36
+ let viewCmd = 'npm view @vcmap/ui --json';
37
+ if (options.mapVersion) {
38
+ viewCmd = `npm view @vcmap/ui@${options.mapVersion} --json`;
39
+ }
40
+ const { stdout, stderr } = await promiseExec(viewCmd);
37
41
  logger.error(stderr);
38
42
  const { name: mapName, peerDependencies: mapPeer } = JSON.parse(stdout);
39
43
  const peerDeps = [`${mapName}@${options.mapVersion || 'latest'}`]; // @vcmap/ui is a required peer dep and will be updated in any case