weboptimizer 2.0.1248 → 2.0.1250
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 +544 -560
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -57,590 +57,574 @@ process.env.UV_THREADPOOL_SIZE = '128';
|
|
|
57
57
|
*
|
|
58
58
|
* @returns Nothing.
|
|
59
59
|
*/
|
|
60
|
-
var main =
|
|
61
|
-
|
|
62
|
-
var currentWorkingDirectory
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
break;
|
|
194
|
-
}
|
|
195
|
-
_context.next = 9;
|
|
196
|
-
return new Promise(function (resolve, reject) {
|
|
197
|
-
return (0, _rimraf["default"])(file.path, {
|
|
198
|
-
glob: false
|
|
199
|
-
}, function (error) {
|
|
200
|
-
return error ? reject(error) : resolve();
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
case 9:
|
|
204
|
-
return _context.abrupt("return", false);
|
|
205
|
-
case 10:
|
|
206
|
-
_context.next = 12;
|
|
207
|
-
return (0, _promises.unlink)(file.path);
|
|
208
|
-
case 12:
|
|
209
|
-
return _context.abrupt("break", 15);
|
|
210
|
-
case 13:
|
|
211
|
-
_context.next = 3;
|
|
212
|
-
break;
|
|
213
|
-
case 15:
|
|
214
|
-
case "end":
|
|
215
|
-
return _context.stop();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}, _callee);
|
|
219
|
-
}));
|
|
220
|
-
return function (_x2) {
|
|
221
|
-
return _ref3.apply(this, arguments);
|
|
222
|
-
};
|
|
223
|
-
}());
|
|
224
|
-
case 29:
|
|
225
|
-
_context2.t0 = _createForOfIteratorHelper;
|
|
226
|
-
_context2.next = 32;
|
|
227
|
-
return _clientnode["default"].walkDirectoryRecursively(configuration.path.target.base, function () {
|
|
228
|
-
return false;
|
|
229
|
-
}, configuration.encoding);
|
|
230
|
-
case 32:
|
|
231
|
-
_context2.t1 = _context2.sent;
|
|
232
|
-
_iterator = (0, _context2.t0)(_context2.t1);
|
|
233
|
-
_context2.prev = 34;
|
|
234
|
-
_iterator.s();
|
|
235
|
-
case 36:
|
|
236
|
-
if ((_step = _iterator.n()).done) {
|
|
237
|
-
_context2.next = 43;
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
file = _step.value;
|
|
241
|
-
if (!file.name.startsWith('npm-debug')) {
|
|
242
|
-
_context2.next = 41;
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
_context2.next = 41;
|
|
246
|
-
return (0, _promises.unlink)(file.path);
|
|
247
|
-
case 41:
|
|
248
|
-
_context2.next = 36;
|
|
249
|
-
break;
|
|
250
|
-
case 43:
|
|
251
|
-
_context2.next = 48;
|
|
252
|
-
break;
|
|
253
|
-
case 45:
|
|
254
|
-
_context2.prev = 45;
|
|
255
|
-
_context2.t2 = _context2["catch"](34);
|
|
256
|
-
_iterator.e(_context2.t2);
|
|
257
|
-
case 48:
|
|
258
|
-
_context2.prev = 48;
|
|
259
|
-
_iterator.f();
|
|
260
|
-
return _context2.finish(48);
|
|
261
|
-
case 51:
|
|
262
|
-
_context2.next = 55;
|
|
263
|
-
break;
|
|
264
|
-
case 53:
|
|
265
|
-
_context2.next = 55;
|
|
266
|
-
return new Promise(function (resolve, reject) {
|
|
267
|
-
return (0, _rimraf["default"])(configuration.path.target.base, {
|
|
268
|
-
glob: false
|
|
269
|
-
}, function (error) {
|
|
270
|
-
return error ? reject(error) : resolve();
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
case 55:
|
|
274
|
-
_context2.next = 57;
|
|
275
|
-
return _clientnode["default"].isDirectory(configuration.path.apiDocumentation);
|
|
276
|
-
case 57:
|
|
277
|
-
if (!_context2.sent) {
|
|
278
|
-
_context2.next = 60;
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
_context2.next = 60;
|
|
282
|
-
return new Promise(function (resolve, reject) {
|
|
283
|
-
return (0, _rimraf["default"])(configuration.path.apiDocumentation, {
|
|
284
|
-
glob: false
|
|
285
|
-
}, function (error) {
|
|
286
|
-
return error ? reject(error) : resolve();
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
case 60:
|
|
290
|
-
_iterator2 = _createForOfIteratorHelper(configuration.path.tidyUpOnClear);
|
|
291
|
-
try {
|
|
292
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
293
|
-
_filePath = _step2.value;
|
|
294
|
-
if (_filePath) if (_clientnode["default"].isFileSync(_filePath))
|
|
295
|
-
// NOTE: Close handler have to be synchronous.
|
|
296
|
-
(0, _fs.unlinkSync)(_filePath);else if (_clientnode["default"].isDirectorySync(_filePath)) (0, _rimraf.sync)(_filePath, {
|
|
297
|
-
glob: false
|
|
60
|
+
var main = function main(context) {
|
|
61
|
+
try {
|
|
62
|
+
var currentWorkingDirectory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
|
|
63
|
+
var commandLineArguments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : process.argv;
|
|
64
|
+
var webOptimizerPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : __dirname;
|
|
65
|
+
var environment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : eval('process.env');
|
|
66
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
67
|
+
var configuration, clear;
|
|
68
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
69
|
+
while (1) {
|
|
70
|
+
switch (_context3.prev = _context3.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
configuration = (0, _configurator.load)(context, currentWorkingDirectory, commandLineArguments, webOptimizerPath, environment);
|
|
73
|
+
clear = _clientnode["default"].noop();
|
|
74
|
+
_context3.prev = 2;
|
|
75
|
+
return _context3.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
76
|
+
var processOptions, childProcessOptions, childProcesses, processPromises, possibleArguments, closeEventHandlers, dynamicConfiguration, count, filePath, additionalArguments, _iterator, _step, file, _iterator2, _step2, _filePath, _iterator3, _step3, filePathPattern, buildConfigurations, tidiedUp, tidyUp, testModuleFilePaths, _iterator9, _step9, buildConfiguration, expression, _iterator10, _step10, _filePath6, handleTask, finished, closeHandler, _iterator14, _step14, closeEventName;
|
|
77
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
78
|
+
while (1) {
|
|
79
|
+
switch (_context2.prev = _context2.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
// region controller
|
|
82
|
+
processOptions = {
|
|
83
|
+
cwd: configuration.path.context,
|
|
84
|
+
env: environment
|
|
85
|
+
};
|
|
86
|
+
childProcessOptions = _objectSpread({
|
|
87
|
+
shell: true,
|
|
88
|
+
stdio: 'inherit'
|
|
89
|
+
}, processOptions);
|
|
90
|
+
childProcesses = [];
|
|
91
|
+
processPromises = [];
|
|
92
|
+
possibleArguments = ['build', 'build:types', 'clear', 'document', 'lint', 'preinstall', 'serve', 'test', 'test:browser', 'test:coverage', 'test:coverage:report', 'check:types'];
|
|
93
|
+
closeEventHandlers = [];
|
|
94
|
+
if (!(configuration.givenCommandLineArguments.length > 2)) {
|
|
95
|
+
_context2.next = 74;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
// region temporary save dynamically given configurations
|
|
99
|
+
// NOTE: We need a copy of given arguments array.
|
|
100
|
+
dynamicConfiguration = {
|
|
101
|
+
givenCommandLineArguments: configuration.givenCommandLineArguments.slice()
|
|
102
|
+
};
|
|
103
|
+
if (configuration.givenCommandLineArguments.length > 3 && _clientnode["default"].stringParseEncodedObject(configuration.givenCommandLineArguments[configuration.givenCommandLineArguments.length - 1], configuration, 'configuration')) configuration.givenCommandLineArguments.pop();
|
|
104
|
+
count = 0;
|
|
105
|
+
filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
|
|
106
|
+
case 11:
|
|
107
|
+
if (!true) {
|
|
108
|
+
_context2.next = 20;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
|
|
112
|
+
_context2.next = 15;
|
|
113
|
+
return _clientnode["default"].isFile(filePath);
|
|
114
|
+
case 15:
|
|
115
|
+
if (_context2.sent) {
|
|
116
|
+
_context2.next = 17;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
return _context2.abrupt("break", 20);
|
|
120
|
+
case 17:
|
|
121
|
+
count += 1;
|
|
122
|
+
_context2.next = 11;
|
|
123
|
+
break;
|
|
124
|
+
case 20:
|
|
125
|
+
_context2.next = 22;
|
|
126
|
+
return (0, _promises.writeFile)(filePath, JSON.stringify(dynamicConfiguration));
|
|
127
|
+
case 22:
|
|
128
|
+
additionalArguments = commandLineArguments.splice(3); /// region register exit handler to tidy up
|
|
129
|
+
clear = function clear(error) {
|
|
130
|
+
// NOTE: Close handler have to be synchronous.
|
|
131
|
+
if (_clientnode["default"].isFileSync(filePath)) (0, _fs.unlinkSync)(filePath);
|
|
132
|
+
if (error) throw error;
|
|
133
|
+
};
|
|
134
|
+
closeEventHandlers.push(clear);
|
|
135
|
+
/// endregion
|
|
136
|
+
// endregion
|
|
137
|
+
// region handle clear
|
|
138
|
+
/*
|
|
139
|
+
NOTE: Some tasks could depend on previously created artefacts
|
|
140
|
+
packages so a preceding clear should not be performed in that
|
|
141
|
+
cases.
|
|
142
|
+
NOTE: If we have a dependency cycle we need to preserve files
|
|
143
|
+
during pre-install phase.
|
|
144
|
+
*/
|
|
145
|
+
if (!(!['build', 'build:types', 'preinstall', 'serve', 'test', 'test:browser', 'test:coverage', 'test:coverage:report'].includes(configuration.givenCommandLineArguments[2]) && possibleArguments.includes(configuration.givenCommandLineArguments[2]))) {
|
|
146
|
+
_context2.next = 64;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
if (!((0, _path.resolve)(configuration.path.target.base) === (0, _path.resolve)(configuration.path.context))) {
|
|
150
|
+
_context2.next = 53;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
_context2.next = 29;
|
|
154
|
+
return _clientnode["default"].walkDirectoryRecursively(configuration.path.target.base, /*#__PURE__*/function () {
|
|
155
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
|
|
156
|
+
var type, _file$stats;
|
|
157
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
158
|
+
while (1) {
|
|
159
|
+
switch (_context.prev = _context.next) {
|
|
160
|
+
case 0:
|
|
161
|
+
if (!_helper["default"].isFilePathInLocation(file.path, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
|
|
162
|
+
return (0, _path.resolve)(configuration.path.context, filePath);
|
|
163
|
+
}).filter(function (filePath) {
|
|
164
|
+
return !configuration.path.context.startsWith(filePath);
|
|
165
|
+
}))) {
|
|
166
|
+
_context.next = 2;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
return _context.abrupt("return", false);
|
|
170
|
+
case 2:
|
|
171
|
+
_context.t0 = _regenerator["default"].keys(configuration.buildContext.types);
|
|
172
|
+
case 3:
|
|
173
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
174
|
+
_context.next = 15;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
type = _context.t1.value;
|
|
178
|
+
if (!new RegExp(configuration.buildContext.types[type].filePathPattern).test(file.path)) {
|
|
179
|
+
_context.next = 13;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
if (!((_file$stats = file.stats) !== null && _file$stats !== void 0 && _file$stats.isDirectory())) {
|
|
183
|
+
_context.next = 10;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
_context.next = 9;
|
|
187
|
+
return new Promise(function (resolve, reject) {
|
|
188
|
+
return (0, _rimraf["default"])(file.path, {
|
|
189
|
+
glob: false
|
|
190
|
+
}, function (error) {
|
|
191
|
+
return error ? reject(error) : resolve();
|
|
192
|
+
});
|
|
298
193
|
});
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
_iterator3.e(err);
|
|
313
|
-
} finally {
|
|
314
|
-
_iterator3.f();
|
|
194
|
+
case 9:
|
|
195
|
+
return _context.abrupt("return", false);
|
|
196
|
+
case 10:
|
|
197
|
+
_context.next = 12;
|
|
198
|
+
return (0, _promises.unlink)(file.path);
|
|
199
|
+
case 12:
|
|
200
|
+
return _context.abrupt("break", 15);
|
|
201
|
+
case 13:
|
|
202
|
+
_context.next = 3;
|
|
203
|
+
break;
|
|
204
|
+
case 15:
|
|
205
|
+
case "end":
|
|
206
|
+
return _context.stop();
|
|
315
207
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
208
|
+
}
|
|
209
|
+
}, _callee);
|
|
210
|
+
}));
|
|
211
|
+
return function (_x) {
|
|
212
|
+
return _ref2.apply(this, arguments);
|
|
213
|
+
};
|
|
214
|
+
}());
|
|
215
|
+
case 29:
|
|
216
|
+
_context2.t0 = _createForOfIteratorHelper;
|
|
217
|
+
_context2.next = 32;
|
|
218
|
+
return _clientnode["default"].walkDirectoryRecursively(configuration.path.target.base, function () {
|
|
219
|
+
return false;
|
|
220
|
+
}, configuration.encoding);
|
|
221
|
+
case 32:
|
|
222
|
+
_context2.t1 = _context2.sent;
|
|
223
|
+
_iterator = (0, _context2.t0)(_context2.t1);
|
|
224
|
+
_context2.prev = 34;
|
|
225
|
+
_iterator.s();
|
|
226
|
+
case 36:
|
|
227
|
+
if ((_step = _iterator.n()).done) {
|
|
228
|
+
_context2.next = 43;
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
file = _step.value;
|
|
232
|
+
if (!file.name.startsWith('npm-debug')) {
|
|
233
|
+
_context2.next = 41;
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
_context2.next = 41;
|
|
237
|
+
return (0, _promises.unlink)(file.path);
|
|
238
|
+
case 41:
|
|
239
|
+
_context2.next = 36;
|
|
240
|
+
break;
|
|
241
|
+
case 43:
|
|
242
|
+
_context2.next = 48;
|
|
243
|
+
break;
|
|
244
|
+
case 45:
|
|
245
|
+
_context2.prev = 45;
|
|
246
|
+
_context2.t2 = _context2["catch"](34);
|
|
247
|
+
_iterator.e(_context2.t2);
|
|
248
|
+
case 48:
|
|
249
|
+
_context2.prev = 48;
|
|
250
|
+
_iterator.f();
|
|
251
|
+
return _context2.finish(48);
|
|
252
|
+
case 51:
|
|
253
|
+
_context2.next = 55;
|
|
254
|
+
break;
|
|
255
|
+
case 53:
|
|
256
|
+
_context2.next = 55;
|
|
257
|
+
return new Promise(function (resolve, reject) {
|
|
258
|
+
return (0, _rimraf["default"])(configuration.path.target.base, {
|
|
259
|
+
glob: false
|
|
260
|
+
}, function (error) {
|
|
261
|
+
return error ? reject(error) : resolve();
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
case 55:
|
|
265
|
+
_context2.next = 57;
|
|
266
|
+
return _clientnode["default"].isDirectory(configuration.path.apiDocumentation);
|
|
267
|
+
case 57:
|
|
268
|
+
if (!_context2.sent) {
|
|
269
|
+
_context2.next = 60;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
_context2.next = 60;
|
|
273
|
+
return new Promise(function (resolve, reject) {
|
|
274
|
+
return (0, _rimraf["default"])(configuration.path.apiDocumentation, {
|
|
275
|
+
glob: false
|
|
276
|
+
}, function (error) {
|
|
277
|
+
return error ? reject(error) : resolve();
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
case 60:
|
|
281
|
+
_iterator2 = _createForOfIteratorHelper(configuration.path.tidyUpOnClear);
|
|
282
|
+
try {
|
|
283
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
284
|
+
_filePath = _step2.value;
|
|
285
|
+
if (_filePath) if (_clientnode["default"].isFileSync(_filePath))
|
|
286
|
+
// NOTE: Close handler have to be synchronous.
|
|
287
|
+
(0, _fs.unlinkSync)(_filePath);else if (_clientnode["default"].isDirectorySync(_filePath)) (0, _rimraf.sync)(_filePath, {
|
|
288
|
+
glob: false
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
} catch (err) {
|
|
292
|
+
_iterator2.e(err);
|
|
293
|
+
} finally {
|
|
294
|
+
_iterator2.f();
|
|
295
|
+
}
|
|
296
|
+
_iterator3 = _createForOfIteratorHelper(configuration.path.tidyUpOnClearGlobs.pattern);
|
|
297
|
+
try {
|
|
298
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
299
|
+
filePathPattern = _step3.value;
|
|
300
|
+
if (filePathPattern) (0, _rimraf.sync)(filePathPattern, configuration.path.tidyUpOnClearGlobs.options);
|
|
301
|
+
}
|
|
302
|
+
} catch (err) {
|
|
303
|
+
_iterator3.e(err);
|
|
304
|
+
} finally {
|
|
305
|
+
_iterator3.f();
|
|
306
|
+
}
|
|
307
|
+
case 64:
|
|
308
|
+
// endregion
|
|
309
|
+
// region handle build
|
|
310
|
+
buildConfigurations = _helper["default"].resolveBuildConfigurationFilePaths(configuration.buildContext.types, configuration.path.source.asset.base, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
|
|
311
|
+
return (0, _path.resolve)(configuration.path.context, filePath);
|
|
312
|
+
}).filter(function (filePath) {
|
|
313
|
+
return !configuration.path.context.startsWith(filePath);
|
|
314
|
+
}), configuration["package"].main.fileNames);
|
|
315
|
+
if (['build', 'document', 'test', 'test:coverage', 'test:coverage:report'].includes(commandLineArguments[2])) {
|
|
316
|
+
tidiedUp = false;
|
|
317
|
+
tidyUp = function tidyUp() {
|
|
318
|
+
/*
|
|
319
|
+
Determines all none javaScript entities which have been
|
|
320
|
+
emitted as single module to remove.
|
|
321
|
+
*/
|
|
322
|
+
if (tidiedUp) return;
|
|
323
|
+
tidiedUp = true;
|
|
324
|
+
for (var _i = 0, _Object$entries = Object.entries(configuration.injection.entry.normalized); _i < _Object$entries.length; _i++) {
|
|
325
|
+
var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
|
|
326
|
+
chunkName = _Object$entries$_i[0],
|
|
327
|
+
chunk = _Object$entries$_i[1];
|
|
328
|
+
var _iterator4 = _createForOfIteratorHelper(chunk),
|
|
329
|
+
_step4;
|
|
330
|
+
try {
|
|
331
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
332
|
+
var moduleID = _step4.value;
|
|
333
|
+
var _filePath2 = _helper["default"].determineModuleFilePath(moduleID, configuration.module.aliases, configuration.module.replacements.normal, {
|
|
334
|
+
file: configuration.extensions.file.internal
|
|
335
|
+
}, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore, configuration.module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.encoding);
|
|
336
|
+
var type = null;
|
|
337
|
+
if (_filePath2) type = _helper["default"].determineAssetType(_filePath2, configuration.buildContext.types, configuration.path);
|
|
338
|
+
if (typeof type === 'string' && configuration.buildContext.types[type]) {
|
|
339
|
+
var _filePath3 = _helper["default"].renderFilePathTemplate(_helper["default"].stripLoader(configuration.files.compose.javaScript), {
|
|
340
|
+
'[name]': chunkName
|
|
341
|
+
});
|
|
327
342
|
/*
|
|
328
|
-
|
|
329
|
-
|
|
343
|
+
NOTE: Close handler have to be
|
|
344
|
+
synchronous.
|
|
330
345
|
*/
|
|
331
|
-
if (
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
// NOTE: Close handler have to be synchronous.
|
|
371
|
-
(0, _fs.unlinkSync)(_filePath4);else if (_clientnode["default"].isDirectorySync(_filePath4)) (0, _rimraf.sync)(_filePath4, {
|
|
372
|
-
glob: false
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
} catch (err) {
|
|
376
|
-
_iterator5.e(err);
|
|
377
|
-
} finally {
|
|
378
|
-
_iterator5.f();
|
|
379
|
-
}
|
|
380
|
-
var _iterator6 = _createForOfIteratorHelper(configuration.path.tidyUpGlobs.pattern),
|
|
381
|
-
_step6;
|
|
382
|
-
try {
|
|
383
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
384
|
-
var _filePathPattern = _step6.value;
|
|
385
|
-
if (_filePathPattern) (0, _rimraf.sync)(_filePathPattern, configuration.path.tidyUpOnClearGlobs.options);
|
|
386
|
-
}
|
|
387
|
-
} catch (err) {
|
|
388
|
-
_iterator6.e(err);
|
|
389
|
-
} finally {
|
|
390
|
-
_iterator6.f();
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
closeEventHandlers.push(tidyUp);
|
|
346
|
+
if (configuration.buildContext.types[type].outputExtension === 'js' && _clientnode["default"].isFileSync(_filePath3)) (0, _fs.chmodSync)(_filePath3, '755');
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
} catch (err) {
|
|
350
|
+
_iterator4.e(err);
|
|
351
|
+
} finally {
|
|
352
|
+
_iterator4.f();
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
var _iterator5 = _createForOfIteratorHelper(configuration.path.tidyUp),
|
|
356
|
+
_step5;
|
|
357
|
+
try {
|
|
358
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
359
|
+
var _filePath4 = _step5.value;
|
|
360
|
+
if (_filePath4) if (_clientnode["default"].isFileSync(_filePath4))
|
|
361
|
+
// NOTE: Close handler have to be synchronous.
|
|
362
|
+
(0, _fs.unlinkSync)(_filePath4);else if (_clientnode["default"].isDirectorySync(_filePath4)) (0, _rimraf.sync)(_filePath4, {
|
|
363
|
+
glob: false
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
} catch (err) {
|
|
367
|
+
_iterator5.e(err);
|
|
368
|
+
} finally {
|
|
369
|
+
_iterator5.f();
|
|
370
|
+
}
|
|
371
|
+
var _iterator6 = _createForOfIteratorHelper(configuration.path.tidyUpGlobs.pattern),
|
|
372
|
+
_step6;
|
|
373
|
+
try {
|
|
374
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
375
|
+
var _filePathPattern = _step6.value;
|
|
376
|
+
if (_filePathPattern) (0, _rimraf.sync)(_filePathPattern, configuration.path.tidyUpOnClearGlobs.options);
|
|
377
|
+
}
|
|
378
|
+
} catch (err) {
|
|
379
|
+
_iterator6.e(err);
|
|
380
|
+
} finally {
|
|
381
|
+
_iterator6.f();
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
closeEventHandlers.push(tidyUp);
|
|
394
385
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
386
|
+
/*
|
|
387
|
+
Triggers complete asset compiling and bundles them into the
|
|
388
|
+
final productive output.
|
|
389
|
+
*/
|
|
390
|
+
processPromises.push(new Promise(function (resolve, reject) {
|
|
391
|
+
var commandLineArguments = (configuration.commandLine.build.arguments || []).concat(additionalArguments);
|
|
392
|
+
console.info('Running "' + ("".concat(configuration.commandLine.build.command, " ") + commandLineArguments.join(' ')).trim() + '"');
|
|
402
393
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
394
|
+
/*
|
|
395
|
+
NOTE: Take current weboptimizer's dependencies into
|
|
396
|
+
account.
|
|
397
|
+
*/
|
|
398
|
+
childProcessOptions.env.PATH += ":".concat(webOptimizerPath, "/node_modules/.bin");
|
|
399
|
+
var childProcess = (0, _child_process.spawn)(configuration.commandLine.build.command, commandLineArguments, childProcessOptions);
|
|
400
|
+
var copyAdditionalFilesAndTidyUp = function copyAdditionalFilesAndTidyUp() {
|
|
401
|
+
var _iterator7 = _createForOfIteratorHelper(configuration.files.additionalPaths),
|
|
402
|
+
_step7;
|
|
403
|
+
try {
|
|
404
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
405
|
+
var _filePath5 = _step7.value;
|
|
406
|
+
var sourcePath = (0, _path.join)(configuration.path.source.base, _filePath5);
|
|
407
|
+
var targetPath = (0, _path.join)(configuration.path.target.base, _filePath5);
|
|
417
408
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
} catch (err) {
|
|
427
|
-
_iterator7.e(err);
|
|
428
|
-
} finally {
|
|
429
|
-
_iterator7.f();
|
|
430
|
-
}
|
|
431
|
-
tidyUp();
|
|
432
|
-
};
|
|
433
|
-
var closeHandler = _clientnode["default"].getProcessCloseHandler(resolve, reject, null, commandLineArguments[2] === 'build' ? copyAdditionalFilesAndTidyUp : tidyUp);
|
|
434
|
-
var _iterator8 = _createForOfIteratorHelper(_clientnode.CloseEventNames),
|
|
435
|
-
_step8;
|
|
436
|
-
try {
|
|
437
|
-
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
438
|
-
var closeEventName = _step8.value;
|
|
439
|
-
childProcess.on(closeEventName, closeHandler);
|
|
440
|
-
}
|
|
441
|
-
} catch (err) {
|
|
442
|
-
_iterator8.e(err);
|
|
443
|
-
} finally {
|
|
444
|
-
_iterator8.f();
|
|
445
|
-
}
|
|
446
|
-
childProcesses.push(childProcess);
|
|
447
|
-
return childProcesses;
|
|
448
|
-
}));
|
|
449
|
-
// endregion
|
|
450
|
-
// region handle pre-install
|
|
451
|
-
} else if (configuration.library && configuration.givenCommandLineArguments[2] === 'preinstall') {
|
|
452
|
-
// Perform all file specific preprocessing stuff.
|
|
453
|
-
testModuleFilePaths = [];
|
|
454
|
-
if (_clientnode["default"].isPlainObject(configuration['test:browser'].injection) && configuration['test:browser'].injection.entry) testModuleFilePaths = _helper["default"].determineModuleLocations(configuration['test:browser'].injection.entry, configuration.module.aliases, configuration.module.replacements.normal, {
|
|
455
|
-
file: configuration.extensions.file.internal
|
|
456
|
-
}, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore).filePaths;
|
|
457
|
-
_iterator9 = _createForOfIteratorHelper(buildConfigurations);
|
|
458
|
-
try {
|
|
459
|
-
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
460
|
-
buildConfiguration = _step9.value;
|
|
461
|
-
expression = buildConfiguration[configuration.givenCommandLineArguments[2]].trim();
|
|
462
|
-
_iterator10 = _createForOfIteratorHelper(buildConfiguration.filePaths);
|
|
463
|
-
try {
|
|
464
|
-
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
465
|
-
_filePath6 = _step10.value;
|
|
466
|
-
if (!testModuleFilePaths.includes(_filePath6)) {
|
|
467
|
-
(function () {
|
|
468
|
-
var evaluated = _clientnode["default"].stringEvaluate("`".concat(expression, "`"), {
|
|
469
|
-
global: global,
|
|
470
|
-
self: configuration,
|
|
471
|
-
buildConfiguration: buildConfiguration,
|
|
472
|
-
path: _path["default"],
|
|
473
|
-
additionalArguments: additionalArguments,
|
|
474
|
-
filePath: _filePath6
|
|
475
|
-
});
|
|
476
|
-
if (evaluated.error) throw new Error('Error occurred during processing given ' + "command: ".concat(evaluated.error));
|
|
477
|
-
console.info("Running \"".concat(evaluated.result, "\""));
|
|
478
|
-
processPromises.push(new Promise(function (resolve, reject) {
|
|
479
|
-
return [_clientnode["default"].handleChildProcess((0, _child_process.exec)(evaluated.result, _objectSpread({
|
|
480
|
-
encoding: configuration.encoding
|
|
481
|
-
}, processOptions), function (error) {
|
|
482
|
-
return error ? reject(error) : resolve({
|
|
483
|
-
reason: 'Finished.',
|
|
484
|
-
parameters: []
|
|
485
|
-
});
|
|
486
|
-
}))];
|
|
487
|
-
}));
|
|
488
|
-
})();
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
} catch (err) {
|
|
492
|
-
_iterator10.e(err);
|
|
493
|
-
} finally {
|
|
494
|
-
_iterator10.f();
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
} catch (err) {
|
|
498
|
-
_iterator9.e(err);
|
|
499
|
-
} finally {
|
|
500
|
-
_iterator9.f();
|
|
501
|
-
}
|
|
409
|
+
// NOTE: Close handler have to be synchronous.
|
|
410
|
+
if (_clientnode["default"].isDirectorySync(sourcePath)) {
|
|
411
|
+
if (_clientnode["default"].isDirectorySync(targetPath)) (0, _rimraf.sync)(targetPath, {
|
|
412
|
+
glob: false
|
|
413
|
+
});
|
|
414
|
+
_clientnode["default"].copyDirectoryRecursiveSync(sourcePath, targetPath);
|
|
415
|
+
} else if (_clientnode["default"].isFileSync(sourcePath)) _clientnode["default"].copyFileSync(sourcePath, targetPath);
|
|
502
416
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
417
|
+
} catch (err) {
|
|
418
|
+
_iterator7.e(err);
|
|
419
|
+
} finally {
|
|
420
|
+
_iterator7.f();
|
|
421
|
+
}
|
|
422
|
+
tidyUp();
|
|
423
|
+
};
|
|
424
|
+
var closeHandler = _clientnode["default"].getProcessCloseHandler(resolve, reject, null, commandLineArguments[2] === 'build' ? copyAdditionalFilesAndTidyUp : tidyUp);
|
|
425
|
+
var _iterator8 = _createForOfIteratorHelper(_clientnode.CloseEventNames),
|
|
426
|
+
_step8;
|
|
427
|
+
try {
|
|
428
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
429
|
+
var closeEventName = _step8.value;
|
|
430
|
+
childProcess.on(closeEventName, closeHandler);
|
|
431
|
+
}
|
|
432
|
+
} catch (err) {
|
|
433
|
+
_iterator8.e(err);
|
|
434
|
+
} finally {
|
|
435
|
+
_iterator8.f();
|
|
436
|
+
}
|
|
437
|
+
childProcesses.push(childProcess);
|
|
438
|
+
return childProcesses;
|
|
439
|
+
}));
|
|
440
|
+
// endregion
|
|
441
|
+
// region handle pre-install
|
|
442
|
+
} else if (configuration.library && configuration.givenCommandLineArguments[2] === 'preinstall') {
|
|
443
|
+
// Perform all file specific preprocessing stuff.
|
|
444
|
+
testModuleFilePaths = [];
|
|
445
|
+
if (_clientnode["default"].isPlainObject(configuration['test:browser'].injection) && configuration['test:browser'].injection.entry) testModuleFilePaths = _helper["default"].determineModuleLocations(configuration['test:browser'].injection.entry, configuration.module.aliases, configuration.module.replacements.normal, {
|
|
446
|
+
file: configuration.extensions.file.internal
|
|
447
|
+
}, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore).filePaths;
|
|
448
|
+
_iterator9 = _createForOfIteratorHelper(buildConfigurations);
|
|
449
|
+
try {
|
|
450
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
451
|
+
buildConfiguration = _step9.value;
|
|
452
|
+
expression = buildConfiguration[configuration.givenCommandLineArguments[2]].trim();
|
|
453
|
+
_iterator10 = _createForOfIteratorHelper(buildConfiguration.filePaths);
|
|
454
|
+
try {
|
|
455
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
456
|
+
_filePath6 = _step10.value;
|
|
457
|
+
if (!testModuleFilePaths.includes(_filePath6)) {
|
|
458
|
+
(function () {
|
|
459
|
+
var evaluated = _clientnode["default"].stringEvaluate("`".concat(expression, "`"), {
|
|
513
460
|
global: global,
|
|
514
461
|
self: configuration,
|
|
515
|
-
|
|
462
|
+
buildConfiguration: buildConfiguration,
|
|
463
|
+
path: _path["default"],
|
|
464
|
+
additionalArguments: additionalArguments,
|
|
465
|
+
filePath: _filePath6
|
|
516
466
|
});
|
|
517
|
-
if (evaluated.error) throw new Error('Error occurred during processing given
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
childProcess.on(closeEventName, closeHandler);
|
|
529
|
-
}
|
|
530
|
-
} catch (err) {
|
|
531
|
-
_iterator12.e(err);
|
|
532
|
-
} finally {
|
|
533
|
-
_iterator12.f();
|
|
534
|
-
}
|
|
535
|
-
childProcesses.push(childProcess);
|
|
536
|
-
return childProcesses;
|
|
467
|
+
if (evaluated.error) throw new Error('Error occurred during processing given ' + "command: ".concat(evaluated.error));
|
|
468
|
+
console.info("Running \"".concat(evaluated.result, "\""));
|
|
469
|
+
processPromises.push(new Promise(function (resolve, reject) {
|
|
470
|
+
return [_clientnode["default"].handleChildProcess((0, _child_process.exec)(evaluated.result, _objectSpread({
|
|
471
|
+
encoding: configuration.encoding
|
|
472
|
+
}, processOptions), function (error) {
|
|
473
|
+
return error ? reject(error) : resolve({
|
|
474
|
+
reason: 'Finished.',
|
|
475
|
+
parameters: []
|
|
476
|
+
});
|
|
477
|
+
}))];
|
|
537
478
|
}));
|
|
538
|
-
};
|
|
539
|
-
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
540
|
-
_loop();
|
|
541
|
-
}
|
|
542
|
-
} catch (err) {
|
|
543
|
-
_iterator11.e(err);
|
|
544
|
-
} finally {
|
|
545
|
-
_iterator11.f();
|
|
479
|
+
})();
|
|
546
480
|
}
|
|
547
|
-
}; /// region a-/synchronous
|
|
548
|
-
if (!['document', 'test', 'test:coverage', 'test:coverage:report'].includes(configuration.givenCommandLineArguments[2])) {
|
|
549
|
-
_context2.next = 73;
|
|
550
|
-
break;
|
|
551
481
|
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
482
|
+
} catch (err) {
|
|
483
|
+
_iterator10.e(err);
|
|
484
|
+
} finally {
|
|
485
|
+
_iterator10.f();
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
} catch (err) {
|
|
489
|
+
_iterator9.e(err);
|
|
490
|
+
} finally {
|
|
491
|
+
_iterator9.f();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
// endregion
|
|
495
|
+
// region handle remaining tasks
|
|
496
|
+
handleTask = function handleTask(type) {
|
|
497
|
+
var tasks = Array.isArray(configuration.commandLine[type]) ? configuration.commandLine[type] : [configuration.commandLine[type]];
|
|
498
|
+
var _iterator11 = _createForOfIteratorHelper(tasks),
|
|
499
|
+
_step11;
|
|
500
|
+
try {
|
|
501
|
+
var _loop = function _loop() {
|
|
502
|
+
var task = _step11.value;
|
|
503
|
+
var evaluated = _clientnode["default"].stringEvaluate(Object.prototype.hasOwnProperty.call(task, 'indicator') ? task.indicator : 'true', {
|
|
504
|
+
global: global,
|
|
505
|
+
self: configuration,
|
|
506
|
+
path: _path["default"]
|
|
507
|
+
});
|
|
508
|
+
if (evaluated.error) throw new Error('Error occurred during processing given task: ' + evaluated.error);
|
|
509
|
+
if (evaluated.result) processPromises.push(new Promise(function (resolve, reject) {
|
|
510
|
+
var commandLineArguments = (task.arguments || []).concat(additionalArguments);
|
|
511
|
+
console.info('Running "' + ("".concat(task.command, " ") + commandLineArguments.join(' ')).trim() + '"');
|
|
512
|
+
var childProcess = (0, _child_process.spawn)(task.command, commandLineArguments, childProcessOptions);
|
|
513
|
+
var closeHandler = _clientnode["default"].getProcessCloseHandler(resolve, reject);
|
|
514
|
+
var _iterator12 = _createForOfIteratorHelper(_clientnode.CloseEventNames),
|
|
515
|
+
_step12;
|
|
580
516
|
try {
|
|
581
|
-
for (
|
|
582
|
-
closeEventName =
|
|
583
|
-
|
|
517
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
518
|
+
var closeEventName = _step12.value;
|
|
519
|
+
childProcess.on(closeEventName, closeHandler);
|
|
584
520
|
}
|
|
585
521
|
} catch (err) {
|
|
586
|
-
|
|
522
|
+
_iterator12.e(err);
|
|
587
523
|
} finally {
|
|
588
|
-
|
|
524
|
+
_iterator12.f();
|
|
589
525
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
case 82:
|
|
597
|
-
_context2.next = 88;
|
|
598
|
-
break;
|
|
599
|
-
case 84:
|
|
600
|
-
_context2.prev = 84;
|
|
601
|
-
_context2.t3 = _context2["catch"](79);
|
|
602
|
-
console.error(_context2.t3);
|
|
603
|
-
process.exit(_context2.t3.returnCode);
|
|
604
|
-
case 88:
|
|
605
|
-
case "end":
|
|
606
|
-
return _context2.stop();
|
|
526
|
+
childProcesses.push(childProcess);
|
|
527
|
+
return childProcesses;
|
|
528
|
+
}));
|
|
529
|
+
};
|
|
530
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
531
|
+
_loop();
|
|
607
532
|
}
|
|
533
|
+
} catch (err) {
|
|
534
|
+
_iterator11.e(err);
|
|
535
|
+
} finally {
|
|
536
|
+
_iterator11.f();
|
|
537
|
+
}
|
|
538
|
+
}; /// region a-/synchronous
|
|
539
|
+
if (!['document', 'test', 'test:coverage', 'test:coverage:report'].includes(configuration.givenCommandLineArguments[2])) {
|
|
540
|
+
_context2.next = 73;
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
_context2.next = 70;
|
|
544
|
+
return Promise.all(processPromises);
|
|
545
|
+
case 70:
|
|
546
|
+
handleTask(configuration.givenCommandLineArguments[2]);
|
|
547
|
+
_context2.next = 74;
|
|
548
|
+
break;
|
|
549
|
+
case 73:
|
|
550
|
+
if (['build:types', 'check:types', 'lint', 'serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2])) handleTask(configuration.givenCommandLineArguments[2]);
|
|
551
|
+
case 74:
|
|
552
|
+
finished = false;
|
|
553
|
+
closeHandler = function closeHandler() {
|
|
554
|
+
if (!finished) {
|
|
555
|
+
var _iterator13 = _createForOfIteratorHelper(closeEventHandlers),
|
|
556
|
+
_step13;
|
|
557
|
+
try {
|
|
558
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
559
|
+
var closeEventHandler = _step13.value;
|
|
560
|
+
closeEventHandler.apply(void 0, arguments);
|
|
561
|
+
}
|
|
562
|
+
} catch (err) {
|
|
563
|
+
_iterator13.e(err);
|
|
564
|
+
} finally {
|
|
565
|
+
_iterator13.f();
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
finished = true;
|
|
569
|
+
};
|
|
570
|
+
_iterator14 = _createForOfIteratorHelper(_clientnode.CloseEventNames);
|
|
571
|
+
try {
|
|
572
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
573
|
+
closeEventName = _step14.value;
|
|
574
|
+
process.on(closeEventName, closeHandler);
|
|
608
575
|
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
576
|
+
} catch (err) {
|
|
577
|
+
_iterator14.e(err);
|
|
578
|
+
} finally {
|
|
579
|
+
_iterator14.f();
|
|
580
|
+
}
|
|
581
|
+
if (require.main === module && (configuration.givenCommandLineArguments.length < 3 || !possibleArguments.includes(configuration.givenCommandLineArguments[2]))) console.info("Give one of \"".concat(possibleArguments.join('", "'), "\" as command ") + 'line argument. You can provide a json string as second ' + 'parameter to dynamically overwrite some configurations.\n');
|
|
582
|
+
// endregion
|
|
583
|
+
// region forward nested return codes
|
|
584
|
+
_context2.prev = 79;
|
|
585
|
+
_context2.next = 82;
|
|
586
|
+
return Promise.all(processPromises);
|
|
587
|
+
case 82:
|
|
588
|
+
_context2.next = 88;
|
|
619
589
|
break;
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
590
|
+
case 84:
|
|
591
|
+
_context2.prev = 84;
|
|
592
|
+
_context2.t3 = _context2["catch"](79);
|
|
593
|
+
console.error(_context2.t3);
|
|
594
|
+
process.exit(_context2.t3.returnCode);
|
|
595
|
+
case 88:
|
|
596
|
+
case "end":
|
|
597
|
+
return _context2.stop();
|
|
598
|
+
}
|
|
629
599
|
}
|
|
630
|
-
}
|
|
631
|
-
},
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
600
|
+
}, _callee2, null, [[34, 45, 48, 51], [79, 84]]);
|
|
601
|
+
})(), "t0", 4);
|
|
602
|
+
case 4:
|
|
603
|
+
_context3.next = 13;
|
|
604
|
+
break;
|
|
605
|
+
case 6:
|
|
606
|
+
_context3.prev = 6;
|
|
607
|
+
_context3.t1 = _context3["catch"](2);
|
|
608
|
+
if (!configuration.debug) {
|
|
609
|
+
_context3.next = 12;
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
throw _context3.t1;
|
|
613
|
+
case 12:
|
|
614
|
+
console.error(_context3.t1);
|
|
615
|
+
case 13:
|
|
616
|
+
return _context3.abrupt("return", clear);
|
|
617
|
+
case 14:
|
|
618
|
+
case "end":
|
|
619
|
+
return _context3.stop();
|
|
620
|
+
}
|
|
636
621
|
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
})
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}();
|
|
622
|
+
}, _callee3, null, [[2, 6]]);
|
|
623
|
+
}))();
|
|
624
|
+
} catch (e) {
|
|
625
|
+
return Promise.reject(e);
|
|
626
|
+
}
|
|
627
|
+
};
|
|
644
628
|
if (require.main === module) void main();
|
|
645
629
|
var _default = main; // region vim modline
|
|
646
630
|
// vim: set tabstop=4 shiftwidth=4 expandtab:
|