@tywalk/pcf-helper-run 1.1.25 → 1.1.28
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/dist/index.js +28 -10
- package/dist/package.json +5 -5
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -69,6 +69,14 @@ if (typeof path === 'undefined') {
|
|
|
69
69
|
}
|
|
70
70
|
process.exit(1);
|
|
71
71
|
}
|
|
72
|
+
const timeout = (0, argumentUtil_1.getArgValue)(args, ['-t', '--timeout']);
|
|
73
|
+
if (typeof timeout !== 'undefined') {
|
|
74
|
+
const timeoutNumber = Number(timeout);
|
|
75
|
+
if (isNaN(timeoutNumber) || timeoutNumber <= 0) {
|
|
76
|
+
logger.error('Timeout argument must be a positive number representing milliseconds.');
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
72
80
|
const tick = performance.now();
|
|
73
81
|
const env = (_c = (0, argumentUtil_1.getArgValue)(args, ['-env', '--environment'])) !== null && _c !== void 0 ? _c : '';
|
|
74
82
|
if (env === '' && !runInit) {
|
|
@@ -81,12 +89,12 @@ function executeTasks() {
|
|
|
81
89
|
return 1;
|
|
82
90
|
}
|
|
83
91
|
if (commandArgument === 'build' || runAll) {
|
|
84
|
-
const buildResult = tasks.runBuild(path, isVerbose);
|
|
92
|
+
const buildResult = tasks.runBuild(path, isVerbose, timeout ? Number(timeout) : undefined);
|
|
85
93
|
if (buildResult === 1)
|
|
86
94
|
return 1;
|
|
87
95
|
}
|
|
88
96
|
if (commandArgument === 'import' || runAll) {
|
|
89
|
-
const importResult = tasks.runImport(path, env, isVerbose);
|
|
97
|
+
const importResult = tasks.runImport(path, env, isVerbose, timeout ? Number(timeout) : undefined);
|
|
90
98
|
if (importResult === 1)
|
|
91
99
|
return 1;
|
|
92
100
|
}
|
|
@@ -111,17 +119,23 @@ function executeTasks() {
|
|
|
111
119
|
if (initResult === 1)
|
|
112
120
|
return 1;
|
|
113
121
|
}
|
|
122
|
+
if (commandArgument === 'session') {
|
|
123
|
+
const config = tasks.loadConfig();
|
|
124
|
+
tasks.runSession(config.remoteEnvironmentUrl, config.remoteScriptToIntercept, config.remoteStylesheetToIntercept, config.localBundlePath, config.localCssPath);
|
|
125
|
+
}
|
|
114
126
|
return 0;
|
|
115
127
|
}
|
|
116
128
|
var result = 0;
|
|
117
129
|
try {
|
|
118
130
|
logger.log('[PCF Helper Run] ' + (0, performanceUtil_1.formatTime)(new Date()) + ' ' + commandArgument + ' started.\n');
|
|
119
131
|
result = executeTasks();
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
132
|
+
if (commandArgument !== 'session') {
|
|
133
|
+
if (result === 0) {
|
|
134
|
+
logger.log('[PCF Helper Run] ' + commandArgument + ' completed successfully!');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
logger.log('[PCF Helper Run] ' + commandArgument + ' completed with errors.');
|
|
138
|
+
}
|
|
125
139
|
}
|
|
126
140
|
}
|
|
127
141
|
catch (e) {
|
|
@@ -129,7 +143,11 @@ catch (e) {
|
|
|
129
143
|
result = 1;
|
|
130
144
|
}
|
|
131
145
|
finally {
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
if (commandArgument !== 'session' || result === 1) {
|
|
147
|
+
const tock = performance.now();
|
|
148
|
+
logger.log((0, performanceUtil_1.formatMsToSec)('[PCF Helper Run] ' + (0, performanceUtil_1.formatTime)(new Date()) + ' ' + commandArgument + ' finished in %is.', tock - tick));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (commandArgument !== 'session' || result === 1) {
|
|
152
|
+
process.exit(result);
|
|
134
153
|
}
|
|
135
|
-
process.exit(result);
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tywalk/pcf-helper-run",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
4
4
|
"description": "A simple command-line utility for building and publishing PCF controls to Dataverse.",
|
|
5
5
|
"types": "./types/",
|
|
6
6
|
"files": [
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@tywalk/color-logger": "^1.0.3",
|
|
28
|
-
"@tywalk/pcf-helper": "^1.4.
|
|
28
|
+
"@tywalk/pcf-helper": "^1.4.26"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/jest": "^29.5.14",
|
|
32
|
-
"@types/node": "^22.
|
|
32
|
+
"@types/node": "^22.19.3",
|
|
33
33
|
"jest": "^29.7.0",
|
|
34
|
-
"ts-jest": "^29.
|
|
35
|
-
"typescript": "^5.
|
|
34
|
+
"ts-jest": "^29.4.6",
|
|
35
|
+
"typescript": "^5.9.3"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tywalk/pcf-helper-run",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.28",
|
|
4
4
|
"description": "A simple command-line utility for building and publishing PCF controls to Dataverse.",
|
|
5
5
|
"types": "./types/",
|
|
6
6
|
"files": [
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@tywalk/color-logger": "^1.0.3",
|
|
28
|
-
"@tywalk/pcf-helper": "^1.4.
|
|
28
|
+
"@tywalk/pcf-helper": "^1.4.26"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/jest": "^29.5.14",
|
|
32
|
-
"@types/node": "^22.
|
|
32
|
+
"@types/node": "^22.19.3",
|
|
33
33
|
"jest": "^29.7.0",
|
|
34
|
-
"ts-jest": "^29.
|
|
35
|
-
"typescript": "^5.
|
|
34
|
+
"ts-jest": "^29.4.6",
|
|
35
|
+
"typescript": "^5.9.3"
|
|
36
36
|
}
|
|
37
37
|
}
|