piral-cli 1.8.0-beta.7544 → 1.8.0-beta.7655
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/api.js +10 -11
- package/lib/api.js.map +1 -1
- package/lib/apps/add-piral-instance-pilet.d.ts +8 -0
- package/lib/apps/add-piral-instance-pilet.js +8 -4
- package/lib/apps/add-piral-instance-pilet.js.map +1 -1
- package/lib/apps/build-pilet.js +2 -2
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/build-piral.js +2 -2
- package/lib/apps/build-piral.js.map +1 -1
- package/lib/apps/debug-pilet.js +2 -2
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.js +2 -2
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/declaration-pilet.js +2 -2
- package/lib/apps/declaration-pilet.js.map +1 -1
- package/lib/apps/declaration-piral.js +2 -2
- package/lib/apps/declaration-piral.js.map +1 -1
- package/lib/apps/new-pilet.d.ts +8 -0
- package/lib/apps/new-pilet.js +8 -4
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.js +2 -2
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/apps/pack-pilet.js +2 -2
- package/lib/apps/pack-pilet.js.map +1 -1
- package/lib/apps/publish-pilet.d.ts +4 -0
- package/lib/apps/publish-pilet.js +11 -9
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.d.ts +4 -0
- package/lib/apps/publish-piral.js +8 -6
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/apps/remove-piral-instance-pilet.js +2 -2
- package/lib/apps/remove-piral-instance-pilet.js.map +1 -1
- package/lib/apps/run-emulator-piral.d.ts +8 -0
- package/lib/apps/run-emulator-piral.js +9 -7
- package/lib/apps/run-emulator-piral.js.map +1 -1
- package/lib/apps/upgrade-pilet.d.ts +8 -0
- package/lib/apps/upgrade-pilet.js +9 -5
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/apps/upgrade-piral.js +2 -2
- package/lib/apps/upgrade-piral.js.map +1 -1
- package/lib/apps/validate-pilet.js +2 -2
- package/lib/apps/validate-pilet.js.map +1 -1
- package/lib/apps/validate-piral.js +2 -2
- package/lib/apps/validate-piral.js.map +1 -1
- package/lib/build/bundler-calls.js +2 -3
- package/lib/build/bundler-calls.js.map +1 -1
- package/lib/build/run-build-pilet.js.map +1 -1
- package/lib/build/run-build-piral.js.map +1 -1
- package/lib/build/run-debug-mono-piral.js.map +1 -1
- package/lib/build/run-debug-pilet.js.map +1 -1
- package/lib/build/run-debug-piral.js.map +1 -1
- package/lib/bundler.js +23 -14
- package/lib/bundler.js.map +1 -1
- package/lib/cli.js +1 -2
- package/lib/cli.js.map +1 -1
- package/lib/commands.js +57 -7
- package/lib/commands.js.map +1 -1
- package/lib/common/MemoryStream.d.ts +0 -1
- package/lib/common/archive.d.ts +0 -1
- package/lib/common/archive.js +4 -5
- package/lib/common/archive.js.map +1 -1
- package/lib/common/browser.js +2 -3
- package/lib/common/browser.js.map +1 -1
- package/lib/common/compatibility.js +2 -3
- package/lib/common/compatibility.js.map +1 -1
- package/lib/common/config.d.ts +4 -0
- package/lib/common/config.js +3 -2
- package/lib/common/config.js.map +1 -1
- package/lib/common/constants.d.ts +1 -1
- package/lib/common/constants.js +1 -0
- package/lib/common/constants.js.map +1 -1
- package/lib/common/declaration.js +2 -3
- package/lib/common/declaration.js.map +1 -1
- package/lib/common/emulator.js +6 -7
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/envs.js +1 -2
- package/lib/common/envs.js.map +1 -1
- package/lib/common/hash.d.ts +0 -1
- package/lib/common/hash.js +3 -4
- package/lib/common/hash.js.map +1 -1
- package/lib/common/http.d.ts +9 -5
- package/lib/common/http.js +31 -16
- package/lib/common/http.js.map +1 -1
- package/lib/common/importmap.js +1 -2
- package/lib/common/importmap.js.map +1 -1
- package/lib/common/info.js +2 -2
- package/lib/common/info.js.map +1 -1
- package/lib/common/injectors.js +2 -3
- package/lib/common/injectors.js.map +1 -1
- package/lib/common/inspect.d.ts +0 -1
- package/lib/common/inspect.js +4 -5
- package/lib/common/inspect.js.map +1 -1
- package/lib/common/interactive.d.ts +0 -1
- package/lib/common/interactive.js +3 -4
- package/lib/common/interactive.js.map +1 -1
- package/lib/common/io.d.ts +0 -1
- package/lib/common/io.js +29 -30
- package/lib/common/io.js.map +1 -1
- package/lib/common/language.js +5 -6
- package/lib/common/language.js.map +1 -1
- package/lib/common/log.js +30 -21
- package/lib/common/log.js.map +1 -1
- package/lib/common/merge.js +1 -2
- package/lib/common/merge.js.map +1 -1
- package/lib/common/npm.d.ts +6 -6
- package/lib/common/npm.js +95 -67
- package/lib/common/npm.js.map +1 -1
- package/lib/common/pack.js +1 -2
- package/lib/common/pack.js.map +1 -1
- package/lib/common/package.d.ts +5 -4
- package/lib/common/package.js +32 -33
- package/lib/common/package.js.map +1 -1
- package/lib/common/parallel.js +1 -2
- package/lib/common/parallel.js.map +1 -1
- package/lib/common/patcher.js +1 -2
- package/lib/common/patcher.js.map +1 -1
- package/lib/common/patches.js +2 -3
- package/lib/common/patches.js.map +1 -1
- package/lib/common/pilet.js +1 -2
- package/lib/common/pilet.js.map +1 -1
- package/lib/common/piral.js +2 -3
- package/lib/common/piral.js.map +1 -1
- package/lib/common/platform.js +1 -2
- package/lib/common/platform.js.map +1 -1
- package/lib/common/port.js +2 -3
- package/lib/common/port.js.map +1 -1
- package/lib/common/release.d.ts +2 -2
- package/lib/common/release.js +4 -5
- package/lib/common/release.js.map +1 -1
- package/lib/common/rules.js +2 -3
- package/lib/common/rules.js.map +1 -1
- package/lib/common/scaffold.js +4 -5
- package/lib/common/scaffold.js.map +1 -1
- package/lib/common/scripts.d.ts +0 -1
- package/lib/common/scripts.js +2 -3
- package/lib/common/scripts.js.map +1 -1
- package/lib/common/shell.d.ts +3 -2
- package/lib/common/shell.js +3 -4
- package/lib/common/shell.js.map +1 -1
- package/lib/common/spec.js +1 -2
- package/lib/common/spec.js.map +1 -1
- package/lib/common/template.js +1 -2
- package/lib/common/template.js.map +1 -1
- package/lib/common/url.js +1 -2
- package/lib/common/url.js.map +1 -1
- package/lib/common/utils.js +2 -3
- package/lib/common/utils.js.map +1 -1
- package/lib/common/validate.js +1 -2
- package/lib/common/validate.js.map +1 -1
- package/lib/common/version.js +2 -3
- package/lib/common/version.js.map +1 -1
- package/lib/common/watcher.js +1 -2
- package/lib/common/watcher.js.map +1 -1
- package/lib/common/website.d.ts +3 -2
- package/lib/common/website.js +9 -14
- package/lib/common/website.js.map +1 -1
- package/lib/external/index.js +6012 -4278
- package/lib/helpers.js +3 -3
- package/lib/helpers.js.map +1 -1
- package/lib/inject.js +18 -9
- package/lib/inject.js.map +1 -1
- package/lib/injectors/pilet-injector.d.ts +0 -3
- package/lib/injectors/pilet-injector.js.map +1 -1
- package/lib/injectors/piral-injector.d.ts +0 -2
- package/lib/injectors/piral-injector.js.map +1 -1
- package/lib/messages.js +93 -95
- package/lib/messages.js.map +1 -1
- package/lib/npm-clients/bun.js +7 -8
- package/lib/npm-clients/bun.js.map +1 -1
- package/lib/npm-clients/index.d.ts +9 -5
- package/lib/npm-clients/index.js +35 -13
- package/lib/npm-clients/index.js.map +1 -1
- package/lib/npm-clients/lerna.js +7 -8
- package/lib/npm-clients/lerna.js.map +1 -1
- package/lib/npm-clients/npm.js +13 -14
- package/lib/npm-clients/npm.js.map +1 -1
- package/lib/npm-clients/pnp.js +7 -8
- package/lib/npm-clients/pnp.js.map +1 -1
- package/lib/npm-clients/pnpm.js +7 -8
- package/lib/npm-clients/pnpm.js.map +1 -1
- package/lib/npm-clients/rush.js +7 -8
- package/lib/npm-clients/rush.js.map +1 -1
- package/lib/npm-clients/yarn.js +7 -8
- package/lib/npm-clients/yarn.js.map +1 -1
- package/lib/platforms/node.js +1 -2
- package/lib/platforms/node.js.map +1 -1
- package/lib/platforms/web.js +1 -2
- package/lib/platforms/web.js.map +1 -1
- package/lib/plugin.js +1 -2
- package/lib/plugin.js.map +1 -1
- package/lib/questionnaire.js +2 -3
- package/lib/questionnaire.js.map +1 -1
- package/lib/resolvers.js.map +1 -1
- package/lib/rules/index.js +4 -5
- package/lib/rules/index.js.map +1 -1
- package/lib/rules/pilet-has-externals-as-peers.js +1 -1
- package/lib/rules/pilet-has-externals-as-peers.js.map +1 -1
- package/lib/rules/pilet-has-no-self-reference.js +1 -1
- package/lib/rules/pilet-has-no-self-reference.js.map +1 -1
- package/lib/rules/pilet-has-no-third-party-dependency.js +1 -1
- package/lib/rules/pilet-has-no-third-party-dependency.js.map +1 -1
- package/lib/rules/pilet-has-non-conflicting-css.js +1 -1
- package/lib/rules/pilet-has-non-conflicting-css.js.map +1 -1
- package/lib/rules/pilet-stays-small.js +1 -1
- package/lib/rules/pilet-stays-small.js.map +1 -1
- package/lib/rules/pilet-uses-latest-piral.js +1 -1
- package/lib/rules/pilet-uses-latest-piral.js.map +1 -1
- package/lib/rules/piral-depends-on-piral.js +1 -1
- package/lib/rules/piral-depends-on-piral.js.map +1 -1
- package/lib/rules/piral-entry-ends-with-html.js +1 -1
- package/lib/rules/piral-entry-ends-with-html.js.map +1 -1
- package/lib/rules/piral-has-valid-devDependencies.js +1 -1
- package/lib/rules/piral-has-valid-devDependencies.js.map +1 -1
- package/lib/rules/piral-has-valid-externals.js +1 -1
- package/lib/rules/piral-has-valid-externals.js.map +1 -1
- package/lib/rules/piral-has-valid-files.js +1 -1
- package/lib/rules/piral-has-valid-files.js.map +1 -1
- package/lib/rules/piral-has-valid-scripts.js +1 -1
- package/lib/rules/piral-has-valid-scripts.js.map +1 -1
- package/lib/runner.js.map +1 -1
- package/lib/select.js +1 -2
- package/lib/select.js.map +1 -1
- package/lib/start.js +1 -2
- package/lib/start.js.map +1 -1
- package/lib/types/internal.d.ts +18 -2
- package/lib/types/public.d.ts +3 -1
- package/package.json +6 -6
- package/src/apps/add-piral-instance-pilet.ts +20 -1
- package/src/apps/new-pilet.ts +19 -1
- package/src/apps/publish-pilet.ts +17 -7
- package/src/apps/publish-piral.ts +13 -4
- package/src/apps/run-emulator-piral.ts +22 -6
- package/src/apps/upgrade-pilet.ts +21 -2
- package/src/commands.ts +41 -1
- package/src/common/config.ts +5 -0
- package/src/common/constants.ts +1 -0
- package/src/common/emulator.ts +4 -4
- package/src/common/http.test.ts +5 -4
- package/src/common/http.ts +26 -7
- package/src/common/npm.test.ts +16 -16
- package/src/common/npm.ts +84 -50
- package/src/common/package.ts +10 -11
- package/src/common/release.ts +3 -2
- package/src/common/shell.ts +6 -4
- package/src/common/website.ts +8 -11
- package/src/npm-clients/index.ts +21 -6
- package/src/types/internal.ts +25 -1
- package/src/types/public.ts +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"piral-has-valid-files.js","sourceRoot":"","sources":["../../src/rules/piral-has-valid-files.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"piral-has-valid-files.js","sourceRoot":"","sources":["../../src/rules/piral-has-valid-files.ts"],"names":[],"mappings":";;AAiBA,4BAmEC;AApFD,2BAAuD;AACvD,+BAAsC;AAGtC,SAAS,iBAAiB,CAAC,MAAc;IACvC,IAAI,IAAA,aAAQ,EAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QACnC,OAAO,IAAA,gBAAW,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,aAAQ,EAAC,IAAA,WAAI,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAID;;GAEG;AACH,mBAAyB,OAAyB,EAAE,UAAmB,SAAS;IAC9E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,KAAK,CACX;;;eAGS,OAAO,KAAK;CAC1B,CACI,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YAC7C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,OAAO,KAAK,CAAC;YACf,CAAC;iBAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;gBAChF,OAAO,KAAK,CAAC;YACf,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QACH,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/E,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAElD,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,KAAK,CACX;;;oBAGY,gBAAgB,CAAC,MAAM;CAC1C,CACM,CAAC;QACJ,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACzF,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAExC,IAAI,CAAC,IAAA,eAAU,EAAC,MAAM,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,KAAK,CACX;yBACe,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBAC5B,IAAI;sBACC,MAAM;GACzB,CACM,CAAC;YACJ,CAAC;iBAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC3D,OAAO,CAAC,OAAO,CACb;4BACkB,IAAI,CAAC,SAAS,CAC9B,IAAI,CACL;;;CAGV,CACQ,CAAC;YACJ,CAAC;iBAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAA,eAAQ,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBACnD,OAAO,CAAC,KAAK,CACX;uBACa,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;eAC5B,IAAI;4BACS,IAAI;CAC/B,CACQ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
3
4
|
/**
|
|
4
5
|
* Checks that the scripts defined for pilets are valid.
|
|
5
6
|
*/
|
|
@@ -23,5 +24,4 @@ The scripts in pilets.scripts are invalid.
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
exports.default = default_1;
|
|
27
27
|
//# sourceMappingURL=piral-has-valid-scripts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"piral-has-valid-scripts.js","sourceRoot":"","sources":["../../src/rules/piral-has-valid-scripts.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"piral-has-valid-scripts.js","sourceRoot":"","sources":["../../src/rules/piral-has-valid-scripts.ts"],"names":[],"mappings":";;AAOA,4BAwBC;AA3BD;;GAEG;AACH,mBAAyB,OAAyB,EAAE,UAAmB,SAAS;IAC9E,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAEjC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,CACX;;;eAGS,OAAO,OAAO;CAC5B,CACI,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC;QAE9F,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,KAAK,CACX;;;oBAGY,cAAc,CAAC,MAAM;GACtC,CACI,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":";;AAAA,mCAAgC;AAEhC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IACrD,IAAI,IAAI,KAAK,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":";;AAAA,mCAAgC;AAEhC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IACrD,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QACnC,MAAM,IAAA,aAAK,EAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/lib/select.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.select =
|
|
3
|
+
exports.select = select;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
@@ -35,5 +35,4 @@ async function select(from) {
|
|
|
35
35
|
await start(from);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
exports.select = select;
|
|
39
38
|
//# sourceMappingURL=select.js.map
|
package/lib/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../src/select.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../src/select.ts"],"names":[],"mappings":";;AAiBA,wBAsBC;AAvCD,+BAA8C;AAC9C,2BAAgC;AAChC,iDAAqC;AAGrC,SAAS,OAAO;IACd,IAAI,CAAC;QACH,OAAO,IAAA,cAAO,EACZ,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE;YAC/B,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;SACvB,CAAC,CACH,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,MAAM,CAAC,IAAoB;IAC/C,MAAM,SAAS,GAAG,OAAO,EAAE,CAAC;IAC5B,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEpD,IAAI,SAAS,KAAK,SAAS,IAAI,IAAA,eAAU,EAAC,WAAW,CAAC,EAAE,CAAC;QACvD,+EAA+E;QAC/E,MAAM,EAAE,GAAG,IAAA,oBAAI,EAAC,WAAW,EAAE,EAAE,EAAE;YAC/B,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;SACnB,CAAC,CAAC;QAEH,EAAE,CAAC,IAAI,CAAC;YACN,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE;YACvB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAC5B,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,8EAA8E;QAC9E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QACpD,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
|
package/lib/start.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.start =
|
|
3
|
+
exports.start = start;
|
|
4
4
|
async function start(from) {
|
|
5
5
|
const { loadPlugins } = require('./plugin');
|
|
6
6
|
const { commands } = require('./commands');
|
|
@@ -8,5 +8,4 @@ async function start(from) {
|
|
|
8
8
|
await loadPlugins();
|
|
9
9
|
await setupCli(from(commands));
|
|
10
10
|
}
|
|
11
|
-
exports.start = start;
|
|
12
11
|
//# sourceMappingURL=start.js.map
|
package/lib/start.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";;AAEA,sBAMC;AANM,KAAK,UAAU,KAAK,CAAC,IAAoB;IAC9C,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,WAAW,EAAE,CAAC;IACpB,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjC,CAAC"}
|
package/lib/types/internal.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { LogLevels } from './common';
|
|
3
|
-
import type { ImportmapVersions, PiletSchemaVersion } from './public';
|
|
2
|
+
import type { ImportmapVersions, NpmClientType, NpmDirectClientType, NpmWapperClientType, PiletSchemaVersion } from './public';
|
|
4
3
|
export interface PiralInstanceDetails {
|
|
5
4
|
selected?: boolean;
|
|
6
5
|
port?: number;
|
|
@@ -30,3 +29,20 @@ export interface FileInfo {
|
|
|
30
29
|
* 2. The (short) error message
|
|
31
30
|
*/
|
|
32
31
|
export type QuickMessage = [LogLevels, string, string];
|
|
32
|
+
/**
|
|
33
|
+
* Result of identifying an npm client in a project.
|
|
34
|
+
*/
|
|
35
|
+
export interface NpmClient {
|
|
36
|
+
/**
|
|
37
|
+
* The proposed client - can be anything.
|
|
38
|
+
*/
|
|
39
|
+
proposed?: NpmClientType;
|
|
40
|
+
/**
|
|
41
|
+
* The direct npm client.
|
|
42
|
+
*/
|
|
43
|
+
direct: NpmDirectClientType;
|
|
44
|
+
/**
|
|
45
|
+
* The wrapper npm client, if any.
|
|
46
|
+
*/
|
|
47
|
+
wrapper?: NpmWapperClientType;
|
|
48
|
+
}
|
package/lib/types/public.d.ts
CHANGED
|
@@ -212,7 +212,9 @@ export type PiralBuildType = 'all' | 'release' | 'emulator' | 'emulator-package'
|
|
|
212
212
|
export type PiralPublishType = 'release' | 'emulator';
|
|
213
213
|
export type PiletBuildType = 'default' | 'standalone' | 'manifest';
|
|
214
214
|
export type PackageType = 'registry' | 'file' | 'git' | 'remote';
|
|
215
|
-
export type
|
|
215
|
+
export type NpmDirectClientType = 'npm' | 'yarn' | 'pnp' | 'pnpm' | 'bun';
|
|
216
|
+
export type NpmWapperClientType = 'lerna' | 'rush';
|
|
217
|
+
export type NpmClientType = NpmDirectClientType | NpmWapperClientType;
|
|
216
218
|
export type Framework = 'piral' | 'piral-core' | 'piral-base';
|
|
217
219
|
export interface StandardEnvProps {
|
|
218
220
|
production?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli",
|
|
3
|
-
"version": "1.8.0-beta.
|
|
3
|
+
"version": "1.8.0-beta.7655",
|
|
4
4
|
"description": "The standard CLI for creating and building a Piral instance or a Pilet.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/rc": "^1.1.0",
|
|
58
58
|
"@types/rimraf": "^2.0.2",
|
|
59
59
|
"@types/tar": "^4.0.0",
|
|
60
|
-
"@types/yargs": "^
|
|
60
|
+
"@types/yargs": "^17",
|
|
61
61
|
"axios": "^1.7.7",
|
|
62
62
|
"chalk": "^4.0.0",
|
|
63
63
|
"enhanced-resolve": "^5.10.0",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"css-conflict-inspector": "^0.2.1",
|
|
78
78
|
"dets": "^0.16.4",
|
|
79
|
-
"kras": "
|
|
79
|
+
"kras": "1.0.0-pre.92",
|
|
80
80
|
"rimraf": "^3.0.0",
|
|
81
|
-
"typescript": "^5
|
|
82
|
-
"yargs": "^
|
|
81
|
+
"typescript": "^5",
|
|
82
|
+
"yargs": "^17"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "68e1232fe36c56cf7edaa546389bc635693907bf"
|
|
85
85
|
}
|
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
checkAppShellPackage,
|
|
17
17
|
ForceOverwrite,
|
|
18
18
|
copyPiralFiles,
|
|
19
|
+
config,
|
|
20
|
+
getCertificate,
|
|
21
|
+
getAgent,
|
|
19
22
|
} from '../common';
|
|
20
23
|
|
|
21
24
|
export interface AddPiralInstancePiletOptions {
|
|
@@ -39,6 +42,16 @@ export interface AddPiralInstancePiletOptions {
|
|
|
39
42
|
*/
|
|
40
43
|
selected?: boolean;
|
|
41
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Defines a custom certificate for the website emulator.
|
|
47
|
+
*/
|
|
48
|
+
cert?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Allow self-signed certificates.
|
|
52
|
+
*/
|
|
53
|
+
allowSelfSigned?: boolean;
|
|
54
|
+
|
|
42
55
|
/**
|
|
43
56
|
* The npm client to be used when scaffolding.
|
|
44
57
|
* @example 'yarn'
|
|
@@ -52,6 +65,8 @@ export const addPiralInstancePiletDefaults: AddPiralInstancePiletOptions = {
|
|
|
52
65
|
source: '.',
|
|
53
66
|
selected: false,
|
|
54
67
|
npmClient: undefined,
|
|
68
|
+
cert: undefined,
|
|
69
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
55
70
|
};
|
|
56
71
|
|
|
57
72
|
export async function addPiralInstancePilet(baseDir = process.cwd(), options: AddPiralInstancePiletOptions = {}) {
|
|
@@ -61,6 +76,8 @@ export async function addPiralInstancePilet(baseDir = process.cwd(), options: Ad
|
|
|
61
76
|
source = addPiralInstancePiletDefaults.source,
|
|
62
77
|
selected = addPiralInstancePiletDefaults.selected,
|
|
63
78
|
app = addPiralInstancePiletDefaults.app,
|
|
79
|
+
cert = addPiralInstancePiletDefaults.cert,
|
|
80
|
+
allowSelfSigned = addPiralInstancePiletDefaults.allowSelfSigned,
|
|
64
81
|
} = options;
|
|
65
82
|
|
|
66
83
|
ensure('baseDir', baseDir, 'string');
|
|
@@ -72,6 +89,8 @@ export async function addPiralInstancePilet(baseDir = process.cwd(), options: Ad
|
|
|
72
89
|
|
|
73
90
|
const npmClient = await determineNpmClient(fullBase, defaultNpmClient);
|
|
74
91
|
const allEntries = await matchAnyPilet(fullBase, [source]);
|
|
92
|
+
const ca = await getCertificate(cert);
|
|
93
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
75
94
|
|
|
76
95
|
const tasks = allEntries.map(async (entryModule) => {
|
|
77
96
|
const targetDir = dirname(entryModule);
|
|
@@ -80,7 +99,7 @@ export async function addPiralInstancePilet(baseDir = process.cwd(), options: Ad
|
|
|
80
99
|
if (piletJsonPath) {
|
|
81
100
|
const piletJsonDir = dirname(piletJsonPath);
|
|
82
101
|
const root = await findPiletRoot(piletJsonDir);
|
|
83
|
-
const packageName = await installPiralInstance(app, fullBase, root, npmClient, selected);
|
|
102
|
+
const packageName = await installPiralInstance(app, fullBase, root, npmClient, agent, selected);
|
|
84
103
|
const piralInfo = await readPiralPackage(root, packageName);
|
|
85
104
|
const isEmulator = checkAppShellPackage(piralInfo);
|
|
86
105
|
|
package/src/apps/new-pilet.ts
CHANGED
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
defaultSchemaVersion,
|
|
30
30
|
piletJsonSchemaUrl,
|
|
31
31
|
ensure,
|
|
32
|
+
getCertificate,
|
|
33
|
+
getAgent,
|
|
32
34
|
} from '../common';
|
|
33
35
|
|
|
34
36
|
export interface NewPiletOptions {
|
|
@@ -47,6 +49,16 @@ export interface NewPiletOptions {
|
|
|
47
49
|
*/
|
|
48
50
|
source?: string;
|
|
49
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Defines a custom certificate for the website emulator.
|
|
54
|
+
*/
|
|
55
|
+
cert?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Allow self-signed certificates.
|
|
59
|
+
*/
|
|
60
|
+
allowSelfSigned?: boolean;
|
|
61
|
+
|
|
50
62
|
/**
|
|
51
63
|
* Determines if files should be overwritten by the scaffolding.
|
|
52
64
|
*/
|
|
@@ -110,6 +122,8 @@ export const newPiletDefaults: NewPiletOptions = {
|
|
|
110
122
|
bundlerName: 'none',
|
|
111
123
|
variables: {},
|
|
112
124
|
name: undefined,
|
|
125
|
+
cert: undefined,
|
|
126
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
113
127
|
};
|
|
114
128
|
|
|
115
129
|
export async function newPilet(baseDir = process.cwd(), options: NewPiletOptions = {}) {
|
|
@@ -126,6 +140,8 @@ export async function newPilet(baseDir = process.cwd(), options: NewPiletOptions
|
|
|
126
140
|
variables = newPiletDefaults.variables,
|
|
127
141
|
npmClient: defaultNpmClient = newPiletDefaults.npmClient,
|
|
128
142
|
name = newPiletDefaults.name,
|
|
143
|
+
cert = newPiletDefaults.cert,
|
|
144
|
+
allowSelfSigned = newPiletDefaults.allowSelfSigned,
|
|
129
145
|
} = options;
|
|
130
146
|
|
|
131
147
|
ensure('baseDir', baseDir, 'string');
|
|
@@ -142,6 +158,8 @@ export async function newPilet(baseDir = process.cwd(), options: NewPiletOptions
|
|
|
142
158
|
|
|
143
159
|
if (success) {
|
|
144
160
|
const npmClient = await determineNpmClient(root, defaultNpmClient);
|
|
161
|
+
const ca = await getCertificate(cert);
|
|
162
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
145
163
|
const projectName = name || basename(root);
|
|
146
164
|
|
|
147
165
|
progress(`Scaffolding new pilet in %s ...`, root);
|
|
@@ -196,7 +214,7 @@ always-auth=true`,
|
|
|
196
214
|
);
|
|
197
215
|
|
|
198
216
|
const sourceName = source || `empty-piral@${cliVersion}`;
|
|
199
|
-
const packageName = await installPiralInstance(sourceName, fullBase, root, npmClient, true);
|
|
217
|
+
const packageName = await installPiralInstance(sourceName, fullBase, root, npmClient, agent, true);
|
|
200
218
|
const piralInfo = await readPiralPackage(root, packageName);
|
|
201
219
|
const isEmulator = checkAppShellPackage(piralInfo);
|
|
202
220
|
const { preScaffold, postScaffold, files, template: preSelectedTemplate } = getPiletsInfo(piralInfo);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Agent } from 'https';
|
|
1
2
|
import { relative, resolve } from 'path';
|
|
2
3
|
import { LogLevels, PiletSchemaVersion, PiletPublishSource, PublishScheme } from '../types';
|
|
3
4
|
import {
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
triggerBuildPilet,
|
|
18
19
|
getCertificate,
|
|
19
20
|
ensure,
|
|
21
|
+
getAgent,
|
|
20
22
|
} from '../common';
|
|
21
23
|
|
|
22
24
|
export interface PublishPiletOptions {
|
|
@@ -52,6 +54,11 @@ export interface PublishPiletOptions {
|
|
|
52
54
|
* Defines a custom certificate for the feed service.
|
|
53
55
|
*/
|
|
54
56
|
cert?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Allow self-signed certificates.
|
|
60
|
+
*/
|
|
61
|
+
allowSelfSigned?: boolean;
|
|
55
62
|
|
|
56
63
|
/**
|
|
57
64
|
* Sets the schema version of the pilet. Usually, the default one should be picked.
|
|
@@ -110,7 +117,6 @@ export const publishPiletDefaults: PublishPiletOptions = {
|
|
|
110
117
|
url: undefined,
|
|
111
118
|
apiKey: undefined,
|
|
112
119
|
fresh: false,
|
|
113
|
-
cert: undefined,
|
|
114
120
|
logLevel: LogLevels.info,
|
|
115
121
|
schemaVersion: undefined,
|
|
116
122
|
mode: 'basic',
|
|
@@ -118,6 +124,8 @@ export const publishPiletDefaults: PublishPiletOptions = {
|
|
|
118
124
|
fields: {},
|
|
119
125
|
headers: {},
|
|
120
126
|
interactive: false,
|
|
127
|
+
cert: undefined,
|
|
128
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
121
129
|
};
|
|
122
130
|
|
|
123
131
|
async function getFiles(
|
|
@@ -129,7 +137,7 @@ async function getFiles(
|
|
|
129
137
|
logLevel: LogLevels,
|
|
130
138
|
bundlerName: string,
|
|
131
139
|
_?: Record<string, any>,
|
|
132
|
-
|
|
140
|
+
agent?: Agent,
|
|
133
141
|
hooks?: PublishPiletOptions['hooks'],
|
|
134
142
|
): Promise<Array<string>> {
|
|
135
143
|
if (fresh) {
|
|
@@ -181,14 +189,14 @@ async function getFiles(
|
|
|
181
189
|
}
|
|
182
190
|
case 'remote': {
|
|
183
191
|
log('generalDebug_0003', `Download file from "${sources.join('", "')}".`);
|
|
184
|
-
const allFiles = await Promise.all(sources.map((s) => downloadFile(s,
|
|
192
|
+
const allFiles = await Promise.all(sources.map((s) => downloadFile(s, agent)));
|
|
185
193
|
return allFiles.reduce((result, files) => [...result, ...files], []);
|
|
186
194
|
}
|
|
187
195
|
case 'npm': {
|
|
188
196
|
log('generalDebug_0003', `View npm package "${sources.join('", "')}".`);
|
|
189
197
|
const allUrls = await Promise.all(sources.map((s) => findNpmTarball(s)));
|
|
190
198
|
log('generalDebug_0003', `Download file from "${allUrls.join('", "')}".`);
|
|
191
|
-
const allFiles = await Promise.all(allUrls.map((url) => downloadFile(url,
|
|
199
|
+
const allFiles = await Promise.all(allUrls.map((url) => downloadFile(url, agent)));
|
|
192
200
|
return allFiles.reduce((result, files) => [...result, ...files], []);
|
|
193
201
|
}
|
|
194
202
|
}
|
|
@@ -204,11 +212,12 @@ export async function publishPilet(baseDir = process.cwd(), options: PublishPile
|
|
|
204
212
|
logLevel = publishPiletDefaults.logLevel,
|
|
205
213
|
from = publishPiletDefaults.from,
|
|
206
214
|
schemaVersion = publishPiletDefaults.schemaVersion,
|
|
207
|
-
cert = publishPiletDefaults.cert,
|
|
208
215
|
fields = publishPiletDefaults.fields,
|
|
209
216
|
headers = publishPiletDefaults.headers,
|
|
210
217
|
mode = publishPiletDefaults.mode,
|
|
211
218
|
interactive = publishPiletDefaults.interactive,
|
|
219
|
+
cert = publishPiletDefaults.cert,
|
|
220
|
+
allowSelfSigned = publishPiletDefaults.allowSelfSigned,
|
|
212
221
|
_ = {},
|
|
213
222
|
hooks = {},
|
|
214
223
|
bundlerName,
|
|
@@ -229,10 +238,11 @@ export async function publishPilet(baseDir = process.cwd(), options: PublishPile
|
|
|
229
238
|
}
|
|
230
239
|
|
|
231
240
|
const ca = await getCertificate(cert);
|
|
241
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
232
242
|
|
|
233
243
|
log('generalDebug_0003', 'Getting the tgz files ...');
|
|
234
244
|
const sources = Array.isArray(source) ? source : [source];
|
|
235
|
-
const files = await getFiles(fullBase, sources, from, fresh, schemaVersion, logLevel, bundlerName, _,
|
|
245
|
+
const files = await getFiles(fullBase, sources, from, fresh, schemaVersion, logLevel, bundlerName, _, agent, hooks);
|
|
236
246
|
const successfulUploads: Array<string> = [];
|
|
237
247
|
log('generalDebug_0003', 'Received available tgz files.');
|
|
238
248
|
|
|
@@ -249,7 +259,7 @@ export async function publishPilet(baseDir = process.cwd(), options: PublishPile
|
|
|
249
259
|
|
|
250
260
|
if (content) {
|
|
251
261
|
progress(`Publishing "%s" to "%s" ...`, file, url);
|
|
252
|
-
const result = await postFile(url, mode, apiKey, content, fields, headers,
|
|
262
|
+
const result = await postFile(url, mode, apiKey, content, fields, headers, agent, interactive);
|
|
253
263
|
|
|
254
264
|
if (result.success) {
|
|
255
265
|
successfulUploads.push(file);
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
triggerBuildShell,
|
|
26
26
|
publishPackageEmulator,
|
|
27
27
|
ensure,
|
|
28
|
+
getAgent,
|
|
28
29
|
} from '../common';
|
|
29
30
|
|
|
30
31
|
export interface PublishPiralOptions {
|
|
@@ -58,6 +59,11 @@ export interface PublishPiralOptions {
|
|
|
58
59
|
* Defines a custom certificate for the feed service.
|
|
59
60
|
*/
|
|
60
61
|
cert?: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Allow self-signed certificates.
|
|
65
|
+
*/
|
|
66
|
+
allowSelfSigned?: boolean;
|
|
61
67
|
|
|
62
68
|
/**
|
|
63
69
|
* Places additional headers that should be posted to the feed service.
|
|
@@ -107,10 +113,11 @@ export const publishPiralDefaults: PublishPiralOptions = {
|
|
|
107
113
|
interactive: false,
|
|
108
114
|
apiKey: undefined,
|
|
109
115
|
fresh: false,
|
|
110
|
-
cert: undefined,
|
|
111
116
|
mode: 'basic',
|
|
112
117
|
headers: {},
|
|
113
118
|
type: 'emulator',
|
|
119
|
+
cert: undefined,
|
|
120
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
114
121
|
};
|
|
115
122
|
|
|
116
123
|
export async function publishPiral(baseDir = process.cwd(), options: PublishPiralOptions = {}) {
|
|
@@ -121,10 +128,11 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
121
128
|
fresh = publishPiralDefaults.fresh,
|
|
122
129
|
url = config.url ?? publishPiralDefaults.url,
|
|
123
130
|
apiKey = config.apiKeys?.[url] ?? config.apiKey ?? publishPiralDefaults.apiKey,
|
|
124
|
-
cert = publishPiralDefaults.cert,
|
|
125
131
|
headers = publishPiralDefaults.headers,
|
|
126
132
|
mode = publishPiralDefaults.mode,
|
|
127
133
|
type = publishPiralDefaults.type,
|
|
134
|
+
cert = publishPiralDefaults.cert,
|
|
135
|
+
allowSelfSigned = publishPiralDefaults.allowSelfSigned,
|
|
128
136
|
_ = {},
|
|
129
137
|
hooks = {},
|
|
130
138
|
bundlerName,
|
|
@@ -144,6 +152,7 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
144
152
|
}
|
|
145
153
|
|
|
146
154
|
const ca = await getCertificate(cert);
|
|
155
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
147
156
|
|
|
148
157
|
log('generalDebug_0003', 'Getting the files ...');
|
|
149
158
|
const entryFiles = await retrievePiralRoot(fullBase, './');
|
|
@@ -224,7 +233,7 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
224
233
|
const files = await matchFiles(targetDir, '**/*');
|
|
225
234
|
|
|
226
235
|
progress(`Publishing release artifacts to "%s" ...`, url);
|
|
227
|
-
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers,
|
|
236
|
+
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers, agent);
|
|
228
237
|
|
|
229
238
|
if (!result.success) {
|
|
230
239
|
fail('failedUploading_0064');
|
|
@@ -249,7 +258,7 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
249
258
|
const files = await matchFiles(targetDir, '**/*');
|
|
250
259
|
|
|
251
260
|
progress(`Publishing emulator to "%s" ...`, url);
|
|
252
|
-
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers,
|
|
261
|
+
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers, agent);
|
|
253
262
|
|
|
254
263
|
if (!result.success) {
|
|
255
264
|
fail('failedUploading_0064');
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
findPiralInstance,
|
|
19
19
|
determineNpmClient,
|
|
20
20
|
ensure,
|
|
21
|
+
getCertificate,
|
|
22
|
+
getAgent,
|
|
21
23
|
} from '../common';
|
|
22
24
|
|
|
23
25
|
export interface RunEmulatorPiralOptions {
|
|
@@ -61,6 +63,16 @@ export interface RunEmulatorPiralOptions {
|
|
|
61
63
|
* The package registry to use for resolving the specified Piral app.
|
|
62
64
|
*/
|
|
63
65
|
registry?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Defines a custom certificate for the website emulator.
|
|
69
|
+
*/
|
|
70
|
+
cert?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Allow self-signed certificates.
|
|
74
|
+
*/
|
|
75
|
+
allowSelfSigned?: boolean;
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
export const runEmulatorPiralDefaults: RunEmulatorPiralOptions = {
|
|
@@ -70,6 +82,8 @@ export const runEmulatorPiralDefaults: RunEmulatorPiralOptions = {
|
|
|
70
82
|
strictPort: config.strictPort,
|
|
71
83
|
registry: config.registry,
|
|
72
84
|
npmClient: undefined,
|
|
85
|
+
cert: undefined,
|
|
86
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
73
87
|
};
|
|
74
88
|
|
|
75
89
|
function createTempDir() {
|
|
@@ -94,13 +108,15 @@ export async function runEmulatorPiral(baseDir = process.cwd(), options: RunEmul
|
|
|
94
108
|
logLevel = runEmulatorPiralDefaults.logLevel,
|
|
95
109
|
npmClient: defaultNpmClient = runEmulatorPiralDefaults.npmClient,
|
|
96
110
|
registry = runEmulatorPiralDefaults.registry,
|
|
111
|
+
cert = runEmulatorPiralDefaults.cert,
|
|
112
|
+
allowSelfSigned = runEmulatorPiralDefaults.allowSelfSigned,
|
|
97
113
|
app,
|
|
98
114
|
feed,
|
|
99
115
|
} = options;
|
|
100
|
-
|
|
116
|
+
|
|
101
117
|
ensure('baseDir', baseDir, 'string');
|
|
102
118
|
ensure('app', app, 'string');
|
|
103
|
-
|
|
119
|
+
|
|
104
120
|
const publicUrl = '/';
|
|
105
121
|
const api = config.piletApi;
|
|
106
122
|
const fullBase = resolve(process.cwd(), baseDir);
|
|
@@ -114,6 +130,8 @@ export async function runEmulatorPiral(baseDir = process.cwd(), options: RunEmul
|
|
|
114
130
|
process.stdin?.setMaxListeners(16);
|
|
115
131
|
|
|
116
132
|
const appRoot = await createTempDir();
|
|
133
|
+
const ca = await getCertificate(cert);
|
|
134
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
117
135
|
|
|
118
136
|
if (registry !== runEmulatorPiralDefaults.registry) {
|
|
119
137
|
progress(`Setting up npm registry (%s) ...`, registry);
|
|
@@ -128,10 +146,8 @@ always-auth=true`,
|
|
|
128
146
|
}
|
|
129
147
|
|
|
130
148
|
const npmClient = await determineNpmClient(appRoot, defaultNpmClient);
|
|
131
|
-
const packageName = await installPiralInstance(app, fullBase, appRoot, npmClient);
|
|
132
|
-
const piral = await findPiralInstance(packageName, appRoot, {
|
|
133
|
-
port: originalPort,
|
|
134
|
-
});
|
|
149
|
+
const packageName = await installPiralInstance(app, fullBase, appRoot, npmClient, agent);
|
|
150
|
+
const piral = await findPiralInstance(packageName, appRoot, { port: originalPort }, agent);
|
|
135
151
|
const port = await getAvailablePort(piral.port, strictPort);
|
|
136
152
|
|
|
137
153
|
const krasBaseConfig = resolve(fullBase, krasrc);
|
|
@@ -26,6 +26,9 @@ import {
|
|
|
26
26
|
getPiletScaffoldData,
|
|
27
27
|
retrievePiletData,
|
|
28
28
|
ensure,
|
|
29
|
+
config,
|
|
30
|
+
getCertificate,
|
|
31
|
+
getAgent,
|
|
29
32
|
} from '../common';
|
|
30
33
|
|
|
31
34
|
export interface UpgradePiletOptions {
|
|
@@ -58,6 +61,16 @@ export interface UpgradePiletOptions {
|
|
|
58
61
|
*/
|
|
59
62
|
install?: boolean;
|
|
60
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Defines a custom certificate for the website emulator.
|
|
66
|
+
*/
|
|
67
|
+
cert?: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Allow self-signed certificates.
|
|
71
|
+
*/
|
|
72
|
+
allowSelfSigned?: boolean;
|
|
73
|
+
|
|
61
74
|
/**
|
|
62
75
|
* Defines the used npm client. By default, "npm" is used
|
|
63
76
|
* if no other client is autodetected. The autodetection
|
|
@@ -79,6 +92,8 @@ export const upgradePiletDefaults: UpgradePiletOptions = {
|
|
|
79
92
|
install: true,
|
|
80
93
|
npmClient: undefined,
|
|
81
94
|
variables: {},
|
|
95
|
+
cert: undefined,
|
|
96
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
82
97
|
};
|
|
83
98
|
|
|
84
99
|
export async function upgradePilet(baseDir = process.cwd(), options: UpgradePiletOptions = {}) {
|
|
@@ -90,6 +105,8 @@ export async function upgradePilet(baseDir = process.cwd(), options: UpgradePile
|
|
|
90
105
|
install = upgradePiletDefaults.install,
|
|
91
106
|
variables = upgradePiletDefaults.variables,
|
|
92
107
|
npmClient: defaultNpmClient = upgradePiletDefaults.npmClient,
|
|
108
|
+
cert = upgradePiletDefaults.cert,
|
|
109
|
+
allowSelfSigned = upgradePiletDefaults.allowSelfSigned,
|
|
93
110
|
} = options;
|
|
94
111
|
|
|
95
112
|
ensure('baseDir', baseDir, 'string');
|
|
@@ -106,10 +123,12 @@ export async function upgradePilet(baseDir = process.cwd(), options: UpgradePile
|
|
|
106
123
|
}
|
|
107
124
|
|
|
108
125
|
const npmClient = await determineNpmClient(root, defaultNpmClient);
|
|
126
|
+
const ca = await getCertificate(cert);
|
|
127
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
109
128
|
|
|
110
129
|
// in case we run from a user's CLI we want to allow updating
|
|
111
130
|
const interactive = isInteractive();
|
|
112
|
-
const { apps, piletPackage } = await retrievePiletData(root, undefined, interactive);
|
|
131
|
+
const { apps, piletPackage } = await retrievePiletData(root, undefined, agent, interactive);
|
|
113
132
|
const { devDependencies = {}, dependencies = {}, source } = piletPackage;
|
|
114
133
|
|
|
115
134
|
if (apps.length === 0) {
|
|
@@ -144,7 +163,7 @@ export async function upgradePilet(baseDir = process.cwd(), options: UpgradePile
|
|
|
144
163
|
if (!monorepoRef) {
|
|
145
164
|
// only install the latest if the shell does come from remote
|
|
146
165
|
progress(`Updating npm package to %s ...`, packageRef);
|
|
147
|
-
await installNpmPackage(npmClient, packageRef, root
|
|
166
|
+
await installNpmPackage(npmClient, packageRef, root);
|
|
148
167
|
}
|
|
149
168
|
|
|
150
169
|
const piralInfo = await readPiralPackage(root, sourceName);
|