@tywalk/pcf-helper-run 1.1.12 → 1.1.14

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
@@ -3,7 +3,7 @@ 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
5
  const version = require('./package.json').version;
6
- const { formatMsToSec } = require('./util/performanceUtil');
6
+ const { formatMsToSec, formatTime } = require('./util/performanceUtil');
7
7
  const [, , ...args] = process.argv;
8
8
 
9
9
  const commandArgument = args.at(0)?.toLowerCase();
@@ -60,16 +60,19 @@ function executeTasks() {
60
60
 
61
61
  var result = 0;
62
62
  try {
63
+ console.log('[PCF Helper Run] ' + formatTime(new Date()) + ' ' + commandArgument + ' started.\n');
63
64
  result = executeTasks();
64
65
  if (result === 0) {
65
- console.log('[PCF Helper Run] ' + commandArgument + ' complete!');
66
+ console.log('[PCF Helper Run] ' + commandArgument + ' completed successfully!');
67
+ } else {
68
+ console.log('[PCF Helper Run] ' + commandArgument + ' completed with errors.');
66
69
  }
67
70
  } catch (e) {
68
71
  console.error('[PCF Helper Run] One or more tasks failed while deploying: ', (e && e.message) || 'unkown error');
69
72
  result = 1;
70
73
  } finally {
71
74
  const tock = performance.now();
72
- console.log(formatMsToSec('[PCF Helper Run] ' + commandArgument + ' finished in %is.', tock - tick));
75
+ console.log(formatMsToSec('[PCF Helper Run] ' + formatTime(new Date()) + ' ' + commandArgument + ' finished in %is.', tock - tick));
73
76
  }
74
77
 
75
78
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper-run",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "A simple command-line utility for building and publishing PCF controls to Dataverse.",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/tywalk/pcf-helper.git"
@@ -16,6 +16,6 @@
16
16
  "pcf-helper-run": "./index.js"
17
17
  },
18
18
  "dependencies": {
19
- "@tywalk/pcf-helper": "^1.4.9"
19
+ "@tywalk/pcf-helper": "^1.4.11"
20
20
  }
21
21
  }
@@ -1,10 +1,22 @@
1
1
  const util = require('node:util');
2
2
 
3
+ var formatter = new Intl.DateTimeFormat('en-US', {
4
+ hour: '2-digit',
5
+ minute: '2-digit',
6
+ second: '2-digit',
7
+ hour12: false
8
+ });
9
+
3
10
  function formatMsToSec(format, ms) {
4
11
  const seconds = ms / 1000;
5
12
  return util.format(format, seconds);
6
13
  }
7
14
 
15
+ function formatTime(date) {
16
+ return formatter.format(date);
17
+ }
18
+
8
19
  module.exports = {
9
- formatMsToSec
20
+ formatMsToSec,
21
+ formatTime
10
22
  }