@tywalk/pcf-helper 1.4.3 → 1.4.5

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/bin/build.js CHANGED
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  const task = require('../tasks/build-pcf');
3
+ const version = require('../package.json').version;
3
4
  const [, , ...args] = process.argv;
4
5
 
6
+ console.log('PCF Helper version', version);
7
+
5
8
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
6
9
  if (typeof pathArgument === 'undefined') {
7
10
  console.error('Path argument is required. Use --path to specify the path to solution folder.');
package/bin/deploy.js CHANGED
@@ -3,8 +3,11 @@ const upgradeTask = require('../tasks/upgrade-pcf');
3
3
  const buildTask = require('../tasks/build-pcf');
4
4
  const importTask = require('../tasks/import-pcf');
5
5
  const { formatMsToSec } = require('../util/performanceUtil');
6
+ const version = require('../package.json').version;
6
7
  const [, , ...args] = process.argv;
7
8
 
9
+ console.log('PCF Helper version', version);
10
+
8
11
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
9
12
  if (typeof pathArgument === 'undefined') {
10
13
  console.error('Path argument is required. Use --path to specify the path to solution folder.');
@@ -48,7 +51,7 @@ try {
48
51
  result = 1;
49
52
  } finally {
50
53
  const tock = performance.now();
51
- console.log('Deploy finished in %is.', formatMsToSec(tock - tick));
54
+ console.log(formatMsToSec('Deploy finished in %is.', tock - tick));
52
55
  }
53
56
 
54
57
  return result;
package/bin/import.js CHANGED
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  const task = require('../tasks/import-pcf');
3
+ const version = require('../package.json').version;
3
4
  const [, , ...args] = process.argv;
4
5
 
6
+ console.log('PCF Helper version', version);
7
+
5
8
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
6
9
  if (typeof pathArgument === 'undefined') {
7
10
  console.error('Path argument is required. Use --path to specify the path to solution folder.');
package/bin/upgrade.js CHANGED
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  const task = require('../tasks/upgrade-pcf');
3
+ const version = require('../package.json').version;
3
4
  const [, , ...args] = process.argv;
4
5
 
6
+ console.log('PCF Helper version', version);
7
+
5
8
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
6
9
  if (typeof pathArgument === 'undefined') {
7
10
  console.error('Path argument is required. Use --path to specify the path to solution folder.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "Command line helper for building and publishing PCF controls to Dataverse.",
5
5
  "scripts": {
6
6
  "test": "node test.js"
@@ -26,7 +26,7 @@ function run(path) {
26
26
  console.error('Unable to complete build: One or more errors ocurred.');
27
27
  }
28
28
  }
29
- console.log('Build finished in %is.', formatMsToSec(tock - tick));
29
+ console.log(formatMsToSec('Build finished in %is.', tock - tick));
30
30
  return task.status;
31
31
  }
32
32
 
@@ -40,7 +40,7 @@ function run(path, env, verbose) {
40
40
  console.error('Unable to complete import: One or more errors ocurred.');
41
41
  }
42
42
  }
43
- console.log('Import finished in %is.', formatMsToSec(tock - tick));
43
+ console.log(formatMsToSec('Import finished in %is.', tock - tick));
44
44
  return task.status;
45
45
  }
46
46
 
@@ -26,7 +26,7 @@ function run(path) {
26
26
  console.error('Unable to complete upgrade: One or more errors ocurred.');
27
27
  }
28
28
  }
29
- console.log('Upgrade finished in %is.', formatMsToSec(tock - tick));
29
+ console.log(formatMsToSec('Upgrade finished in %is.', tock - tick));
30
30
  return task.status;
31
31
  }
32
32
 
@@ -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
  }