@tywalk/pcf-helper-run 1.1.6 → 1.1.7

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/index.js CHANGED
@@ -2,10 +2,18 @@
2
2
  const upgradeTask = require('@tywalk/pcf-helper/tasks/upgrade-pcf');
3
3
  const buildTask = require('@tywalk/pcf-helper/tasks/build-pcf');
4
4
  const importTask = require('@tywalk/pcf-helper/tasks/import-pcf');
5
+ const version = require('./package.json').version;
5
6
  const { formatMsToSec } = require('./util/performanceUtil');
6
7
  const [, , ...args] = process.argv;
7
8
 
8
9
  const commandArgument = args.at(0)?.toLowerCase();
10
+ if (['-v', '--version'].includes(commandArgument)) {
11
+ console.log('v%s', version);
12
+ return;
13
+ }
14
+
15
+ console.log('PCF Helper Run version', version);
16
+
9
17
  if (typeof commandArgument === 'undefined' || !['upgrade', 'build', 'import', 'deploy'].includes(commandArgument)) {
10
18
  console.error('Command [command] (upgrade, build, import, deploy) is required.');
11
19
  return 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper-run",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "A simple command-line utility for building and publishing PCF controls to Dataverse.",
5
5
  "scripts": {
6
6
  "test": "node test.js"
@@ -13,6 +13,6 @@
13
13
  "pcf-helper-run": "./index.js"
14
14
  },
15
15
  "dependencies": {
16
- "@tywalk/pcf-helper": "^1.4.4"
16
+ "@tywalk/pcf-helper": "^1.4.5"
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  const util = require('node:util');
2
2
 
3
- function formatMsToSec(ms, format) {
3
+ function formatMsToSec(format, ms) {
4
4
  const seconds = ms / 1000;
5
5
  return util.format(format, seconds);
6
6
  }