piral-cli 0.15.0-alpha.3905 → 0.15.0-alpha.4005
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/lib/apps/build-pilet.d.ts +4 -0
- package/lib/apps/build-pilet.js +4 -3
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/debug-pilet.d.ts +4 -0
- package/lib/apps/debug-pilet.js +4 -3
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/publish-pilet.d.ts +9 -1
- package/lib/apps/publish-pilet.js +4 -2
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/commands.js +16 -0
- package/lib/commands.js.map +1 -1
- package/lib/common/http.d.ts +2 -1
- package/lib/common/http.js +18 -4
- package/lib/common/http.js.map +1 -1
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.js +1 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/info.d.ts +1 -0
- package/lib/common/info.js +3 -1
- package/lib/common/info.js.map +1 -1
- package/lib/common/parallel.d.ts +1 -0
- package/lib/common/parallel.js +29 -0
- package/lib/common/parallel.js.map +1 -0
- package/lib/external/index.js +142 -75
- package/lib/helpers.d.ts +2 -1
- package/lib/helpers.js +2 -1
- package/lib/helpers.js.map +1 -1
- package/lib/types/public.d.ts +1 -0
- package/package.json +2 -2
- package/src/apps/build-pilet.ts +105 -99
- package/src/apps/debug-pilet.ts +61 -54
- package/src/apps/publish-pilet.ts +16 -2
- package/src/commands.ts +18 -0
- package/src/common/http.test.ts +7 -7
- package/src/common/http.ts +21 -3
- package/src/common/index.ts +1 -0
- package/src/common/info.ts +3 -0
- package/src/common/parallel.test.ts +28 -0
- package/src/common/parallel.ts +21 -0
- package/src/helpers.ts +2 -0
- package/src/types/public.ts +2 -0
package/lib/external/index.js
CHANGED
|
@@ -1274,7 +1274,77 @@ const mtimeFilter = opt => {
|
|
|
1274
1274
|
|
|
1275
1275
|
|
|
1276
1276
|
/***/ }),
|
|
1277
|
-
/* 32
|
|
1277
|
+
/* 32 */
|
|
1278
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1279
|
+
|
|
1280
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1281
|
+
/* eslint-disable node/no-deprecated-api */
|
|
1282
|
+
var buffer = __webpack_require__(293)
|
|
1283
|
+
var Buffer = buffer.Buffer
|
|
1284
|
+
|
|
1285
|
+
// alternative to using Object.keys for old browsers
|
|
1286
|
+
function copyProps (src, dst) {
|
|
1287
|
+
for (var key in src) {
|
|
1288
|
+
dst[key] = src[key]
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
1292
|
+
module.exports = buffer
|
|
1293
|
+
} else {
|
|
1294
|
+
// Copy properties from require('buffer')
|
|
1295
|
+
copyProps(buffer, exports)
|
|
1296
|
+
exports.Buffer = SafeBuffer
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
function SafeBuffer (arg, encodingOrOffset, length) {
|
|
1300
|
+
return Buffer(arg, encodingOrOffset, length)
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
SafeBuffer.prototype = Object.create(Buffer.prototype)
|
|
1304
|
+
|
|
1305
|
+
// Copy static methods from Buffer
|
|
1306
|
+
copyProps(Buffer, SafeBuffer)
|
|
1307
|
+
|
|
1308
|
+
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
|
1309
|
+
if (typeof arg === 'number') {
|
|
1310
|
+
throw new TypeError('Argument must not be a number')
|
|
1311
|
+
}
|
|
1312
|
+
return Buffer(arg, encodingOrOffset, length)
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
SafeBuffer.alloc = function (size, fill, encoding) {
|
|
1316
|
+
if (typeof size !== 'number') {
|
|
1317
|
+
throw new TypeError('Argument must be a number')
|
|
1318
|
+
}
|
|
1319
|
+
var buf = Buffer(size)
|
|
1320
|
+
if (fill !== undefined) {
|
|
1321
|
+
if (typeof encoding === 'string') {
|
|
1322
|
+
buf.fill(fill, encoding)
|
|
1323
|
+
} else {
|
|
1324
|
+
buf.fill(fill)
|
|
1325
|
+
}
|
|
1326
|
+
} else {
|
|
1327
|
+
buf.fill(0)
|
|
1328
|
+
}
|
|
1329
|
+
return buf
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
SafeBuffer.allocUnsafe = function (size) {
|
|
1333
|
+
if (typeof size !== 'number') {
|
|
1334
|
+
throw new TypeError('Argument must be a number')
|
|
1335
|
+
}
|
|
1336
|
+
return Buffer(size)
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
SafeBuffer.allocUnsafeSlow = function (size) {
|
|
1340
|
+
if (typeof size !== 'number') {
|
|
1341
|
+
throw new TypeError('Argument must be a number')
|
|
1342
|
+
}
|
|
1343
|
+
return buffer.SlowBuffer(size)
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
/***/ }),
|
|
1278
1348
|
/* 33 */
|
|
1279
1349
|
/***/ (function(__unusedmodule, exports) {
|
|
1280
1350
|
|
|
@@ -40045,7 +40115,7 @@ module.exports = (fn, opts) => {
|
|
|
40045
40115
|
let B = Buffer
|
|
40046
40116
|
/* istanbul ignore next */
|
|
40047
40117
|
if (!B.alloc) {
|
|
40048
|
-
B = __webpack_require__(
|
|
40118
|
+
B = __webpack_require__(32).Buffer
|
|
40049
40119
|
}
|
|
40050
40120
|
module.exports = B
|
|
40051
40121
|
|
|
@@ -49763,7 +49833,7 @@ const ITERATOR = doIter && Symbol.iterator
|
|
|
49763
49833
|
// or Buffer.alloc, and Buffer in node 10 deprecated the ctor.
|
|
49764
49834
|
// .M, this is fine .\^/M..
|
|
49765
49835
|
const B = Buffer.alloc ? Buffer
|
|
49766
|
-
: /* istanbul ignore next */ __webpack_require__(
|
|
49836
|
+
: /* istanbul ignore next */ __webpack_require__(921).Buffer
|
|
49767
49837
|
|
|
49768
49838
|
// events that mean 'the stream is over'
|
|
49769
49839
|
// these are treated specially, and re-emitted
|
|
@@ -58846,77 +58916,7 @@ exports.subscribeToArray = function (array) { return function (subscriber) {
|
|
|
58846
58916
|
|
|
58847
58917
|
/***/ }),
|
|
58848
58918
|
/* 890 */,
|
|
58849
|
-
/* 891
|
|
58850
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
58851
|
-
|
|
58852
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
58853
|
-
/* eslint-disable node/no-deprecated-api */
|
|
58854
|
-
var buffer = __webpack_require__(293)
|
|
58855
|
-
var Buffer = buffer.Buffer
|
|
58856
|
-
|
|
58857
|
-
// alternative to using Object.keys for old browsers
|
|
58858
|
-
function copyProps (src, dst) {
|
|
58859
|
-
for (var key in src) {
|
|
58860
|
-
dst[key] = src[key]
|
|
58861
|
-
}
|
|
58862
|
-
}
|
|
58863
|
-
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
58864
|
-
module.exports = buffer
|
|
58865
|
-
} else {
|
|
58866
|
-
// Copy properties from require('buffer')
|
|
58867
|
-
copyProps(buffer, exports)
|
|
58868
|
-
exports.Buffer = SafeBuffer
|
|
58869
|
-
}
|
|
58870
|
-
|
|
58871
|
-
function SafeBuffer (arg, encodingOrOffset, length) {
|
|
58872
|
-
return Buffer(arg, encodingOrOffset, length)
|
|
58873
|
-
}
|
|
58874
|
-
|
|
58875
|
-
SafeBuffer.prototype = Object.create(Buffer.prototype)
|
|
58876
|
-
|
|
58877
|
-
// Copy static methods from Buffer
|
|
58878
|
-
copyProps(Buffer, SafeBuffer)
|
|
58879
|
-
|
|
58880
|
-
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
|
58881
|
-
if (typeof arg === 'number') {
|
|
58882
|
-
throw new TypeError('Argument must not be a number')
|
|
58883
|
-
}
|
|
58884
|
-
return Buffer(arg, encodingOrOffset, length)
|
|
58885
|
-
}
|
|
58886
|
-
|
|
58887
|
-
SafeBuffer.alloc = function (size, fill, encoding) {
|
|
58888
|
-
if (typeof size !== 'number') {
|
|
58889
|
-
throw new TypeError('Argument must be a number')
|
|
58890
|
-
}
|
|
58891
|
-
var buf = Buffer(size)
|
|
58892
|
-
if (fill !== undefined) {
|
|
58893
|
-
if (typeof encoding === 'string') {
|
|
58894
|
-
buf.fill(fill, encoding)
|
|
58895
|
-
} else {
|
|
58896
|
-
buf.fill(fill)
|
|
58897
|
-
}
|
|
58898
|
-
} else {
|
|
58899
|
-
buf.fill(0)
|
|
58900
|
-
}
|
|
58901
|
-
return buf
|
|
58902
|
-
}
|
|
58903
|
-
|
|
58904
|
-
SafeBuffer.allocUnsafe = function (size) {
|
|
58905
|
-
if (typeof size !== 'number') {
|
|
58906
|
-
throw new TypeError('Argument must be a number')
|
|
58907
|
-
}
|
|
58908
|
-
return Buffer(size)
|
|
58909
|
-
}
|
|
58910
|
-
|
|
58911
|
-
SafeBuffer.allocUnsafeSlow = function (size) {
|
|
58912
|
-
if (typeof size !== 'number') {
|
|
58913
|
-
throw new TypeError('Argument must be a number')
|
|
58914
|
-
}
|
|
58915
|
-
return buffer.SlowBuffer(size)
|
|
58916
|
-
}
|
|
58917
|
-
|
|
58918
|
-
|
|
58919
|
-
/***/ }),
|
|
58919
|
+
/* 891 */,
|
|
58920
58920
|
/* 892 */,
|
|
58921
58921
|
/* 893 */
|
|
58922
58922
|
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
@@ -59712,7 +59712,74 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
59712
59712
|
/* 918 */,
|
|
59713
59713
|
/* 919 */,
|
|
59714
59714
|
/* 920 */,
|
|
59715
|
-
/* 921
|
|
59715
|
+
/* 921 */
|
|
59716
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
59717
|
+
|
|
59718
|
+
/* eslint-disable node/no-deprecated-api */
|
|
59719
|
+
var buffer = __webpack_require__(293)
|
|
59720
|
+
var Buffer = buffer.Buffer
|
|
59721
|
+
|
|
59722
|
+
// alternative to using Object.keys for old browsers
|
|
59723
|
+
function copyProps (src, dst) {
|
|
59724
|
+
for (var key in src) {
|
|
59725
|
+
dst[key] = src[key]
|
|
59726
|
+
}
|
|
59727
|
+
}
|
|
59728
|
+
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
59729
|
+
module.exports = buffer
|
|
59730
|
+
} else {
|
|
59731
|
+
// Copy properties from require('buffer')
|
|
59732
|
+
copyProps(buffer, exports)
|
|
59733
|
+
exports.Buffer = SafeBuffer
|
|
59734
|
+
}
|
|
59735
|
+
|
|
59736
|
+
function SafeBuffer (arg, encodingOrOffset, length) {
|
|
59737
|
+
return Buffer(arg, encodingOrOffset, length)
|
|
59738
|
+
}
|
|
59739
|
+
|
|
59740
|
+
// Copy static methods from Buffer
|
|
59741
|
+
copyProps(Buffer, SafeBuffer)
|
|
59742
|
+
|
|
59743
|
+
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
|
59744
|
+
if (typeof arg === 'number') {
|
|
59745
|
+
throw new TypeError('Argument must not be a number')
|
|
59746
|
+
}
|
|
59747
|
+
return Buffer(arg, encodingOrOffset, length)
|
|
59748
|
+
}
|
|
59749
|
+
|
|
59750
|
+
SafeBuffer.alloc = function (size, fill, encoding) {
|
|
59751
|
+
if (typeof size !== 'number') {
|
|
59752
|
+
throw new TypeError('Argument must be a number')
|
|
59753
|
+
}
|
|
59754
|
+
var buf = Buffer(size)
|
|
59755
|
+
if (fill !== undefined) {
|
|
59756
|
+
if (typeof encoding === 'string') {
|
|
59757
|
+
buf.fill(fill, encoding)
|
|
59758
|
+
} else {
|
|
59759
|
+
buf.fill(fill)
|
|
59760
|
+
}
|
|
59761
|
+
} else {
|
|
59762
|
+
buf.fill(0)
|
|
59763
|
+
}
|
|
59764
|
+
return buf
|
|
59765
|
+
}
|
|
59766
|
+
|
|
59767
|
+
SafeBuffer.allocUnsafe = function (size) {
|
|
59768
|
+
if (typeof size !== 'number') {
|
|
59769
|
+
throw new TypeError('Argument must be a number')
|
|
59770
|
+
}
|
|
59771
|
+
return Buffer(size)
|
|
59772
|
+
}
|
|
59773
|
+
|
|
59774
|
+
SafeBuffer.allocUnsafeSlow = function (size) {
|
|
59775
|
+
if (typeof size !== 'number') {
|
|
59776
|
+
throw new TypeError('Argument must be a number')
|
|
59777
|
+
}
|
|
59778
|
+
return buffer.SlowBuffer(size)
|
|
59779
|
+
}
|
|
59780
|
+
|
|
59781
|
+
|
|
59782
|
+
/***/ }),
|
|
59716
59783
|
/* 922 */
|
|
59717
59784
|
/***/ (function(module, __unusedexports, __webpack_require__) {
|
|
59718
59785
|
|
package/lib/helpers.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ForceOverwrite, SourceLanguage } from './common/enums';
|
|
2
|
-
import { Framework, NpmClientType, PiletSchemaVersion, PiletPublishSource, PiralBuildType, PiletBuildType } from './types';
|
|
2
|
+
import { Framework, NpmClientType, PiletSchemaVersion, PiletPublishSource, PiralBuildType, PiletBuildType, PiletPublishScheme } from './types';
|
|
3
3
|
export declare const schemaKeys: Array<PiletSchemaVersion>;
|
|
4
|
+
export declare const publishModeKeys: Array<PiletPublishScheme>;
|
|
4
5
|
export declare const fromKeys: Array<PiletPublishSource>;
|
|
5
6
|
export declare const piralBuildTypeKeys: Array<PiralBuildType>;
|
|
6
7
|
export declare const piletBuildTypeKeys: Array<PiletBuildType>;
|
package/lib/helpers.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.keyOfPiletLanguage = exports.valueOfPiletLanguage = exports.piletLanguageKeys = exports.keyOfForceOverwrite = exports.valueOfForceOverwrite = exports.forceOverwriteKeys = exports.frameworkKeys = exports.availableReleaseProviders = exports.availableBundlers = exports.bundlerKeys = exports.clientTypeKeys = exports.piletBuildTypeKeys = exports.piralBuildTypeKeys = exports.fromKeys = exports.schemaKeys = void 0;
|
|
3
|
+
exports.keyOfPiletLanguage = exports.valueOfPiletLanguage = exports.piletLanguageKeys = exports.keyOfForceOverwrite = exports.valueOfForceOverwrite = exports.forceOverwriteKeys = exports.frameworkKeys = exports.availableReleaseProviders = exports.availableBundlers = exports.bundlerKeys = exports.clientTypeKeys = exports.piletBuildTypeKeys = exports.piralBuildTypeKeys = exports.fromKeys = exports.publishModeKeys = exports.schemaKeys = void 0;
|
|
4
4
|
const enums_1 = require("./common/enums");
|
|
5
5
|
const constants_1 = require("./common/constants");
|
|
6
6
|
exports.schemaKeys = ['v0', 'v1', 'v2', 'none'];
|
|
7
|
+
exports.publishModeKeys = ['none', 'basic', 'bearer', 'digest'];
|
|
7
8
|
exports.fromKeys = ['local', 'remote', 'npm'];
|
|
8
9
|
exports.piralBuildTypeKeys = ['all', 'release', 'emulator', 'emulator-sources'];
|
|
9
10
|
exports.piletBuildTypeKeys = ['default', 'standalone', 'manifest'];
|
package/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,0CAAgE;AAChE,kDAAiE;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,0CAAgE;AAChE,kDAAiE;AAWpD,QAAA,UAAU,GAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACnE,QAAA,eAAe,GAA8B,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACnF,QAAA,QAAQ,GAA8B,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACjE,QAAA,kBAAkB,GAA0B,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAC/F,QAAA,kBAAkB,GAA0B,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAClF,QAAA,cAAc,GAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC/D,QAAA,WAAW,GAAkB,CAAC,MAAM,EAAE,GAAG,wBAAY,CAAC,CAAC;AACvD,QAAA,iBAAiB,GAAkB,EAAE,CAAC;AACtC,QAAA,yBAAyB,GAAkB,EAAE,CAAC;AAC9C,QAAA,aAAa,GAAqB,CAAC,GAAG,yBAAa,CAAC,CAAC;AACrD,QAAA,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,sBAAc,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;AAEnH,SAAgB,qBAAqB,CAAC,GAAW;IAC/C,KAAK,MAAM,iBAAiB,IAAI,0BAAkB,EAAE;QAClD,IAAI,iBAAiB,KAAK,GAAG,EAAE;YAC7B,OAAO,sBAAc,CAAC,iBAAiB,CAAC,CAAC;SAC1C;KACF;IAED,OAAO,sBAAc,CAAC,EAAE,CAAC;AAC3B,CAAC;AARD,sDAQC;AAED,SAAgB,mBAAmB,CAAC,KAAqB;IACvD,KAAK,MAAM,iBAAiB,IAAI,0BAAkB,EAAE;QAClD,IAAI,sBAAc,CAAC,iBAAiB,CAAC,KAAK,KAAK,EAAE;YAC/C,OAAO,iBAAiB,CAAC;SAC1B;KACF;IAED,OAAO,0BAAkB,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC;AARD,kDAQC;AAEY,QAAA,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,sBAAc,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;AAElH,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,KAAK,MAAM,gBAAgB,IAAI,yBAAiB,EAAE;QAChD,IAAI,gBAAgB,KAAK,GAAG,EAAE;YAC5B,OAAO,sBAAc,CAAC,gBAAgB,CAAC,CAAC;SACzC;KACF;IAED,OAAO,sBAAc,CAAC,EAAE,CAAC;AAC3B,CAAC;AARD,oDAQC;AAED,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,KAAK,MAAM,gBAAgB,IAAI,yBAAiB,EAAE;QAChD,IAAI,sBAAc,CAAC,gBAAgB,CAAC,KAAK,KAAK,EAAE;YAC9C,OAAO,gBAAgB,CAAC;SACzB;KACF;IAED,OAAO,yBAAiB,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC;AARD,gDAQC"}
|
package/lib/types/public.d.ts
CHANGED
|
@@ -189,6 +189,7 @@ export interface BundlerDefinition {
|
|
|
189
189
|
buildPilet: BuildPiletBundlerDefinition;
|
|
190
190
|
}
|
|
191
191
|
export declare type PiletSchemaVersion = 'none' | 'v0' | 'v1' | 'v2';
|
|
192
|
+
export declare type PiletPublishScheme = 'none' | 'digest' | 'bearer' | 'basic';
|
|
192
193
|
export declare type PiletPublishSource = 'local' | 'npm' | 'remote';
|
|
193
194
|
export declare type PiralBuildType = 'all' | 'release' | 'emulator' | 'emulator-sources';
|
|
194
195
|
export declare type PiletBuildType = 'default' | 'standalone' | 'manifest';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.4005",
|
|
4
4
|
"description": "The standard CLI for creating and building a Piral instance or a Pilet.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"typescript": "^4.0.2",
|
|
79
79
|
"yargs": "^15.4.1"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "612f2072dea6b5d02e3672be3972e850ae95d446"
|
|
82
82
|
}
|
package/src/apps/build-pilet.ts
CHANGED
|
@@ -14,14 +14,48 @@ import {
|
|
|
14
14
|
fail,
|
|
15
15
|
config,
|
|
16
16
|
log,
|
|
17
|
-
createDirectory,
|
|
18
17
|
writeJson,
|
|
19
18
|
getPiletSpecMeta,
|
|
20
19
|
getFileNames,
|
|
21
20
|
copy,
|
|
22
21
|
checkAppShellPackage,
|
|
22
|
+
cpuCount,
|
|
23
|
+
concurrentWorkers,
|
|
23
24
|
} from '../common';
|
|
24
25
|
|
|
26
|
+
interface PiletData {
|
|
27
|
+
id: string;
|
|
28
|
+
package: any;
|
|
29
|
+
path: string;
|
|
30
|
+
outFile: string;
|
|
31
|
+
outDir: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function createMetadata(outDir: string, outFile: string, pilets: Array<PiletData>) {
|
|
35
|
+
return writeJson(
|
|
36
|
+
outDir,
|
|
37
|
+
outFile,
|
|
38
|
+
pilets.map((p) => ({
|
|
39
|
+
name: p.package.name,
|
|
40
|
+
version: p.package.version,
|
|
41
|
+
link: `./${p.id}/${p.outFile}`,
|
|
42
|
+
...getPiletSpecMeta(p.path, p.outDir),
|
|
43
|
+
})),
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function copyPilets(outDir: string, pilets: Array<PiletData>) {
|
|
48
|
+
return Promise.all(
|
|
49
|
+
pilets.map(async (p) => {
|
|
50
|
+
const files = await getFileNames(p.outDir);
|
|
51
|
+
|
|
52
|
+
for (const file of files) {
|
|
53
|
+
await copy(resolve(p.outDir, file), resolve(outDir, p.id, file), ForceOverwrite.yes);
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
25
59
|
export interface BuildPiletOptions {
|
|
26
60
|
/**
|
|
27
61
|
* Sets the name of the Piral instance.
|
|
@@ -50,6 +84,11 @@ export interface BuildPiletOptions {
|
|
|
50
84
|
*/
|
|
51
85
|
declaration?: boolean;
|
|
52
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Sets the maximum number of parallel build processes.
|
|
89
|
+
*/
|
|
90
|
+
concurrency?: number;
|
|
91
|
+
|
|
53
92
|
/**
|
|
54
93
|
* Sets the log level to use (1-5).
|
|
55
94
|
*/
|
|
@@ -109,39 +148,6 @@ export interface BuildPiletOptions {
|
|
|
109
148
|
};
|
|
110
149
|
}
|
|
111
150
|
|
|
112
|
-
interface PiletData {
|
|
113
|
-
id: string;
|
|
114
|
-
package: any;
|
|
115
|
-
path: string;
|
|
116
|
-
outFile: string;
|
|
117
|
-
outDir: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function createMetadata(outDir: string, outFile: string, pilets: Array<PiletData>) {
|
|
121
|
-
return writeJson(
|
|
122
|
-
outDir,
|
|
123
|
-
outFile,
|
|
124
|
-
pilets.map((p) => ({
|
|
125
|
-
name: p.package.name,
|
|
126
|
-
version: p.package.version,
|
|
127
|
-
link: `./${p.id}/${p.outFile}`,
|
|
128
|
-
...getPiletSpecMeta(p.path, p.outDir),
|
|
129
|
-
})),
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function copyPilets(outDir: string, pilets: Array<PiletData>) {
|
|
134
|
-
return Promise.all(
|
|
135
|
-
pilets.map(async (p) => {
|
|
136
|
-
const files = await getFileNames(p.outDir);
|
|
137
|
-
|
|
138
|
-
for (const file of files) {
|
|
139
|
-
await copy(resolve(p.outDir, file), resolve(outDir, p.id, file), ForceOverwrite.yes);
|
|
140
|
-
}
|
|
141
|
-
}),
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
151
|
export const buildPiletDefaults: BuildPiletOptions = {
|
|
146
152
|
entry: './src/index',
|
|
147
153
|
target: './dist/index.js',
|
|
@@ -153,6 +159,7 @@ export const buildPiletDefaults: BuildPiletOptions = {
|
|
|
153
159
|
contentHash: true,
|
|
154
160
|
optimizeModules: false,
|
|
155
161
|
schemaVersion: config.schemaVersion,
|
|
162
|
+
concurrency: cpuCount,
|
|
156
163
|
declaration: true,
|
|
157
164
|
};
|
|
158
165
|
|
|
@@ -165,6 +172,7 @@ export async function buildPilet(baseDir = process.cwd(), options: BuildPiletOpt
|
|
|
165
172
|
contentHash = buildPiletDefaults.contentHash,
|
|
166
173
|
logLevel = buildPiletDefaults.logLevel,
|
|
167
174
|
fresh = buildPiletDefaults.fresh,
|
|
175
|
+
concurrency = buildPiletDefaults.concurrency,
|
|
168
176
|
optimizeModules = buildPiletDefaults.optimizeModules,
|
|
169
177
|
schemaVersion = buildPiletDefaults.schemaVersion,
|
|
170
178
|
declaration = buildPiletDefaults.declaration,
|
|
@@ -187,77 +195,75 @@ export async function buildPilet(baseDir = process.cwd(), options: BuildPiletOpt
|
|
|
187
195
|
fail('entryFileMissing_0077');
|
|
188
196
|
}
|
|
189
197
|
|
|
190
|
-
const pilets = await
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
198
|
+
const pilets = await concurrentWorkers(allEntries, concurrency, async (entryModule) => {
|
|
199
|
+
const targetDir = dirname(entryModule);
|
|
200
|
+
const { peerDependencies, peerModules, root, appPackage, appFile, piletPackage, ignored, importmap } =
|
|
201
|
+
await retrievePiletData(targetDir, app);
|
|
202
|
+
const externals = [...Object.keys(peerDependencies), ...peerModules];
|
|
203
|
+
const dest = resolve(root, target);
|
|
204
|
+
const outDir = dirname(dest);
|
|
205
|
+
const outFile = basename(dest);
|
|
206
|
+
|
|
207
|
+
if (fresh) {
|
|
208
|
+
progress('Removing output directory ...');
|
|
209
|
+
await removeDirectory(outDir);
|
|
210
|
+
}
|
|
204
211
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
await hooks.beforeBuild?.({ root, outDir, importmap, entryModule, schemaVersion, piletPackage });
|
|
208
|
-
|
|
209
|
-
await callPiletBuild(
|
|
210
|
-
{
|
|
211
|
-
root,
|
|
212
|
-
piral: appPackage.name,
|
|
213
|
-
optimizeModules,
|
|
214
|
-
sourceMaps,
|
|
215
|
-
contentHash,
|
|
216
|
-
minify,
|
|
217
|
-
externals,
|
|
218
|
-
targetDir,
|
|
219
|
-
importmap,
|
|
220
|
-
outFile,
|
|
221
|
-
outDir,
|
|
222
|
-
entryModule: `./${relative(root, entryModule)}`,
|
|
223
|
-
logLevel,
|
|
224
|
-
version: schemaVersion,
|
|
225
|
-
ignored,
|
|
226
|
-
_,
|
|
227
|
-
},
|
|
228
|
-
bundlerName,
|
|
229
|
-
);
|
|
212
|
+
logInfo('Bundle pilet ...');
|
|
230
213
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
if (declaration) {
|
|
234
|
-
await hooks.beforeDeclaration?.({ root, outDir, entryModule, piletPackage });
|
|
235
|
-
await createPiletDeclaration(
|
|
236
|
-
piletPackage.name,
|
|
237
|
-
root,
|
|
238
|
-
entryModule,
|
|
239
|
-
externals,
|
|
240
|
-
outDir,
|
|
241
|
-
ForceOverwrite.yes,
|
|
242
|
-
logLevel,
|
|
243
|
-
);
|
|
244
|
-
await hooks.afterDeclaration?.({ root, outDir, entryModule, piletPackage });
|
|
245
|
-
}
|
|
214
|
+
await hooks.beforeBuild?.({ root, outDir, importmap, entryModule, schemaVersion, piletPackage });
|
|
246
215
|
|
|
247
|
-
|
|
216
|
+
await callPiletBuild(
|
|
217
|
+
{
|
|
218
|
+
root,
|
|
219
|
+
piral: appPackage.name,
|
|
220
|
+
optimizeModules,
|
|
221
|
+
sourceMaps,
|
|
222
|
+
contentHash,
|
|
223
|
+
minify,
|
|
224
|
+
externals,
|
|
225
|
+
targetDir,
|
|
226
|
+
importmap,
|
|
227
|
+
outFile,
|
|
228
|
+
outDir,
|
|
229
|
+
entryModule: `./${relative(root, entryModule)}`,
|
|
230
|
+
logLevel,
|
|
231
|
+
version: schemaVersion,
|
|
232
|
+
ignored,
|
|
233
|
+
_,
|
|
234
|
+
},
|
|
235
|
+
bundlerName,
|
|
236
|
+
);
|
|
248
237
|
|
|
249
|
-
|
|
250
|
-
|
|
238
|
+
await hooks.afterBuild?.({ root, outDir, importmap, entryModule, schemaVersion, piletPackage });
|
|
239
|
+
|
|
240
|
+
if (declaration) {
|
|
241
|
+
await hooks.beforeDeclaration?.({ root, outDir, entryModule, piletPackage });
|
|
242
|
+
await createPiletDeclaration(
|
|
243
|
+
piletPackage.name,
|
|
251
244
|
root,
|
|
252
|
-
|
|
253
|
-
|
|
245
|
+
entryModule,
|
|
246
|
+
externals,
|
|
254
247
|
outDir,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
|
|
248
|
+
ForceOverwrite.yes,
|
|
249
|
+
logLevel,
|
|
250
|
+
);
|
|
251
|
+
await hooks.afterDeclaration?.({ root, outDir, entryModule, piletPackage });
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
logDone(`Pilet "${piletPackage.name}" built successfully!`);
|
|
255
|
+
|
|
256
|
+
return {
|
|
257
|
+
id: piletPackage.name.replace(/[^a-zA-Z0-9\-]/gi, ''),
|
|
258
|
+
root,
|
|
259
|
+
appFile,
|
|
260
|
+
appPackage,
|
|
261
|
+
outDir,
|
|
262
|
+
outFile,
|
|
263
|
+
path: dest,
|
|
264
|
+
package: piletPackage,
|
|
265
|
+
};
|
|
266
|
+
});
|
|
261
267
|
|
|
262
268
|
if (type === 'standalone') {
|
|
263
269
|
const distDir = dirname(resolve(fullBase, target));
|