piral-cli 1.0.0-pre.2217 → 1.0.0
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/LICENSE +1 -1
- package/README.md +30 -7
- package/lib/api.js +23 -23
- package/lib/api.js.map +1 -1
- package/lib/apps/add-piral-instance-pilet.d.ts +26 -0
- package/lib/apps/add-piral-instance-pilet.js +53 -0
- package/lib/apps/add-piral-instance-pilet.js.map +1 -0
- package/lib/apps/build-pilet.d.ts +33 -2
- package/lib/apps/build-pilet.js +159 -32
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/build-piral.d.ts +18 -1
- package/lib/apps/build-piral.js +68 -52
- package/lib/apps/build-piral.js.map +1 -1
- package/lib/apps/debug-pilet.d.ts +38 -2
- package/lib/apps/debug-pilet.js +150 -108
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.d.ts +23 -0
- package/lib/apps/debug-piral.js +63 -52
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/declaration-piral.js +5 -3
- package/lib/apps/declaration-piral.js.map +1 -1
- package/lib/apps/index.d.ts +3 -0
- package/lib/apps/index.js +8 -1
- package/lib/apps/index.js.map +1 -1
- package/lib/apps/new-pilet.d.ts +7 -3
- package/lib/apps/new-pilet.js +47 -52
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.d.ts +7 -3
- package/lib/apps/new-piral.js +33 -23
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/apps/pack-pilet.d.ts +9 -0
- package/lib/apps/pack-pilet.js +6 -13
- package/lib/apps/pack-pilet.js.map +1 -1
- package/lib/apps/publish-pilet.d.ts +23 -3
- package/lib/apps/publish-pilet.js +112 -62
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.d.ts +6 -2
- package/lib/apps/publish-piral.js +30 -26
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/apps/remove-piral-instance-pilet.d.ts +22 -0
- package/lib/apps/remove-piral-instance-pilet.js +52 -0
- package/lib/apps/remove-piral-instance-pilet.js.map +1 -0
- package/lib/apps/run-emulator-piral.d.ts +34 -0
- package/lib/apps/run-emulator-piral.js +91 -0
- package/lib/apps/run-emulator-piral.js.map +1 -0
- package/lib/apps/upgrade-pilet.d.ts +6 -2
- package/lib/apps/upgrade-pilet.js +41 -43
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/apps/upgrade-piral.d.ts +2 -2
- package/lib/apps/upgrade-piral.js +21 -20
- package/lib/apps/upgrade-piral.js.map +1 -1
- package/lib/apps/validate-pilet.js +30 -36
- package/lib/apps/validate-pilet.js.map +1 -1
- package/lib/apps/validate-piral.js +13 -10
- package/lib/apps/validate-piral.js.map +1 -1
- package/lib/build/bundler-calls.d.ts +3 -0
- package/lib/build/bundler-calls.js +117 -0
- package/lib/build/bundler-calls.js.map +1 -0
- package/lib/build/run-build-pilet.d.ts +1 -0
- package/lib/build/run-build-pilet.js +65 -0
- package/lib/build/run-build-pilet.js.map +1 -0
- package/lib/build/run-build-piral.d.ts +1 -0
- package/lib/build/run-build-piral.js +67 -0
- package/lib/build/run-build-piral.js.map +1 -0
- package/lib/build/run-debug-mono-piral.d.ts +1 -0
- package/lib/build/run-debug-mono-piral.js +70 -0
- package/lib/build/run-debug-mono-piral.js.map +1 -0
- package/lib/build/run-debug-pilet.d.ts +1 -0
- package/lib/build/run-debug-pilet.js +89 -0
- package/lib/build/run-debug-pilet.js.map +1 -0
- package/lib/build/run-debug-piral.d.ts +1 -0
- package/lib/build/run-debug-piral.js +85 -0
- package/lib/build/run-debug-piral.js.map +1 -0
- package/lib/bundler.js +75 -26
- package/lib/bundler.js.map +1 -1
- package/lib/cli.js +7 -4
- package/lib/cli.js.map +1 -1
- package/lib/commands.js +266 -46
- package/lib/commands.js.map +1 -1
- package/lib/common/archive.d.ts +4 -0
- package/lib/common/archive.js +31 -10
- package/lib/common/archive.js.map +1 -1
- package/lib/common/browser.d.ts +2 -1
- package/lib/common/browser.js +17 -8
- package/lib/common/browser.js.map +1 -1
- package/lib/common/clients/index.d.ts +21 -0
- package/lib/common/clients/index.js +48 -0
- package/lib/common/clients/index.js.map +1 -0
- package/lib/common/clients/lerna.d.ts +7 -1
- package/lib/common/clients/lerna.js +93 -7
- package/lib/common/clients/lerna.js.map +1 -1
- package/lib/common/clients/npm.d.ts +6 -1
- package/lib/common/clients/npm.js +66 -18
- package/lib/common/clients/npm.js.map +1 -1
- package/lib/common/clients/pnp.d.ts +7 -0
- package/lib/common/clients/pnp.js +104 -0
- package/lib/common/clients/pnp.js.map +1 -0
- package/lib/common/clients/pnpm.d.ts +5 -0
- package/lib/common/clients/pnpm.js +55 -6
- package/lib/common/clients/pnpm.js.map +1 -1
- package/lib/common/clients/rush.d.ts +7 -0
- package/lib/common/clients/rush.js +127 -0
- package/lib/common/clients/rush.js.map +1 -0
- package/lib/common/clients/yarn.d.ts +5 -0
- package/lib/common/clients/yarn.js +57 -6
- package/lib/common/clients/yarn.js.map +1 -1
- package/lib/common/compatibility.js +14 -9
- package/lib/common/compatibility.js.map +1 -1
- package/lib/common/config.d.ts +52 -1
- package/lib/common/config.js +10 -30
- package/lib/common/config.js.map +1 -1
- package/lib/common/constants.d.ts +10 -2
- package/lib/common/constants.js +22 -4
- package/lib/common/constants.js.map +1 -1
- package/lib/common/declaration.d.ts +2 -1
- package/lib/common/declaration.js +113 -56
- package/lib/common/declaration.js.map +1 -1
- package/lib/common/emoji.d.ts +8 -0
- package/lib/common/emoji.js +10 -1
- package/lib/common/emoji.js.map +1 -1
- package/lib/common/emulator.d.ts +2 -2
- package/lib/common/emulator.js +45 -32
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/enums.d.ts +0 -4
- package/lib/common/enums.js +1 -6
- package/lib/common/enums.js.map +1 -1
- package/lib/common/envs.js +16 -5
- package/lib/common/envs.js.map +1 -1
- package/lib/common/hash.d.ts +1 -0
- package/lib/common/hash.js +8 -3
- package/lib/common/hash.js.map +1 -1
- package/lib/common/http.d.ts +5 -2
- package/lib/common/http.js +65 -23
- package/lib/common/http.js.map +1 -1
- package/lib/common/importmap.d.ts +2 -0
- package/lib/common/importmap.js +202 -0
- package/lib/common/importmap.js.map +1 -0
- package/lib/common/index.d.ts +10 -0
- package/lib/common/index.js +15 -1
- package/lib/common/index.js.map +1 -1
- package/lib/common/info.d.ts +5 -0
- package/lib/common/info.js +9 -2
- package/lib/common/info.js.map +1 -1
- package/lib/common/injectors.d.ts +36 -8
- package/lib/common/injectors.js +46 -19
- package/lib/common/injectors.js.map +1 -1
- package/lib/common/inspect.d.ts +5 -3
- package/lib/common/inspect.js +15 -15
- package/lib/common/inspect.js.map +1 -1
- package/lib/common/interactive.d.ts +9 -0
- package/lib/common/interactive.js +60 -1
- package/lib/common/interactive.js.map +1 -1
- package/lib/common/io.d.ts +9 -3
- package/lib/common/io.js +219 -116
- package/lib/common/io.js.map +1 -1
- package/lib/common/language.d.ts +9 -6
- package/lib/common/language.js +68 -12
- package/lib/common/language.js.map +1 -1
- package/lib/common/log.d.ts +5 -3
- package/lib/common/log.js +34 -48
- package/lib/common/log.js.map +1 -1
- package/lib/common/npm.d.ts +17 -16
- package/lib/common/npm.js +262 -158
- package/lib/common/npm.js.map +1 -1
- package/lib/common/pack.js +47 -26
- package/lib/common/pack.js.map +1 -1
- package/lib/common/package.d.ts +43 -20
- package/lib/common/package.js +377 -213
- package/lib/common/package.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/common/patcher.js +20 -20
- package/lib/common/patcher.js.map +1 -1
- package/lib/common/platform.d.ts +13 -0
- package/lib/common/platform.js +29 -0
- package/lib/common/platform.js.map +1 -0
- package/lib/common/port.d.ts +1 -0
- package/lib/common/port.js +14 -4
- package/lib/common/port.js.map +1 -1
- package/lib/common/rules.js +4 -4
- package/lib/common/rules.js.map +1 -1
- package/lib/common/scaffold.d.ts +18 -4
- package/lib/common/scaffold.js +59 -36
- package/lib/common/scaffold.js.map +1 -1
- package/lib/common/scripts.js +8 -8
- package/lib/common/scripts.js.map +1 -1
- package/lib/common/shell.d.ts +2 -0
- package/lib/common/shell.js +33 -0
- package/lib/common/shell.js.map +1 -0
- package/lib/common/spec.d.ts +29 -0
- package/lib/common/spec.js +69 -0
- package/lib/common/spec.js.map +1 -0
- package/lib/common/template.d.ts +1 -2
- package/lib/common/template.js +23 -22
- package/lib/common/template.js.map +1 -1
- package/lib/common/url.d.ts +1 -0
- package/lib/common/url.js +17 -0
- package/lib/common/url.js.map +1 -0
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.js +8 -0
- package/lib/common/utils.js.map +1 -0
- package/lib/common/version.d.ts +2 -0
- package/lib/common/version.js +130 -0
- package/lib/common/version.js.map +1 -0
- package/lib/common/watcher.d.ts +13 -0
- package/lib/common/watcher.js +78 -0
- package/lib/common/watcher.js.map +1 -0
- package/lib/external/index.js +59413 -57862
- package/lib/helpers.d.ts +6 -6
- package/lib/helpers.js +10 -25
- package/lib/helpers.js.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/inject.js +2 -2
- package/lib/inject.js.map +1 -1
- package/lib/injectors/pilet-injector.d.ts +75 -0
- package/lib/injectors/pilet-injector.js +246 -0
- package/lib/injectors/pilet-injector.js.map +1 -0
- package/lib/injectors/{piral.d.ts → piral-injector.d.ts} +10 -2
- package/lib/injectors/piral-injector.js +97 -0
- package/lib/injectors/piral-injector.js.map +1 -0
- package/lib/messages.d.ts +567 -47
- package/lib/messages.js +638 -51
- package/lib/messages.js.map +1 -1
- package/lib/pb-cli.js +1 -1
- package/lib/pb-cli.js.map +1 -1
- package/lib/pilet-cli.js +1 -1
- package/lib/pilet-cli.js.map +1 -1
- package/lib/piral-cli.js +1 -1
- package/lib/piral-cli.js.map +1 -1
- package/lib/platforms/node.d.ts +8 -0
- package/lib/platforms/node.js +30 -0
- package/lib/platforms/node.js.map +1 -0
- package/lib/platforms/web.d.ts +8 -0
- package/lib/platforms/web.js +120 -0
- package/lib/platforms/web.js.map +1 -0
- package/lib/plugin.js +36 -11
- package/lib/plugin.js.map +1 -1
- package/lib/questionnaire.d.ts +1 -1
- package/lib/questionnaire.js +9 -4
- package/lib/questionnaire.js.map +1 -1
- package/lib/release.d.ts +1 -1
- package/lib/release.js +38 -6
- package/lib/release.js.map +1 -1
- package/lib/resolvers.js +13 -13
- package/lib/resolvers.js.map +1 -1
- package/lib/rules/index.js +8 -8
- package/lib/rules/index.js.map +1 -1
- package/lib/rules/pilet-has-externals-as-peers.d.ts +1 -1
- package/lib/rules/pilet-has-externals-as-peers.js +9 -7
- package/lib/rules/pilet-has-externals-as-peers.js.map +1 -1
- package/lib/rules/pilet-has-no-self-reference.d.ts +1 -1
- package/lib/rules/pilet-has-no-self-reference.js +2 -2
- package/lib/rules/pilet-has-no-self-reference.js.map +1 -1
- package/lib/rules/pilet-has-no-third-party-dependency.d.ts +1 -1
- package/lib/rules/pilet-stays-small.d.ts +1 -1
- package/lib/rules/pilet-stays-small.js +4 -4
- package/lib/rules/pilet-stays-small.js.map +1 -1
- package/lib/rules/pilet-uses-latest-piral.d.ts +1 -1
- package/lib/rules/pilet-uses-latest-piral.js +18 -9
- package/lib/rules/pilet-uses-latest-piral.js.map +1 -1
- package/lib/rules/piral-depends-on-piral.d.ts +1 -1
- package/lib/rules/piral-entry-ends-with-html.d.ts +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.d.ts +1 -1
- package/lib/rules/piral-has-valid-externals.d.ts +1 -1
- package/lib/rules/piral-has-valid-externals.js +10 -24
- package/lib/rules/piral-has-valid-externals.js.map +1 -1
- package/lib/rules/piral-has-valid-files.d.ts +1 -1
- package/lib/rules/piral-has-valid-files.js +5 -5
- package/lib/rules/piral-has-valid-files.js.map +1 -1
- package/lib/rules/piral-has-valid-scripts.d.ts +1 -1
- package/lib/runner.js +1 -1
- package/lib/runner.js.map +1 -1
- package/lib/select.js +6 -6
- package/lib/select.js.map +1 -1
- package/lib/types/common.d.ts +88 -8
- package/lib/types/common.js.map +1 -1
- package/lib/types/index.js +5 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/internal.d.ts +12 -13
- package/lib/types/public.d.ts +89 -23
- package/package.json +19 -16
- package/src/apps/add-piral-instance-pilet.ts +98 -0
- package/src/apps/build-pilet.ts +286 -38
- package/src/apps/build-piral.test.ts +20 -7
- package/src/apps/build-piral.ts +90 -39
- package/src/apps/debug-pilet.ts +229 -123
- package/src/apps/debug-piral.ts +121 -68
- package/src/apps/declaration-piral.ts +4 -2
- package/src/apps/index.ts +3 -0
- package/src/apps/new-pilet.test.ts +28 -11
- package/src/apps/new-pilet.ts +60 -48
- package/src/apps/new-piral.test.ts +25 -13
- package/src/apps/new-piral.ts +43 -19
- package/src/apps/pack-pilet.test.ts +2 -2
- package/src/apps/pack-pilet.ts +12 -10
- package/src/apps/publish-pilet.ts +148 -43
- package/src/apps/publish-piral.ts +38 -11
- package/src/apps/remove-piral-instance-pilet.ts +92 -0
- package/src/apps/run-emulator-piral.ts +154 -0
- package/src/apps/upgrade-pilet.ts +37 -31
- package/src/apps/upgrade-piral.ts +9 -7
- package/src/apps/validate-pilet.ts +30 -22
- package/src/apps/validate-piral.ts +5 -2
- package/src/build/bundler-calls.ts +133 -0
- package/src/build/run-build-pilet.ts +91 -0
- package/src/build/run-build-piral.ts +93 -0
- package/src/build/run-debug-mono-piral.ts +86 -0
- package/src/build/run-debug-pilet.ts +116 -0
- package/src/build/run-debug-piral.ts +105 -0
- package/src/bundler.test.ts +86 -68
- package/src/bundler.ts +74 -19
- package/src/cli.ts +6 -2
- package/src/commands.ts +273 -44
- package/src/common/archive.test.ts +51 -45
- package/src/common/archive.ts +28 -1
- package/src/common/browser.test.ts +20 -10
- package/src/common/browser.ts +13 -6
- package/src/common/clients/index.ts +41 -0
- package/src/common/clients/lerna.ts +85 -1
- package/src/common/clients/npm.ts +56 -14
- package/src/common/clients/pnp.ts +84 -0
- package/src/common/clients/pnpm.ts +45 -1
- package/src/common/clients/rush.ts +118 -0
- package/src/common/clients/yarn.ts +49 -3
- package/src/common/compatibility.ts +8 -1
- package/src/common/config.ts +57 -22
- package/src/common/constants.ts +21 -3
- package/src/common/declaration.ts +124 -50
- package/src/common/emoji.ts +9 -0
- package/src/common/emulator.ts +43 -23
- package/src/common/enums.ts +0 -5
- package/src/common/envs.ts +15 -3
- package/src/common/hash.ts +5 -0
- package/src/common/http.test.ts +76 -64
- package/src/common/http.ts +88 -24
- package/src/common/importmap.ts +242 -0
- package/src/common/index.ts +10 -0
- package/src/common/info.ts +9 -1
- package/src/common/injectors.ts +49 -22
- package/src/common/inspect.ts +13 -14
- package/src/common/interactive.test.ts +6 -0
- package/src/common/interactive.ts +69 -1
- package/src/common/io.ts +199 -82
- package/src/common/language.ts +87 -10
- package/src/common/log.ts +32 -46
- package/src/common/npm.test.ts +187 -166
- package/src/common/npm.ts +263 -119
- package/src/common/pack.test.ts +11 -13
- package/src/common/pack.ts +60 -21
- package/src/common/package.test.ts +59 -49
- package/src/common/package.ts +406 -167
- package/src/common/parallel.test.ts +28 -0
- package/src/common/parallel.ts +21 -0
- package/src/common/platform.ts +31 -0
- package/src/common/port.test.ts +4 -1
- package/src/common/port.ts +10 -0
- package/src/common/rules.test.ts +3 -3
- package/src/common/scaffold.ts +69 -41
- package/src/common/scripts.ts +5 -4
- package/src/common/shell.ts +34 -0
- package/src/common/spec.ts +69 -0
- package/src/common/template.ts +20 -18
- package/src/common/url.test.ts +28 -0
- package/src/common/url.ts +15 -0
- package/src/common/utils.ts +3 -0
- package/src/common/version.test.ts +233 -0
- package/src/common/version.ts +142 -0
- package/src/common/watcher.ts +89 -0
- package/src/external/index.test.ts +2 -2
- package/src/external/index.ts +7 -3
- package/src/external/resolve.ts +29 -0
- package/src/helpers.test.ts +2 -22
- package/src/helpers.ts +21 -30
- package/src/injectors/{pilet.test.ts → pilet-injector.test.ts} +13 -4
- package/src/injectors/pilet-injector.ts +346 -0
- package/src/injectors/{piral.test.ts → piral-injector.test.ts} +14 -5
- package/src/injectors/piral-injector.ts +130 -0
- package/src/messages.ts +649 -63
- package/src/platforms/node.ts +16 -0
- package/src/platforms/web.ts +148 -0
- package/src/plugin.ts +34 -5
- package/src/questionnaire.ts +17 -3
- package/src/release.ts +47 -5
- package/src/rules/index.ts +1 -1
- package/src/rules/pilet-has-externals-as-peers.test.ts +3 -2
- package/src/rules/pilet-has-externals-as-peers.ts +9 -7
- package/src/rules/pilet-has-no-self-reference.ts +1 -1
- package/src/rules/pilet-stays-small.ts +1 -1
- package/src/rules/pilet-uses-latest-piral.ts +22 -12
- package/src/rules/piral-has-valid-externals.ts +10 -29
- package/src/types/common.ts +99 -9
- package/src/types/internal.ts +14 -14
- package/src/types/public.ts +93 -27
- package/lib/external/child.js +0 -144
- package/lib/external/classes.trie +0 -0
- package/lib/external/xdg-open +0 -1066
- package/lib/injectors/pilet.d.ts +0 -47
- package/lib/injectors/pilet.js +0 -187
- package/lib/injectors/pilet.js.map +0 -1
- package/lib/injectors/piral.js +0 -62
- package/lib/injectors/piral.js.map +0 -1
- package/src/injectors/pilet.ts +0 -219
- package/src/injectors/piral.ts +0 -76
- package/templates/piral-index.js.ejs +0 -16
package/lib/common/package.js
CHANGED
|
@@ -20,24 +20,64 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
23
|
+
exports.retrievePiletData = exports.findPiletRoot = exports.combinePiletExternals = exports.checkAppShellPackage = exports.patchPiletPackage = exports.isValidDependency = exports.validateSharedDependencies = exports.retrievePiletsInfo = exports.retrieveExternals = exports.flattenExternals = exports.findPackageVersion = exports.findDependencyVersion = exports.retrievePiralRoot = exports.getPiletsInfo = exports.copyPiralFiles = exports.copyScaffoldingFiles = exports.getFileStats = exports.getPiralPackage = exports.patchPiralPackage = exports.readPiralPackage = exports.findPiralInstances = exports.findPiralInstance = exports.getPiralPath = void 0;
|
|
24
24
|
const path_1 = require("path");
|
|
25
25
|
const log_1 = require("./log");
|
|
26
26
|
const info_1 = require("./info");
|
|
27
27
|
const archive_1 = require("./archive");
|
|
28
|
-
const language_1 = require("./language");
|
|
29
28
|
const enums_1 = require("./enums");
|
|
30
29
|
const compatibility_1 = require("./compatibility");
|
|
31
|
-
const
|
|
30
|
+
const merge_1 = require("./merge");
|
|
31
|
+
const utils_1 = require("./utils");
|
|
32
|
+
const importmap_1 = require("./importmap");
|
|
32
33
|
const io_1 = require("./io");
|
|
33
34
|
const io_2 = require("./io");
|
|
34
35
|
const npm_1 = require("./npm");
|
|
35
|
-
const
|
|
36
|
+
const npm_2 = require("./npm");
|
|
37
|
+
const external_1 = require("../external");
|
|
38
|
+
const language_1 = require("./language");
|
|
39
|
+
const language_2 = require("./language");
|
|
40
|
+
const constants_1 = require("./constants");
|
|
41
|
+
function appendBundler(devDependencies, bundler, proposedVersion) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
if (bundler && bundler !== 'none') {
|
|
44
|
+
if (isValidDependency(bundler)) {
|
|
45
|
+
const sep = bundler.indexOf('@', 1);
|
|
46
|
+
const hasVersion = sep !== -1;
|
|
47
|
+
const proposedName = bundler.substring(0, hasVersion ? sep : bundler.length);
|
|
48
|
+
const givenVersion = hasVersion ? bundler.substring(sep + 1) : proposedVersion;
|
|
49
|
+
const name = constants_1.bundlerNames.includes(proposedName) ? `piral-cli-${bundler}` : proposedName;
|
|
50
|
+
const versions = new Set([
|
|
51
|
+
givenVersion,
|
|
52
|
+
givenVersion.includes('-beta.') && 'next',
|
|
53
|
+
givenVersion.includes('-alpha.') && 'canary',
|
|
54
|
+
givenVersion.includes('.') && givenVersion.split('.').slice(0, 2).join('.'),
|
|
55
|
+
'latest',
|
|
56
|
+
]);
|
|
57
|
+
for (const version of versions) {
|
|
58
|
+
if (version) {
|
|
59
|
+
const isAvailable = yield (0, npm_2.findSpecificVersion)(name, version);
|
|
60
|
+
// only if something was returned we know that the version exists; so we can take it.
|
|
61
|
+
if (isAvailable) {
|
|
62
|
+
devDependencies[name] = version;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
(0, log_1.log)('generalWarning_0001', `Could not find a valid version for the provided bundler "${bundler}".'`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
//Error case - print warning and ignore
|
|
71
|
+
(0, log_1.log)('generalWarning_0001', `The provided bundler name "${bundler}" does not refer to a valid package name.'`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
36
76
|
function getDependencyVersion(name, devDependencies, allDependencies) {
|
|
37
77
|
const version = devDependencies[name];
|
|
38
78
|
const selected = typeof version === 'string' ? version : version === true ? allDependencies[name] : undefined;
|
|
39
79
|
if (!selected) {
|
|
40
|
-
log_1.log('cannotResolveVersion_0052', name);
|
|
80
|
+
(0, log_1.log)('cannotResolveVersion_0052', name);
|
|
41
81
|
}
|
|
42
82
|
return selected || 'latest';
|
|
43
83
|
}
|
|
@@ -45,21 +85,21 @@ const globPatternStartIndicators = ['*', '?', '[', '!(', '?(', '+(', '@('];
|
|
|
45
85
|
function getMatchingFiles(source, target, file) {
|
|
46
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
87
|
const { from, to, deep = true } = typeof file === 'string' ? { from: file, to: file, deep: true } : file;
|
|
48
|
-
const sourcePath = path_1.resolve(source, from);
|
|
49
|
-
const targetPath = path_1.resolve(target, to);
|
|
50
|
-
const isDirectory = yield io_1.checkIsDirectory(sourcePath);
|
|
88
|
+
const sourcePath = (0, path_1.resolve)(source, from);
|
|
89
|
+
const targetPath = (0, path_1.resolve)(target, to);
|
|
90
|
+
const isDirectory = yield (0, io_1.checkIsDirectory)(sourcePath);
|
|
51
91
|
if (isDirectory) {
|
|
52
|
-
log_1.log('generalDebug_0003', `Matching in directory "${sourcePath}".`);
|
|
92
|
+
(0, log_1.log)('generalDebug_0003', `Matching in directory "${sourcePath}".`);
|
|
53
93
|
const pattern = deep ? '**/*' : '*';
|
|
54
|
-
const files = yield io_1.matchFiles(sourcePath, pattern);
|
|
94
|
+
const files = yield (0, io_1.matchFiles)(sourcePath, pattern);
|
|
55
95
|
return files.map((file) => ({
|
|
56
96
|
sourcePath: file,
|
|
57
|
-
targetPath: path_1.resolve(targetPath, path_1.relative(sourcePath, file)),
|
|
97
|
+
targetPath: (0, path_1.resolve)(targetPath, (0, path_1.relative)(sourcePath, file)),
|
|
58
98
|
}));
|
|
59
99
|
}
|
|
60
100
|
else if (globPatternStartIndicators.some((m) => from.indexOf(m) !== -1)) {
|
|
61
|
-
log_1.log('generalDebug_0003', `Matching using glob "${sourcePath}".`);
|
|
62
|
-
const files = yield io_1.matchFiles(source, from);
|
|
101
|
+
(0, log_1.log)('generalDebug_0003', `Matching using glob "${sourcePath}".`);
|
|
102
|
+
const files = yield (0, io_1.matchFiles)(source, from);
|
|
63
103
|
const parts = sourcePath.split('/');
|
|
64
104
|
for (let i = 0; i < parts.length; i++) {
|
|
65
105
|
const part = parts[i];
|
|
@@ -69,13 +109,13 @@ function getMatchingFiles(source, target, file) {
|
|
|
69
109
|
}
|
|
70
110
|
}
|
|
71
111
|
const relRoot = parts.join('/');
|
|
72
|
-
const tarRoot = path_1.resolve(target, to);
|
|
112
|
+
const tarRoot = (0, path_1.resolve)(target, to);
|
|
73
113
|
return files.map((file) => ({
|
|
74
114
|
sourcePath: file,
|
|
75
|
-
targetPath: path_1.resolve(tarRoot, path_1.relative(relRoot, file)),
|
|
115
|
+
targetPath: (0, path_1.resolve)(tarRoot, (0, path_1.relative)(relRoot, file)),
|
|
76
116
|
}));
|
|
77
117
|
}
|
|
78
|
-
log_1.log('generalDebug_0003', `Assume direct path source "${sourcePath}".`);
|
|
118
|
+
(0, log_1.log)('generalDebug_0003', `Assume direct path source "${sourcePath}".`);
|
|
79
119
|
return [
|
|
80
120
|
{
|
|
81
121
|
sourcePath,
|
|
@@ -85,94 +125,128 @@ function getMatchingFiles(source, target, file) {
|
|
|
85
125
|
});
|
|
86
126
|
}
|
|
87
127
|
function getPiralPath(root, name) {
|
|
88
|
-
const path =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return path_1.dirname(path);
|
|
92
|
-
}
|
|
93
|
-
exports.getPiralPath = getPiralPath;
|
|
94
|
-
function findPackageRoot(pck, baseDir) {
|
|
95
|
-
try {
|
|
96
|
-
return require.resolve(`${pck}/package.json`, {
|
|
97
|
-
paths: [baseDir],
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
catch (ex) {
|
|
101
|
-
log_1.log('generalDebug_0003', `Could not find the package root in "${baseDir}": ${ex}.`);
|
|
102
|
-
return undefined;
|
|
128
|
+
const path = (0, npm_2.findPackageRoot)(name, root);
|
|
129
|
+
if (!path) {
|
|
130
|
+
(0, log_1.fail)('invalidPiralReference_0043');
|
|
103
131
|
}
|
|
132
|
+
return (0, path_1.dirname)(path);
|
|
104
133
|
}
|
|
105
|
-
exports.
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const result = findPackage(item, baseDir);
|
|
110
|
-
if (result) {
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
const path = findPackageRoot(pck, baseDir);
|
|
134
|
+
exports.getPiralPath = getPiralPath;
|
|
135
|
+
function findPiralInstance(proposedApp, baseDir, port) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
const path = (0, npm_2.findPackageRoot)(proposedApp, baseDir);
|
|
117
138
|
if (path) {
|
|
118
|
-
log_1.log('generalDebug_0003', `Following the app package in "${path}" ...`);
|
|
119
|
-
const
|
|
139
|
+
(0, log_1.log)('generalDebug_0003', `Following the app package in "${path}" ...`);
|
|
140
|
+
const root = (0, path_1.dirname)(path);
|
|
141
|
+
const appPackage = yield (0, io_2.readJson)(root, (0, path_1.basename)(path));
|
|
120
142
|
const relPath = appPackage && appPackage.app;
|
|
121
|
-
appPackage.app = relPath && path_1.resolve(
|
|
143
|
+
appPackage.app = relPath && (0, path_1.resolve)(root, relPath);
|
|
144
|
+
appPackage.root = root;
|
|
145
|
+
appPackage.port = port;
|
|
122
146
|
return appPackage;
|
|
123
147
|
}
|
|
124
|
-
|
|
125
|
-
|
|
148
|
+
(0, log_1.fail)('appInstanceNotFound_0010', proposedApp);
|
|
149
|
+
});
|
|
126
150
|
}
|
|
151
|
+
exports.findPiralInstance = findPiralInstance;
|
|
152
|
+
function findPiralInstances(proposedApps, piletPackage, piletDefinition, baseDir) {
|
|
153
|
+
var _a;
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
if (proposedApps) {
|
|
156
|
+
// do nothing
|
|
157
|
+
}
|
|
158
|
+
else if (piletDefinition) {
|
|
159
|
+
const availableApps = Object.keys(piletDefinition.piralInstances || {});
|
|
160
|
+
proposedApps = availableApps.filter((m) => piletDefinition.piralInstances[m].selected);
|
|
161
|
+
if (proposedApps.length === 0) {
|
|
162
|
+
proposedApps = availableApps.slice(0, 1);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
proposedApps = [(_a = piletPackage.piral) === null || _a === void 0 ? void 0 : _a.name].filter(Boolean);
|
|
167
|
+
}
|
|
168
|
+
if (proposedApps.length > 0) {
|
|
169
|
+
return Promise.all(proposedApps.map((proposedApp) => { var _a, _b, _c; return findPiralInstance(proposedApp, baseDir, (_c = (_b = (_a = piletDefinition === null || piletDefinition === void 0 ? void 0 : piletDefinition.piralInstances) === null || _a === void 0 ? void 0 : _a[proposedApp]) === null || _b === void 0 ? void 0 : _b.port) !== null && _c !== void 0 ? _c : 0); }));
|
|
170
|
+
}
|
|
171
|
+
return [];
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
exports.findPiralInstances = findPiralInstances;
|
|
127
175
|
function readPiralPackage(root, name) {
|
|
128
|
-
log_1.log('generalDebug_0003', `Reading the piral package in "${root}" ...`);
|
|
176
|
+
(0, log_1.log)('generalDebug_0003', `Reading the piral package in "${root}" ...`);
|
|
129
177
|
const path = getPiralPath(root, name);
|
|
130
|
-
return io_2.readJson(path, 'package.json');
|
|
178
|
+
return (0, io_2.readJson)(path, 'package.json');
|
|
131
179
|
}
|
|
132
180
|
exports.readPiralPackage = readPiralPackage;
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
181
|
+
function patchPiralPackage(root, app, data, version, bundler) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
(0, log_1.log)('generalDebug_0003', `Patching the package.json in "${root}" ...`);
|
|
184
|
+
const pkg = yield getPiralPackage(app, data, version, bundler);
|
|
185
|
+
yield (0, io_2.updateExistingJson)(root, 'package.json', pkg);
|
|
186
|
+
(0, log_1.log)('generalDebug_0003', `Succesfully patched the package.json.`);
|
|
187
|
+
yield (0, io_2.updateExistingJson)(root, constants_1.piralJson, {
|
|
188
|
+
$schema: constants_1.piralJsonSchemaUrl,
|
|
189
|
+
pilets: getPiletsInfo({}),
|
|
190
|
+
});
|
|
191
|
+
(0, log_1.log)('generalDebug_0003', `Succesfully patched the pilet.json.`);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
exports.patchPiralPackage = patchPiralPackage;
|
|
195
|
+
function getPiralPackage(app, data, version, bundler) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const framework = data.packageName;
|
|
198
|
+
const devDependencies = Object.assign(Object.assign({}, (0, language_1.getDevDependencies)(data.language, (0, language_2.getDevDependencyPackages)(framework, data.reactVersion, data.reactRouterVersion))), { 'piral-cli': `${version}` });
|
|
199
|
+
const dependencies = Object.assign(Object.assign({}, (0, language_2.getFrameworkDependencies)(framework, version)), (0, language_1.getDependencies)(data.language, (0, language_1.getDependencyPackages)(framework, data.reactVersion, data.reactRouterVersion)));
|
|
200
|
+
yield appendBundler(devDependencies, bundler, version);
|
|
201
|
+
return {
|
|
202
|
+
app,
|
|
203
|
+
scripts: {
|
|
204
|
+
start: 'piral debug',
|
|
205
|
+
build: 'piral build',
|
|
206
|
+
postinstall: 'piral declaration',
|
|
207
|
+
},
|
|
208
|
+
types: 'dist/index.d.ts',
|
|
209
|
+
importmap: {
|
|
210
|
+
imports: {},
|
|
211
|
+
inherit: [
|
|
212
|
+
'piral-base',
|
|
213
|
+
framework !== 'piral-base' && 'piral-core',
|
|
214
|
+
framework === 'piral' && 'piral', // this we take only if we selected piral
|
|
215
|
+
].filter(Boolean),
|
|
216
|
+
},
|
|
217
|
+
dependencies,
|
|
218
|
+
devDependencies,
|
|
219
|
+
};
|
|
220
|
+
});
|
|
148
221
|
}
|
|
149
222
|
exports.getPiralPackage = getPiralPackage;
|
|
150
|
-
function getAvailableFiles(root, name,
|
|
223
|
+
function getAvailableFiles(root, name, dirName, fileMap) {
|
|
151
224
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
225
|
const source = getPiralPath(root, name);
|
|
153
|
-
|
|
154
|
-
|
|
226
|
+
const tgz = `${dirName}.tar`;
|
|
227
|
+
(0, log_1.log)('generalDebug_0003', `Checking if "${tgz}" exists in "${source}" ...`);
|
|
228
|
+
const exists = yield (0, io_2.checkExists)((0, path_1.resolve)(source, tgz));
|
|
155
229
|
if (exists) {
|
|
156
|
-
yield archive_1.unpackTarball(source,
|
|
230
|
+
yield (0, archive_1.unpackTarball)(source, tgz);
|
|
157
231
|
}
|
|
158
|
-
log_1.log('generalDebug_0003', `Get matching files from "${source}".`);
|
|
159
|
-
const base = path_1.resolve(source,
|
|
160
|
-
const files = yield io_1.matchFiles(base, '**/*');
|
|
232
|
+
(0, log_1.log)('generalDebug_0003', `Get matching files from "${source}".`);
|
|
233
|
+
const base = (0, path_1.resolve)(source, dirName);
|
|
234
|
+
const files = yield (0, io_1.matchFiles)(base, '**/*');
|
|
161
235
|
return files.map((file) => ({
|
|
162
236
|
sourcePath: file,
|
|
163
|
-
targetPath: path_1.resolve(root, path_1.relative(base, file)),
|
|
237
|
+
targetPath: (0, path_1.resolve)(root, (0, path_1.relative)(base, file)),
|
|
164
238
|
}));
|
|
165
239
|
});
|
|
166
240
|
}
|
|
167
|
-
function getFileStats(root, name) {
|
|
241
|
+
function getFileStats(root, name, fileMap = []) {
|
|
168
242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
const files = yield getAvailableFiles(root, name, constants_1.filesTar);
|
|
243
|
+
const files = yield getAvailableFiles(root, name, constants_1.filesTar, fileMap);
|
|
170
244
|
return yield Promise.all(files.map((file) => __awaiter(this, void 0, void 0, function* () {
|
|
171
245
|
const { sourcePath, targetPath } = file;
|
|
172
|
-
const sourceHash = yield io_1.getHash(sourcePath);
|
|
173
|
-
log_1.log('generalDebug_0003', `Obtained hash from "${sourcePath}": ${sourceHash}`);
|
|
174
|
-
const targetHash = yield io_1.getHash(targetPath);
|
|
175
|
-
log_1.log('generalDebug_0003', `Obtained hash from "${targetPath}": ${targetHash}`);
|
|
246
|
+
const sourceHash = yield (0, io_1.getHash)(sourcePath);
|
|
247
|
+
(0, log_1.log)('generalDebug_0003', `Obtained hash from "${sourcePath}": ${sourceHash}`);
|
|
248
|
+
const targetHash = yield (0, io_1.getHash)(targetPath);
|
|
249
|
+
(0, log_1.log)('generalDebug_0003', `Obtained hash from "${targetPath}": ${targetHash}`);
|
|
176
250
|
return {
|
|
177
251
|
path: targetPath,
|
|
178
252
|
hash: targetHash,
|
|
@@ -182,25 +256,25 @@ function getFileStats(root, name) {
|
|
|
182
256
|
});
|
|
183
257
|
}
|
|
184
258
|
exports.getFileStats = getFileStats;
|
|
185
|
-
function copyFiles(subfiles, forceOverwrite, originalFiles) {
|
|
259
|
+
function copyFiles(subfiles, forceOverwrite, originalFiles, variables) {
|
|
186
260
|
return __awaiter(this, void 0, void 0, function* () {
|
|
187
261
|
for (const subfile of subfiles) {
|
|
188
262
|
const { sourcePath, targetPath } = subfile;
|
|
189
|
-
const exists = yield io_2.checkExists(sourcePath);
|
|
263
|
+
const exists = yield (0, io_2.checkExists)(sourcePath);
|
|
190
264
|
if (exists) {
|
|
191
265
|
const overwrite = originalFiles.some((m) => m.path === targetPath && !m.changed);
|
|
192
266
|
const force = overwrite ? enums_1.ForceOverwrite.yes : forceOverwrite;
|
|
193
|
-
yield io_2.copy(sourcePath, targetPath, force);
|
|
267
|
+
yield (0, io_2.copy)(sourcePath, targetPath, force);
|
|
194
268
|
}
|
|
195
269
|
else {
|
|
196
|
-
log_1.fail('cannotFindFile_0046', sourcePath);
|
|
270
|
+
(0, log_1.fail)('cannotFindFile_0046', sourcePath);
|
|
197
271
|
}
|
|
198
272
|
}
|
|
199
273
|
});
|
|
200
274
|
}
|
|
201
|
-
function copyScaffoldingFiles(source, target, files, piralInfo) {
|
|
275
|
+
function copyScaffoldingFiles(source, target, files, piralInfo, variables) {
|
|
202
276
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
log_1.log('generalDebug_0003', `Copying the scaffolding files ...`);
|
|
277
|
+
(0, log_1.log)('generalDebug_0003', `Copying the scaffolding files ...`);
|
|
204
278
|
const allFiles = [];
|
|
205
279
|
for (const file of files) {
|
|
206
280
|
const subfiles = yield getMatchingFiles(source, target, file);
|
|
@@ -209,17 +283,17 @@ function copyScaffoldingFiles(source, target, files, piralInfo) {
|
|
|
209
283
|
if (piralInfo) {
|
|
210
284
|
yield extendPackageOverridesFromTemplateFragment(target, piralInfo, allFiles);
|
|
211
285
|
}
|
|
212
|
-
yield copyFiles(allFiles, enums_1.ForceOverwrite.yes, []);
|
|
286
|
+
yield copyFiles(allFiles, enums_1.ForceOverwrite.yes, [], variables);
|
|
213
287
|
});
|
|
214
288
|
}
|
|
215
289
|
exports.copyScaffoldingFiles = copyScaffoldingFiles;
|
|
216
290
|
function extendPackageOverridesFromTemplateFragment(root, piralInfo, files) {
|
|
217
291
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
-
const packageTarget = path_1.resolve(root, 'package.json');
|
|
292
|
+
const packageTarget = (0, path_1.resolve)(root, 'package.json');
|
|
219
293
|
for (let i = files.length; i--;) {
|
|
220
294
|
const file = files[i];
|
|
221
295
|
if (file.targetPath === packageTarget) {
|
|
222
|
-
const fragment = yield io_2.readJson(path_1.dirname(file.sourcePath), path_1.basename(file.sourcePath));
|
|
296
|
+
const fragment = yield (0, io_2.readJson)((0, path_1.dirname)(file.sourcePath), (0, path_1.basename)(file.sourcePath));
|
|
223
297
|
files.splice(i, 1);
|
|
224
298
|
if (!piralInfo.pilets) {
|
|
225
299
|
piralInfo.pilets = {};
|
|
@@ -232,26 +306,40 @@ function extendPackageOverridesFromTemplateFragment(root, piralInfo, files) {
|
|
|
232
306
|
}
|
|
233
307
|
});
|
|
234
308
|
}
|
|
235
|
-
function
|
|
309
|
+
function isTemplateFileLocation(item) {
|
|
310
|
+
return typeof item === 'object';
|
|
311
|
+
}
|
|
312
|
+
function tryFindPackageVersion(packageName) {
|
|
313
|
+
try {
|
|
314
|
+
const { version } = require(`${packageName}/package.json`);
|
|
315
|
+
return version;
|
|
316
|
+
}
|
|
317
|
+
catch (_a) {
|
|
318
|
+
return undefined;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function copyPiralFiles(root, name, piralInfo, forceOverwrite, variables, originalFiles) {
|
|
236
322
|
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
log_1.log('generalDebug_0003', `Copying the Piral files ...`);
|
|
238
|
-
const files =
|
|
323
|
+
(0, log_1.log)('generalDebug_0003', `Copying the Piral files ...`);
|
|
324
|
+
const { files: _files } = getPiletsInfo(piralInfo);
|
|
325
|
+
const fileMap = _files.filter(isTemplateFileLocation);
|
|
326
|
+
const files = yield getAvailableFiles(root, name, constants_1.filesTar, fileMap);
|
|
239
327
|
if (originalFiles === undefined) {
|
|
240
|
-
const initialFiles = yield getAvailableFiles(root, name, constants_1.filesOnceTar);
|
|
328
|
+
const initialFiles = yield getAvailableFiles(root, name, constants_1.filesOnceTar, fileMap);
|
|
241
329
|
files.push(...initialFiles);
|
|
242
330
|
originalFiles = [];
|
|
243
331
|
}
|
|
244
332
|
yield extendPackageOverridesFromTemplateFragment(root, piralInfo, files);
|
|
245
|
-
yield copyFiles(files, forceOverwrite, originalFiles);
|
|
333
|
+
yield copyFiles(files, forceOverwrite, originalFiles, variables);
|
|
246
334
|
});
|
|
247
335
|
}
|
|
248
336
|
exports.copyPiralFiles = copyPiralFiles;
|
|
249
337
|
function getPiletsInfo(piralInfo) {
|
|
250
|
-
const { files = [],
|
|
338
|
+
const { files = [], scripts = {}, template = 'default', validators = {}, devDependencies = {}, preScaffold = '', postScaffold = '', preUpgrade = '', postUpgrade = '', packageOverrides = {}, } = piralInfo.pilets || {};
|
|
251
339
|
return {
|
|
252
340
|
files,
|
|
253
|
-
externals,
|
|
254
341
|
scripts,
|
|
342
|
+
template,
|
|
255
343
|
validators,
|
|
256
344
|
devDependencies,
|
|
257
345
|
preScaffold,
|
|
@@ -264,23 +352,23 @@ function getPiletsInfo(piralInfo) {
|
|
|
264
352
|
exports.getPiletsInfo = getPiletsInfo;
|
|
265
353
|
function retrievePiralRoot(baseDir, entry) {
|
|
266
354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
267
|
-
const rootDir = path_1.join(baseDir, entry);
|
|
268
|
-
log_1.log('generalDebug_0003', `Retrieving Piral root from "${rootDir}" ...`);
|
|
269
|
-
if (!constants_1.declarationEntryExtensions.includes(path_1.extname(rootDir).toLowerCase())) {
|
|
270
|
-
const packageName = path_1.basename(rootDir) === 'package.json' ? rootDir : path_1.join(rootDir, 'package.json');
|
|
271
|
-
log_1.log('generalDebug_0003', `Trying to get entry point from "${packageName}".`);
|
|
272
|
-
const exists = yield io_2.checkExists(packageName);
|
|
355
|
+
const rootDir = (0, path_1.join)(baseDir, entry);
|
|
356
|
+
(0, log_1.log)('generalDebug_0003', `Retrieving Piral root from "${rootDir}" ...`);
|
|
357
|
+
if (!constants_1.declarationEntryExtensions.includes((0, path_1.extname)(rootDir).toLowerCase())) {
|
|
358
|
+
const packageName = (0, path_1.basename)(rootDir) === 'package.json' ? rootDir : (0, path_1.join)(rootDir, 'package.json');
|
|
359
|
+
(0, log_1.log)('generalDebug_0003', `Trying to get entry point from "${packageName}".`);
|
|
360
|
+
const exists = yield (0, io_2.checkExists)(packageName);
|
|
273
361
|
if (!exists) {
|
|
274
|
-
log_1.fail('entryPointMissing_0070', rootDir);
|
|
362
|
+
(0, log_1.fail)('entryPointMissing_0070', rootDir);
|
|
275
363
|
}
|
|
276
364
|
const { app } = require(packageName);
|
|
277
365
|
if (!app) {
|
|
278
|
-
log_1.fail('entryPointMissing_0071');
|
|
366
|
+
(0, log_1.fail)('entryPointMissing_0071');
|
|
279
367
|
}
|
|
280
|
-
log_1.log('generalDebug_0003', `Found app entry point in "${app}".`);
|
|
281
|
-
return path_1.join(path_1.dirname(packageName), app);
|
|
368
|
+
(0, log_1.log)('generalDebug_0003', `Found app entry point in "${app}".`);
|
|
369
|
+
return (0, path_1.join)((0, path_1.dirname)(packageName), app);
|
|
282
370
|
}
|
|
283
|
-
log_1.log('generalDebug_0003', `Found app entry point in "${rootDir}".`);
|
|
371
|
+
(0, log_1.log)('generalDebug_0003', `Found app entry point in "${rootDir}".`);
|
|
284
372
|
return rootDir;
|
|
285
373
|
});
|
|
286
374
|
}
|
|
@@ -291,89 +379,156 @@ function checkArrayOrUndefined(obj, key) {
|
|
|
291
379
|
return items;
|
|
292
380
|
}
|
|
293
381
|
else if (items !== undefined) {
|
|
294
|
-
log_1.log('expectedArray_0072', key, typeof items);
|
|
382
|
+
(0, log_1.log)('expectedArray_0072', key, typeof items);
|
|
295
383
|
}
|
|
296
384
|
return undefined;
|
|
297
385
|
}
|
|
298
|
-
function findDependencyVersion(pckg, rootPath,
|
|
386
|
+
function findDependencyVersion(pckg, rootPath, dependency) {
|
|
299
387
|
var _a;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
388
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
389
|
+
const { devDependencies = {}, dependencies = {} } = pckg;
|
|
390
|
+
const packageName = dependency.name;
|
|
391
|
+
const desiredVersion = (_a = dependencies[packageName]) !== null && _a !== void 0 ? _a : devDependencies[packageName];
|
|
392
|
+
const [parent] = dependency.parents || [];
|
|
393
|
+
if (desiredVersion) {
|
|
394
|
+
if ((0, npm_1.isNpmPackage)(desiredVersion)) {
|
|
395
|
+
return desiredVersion;
|
|
396
|
+
}
|
|
397
|
+
else if ((0, npm_1.isGitPackage)(desiredVersion)) {
|
|
398
|
+
return (0, npm_1.makeGitUrl)(desiredVersion);
|
|
399
|
+
}
|
|
400
|
+
else if ((0, npm_1.isLocalPackage)(rootPath, desiredVersion)) {
|
|
401
|
+
return (0, npm_1.makeFilePath)(rootPath, desiredVersion);
|
|
402
|
+
}
|
|
305
403
|
}
|
|
306
|
-
|
|
307
|
-
|
|
404
|
+
if (parent) {
|
|
405
|
+
// in case the dependency came from another package (= parent)
|
|
406
|
+
// we should start the lookup in its directory (pnpm issue)
|
|
407
|
+
const parentPath = (0, npm_1.tryResolvePackage)(parent, rootPath);
|
|
408
|
+
if (parentPath) {
|
|
409
|
+
rootPath = (0, path_1.dirname)(parentPath);
|
|
410
|
+
}
|
|
308
411
|
}
|
|
309
|
-
|
|
310
|
-
|
|
412
|
+
const version = yield findPackageVersion(rootPath, packageName);
|
|
413
|
+
if (dependency.alias) {
|
|
414
|
+
return (0, npm_2.makeNpmAlias)(dependency.alias, version);
|
|
415
|
+
}
|
|
416
|
+
return version;
|
|
417
|
+
});
|
|
311
418
|
}
|
|
312
419
|
exports.findDependencyVersion = findDependencyVersion;
|
|
313
420
|
function findPackageVersion(rootPath, packageName) {
|
|
314
421
|
return __awaiter(this, void 0, void 0, function* () {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
422
|
+
const packages = Array.isArray(packageName) ? packageName : [packageName];
|
|
423
|
+
for (const pckg of packages) {
|
|
424
|
+
try {
|
|
425
|
+
(0, log_1.log)('generalDebug_0003', `Finding the version of "${packageName}" in "${rootPath}".`);
|
|
426
|
+
const moduleName = (0, external_1.getModulePath)(rootPath, pckg);
|
|
427
|
+
const packageJson = yield (0, io_2.findFile)(moduleName, 'package.json');
|
|
428
|
+
const root = (0, path_1.dirname)(packageJson);
|
|
429
|
+
const { version } = yield (0, io_2.readJson)(root, 'package.json');
|
|
430
|
+
return version;
|
|
431
|
+
}
|
|
432
|
+
catch (_a) { }
|
|
326
433
|
}
|
|
434
|
+
(0, log_1.log)('cannotResolveDependency_0053', packages, rootPath);
|
|
435
|
+
return 'latest';
|
|
327
436
|
});
|
|
328
437
|
}
|
|
329
438
|
exports.findPackageVersion = findPackageVersion;
|
|
439
|
+
function flattenExternals(dependencies) {
|
|
440
|
+
return dependencies.map((m) => m.name).filter(utils_1.onlyUnique);
|
|
441
|
+
}
|
|
442
|
+
exports.flattenExternals = flattenExternals;
|
|
443
|
+
function retrieveExternals(root, packageInfo) {
|
|
444
|
+
var _a;
|
|
445
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
446
|
+
const sharedDependencies = yield (0, importmap_1.readImportmap)(root, packageInfo);
|
|
447
|
+
if (sharedDependencies.length === 0) {
|
|
448
|
+
const allDeps = Object.assign(Object.assign({}, packageInfo.devDependencies), packageInfo.dependencies);
|
|
449
|
+
const deps = (_a = packageInfo.pilets) === null || _a === void 0 ? void 0 : _a.externals;
|
|
450
|
+
const externals = yield (0, npm_2.makeExternals)(root, allDeps, deps);
|
|
451
|
+
return externals.map((ext) => ({
|
|
452
|
+
id: ext,
|
|
453
|
+
name: ext,
|
|
454
|
+
entry: ext,
|
|
455
|
+
type: 'local',
|
|
456
|
+
ref: undefined,
|
|
457
|
+
requireId: ext,
|
|
458
|
+
}));
|
|
459
|
+
}
|
|
460
|
+
return sharedDependencies;
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
exports.retrieveExternals = retrieveExternals;
|
|
330
464
|
function retrievePiletsInfo(entryFile) {
|
|
331
465
|
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
-
const exists = yield io_2.checkExists(entryFile);
|
|
466
|
+
const exists = yield (0, io_2.checkExists)(entryFile);
|
|
333
467
|
if (!exists) {
|
|
334
|
-
log_1.fail('entryPointDoesNotExist_0073', entryFile);
|
|
468
|
+
(0, log_1.fail)('entryPointDoesNotExist_0073', entryFile);
|
|
335
469
|
}
|
|
336
|
-
const
|
|
337
|
-
if (!
|
|
338
|
-
log_1.fail('packageJsonMissing_0074');
|
|
470
|
+
const packageJsonPath = yield (0, io_2.findFile)(entryFile, constants_1.packageJson);
|
|
471
|
+
if (!packageJsonPath) {
|
|
472
|
+
(0, log_1.fail)('packageJsonMissing_0074');
|
|
339
473
|
}
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
474
|
+
const root = (0, path_1.dirname)(packageJsonPath);
|
|
475
|
+
const packageInfo = yield (0, io_2.readJson)(root, constants_1.packageJson);
|
|
476
|
+
const piralJsonPkg = yield (0, io_2.readJson)(root, constants_1.piralJson);
|
|
477
|
+
const pilets = Object.assign(Object.assign({}, getPiletsInfo(packageInfo)), piralJsonPkg.pilets);
|
|
478
|
+
const externals = yield retrieveExternals(root, packageInfo);
|
|
479
|
+
const dependencies = {
|
|
480
|
+
std: packageInfo.dependencies || {},
|
|
481
|
+
dev: packageInfo.devDependencies || {},
|
|
482
|
+
peer: packageInfo.peerDependencies || {},
|
|
483
|
+
};
|
|
484
|
+
const framework = constants_1.frameworkLibs.find((lib) => lib in dependencies.std || lib in dependencies.dev);
|
|
485
|
+
return Object.assign(Object.assign({}, pilets), { externals, name: packageInfo.name, version: packageInfo.version, framework,
|
|
486
|
+
dependencies, scripts: packageInfo.scripts, ignored: checkArrayOrUndefined(packageInfo, 'preservedDependencies'), root });
|
|
346
487
|
});
|
|
347
488
|
}
|
|
348
489
|
exports.retrievePiletsInfo = retrievePiletsInfo;
|
|
490
|
+
function validateSharedDependencies(externals) {
|
|
491
|
+
// See #591 - we should warn in case somebody shared piral packages
|
|
492
|
+
for (const external of externals) {
|
|
493
|
+
const name = external.name;
|
|
494
|
+
if (external.type === 'local' && name.startsWith('piral-') && name.indexOf('/') === -1) {
|
|
495
|
+
(0, log_1.log)('invalidSharedDependency_0029', name);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
exports.validateSharedDependencies = validateSharedDependencies;
|
|
349
500
|
function isValidDependency(name) {
|
|
350
501
|
// super simple check at the moment
|
|
351
502
|
// just to filter out things like "redux-saga/effects" and "@scope/redux-saga/effects"
|
|
352
503
|
return name.indexOf('/') === -1 || (name.indexOf('@') === 0 && name.split('/').length < 3);
|
|
353
504
|
}
|
|
354
505
|
exports.isValidDependency = isValidDependency;
|
|
355
|
-
function patchPiletPackage(root, name, version, piralInfo, newInfo) {
|
|
506
|
+
function patchPiletPackage(root, name, version, piralInfo, fromEmulator, newInfo) {
|
|
356
507
|
return __awaiter(this, void 0, void 0, function* () {
|
|
357
|
-
log_1.log('generalDebug_0003', `Patching the package.json in "${root}" ...`);
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
508
|
+
(0, log_1.log)('generalDebug_0003', `Patching the package.json in "${root}" ...`);
|
|
509
|
+
const pkg = yield getPiletPackage(root, name, version, piralInfo, fromEmulator, newInfo);
|
|
510
|
+
yield (0, io_2.updateExistingJson)(root, constants_1.packageJson, pkg);
|
|
511
|
+
(0, log_1.log)('generalDebug_0003', `Succesfully patched the package.json.`);
|
|
512
|
+
yield (0, io_2.updateExistingJson)(root, constants_1.piletJson, {
|
|
513
|
+
$schema: constants_1.piletJsonSchemaUrl,
|
|
514
|
+
piralInstances: {
|
|
515
|
+
[name]: {},
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
(0, log_1.log)('generalDebug_0003', `Succesfully patched the pilet.json.`);
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
exports.patchPiletPackage = patchPiletPackage;
|
|
522
|
+
function getPiletPackage(root, name, version, piralInfo, fromEmulator, newInfo) {
|
|
523
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
524
|
+
const { piralCLI = { version: info_1.cliVersion } } = piralInfo;
|
|
525
|
+
const _a = getPiletsInfo(piralInfo), { packageOverrides } = _a, info = __rest(_a, ["packageOverrides"]);
|
|
363
526
|
const piralDependencies = Object.assign(Object.assign({}, piralInfo.devDependencies), piralInfo.dependencies);
|
|
364
|
-
const
|
|
365
|
-
const
|
|
527
|
+
const toolVersion = piralCLI.version;
|
|
528
|
+
const typeDependencies = newInfo ? (0, language_1.getDevDependencies)(newInfo.language) : {};
|
|
366
529
|
const scripts = newInfo
|
|
367
530
|
? Object.assign({ start: 'pilet debug', build: 'pilet build', upgrade: 'pilet upgrade' }, info.scripts) : info.scripts;
|
|
368
|
-
const
|
|
369
|
-
const peerDependencies = Object.assign(Object.assign({}, allExternals.reduce((deps, name) => {
|
|
370
|
-
const valid = isValidDependency(name);
|
|
371
|
-
deps[name] = valid ? '*' : undefined;
|
|
372
|
-
if (!valid) {
|
|
373
|
-
peerModules.push(name);
|
|
374
|
-
}
|
|
375
|
-
return deps;
|
|
376
|
-
}, {})), { [name]: `*` });
|
|
531
|
+
const allExternals = yield (0, npm_2.makePiletExternals)(root, piralDependencies, fromEmulator, piralInfo);
|
|
377
532
|
const devDependencies = Object.assign(Object.assign(Object.assign(Object.assign({}, Object.keys(typeDependencies).reduce((deps, name) => {
|
|
378
533
|
deps[name] = piralDependencies[name] || typeDependencies[name];
|
|
379
534
|
return deps;
|
|
@@ -381,102 +536,111 @@ function patchPiletPackage(root, name, version, piralInfo, newInfo) {
|
|
|
381
536
|
deps[name] = getDependencyVersion(name, info.devDependencies, piralDependencies);
|
|
382
537
|
return deps;
|
|
383
538
|
}, {})), allExternals.filter(isValidDependency).reduce((deps, name) => {
|
|
384
|
-
const version = piralDependencies[name];
|
|
539
|
+
const version = piralDependencies[name] || tryFindPackageVersion(name);
|
|
385
540
|
if (version || newInfo) {
|
|
386
541
|
// set only if we have an explicit version or we are in the scaffolding case
|
|
387
542
|
deps[name] = version || 'latest';
|
|
388
543
|
}
|
|
389
544
|
return deps;
|
|
390
|
-
}, {})), { [name]: `${version || piralInfo.version}
|
|
545
|
+
}, {})), { [name]: `${version || piralInfo.version}`, ['piral-cli']: toolVersion });
|
|
391
546
|
if (newInfo) {
|
|
392
|
-
|
|
393
|
-
devDependencies['piral-cli'] = `^${info_1.cliVersion}`;
|
|
394
|
-
if (bundler && bundler !== 'none') {
|
|
395
|
-
devDependencies[`piral-cli-${bundler}`] = `^${info_1.cliVersion}`;
|
|
396
|
-
}
|
|
547
|
+
yield appendBundler(devDependencies, newInfo.bundler, toolVersion);
|
|
397
548
|
}
|
|
398
|
-
|
|
399
|
-
|
|
549
|
+
return (0, merge_1.deepMerge)(packageOverrides, {
|
|
550
|
+
importmap: {
|
|
551
|
+
imports: {},
|
|
552
|
+
inherit: [name],
|
|
553
|
+
},
|
|
400
554
|
devDependencies,
|
|
401
|
-
peerDependencies,
|
|
402
|
-
peerModules,
|
|
403
555
|
dependencies: {
|
|
404
556
|
[name]: undefined,
|
|
405
557
|
},
|
|
406
558
|
scripts,
|
|
407
559
|
});
|
|
408
|
-
yield io_2.updateExistingJson(root, 'package.json', packageContent);
|
|
409
|
-
log_1.log('generalDebug_0003', `Succesfully patched the package.json.`);
|
|
410
560
|
});
|
|
411
561
|
}
|
|
412
|
-
exports.patchPiletPackage = patchPiletPackage;
|
|
413
562
|
/**
|
|
414
563
|
* Returns true if its an emulator package, otherwise it has to be a "raw" app shell.
|
|
415
564
|
*/
|
|
416
565
|
function checkAppShellPackage(appPackage) {
|
|
417
566
|
const { piralCLI = { generated: false, version: info_1.cliVersion } } = appPackage;
|
|
418
567
|
if (piralCLI.generated) {
|
|
419
|
-
compatibility_1.checkAppShellCompatibility(piralCLI.version);
|
|
568
|
+
(0, compatibility_1.checkAppShellCompatibility)(piralCLI.version);
|
|
420
569
|
return true;
|
|
421
570
|
}
|
|
422
|
-
log_1.log('generalDebug_0003', `Missing "piralCLI" section. Assume raw app shell.`);
|
|
571
|
+
(0, log_1.log)('generalDebug_0003', `Missing "piralCLI" section. Assume raw app shell.`);
|
|
423
572
|
return false;
|
|
424
573
|
}
|
|
425
574
|
exports.checkAppShellPackage = checkAppShellPackage;
|
|
426
|
-
function
|
|
575
|
+
function combinePiletExternals(appShells, peerDependencies, peerModules, importmap) {
|
|
576
|
+
const externals = [...Object.keys(peerDependencies), ...peerModules];
|
|
577
|
+
for (let i = importmap.length; i--;) {
|
|
578
|
+
const entry = importmap[i];
|
|
579
|
+
// if the entry has no parents, i.e., it was explicitly mentioned in the importmap
|
|
580
|
+
// then keep it in the importmap (=> prefer the distributed approach, which will always work)
|
|
581
|
+
if (Array.isArray(entry.parents)) {
|
|
582
|
+
// only accept entry as a centrally shared dependency if the entry appears in all
|
|
583
|
+
// mentioned / referenced app shells
|
|
584
|
+
// in other cases (e.g., if one app shell does not share this) use the distributed
|
|
585
|
+
// mechanism to ensure that the dependency can also be resolved in this shell
|
|
586
|
+
if (appShells.every((app) => entry.parents.includes(app))) {
|
|
587
|
+
externals.push(entry.name);
|
|
588
|
+
importmap.splice(i, 1);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return externals;
|
|
593
|
+
}
|
|
594
|
+
exports.combinePiletExternals = combinePiletExternals;
|
|
595
|
+
function findPiletRoot(proposedRoot) {
|
|
427
596
|
return __awaiter(this, void 0, void 0, function* () {
|
|
428
|
-
const packageJson = yield io_2.findFile(
|
|
597
|
+
const packageJson = yield (0, io_2.findFile)(proposedRoot, 'package.json');
|
|
429
598
|
if (!packageJson) {
|
|
430
|
-
log_1.fail('packageJsonMissing_0075');
|
|
599
|
+
(0, log_1.fail)('packageJsonMissing_0075');
|
|
431
600
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
601
|
+
return (0, path_1.dirname)(packageJson);
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
exports.findPiletRoot = findPiletRoot;
|
|
605
|
+
function retrievePiletData(target, app) {
|
|
606
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
607
|
+
const piletJsonPath = yield (0, io_2.findFile)(target, constants_1.piletJson);
|
|
608
|
+
const proposedRoot = piletJsonPath ? (0, path_1.dirname)(piletJsonPath) : target;
|
|
609
|
+
const root = yield findPiletRoot(proposedRoot);
|
|
610
|
+
const piletPackage = yield (0, io_2.readJson)(root, 'package.json');
|
|
611
|
+
const piletDefinition = piletJsonPath && (yield (0, io_2.readJson)(proposedRoot, constants_1.piletJson));
|
|
612
|
+
const appPackages = yield findPiralInstances(app && [app], piletPackage, piletDefinition, target);
|
|
613
|
+
const apps = [];
|
|
614
|
+
for (const appPackage of appPackages) {
|
|
615
|
+
const appFile = appPackage === null || appPackage === void 0 ? void 0 : appPackage.app;
|
|
616
|
+
const appRoot = appPackage === null || appPackage === void 0 ? void 0 : appPackage.root;
|
|
617
|
+
const appPort = appPackage === null || appPackage === void 0 ? void 0 : appPackage.port;
|
|
618
|
+
if (!appFile || !appRoot) {
|
|
619
|
+
(0, log_1.fail)('appInstanceInvalid_0011');
|
|
620
|
+
}
|
|
621
|
+
const emulator = checkAppShellPackage(appPackage);
|
|
622
|
+
apps.push({
|
|
623
|
+
appPackage,
|
|
624
|
+
appFile,
|
|
625
|
+
appRoot,
|
|
626
|
+
emulator,
|
|
627
|
+
appPort,
|
|
628
|
+
});
|
|
438
629
|
}
|
|
439
|
-
const
|
|
630
|
+
const importmap = yield (0, importmap_1.readImportmap)(root, piletPackage);
|
|
440
631
|
return {
|
|
441
632
|
dependencies: piletPackage.dependencies || {},
|
|
442
633
|
devDependencies: piletPackage.devDependencies || {},
|
|
443
634
|
peerDependencies: piletPackage.peerDependencies || {},
|
|
444
635
|
peerModules: piletPackage.peerModules || [],
|
|
445
636
|
ignored: checkArrayOrUndefined(piletPackage, 'preservedDependencies'),
|
|
446
|
-
|
|
637
|
+
schema: piletDefinition === null || piletDefinition === void 0 ? void 0 : piletDefinition.schemaVersion,
|
|
638
|
+
importmap,
|
|
639
|
+
apps,
|
|
447
640
|
piletPackage,
|
|
448
|
-
appPackage,
|
|
449
|
-
emulator,
|
|
450
641
|
root,
|
|
451
642
|
};
|
|
452
643
|
});
|
|
453
644
|
}
|
|
454
645
|
exports.retrievePiletData = retrievePiletData;
|
|
455
|
-
function findEntryModule(entryFile, target) {
|
|
456
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
457
|
-
const entry = path_1.basename(entryFile);
|
|
458
|
-
const files = yield io_1.getFileNames(target);
|
|
459
|
-
const preferences = ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.cjs', '.esm', '.es', '.es6', '.html'];
|
|
460
|
-
const results = [];
|
|
461
|
-
log_1.log('generalDebug_0003', `Found ${files.length} potential entry points in "${target}".`);
|
|
462
|
-
for (const file of files) {
|
|
463
|
-
const ext = path_1.extname(file);
|
|
464
|
-
const fullPath = path_1.join(target, file);
|
|
465
|
-
if (file === entry) {
|
|
466
|
-
return fullPath;
|
|
467
|
-
}
|
|
468
|
-
else if (file.replace(ext, '') === entry) {
|
|
469
|
-
const prefIndex = preferences.indexOf(ext);
|
|
470
|
-
if (prefIndex !== -1) {
|
|
471
|
-
results[prefIndex] = fullPath;
|
|
472
|
-
}
|
|
473
|
-
else {
|
|
474
|
-
results[preferences.length] = fullPath;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
return results.filter(Boolean).shift() || entryFile;
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
exports.findEntryModule = findEntryModule;
|
|
482
646
|
//# sourceMappingURL=package.js.map
|