piral-cli 1.0.0-pre.2296 → 1.0.1-beta.5640
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/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[](https://piral.io)
|
|
2
2
|
|
|
3
|
-
# [Piral CLI](https://piral.io) · [](https://github.com/smapiot/piral/blob/
|
|
3
|
+
# [Piral CLI](https://piral.io) · [](https://github.com/smapiot/piral/blob/main/LICENSE) [](https://www.npmjs.com/package/piral-cli) [](https://jestjs.io) [](https://gitter.im/piral-io/community)
|
|
4
4
|
|
|
5
5
|
Piral CLI is a command-line tool that can also be used as a library. It should make common tasks such as building a pilet, scaffolding a pilet, or debugging a piral instance simple.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Internally, Piral CLI is build upon existing tools with connection points to the
|
|
|
8
8
|
|
|
9
9
|
## Documentation
|
|
10
10
|
|
|
11
|
-
For details on the available commands check out the [documentation at Piral](https://docs.piral.io) or [on GitHub](https://github.com/smapiot/piral/tree/
|
|
11
|
+
For details on the available commands check out the [documentation at Piral](https://docs.piral.io) or [on GitHub](https://github.com/smapiot/piral/tree/main/docs/commands).
|
|
12
12
|
|
|
13
13
|
## Plugins
|
|
14
14
|
|
|
@@ -21,10 +21,16 @@ Right now the following generic plugins exist:
|
|
|
21
21
|
- [**piral-cli-local-feed**](https://github.com/FlorianRappl/piral-cli-local-feed), provides the ability to start a local feed service
|
|
22
22
|
- [**piral-cli-dotenv**](https://github.com/FlorianRappl/piral-cli-dotenv), provides the ability to easily integrate environment variables
|
|
23
23
|
|
|
24
|
-
Also the following bundler plugin exists (bringing build
|
|
24
|
+
Also the following bundler plugin exists (bringing build/debug capabilities):
|
|
25
25
|
|
|
26
|
-
- [**piral-cli-parcel**](https://github.com/smapiot/piral), provides an integration for Parcel as a bundler
|
|
27
|
-
- [**piral-cli-
|
|
26
|
+
- [**piral-cli-parcel**](https://github.com/smapiot/piral-cli-parcel), provides an integration for Parcel (v1) as a bundler
|
|
27
|
+
- [**piral-cli-parcel2**](https://github.com/smapiot/piral-cli-parcel2), provides an integration for Parcel (v2) as a bundler
|
|
28
|
+
- [**piral-cli-webpack**](https://github.com/smapiot/piral-cli-webpack), provides an integration for Webpack (v4) as a bundler
|
|
29
|
+
- [**piral-cli-webpack5**](https://github.com/smapiot/piral), provides an integration for Webpack (v5) as a bundler
|
|
30
|
+
- [**piral-cli-esbuild**](https://github.com/smapiot/piral-cli-esbuild), provides an integration for ES Build as a bundler
|
|
31
|
+
- [**piral-cli-rollup**](https://github.com/smapiot/piral-cli-rollup), provides an integration for Rollup as a bundler
|
|
32
|
+
- [**piral-cli-vite**](https://github.com/smapiot/piral-cli-vite), provides an integration for Vite as a bundler
|
|
33
|
+
- [**piral-cli-xbuild**](https://github.com/smapiot/piral-cli-xbuild), provides the possibility of using npm scripts for building and debugging
|
|
28
34
|
|
|
29
35
|
You'll find an updated list [on NPM](https://www.npmjs.com/search?q=keywords%3Apiral-cli) using the keyword **piral-cli**.
|
|
30
36
|
|
|
@@ -71,11 +77,28 @@ module.exports = function (cliApi) {
|
|
|
71
77
|
|
|
72
78
|
The resolution for plugins is as follows:
|
|
73
79
|
|
|
74
|
-
1. Take the plugins from the local project (`piral-cli` must be installed
|
|
80
|
+
1. Take the plugins from the local project (`piral-cli` must be installed/run locally)
|
|
75
81
|
2. Take the plugins from the global modules
|
|
76
82
|
|
|
77
83
|
Plugins are never loaded twice. Local versions have precedence.
|
|
78
84
|
|
|
85
|
+
Using a plugin you can also attach to the hooks of the `pilet build/debug` and `piral build/debug` commands.
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
module.exports = function (cliApi) {
|
|
89
|
+
cliApi.wrapCommand('debug-pilet', (args, run) => run({
|
|
90
|
+
...args,
|
|
91
|
+
hooks: {
|
|
92
|
+
afterBuild({ outFile, outDir }) {
|
|
93
|
+
console.log('Build done', outFile, outDir);
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
In this case the `afterBuild` hook of the `pilet debug` command is set. You can do whatever else hook, too. Furthermore, you are not limited to a single command - you might want to wrap multiple here.
|
|
101
|
+
|
|
79
102
|
## License
|
|
80
103
|
|
|
81
104
|
Piral is released using the MIT license. For more information see the [license file](./LICENSE).
|
package/lib/api.js
CHANGED
|
@@ -40,10 +40,10 @@ function maybeWithFlags(commandName, setter) {
|
|
|
40
40
|
}
|
|
41
41
|
function withFlags(commandName, setter) {
|
|
42
42
|
if (typeof commandName !== 'string') {
|
|
43
|
-
common_1.log('apiCommandNameInvalid_0200', 'flags');
|
|
43
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'flags');
|
|
44
44
|
}
|
|
45
45
|
else if (typeof setter !== 'function') {
|
|
46
|
-
common_1.log('apiArgumentInvalid_0201', 'setter', 'flags');
|
|
46
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'setter', 'flags');
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
findAll(commandName, (command) => {
|
|
@@ -56,10 +56,10 @@ function withFlags(commandName, setter) {
|
|
|
56
56
|
exports.withFlags = withFlags;
|
|
57
57
|
function wrapCommand(commandName, wrapper) {
|
|
58
58
|
if (typeof commandName !== 'string') {
|
|
59
|
-
common_1.log('apiCommandNameInvalid_0200', 'command');
|
|
59
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'command');
|
|
60
60
|
}
|
|
61
61
|
else if (typeof wrapper !== 'function') {
|
|
62
|
-
common_1.log('apiArgumentInvalid_0201', 'wrapper', 'command');
|
|
62
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'wrapper', 'command');
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
65
|
findAll(commandName, (command) => {
|
|
@@ -72,10 +72,10 @@ function wrapCommand(commandName, wrapper) {
|
|
|
72
72
|
exports.wrapCommand = wrapCommand;
|
|
73
73
|
function beforeCommand(commandName, before) {
|
|
74
74
|
if (typeof commandName !== 'string') {
|
|
75
|
-
common_1.log('apiCommandNameInvalid_0200', 'before command');
|
|
75
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'before command');
|
|
76
76
|
}
|
|
77
77
|
else if (typeof before !== 'function') {
|
|
78
|
-
common_1.log('apiArgumentInvalid_0201', 'before', 'before command');
|
|
78
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'before', 'before command');
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
81
|
wrapCommand(commandName, (args, current) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -88,10 +88,10 @@ function beforeCommand(commandName, before) {
|
|
|
88
88
|
exports.beforeCommand = beforeCommand;
|
|
89
89
|
function afterCommand(commandName, after) {
|
|
90
90
|
if (typeof commandName !== 'string') {
|
|
91
|
-
common_1.log('apiCommandNameInvalid_0200', 'after command');
|
|
91
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'after command');
|
|
92
92
|
}
|
|
93
93
|
else if (typeof after !== 'function') {
|
|
94
|
-
common_1.log('apiArgumentInvalid_0201', 'after', 'after command');
|
|
94
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'after', 'after command');
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
97
|
wrapCommand(commandName, (args, current) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -104,52 +104,52 @@ function afterCommand(commandName, after) {
|
|
|
104
104
|
exports.afterCommand = afterCommand;
|
|
105
105
|
function withPiralRule(name, run) {
|
|
106
106
|
if (typeof name !== 'string') {
|
|
107
|
-
common_1.log('apiValidateNameInvalid_0202', 'Piral');
|
|
107
|
+
(0, common_1.log)('apiValidateNameInvalid_0202', 'Piral');
|
|
108
108
|
}
|
|
109
109
|
else if (typeof run !== 'function') {
|
|
110
|
-
common_1.log('apiValidateRunInvalid_0203', 'Piral');
|
|
110
|
+
(0, common_1.log)('apiValidateRunInvalid_0203', 'Piral');
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
|
-
rules_1.addPiralRule({ name, run });
|
|
113
|
+
(0, rules_1.addPiralRule)({ name, run });
|
|
114
114
|
}
|
|
115
115
|
return this;
|
|
116
116
|
}
|
|
117
117
|
exports.withPiralRule = withPiralRule;
|
|
118
118
|
function withPiletRule(name, run) {
|
|
119
119
|
if (typeof name !== 'string') {
|
|
120
|
-
common_1.log('apiValidateNameInvalid_0202', 'pilet');
|
|
120
|
+
(0, common_1.log)('apiValidateNameInvalid_0202', 'pilet');
|
|
121
121
|
}
|
|
122
122
|
else if (typeof run !== 'function') {
|
|
123
|
-
common_1.log('apiValidateRunInvalid_0203', 'pilet');
|
|
123
|
+
(0, common_1.log)('apiValidateRunInvalid_0203', 'pilet');
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
|
-
rules_1.addPiletRule({ name, run });
|
|
126
|
+
(0, rules_1.addPiletRule)({ name, run });
|
|
127
127
|
}
|
|
128
128
|
return this;
|
|
129
129
|
}
|
|
130
130
|
exports.withPiletRule = withPiletRule;
|
|
131
131
|
function withPatcher(packageName, patch) {
|
|
132
132
|
if (typeof packageName !== 'string') {
|
|
133
|
-
common_1.log('apiPatchInvalid_0204', 'packageName');
|
|
133
|
+
(0, common_1.log)('apiPatchInvalid_0204', 'packageName');
|
|
134
134
|
}
|
|
135
135
|
else if (typeof patch !== 'function') {
|
|
136
|
-
common_1.log('apiPatchInvalid_0204', 'patch');
|
|
136
|
+
(0, common_1.log)('apiPatchInvalid_0204', 'patch');
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
common_1.installPatch(packageName, patch);
|
|
139
|
+
(0, common_1.installPatch)(packageName, patch);
|
|
140
140
|
}
|
|
141
141
|
return this;
|
|
142
142
|
}
|
|
143
143
|
exports.withPatcher = withPatcher;
|
|
144
144
|
function withBundler(name, actions) {
|
|
145
145
|
if (typeof name !== 'string') {
|
|
146
|
-
common_1.log('apiBundlerInvalid_0206', 'bundlerName');
|
|
146
|
+
(0, common_1.log)('apiBundlerInvalid_0206', 'bundlerName');
|
|
147
147
|
}
|
|
148
148
|
else if (typeof actions !== 'object') {
|
|
149
|
-
common_1.log('apiBundlerInvalid_0206', 'bundler');
|
|
149
|
+
(0, common_1.log)('apiBundlerInvalid_0206', 'bundler');
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
|
-
bundler_1.setBundler({
|
|
152
|
+
(0, bundler_1.setBundler)({
|
|
153
153
|
name,
|
|
154
154
|
actions,
|
|
155
155
|
});
|
|
@@ -163,13 +163,13 @@ function withBundler(name, actions) {
|
|
|
163
163
|
exports.withBundler = withBundler;
|
|
164
164
|
function withReleaseProvider(name, action) {
|
|
165
165
|
if (typeof name !== 'string') {
|
|
166
|
-
common_1.log('apiReleaseProviderInvalid_0207', 'providerName');
|
|
166
|
+
(0, common_1.log)('apiReleaseProviderInvalid_0207', 'providerName');
|
|
167
167
|
}
|
|
168
168
|
else if (typeof action !== 'object') {
|
|
169
|
-
common_1.log('apiReleaseProviderInvalid_0207', 'provider');
|
|
169
|
+
(0, common_1.log)('apiReleaseProviderInvalid_0207', 'provider');
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
172
|
-
release_1.setReleaseProvider({
|
|
172
|
+
(0, release_1.setReleaseProvider)({
|
|
173
173
|
name,
|
|
174
174
|
action,
|
|
175
175
|
});
|
package/lib/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6C;AAC7C,yCAAsC;AACtC,uCAAuC;AACvC,uCAA+C;AAC/C,mCAAqD;AAcrD,SAAS,OAAO,CAAC,WAAmB,EAAE,EAA2D;IAC/F,KAAK,IAAI,CAAC,GAAG,mBAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,GAAI;QACvC,MAAM,OAAO,GAAG,mBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEhC,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE;YAChC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;SAChB;KACF;AACH,CAAC;AAED,SAAgB,WAAW,CAAO,OAA0B;IAC1D,mBAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC;AAHD,kCAGC;AAED,SAAgB,cAAc,CAAC,WAAmB;IAChD,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,mBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC;AAHD,wCAGC;AAED,SAAS,cAAc,CAAI,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CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACxD,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACxD,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACxD,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;KACzD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAlBD,kCAkBC;AAED,SAAgB,mBAAmB,CAAC,IAAY,EAAE,MAAuB;IACvE,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAA,YAAG,EAAC,gCAAgC,EAAE,cAAc,CAAC,CAAC;KACvD;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACrC,IAAA,YAAG,EAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;KACnD;SAAM;QACL,IAAA,4BAAkB,EAAC;YACjB,IAAI;YACJ,MAAM;SACP,CAAC,CAAC;KACJ;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,kDAaC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LogLevels, NpmClientType } from '../types';
|
|
2
|
+
export interface AddPiralInstancePiletOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Sets the log level to use (1-5).
|
|
5
|
+
*/
|
|
6
|
+
logLevel?: LogLevels;
|
|
7
|
+
/**
|
|
8
|
+
* The name of the Piral instance to add.
|
|
9
|
+
*/
|
|
10
|
+
app?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the source directory for adding the Piral instance.
|
|
13
|
+
*/
|
|
14
|
+
source?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Defines if the provided Piral instance should be selected initially.
|
|
17
|
+
*/
|
|
18
|
+
selected?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The npm client to be used when scaffolding.
|
|
21
|
+
* @example 'yarn'
|
|
22
|
+
*/
|
|
23
|
+
npmClient?: NpmClientType;
|
|
24
|
+
}
|
|
25
|
+
export declare const addPiralInstancePiletDefaults: AddPiralInstancePiletOptions;
|
|
26
|
+
export declare function addPiralInstancePilet(baseDir?: string, options?: AddPiralInstancePiletOptions): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.addPiralInstancePilet = exports.addPiralInstancePiletDefaults = void 0;
|
|
13
|
+
const path_1 = require("path");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
const common_1 = require("../common");
|
|
16
|
+
exports.addPiralInstancePiletDefaults = {
|
|
17
|
+
logLevel: types_1.LogLevels.info,
|
|
18
|
+
app: undefined,
|
|
19
|
+
source: '.',
|
|
20
|
+
selected: false,
|
|
21
|
+
npmClient: undefined,
|
|
22
|
+
};
|
|
23
|
+
function addPiralInstancePilet(baseDir = process.cwd(), options = {}) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const { npmClient: defaultNpmClient = exports.addPiralInstancePiletDefaults.npmClient, logLevel = exports.addPiralInstancePiletDefaults.logLevel, source = exports.addPiralInstancePiletDefaults.source, selected = exports.addPiralInstancePiletDefaults.selected, app = exports.addPiralInstancePiletDefaults.app, } = options;
|
|
26
|
+
const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
|
|
27
|
+
(0, common_1.setLogLevel)(logLevel);
|
|
28
|
+
(0, common_1.progress)('Reading configuration ...');
|
|
29
|
+
const npmClient = yield (0, common_1.determineNpmClient)(fullBase, defaultNpmClient);
|
|
30
|
+
const allEntries = yield (0, common_1.matchAnyPilet)(fullBase, [source]);
|
|
31
|
+
const tasks = allEntries.map((entryModule) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const targetDir = (0, path_1.dirname)(entryModule);
|
|
33
|
+
const piletJsonPath = yield (0, common_1.findFile)(targetDir, common_1.piletJson);
|
|
34
|
+
if (piletJsonPath) {
|
|
35
|
+
const piletJsonDir = (0, path_1.dirname)(piletJsonPath);
|
|
36
|
+
const root = yield (0, common_1.findPiletRoot)(piletJsonDir);
|
|
37
|
+
const oldContent = yield (0, common_1.readJson)(piletJsonDir, common_1.piletJson);
|
|
38
|
+
const [appName] = yield (0, common_1.installPiralInstance)(app, fullBase, root, npmClient);
|
|
39
|
+
const newContent = Object.assign(Object.assign({}, oldContent), { piralInstances: Object.assign(Object.assign({}, oldContent.piralInstances), { [appName]: {
|
|
40
|
+
selected,
|
|
41
|
+
} }) });
|
|
42
|
+
yield (0, common_1.writeJson)(piletJsonDir, common_1.piletJson, newContent, true);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
(0, common_1.log)('piletJsonNotAvailable_0180', targetDir);
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
yield Promise.all(tasks);
|
|
49
|
+
(0, common_1.logDone)(`Added the Piral instance!`);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
exports.addPiralInstancePilet = addPiralInstancePilet;
|
|
53
|
+
//# sourceMappingURL=add-piral-instance-pilet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-piral-instance-pilet.js","sourceRoot":"","sources":["../../src/apps/add-piral-instance-pilet.ts"],"names":[],"mappings":";;;;;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AM,IAAI,GAAG,MAAM,IAAA,sBAAa,EAAC,YAAY,CAAC,CAAC;gBAC/C,MAAM,UAAU,GAAG,MAAM,IAAA,iBAAQ,EAAC,YAAY,EAAE,kBAAS,CAAC,CAAC;gBAC3D,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAA,6BAAoB,EAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;gBAE7E,MAAM,UAAU,mCACX,UAAU,KACb,cAAc,kCACT,UAAU,CAAC,cAAc,KAC5B,CAAC,OAAO,CAAC,EAAE;4BACT,QAAQ;yBACT,MAEJ,CAAC;gBAEF,MAAM,IAAA,kBAAS,EAAC,YAAY,EAAE,kBAAS,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;aAC5D;iBAAM;gBACL,IAAA,YAAG,EAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC;aAC9C;QACH,CAAC,CAAA,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAA,gBAAO,EAAC,2BAA2B,CAAC,CAAC;IACvC,CAAC;CAAA;AA5CD,sDA4CC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogLevels, PiletSchemaVersion } from '../types';
|
|
1
|
+
import { LogLevels, PiletBuildType, PiletSchemaVersion } from '../types';
|
|
2
2
|
export interface BuildPiletOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Sets the name of the Piral instance.
|
|
@@ -8,16 +8,28 @@ export interface BuildPiletOptions {
|
|
|
8
8
|
* The source index file (e.g. index.tsx) for collecting all the information
|
|
9
9
|
* @example './src/index'
|
|
10
10
|
*/
|
|
11
|
-
entry?: string
|
|
11
|
+
entry?: string | Array<string>;
|
|
12
12
|
/**
|
|
13
13
|
* The target file of bundling.
|
|
14
14
|
* @example './dist/index.js'
|
|
15
15
|
*/
|
|
16
16
|
target?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the public URL (path) of the bundle. Only for release output.
|
|
19
|
+
*/
|
|
20
|
+
publicUrl?: string;
|
|
17
21
|
/**
|
|
18
22
|
* States if minifaction or other post-bundle transformations should be performed.
|
|
19
23
|
*/
|
|
20
24
|
minify?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Indicates if a declaration file should be generated.
|
|
27
|
+
*/
|
|
28
|
+
declaration?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the maximum number of parallel build processes.
|
|
31
|
+
*/
|
|
32
|
+
concurrency?: number;
|
|
21
33
|
/**
|
|
22
34
|
* Sets the log level to use (1-5).
|
|
23
35
|
*/
|
|
@@ -30,6 +42,10 @@ export interface BuildPiletOptions {
|
|
|
30
42
|
* States if source maps should be created for the bundles.
|
|
31
43
|
*/
|
|
32
44
|
sourceMaps?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* States if the build should run continuously and re-build when files change.
|
|
47
|
+
*/
|
|
48
|
+
watch?: boolean;
|
|
33
49
|
/**
|
|
34
50
|
* Sets the bundler to use for building, if any specific.
|
|
35
51
|
*/
|
|
@@ -38,6 +54,10 @@ export interface BuildPiletOptions {
|
|
|
38
54
|
* States if a content hash should be appended to the side-bundle files
|
|
39
55
|
*/
|
|
40
56
|
contentHash?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Selects the target type of the build (e.g. 'release'). "all" builds all target types.
|
|
59
|
+
*/
|
|
60
|
+
type?: PiletBuildType;
|
|
41
61
|
/**
|
|
42
62
|
* States if the node modules should be included for target transpilation
|
|
43
63
|
*/
|
|
@@ -51,6 +71,17 @@ export interface BuildPiletOptions {
|
|
|
51
71
|
* Additional arguments for a specific bundler.
|
|
52
72
|
*/
|
|
53
73
|
_?: Record<string, any>;
|
|
74
|
+
/**
|
|
75
|
+
* Hooks to be triggered at various stages.
|
|
76
|
+
*/
|
|
77
|
+
hooks?: {
|
|
78
|
+
onBegin?(e: any): Promise<void>;
|
|
79
|
+
beforeBuild?(e: any): Promise<void>;
|
|
80
|
+
afterBuild?(e: any): Promise<void>;
|
|
81
|
+
beforeDeclaration?(e: any): Promise<void>;
|
|
82
|
+
afterDeclaration?(e: any): Promise<void>;
|
|
83
|
+
onEnd?(e: any): Promise<void>;
|
|
84
|
+
};
|
|
54
85
|
}
|
|
55
86
|
export declare const buildPiletDefaults: BuildPiletOptions;
|
|
56
87
|
export declare function buildPilet(baseDir?: string, options?: BuildPiletOptions): Promise<void>;
|
package/lib/apps/build-pilet.js
CHANGED
|
@@ -14,51 +14,178 @@ const path_1 = require("path");
|
|
|
14
14
|
const types_1 = require("../types");
|
|
15
15
|
const bundler_1 = require("../bundler");
|
|
16
16
|
const common_1 = require("../common");
|
|
17
|
+
function createMetadata(outDir, outFile, pilets, publicPath) {
|
|
18
|
+
return (0, common_1.writeJson)(outDir, outFile, pilets.map((p) => (Object.assign({ name: p.package.name, version: p.package.version, link: `${publicPath}${p.id}/${p.outFile}` }, (0, common_1.getPiletSpecMeta)(p.path, `${publicPath}${p.id}/`)))));
|
|
19
|
+
}
|
|
20
|
+
function copyPilets(outDir, pilets) {
|
|
21
|
+
return Promise.all(pilets.map((p) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const files = yield (0, common_1.getFileNames)(p.outDir);
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
yield (0, common_1.copy)((0, path_1.resolve)(p.outDir, file), (0, path_1.resolve)(outDir, p.id, file), common_1.ForceOverwrite.yes);
|
|
25
|
+
}
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
17
28
|
exports.buildPiletDefaults = {
|
|
18
29
|
entry: './src/index',
|
|
19
30
|
target: './dist/index.js',
|
|
31
|
+
publicUrl: '/',
|
|
20
32
|
minify: true,
|
|
21
33
|
logLevel: types_1.LogLevels.info,
|
|
34
|
+
type: 'default',
|
|
22
35
|
fresh: false,
|
|
23
36
|
sourceMaps: true,
|
|
37
|
+
watch: false,
|
|
24
38
|
contentHash: true,
|
|
25
39
|
optimizeModules: false,
|
|
26
|
-
schemaVersion:
|
|
40
|
+
schemaVersion: undefined,
|
|
41
|
+
concurrency: common_1.cpuCount,
|
|
42
|
+
declaration: true,
|
|
27
43
|
};
|
|
28
44
|
function buildPilet(baseDir = process.cwd(), options = {}) {
|
|
45
|
+
var _a, _b;
|
|
29
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const { entry = exports.buildPiletDefaults.entry, target = exports.buildPiletDefaults.target, minify = exports.buildPiletDefaults.minify, sourceMaps = exports.buildPiletDefaults.sourceMaps,
|
|
31
|
-
common_1.
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
common_1.
|
|
41
|
-
|
|
47
|
+
const { entry = exports.buildPiletDefaults.entry, target = exports.buildPiletDefaults.target, publicUrl: originalPublicUrl = exports.buildPiletDefaults.publicUrl, logLevel = exports.buildPiletDefaults.logLevel, minify = exports.buildPiletDefaults.minify, sourceMaps = exports.buildPiletDefaults.sourceMaps, watch = exports.buildPiletDefaults.watch, contentHash = exports.buildPiletDefaults.contentHash, fresh = exports.buildPiletDefaults.fresh, concurrency = exports.buildPiletDefaults.concurrency, optimizeModules = exports.buildPiletDefaults.optimizeModules, schemaVersion: originalSchemaVersion = exports.buildPiletDefaults.schemaVersion, declaration = exports.buildPiletDefaults.declaration, type = exports.buildPiletDefaults.type, _ = {}, hooks = {}, bundlerName, app, } = options;
|
|
48
|
+
const publicUrl = (0, common_1.normalizePublicUrl)(originalPublicUrl);
|
|
49
|
+
const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
|
|
50
|
+
const entryList = Array.isArray(entry) ? entry : [entry];
|
|
51
|
+
(0, common_1.setLogLevel)(logLevel);
|
|
52
|
+
yield ((_a = hooks.onBegin) === null || _a === void 0 ? void 0 : _a.call(hooks, { options, fullBase }));
|
|
53
|
+
(0, common_1.progress)('Reading configuration ...');
|
|
54
|
+
const allEntries = yield (0, common_1.matchAnyPilet)(fullBase, entryList);
|
|
55
|
+
(0, common_1.log)('generalDebug_0003', `Found the following entries: ${allEntries.join(', ')}`);
|
|
56
|
+
if (allEntries.length === 0) {
|
|
57
|
+
(0, common_1.fail)('entryFileMissing_0077');
|
|
58
|
+
}
|
|
59
|
+
const pilets = yield (0, common_1.concurrentWorkers)(allEntries, concurrency, (entryModule) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
var _c, _d, _e, _f;
|
|
61
|
+
const targetDir = (0, path_1.dirname)(entryModule);
|
|
62
|
+
const { peerDependencies, peerModules, root, apps, piletPackage, ignored, importmap, schema } = yield (0, common_1.retrievePiletData)(targetDir, app);
|
|
63
|
+
const schemaVersion = originalSchemaVersion || schema || common_1.config.schemaVersion || common_1.defaultSchemaVersion;
|
|
64
|
+
const piralInstances = apps.map(m => m.appPackage.name);
|
|
65
|
+
const externals = (0, common_1.combinePiletExternals)(piralInstances, peerDependencies, peerModules, importmap);
|
|
66
|
+
const dest = (0, path_1.resolve)(root, target);
|
|
67
|
+
const outDir = (0, path_1.dirname)(dest);
|
|
68
|
+
const outFile = (0, path_1.basename)(dest);
|
|
69
|
+
(0, common_1.validateSharedDependencies)(importmap);
|
|
70
|
+
if (fresh) {
|
|
71
|
+
(0, common_1.progress)('Removing output directory ...');
|
|
72
|
+
yield (0, common_1.removeDirectory)(outDir);
|
|
73
|
+
}
|
|
74
|
+
(0, common_1.logInfo)('Bundle pilet ...');
|
|
75
|
+
yield ((_c = hooks.beforeBuild) === null || _c === void 0 ? void 0 : _c.call(hooks, { root, outDir, importmap, entryModule, schemaVersion, piletPackage }));
|
|
76
|
+
yield (0, bundler_1.callPiletBuild)({
|
|
77
|
+
root,
|
|
78
|
+
piralInstances,
|
|
79
|
+
optimizeModules,
|
|
80
|
+
sourceMaps,
|
|
81
|
+
watch,
|
|
82
|
+
contentHash,
|
|
83
|
+
minify,
|
|
84
|
+
externals,
|
|
85
|
+
targetDir,
|
|
86
|
+
importmap,
|
|
87
|
+
outFile,
|
|
88
|
+
outDir,
|
|
89
|
+
entryModule: `./${(0, path_1.relative)(root, entryModule)}`,
|
|
90
|
+
logLevel,
|
|
91
|
+
version: schemaVersion,
|
|
92
|
+
ignored,
|
|
93
|
+
_,
|
|
94
|
+
}, bundlerName);
|
|
95
|
+
yield ((_d = hooks.afterBuild) === null || _d === void 0 ? void 0 : _d.call(hooks, { root, outDir, importmap, entryModule, schemaVersion, piletPackage }));
|
|
96
|
+
if (declaration) {
|
|
97
|
+
yield ((_e = hooks.beforeDeclaration) === null || _e === void 0 ? void 0 : _e.call(hooks, { root, outDir, entryModule, piletPackage }));
|
|
98
|
+
yield (0, common_1.createPiletDeclaration)(piletPackage.name, root, entryModule, externals, outDir, common_1.ForceOverwrite.yes, logLevel);
|
|
99
|
+
yield ((_f = hooks.afterDeclaration) === null || _f === void 0 ? void 0 : _f.call(hooks, { root, outDir, entryModule, piletPackage }));
|
|
100
|
+
}
|
|
101
|
+
(0, common_1.logDone)(`Pilet "${piletPackage.name}" built successfully!`);
|
|
102
|
+
return {
|
|
103
|
+
id: piletPackage.name.replace(/[^a-zA-Z0-9\-]/gi, ''),
|
|
104
|
+
root,
|
|
105
|
+
apps,
|
|
106
|
+
outDir,
|
|
107
|
+
outFile,
|
|
108
|
+
path: dest,
|
|
109
|
+
package: piletPackage,
|
|
110
|
+
};
|
|
111
|
+
}));
|
|
112
|
+
if (type === 'standalone') {
|
|
113
|
+
const distDir = (0, path_1.dirname)((0, path_1.resolve)(fullBase, target));
|
|
114
|
+
const outDir = (0, path_1.resolve)(distDir, 'standalone');
|
|
115
|
+
const { apps, root } = pilets[0];
|
|
116
|
+
if (apps.length === 0) {
|
|
117
|
+
(0, common_1.fail)('appInstancesNotGiven_0012');
|
|
118
|
+
}
|
|
119
|
+
const { appPackage, appFile } = apps[0];
|
|
120
|
+
const piralInstances = [appPackage.name];
|
|
121
|
+
const isEmulator = (0, common_1.checkAppShellPackage)(appPackage);
|
|
122
|
+
(0, common_1.logInfo)('Building standalone solution ...');
|
|
123
|
+
yield (0, common_1.removeDirectory)(outDir);
|
|
124
|
+
(0, common_1.progress)('Copying files ...');
|
|
125
|
+
yield copyPilets(outDir, pilets);
|
|
126
|
+
yield createMetadata(outDir, '$pilet-api', pilets, publicUrl);
|
|
127
|
+
if (isEmulator) {
|
|
128
|
+
// in case of an emulator assets are not "seen" by the bundler, so we
|
|
129
|
+
// just copy overthing over - this should work in most cases.
|
|
130
|
+
yield (0, common_1.copy)((0, path_1.dirname)(appFile), outDir, common_1.ForceOverwrite.yes);
|
|
131
|
+
(0, common_1.progress)('Optimizing app shell ...');
|
|
132
|
+
// we don't need to care about externals or other things that are already
|
|
133
|
+
// part of the emulator
|
|
134
|
+
yield (0, bundler_1.callPiralBuild)({
|
|
135
|
+
root,
|
|
136
|
+
piralInstances,
|
|
137
|
+
emulator: false,
|
|
138
|
+
standalone: true,
|
|
139
|
+
optimizeModules: false,
|
|
140
|
+
sourceMaps,
|
|
141
|
+
watch: false,
|
|
142
|
+
contentHash,
|
|
143
|
+
minify,
|
|
144
|
+
externals: [],
|
|
145
|
+
publicUrl,
|
|
146
|
+
outFile: 'index.html',
|
|
147
|
+
outDir,
|
|
148
|
+
entryFiles: appFile,
|
|
149
|
+
logLevel,
|
|
150
|
+
ignored: [],
|
|
151
|
+
_,
|
|
152
|
+
}, bundlerName);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
// in this case we can just do the same steps as if
|
|
156
|
+
const { ignored, externals } = yield (0, common_1.retrievePiletsInfo)(appFile);
|
|
157
|
+
yield (0, bundler_1.callPiralBuild)({
|
|
158
|
+
root,
|
|
159
|
+
piralInstances,
|
|
160
|
+
emulator: false,
|
|
161
|
+
standalone: true,
|
|
162
|
+
optimizeModules: false,
|
|
163
|
+
sourceMaps,
|
|
164
|
+
watch: false,
|
|
165
|
+
contentHash,
|
|
166
|
+
minify,
|
|
167
|
+
externals: externals.map(m => m.name),
|
|
168
|
+
publicUrl,
|
|
169
|
+
outFile: 'index.html',
|
|
170
|
+
outDir,
|
|
171
|
+
entryFiles: appFile,
|
|
172
|
+
logLevel,
|
|
173
|
+
ignored,
|
|
174
|
+
_,
|
|
175
|
+
}, bundlerName);
|
|
176
|
+
}
|
|
177
|
+
(0, common_1.logDone)(`Standalone app available at "${outDir}"!`);
|
|
178
|
+
}
|
|
179
|
+
else if (type === 'manifest') {
|
|
180
|
+
const manifest = 'pilets.json';
|
|
181
|
+
const outDir = (0, path_1.dirname)((0, path_1.resolve)(fullBase, target));
|
|
182
|
+
(0, common_1.logInfo)('Building pilet manifest ...');
|
|
183
|
+
(0, common_1.progress)('Copying files ...');
|
|
184
|
+
yield copyPilets(outDir, pilets);
|
|
185
|
+
yield createMetadata(outDir, manifest, pilets, publicUrl);
|
|
186
|
+
(0, common_1.logDone)(`Manifest available at "${outDir}/${manifest}"!`);
|
|
42
187
|
}
|
|
43
|
-
|
|
44
|
-
yield bundler_1.callPiletBuild({
|
|
45
|
-
root,
|
|
46
|
-
piral: appPackage.name,
|
|
47
|
-
optimizeModules,
|
|
48
|
-
sourceMaps,
|
|
49
|
-
contentHash,
|
|
50
|
-
minify,
|
|
51
|
-
externals,
|
|
52
|
-
targetDir,
|
|
53
|
-
outFile: path_1.basename(target),
|
|
54
|
-
outDir,
|
|
55
|
-
entryModule,
|
|
56
|
-
logLevel,
|
|
57
|
-
version: schemaVersion,
|
|
58
|
-
ignored,
|
|
59
|
-
_,
|
|
60
|
-
}, bundlerName);
|
|
61
|
-
common_1.logDone('Pilet built successfully!');
|
|
188
|
+
yield ((_b = hooks.onEnd) === null || _b === void 0 ? void 0 : _b.call(hooks, {}));
|
|
62
189
|
});
|
|
63
190
|
}
|
|
64
191
|
exports.buildPilet = buildPilet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pilet.js","sourceRoot":"","sources":["../../src/apps/build-pilet.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"build-pilet.js","sour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