piral-cli 0.14.0-unstable.3096 → 0.14.1-beta.3244
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/README.md +5 -2
- package/lib/apps/build-pilet.d.ts +11 -0
- package/lib/apps/build-pilet.js +8 -1
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/build-piral.d.ts +13 -0
- package/lib/apps/build-piral.js +16 -5
- package/lib/apps/build-piral.js.map +1 -1
- package/lib/apps/debug-pilet.d.ts +11 -0
- package/lib/apps/debug-pilet.js +15 -3
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.d.ts +11 -0
- package/lib/apps/debug-piral.js +11 -1
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/new-pilet.d.ts +1 -1
- package/lib/apps/new-pilet.js +11 -7
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.d.ts +1 -1
- package/lib/apps/new-piral.js +4 -3
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/apps/pack-pilet.js +1 -1
- package/lib/apps/publish-pilet.d.ts +1 -1
- package/lib/apps/publish-pilet.js +1 -1
- package/lib/apps/upgrade-pilet.d.ts +6 -2
- package/lib/apps/upgrade-pilet.js +9 -6
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/apps/upgrade-piral.d.ts +2 -2
- package/lib/apps/upgrade-piral.js +1 -1
- package/lib/build/bundler-calls.d.ts +3 -0
- package/lib/build/bundler-calls.js +107 -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 +66 -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 +71 -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 +90 -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 +86 -0
- package/lib/build/run-debug-piral.js.map +1 -0
- package/lib/bundler.js +50 -13
- package/lib/bundler.js.map +1 -1
- package/lib/commands.js +12 -8
- package/lib/commands.js.map +1 -1
- package/lib/common/clients/npm.js +10 -10
- package/lib/common/constants.d.ts +1 -1
- package/lib/common/constants.js +2 -2
- package/lib/common/constants.js.map +1 -1
- package/lib/common/emulator.js +5 -2
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/log.js +7 -4
- package/lib/common/log.js.map +1 -1
- package/lib/common/npm.d.ts +3 -1
- package/lib/common/npm.js +31 -11
- package/lib/common/npm.js.map +1 -1
- package/lib/common/package.d.ts +5 -5
- package/lib/common/package.js +43 -24
- package/lib/common/package.js.map +1 -1
- package/lib/common/scaffold.d.ts +14 -2
- package/lib/common/scaffold.js +19 -7
- package/lib/common/scaffold.js.map +1 -1
- package/lib/common/template.d.ts +1 -0
- package/lib/common/template.js +29 -2
- package/lib/common/template.js.map +1 -1
- package/lib/external/index.js +119 -155
- package/lib/helpers.js +1 -1
- package/lib/helpers.js.map +1 -1
- package/lib/injectors/piral.d.ts +4 -2
- package/lib/injectors/piral.js +16 -1
- package/lib/injectors/piral.js.map +1 -1
- package/lib/messages.d.ts +25 -21
- package/lib/messages.js +30 -22
- package/lib/messages.js.map +1 -1
- package/lib/types/common.d.ts +1 -0
- package/lib/types/public.d.ts +63 -11
- package/package.json +3 -3
- package/src/apps/build-pilet.ts +22 -0
- package/src/apps/build-piral.ts +38 -4
- package/src/apps/debug-pilet.ts +29 -6
- package/src/apps/debug-piral.ts +24 -0
- package/src/apps/new-pilet.ts +13 -8
- package/src/apps/new-piral.ts +7 -5
- package/src/apps/pack-pilet.test.ts +2 -2
- package/src/apps/pack-pilet.ts +1 -1
- package/src/apps/publish-pilet.ts +2 -2
- package/src/apps/upgrade-pilet.ts +18 -7
- package/src/apps/upgrade-piral.ts +3 -3
- package/src/build/bundler-calls.ts +121 -0
- package/src/build/run-build-pilet.ts +89 -0
- package/src/build/run-build-piral.ts +88 -0
- package/src/build/run-debug-mono-piral.ts +87 -0
- package/src/build/run-debug-pilet.ts +114 -0
- package/src/build/run-debug-piral.ts +106 -0
- package/src/bundler.test.ts +65 -46
- package/src/bundler.ts +53 -13
- package/src/commands.ts +20 -10
- package/src/common/clients/npm.ts +10 -10
- package/src/common/constants.ts +1 -1
- package/src/common/emulator.ts +5 -2
- package/src/common/log.ts +9 -4
- package/src/common/npm.test.ts +18 -18
- package/src/common/npm.ts +27 -8
- package/src/common/package.ts +53 -17
- package/src/common/scaffold.ts +36 -20
- package/src/common/template.ts +24 -1
- package/src/helpers.ts +1 -1
- package/src/injectors/piral.test.ts +6 -5
- package/src/injectors/piral.ts +21 -2
- package/src/messages.ts +43 -35
- package/src/types/common.ts +1 -0
- package/src/types/public.ts +68 -20
package/src/messages.ts
CHANGED
|
@@ -161,7 +161,7 @@ export function appInstanceNotFound_0010(name: string): QuickMessage {
|
|
|
161
161
|
* It should be an HTML file.
|
|
162
162
|
*
|
|
163
163
|
* @see
|
|
164
|
-
* - [Parcel HTML Asset](https://parceljs.org/html
|
|
164
|
+
* - [Parcel HTML Asset](https://parceljs.org/languages/html/)
|
|
165
165
|
*
|
|
166
166
|
* @example
|
|
167
167
|
* Make sure the package.json of the Piral instance is valid (has an "app" field).
|
|
@@ -198,7 +198,7 @@ export function appInstanceInvalid_0011(): QuickMessage {
|
|
|
198
198
|
* project folder has a package.json in its root.
|
|
199
199
|
*
|
|
200
200
|
* @see
|
|
201
|
-
* - [
|
|
201
|
+
* - [npm Package Specification](https://docs.npmjs.com/files/package.json)
|
|
202
202
|
*
|
|
203
203
|
* @example
|
|
204
204
|
* You can see if you are currently in a correct folder.
|
|
@@ -235,7 +235,7 @@ export function packageJsonNotFound_0020(): QuickMessage {
|
|
|
235
235
|
* The name of the pilet is provided by the name field specified in its package.json.
|
|
236
236
|
*
|
|
237
237
|
* A valid package.json file requires a valid name. The name has to follow standard naming
|
|
238
|
-
* conventions of the
|
|
238
|
+
* conventions of the npm system.
|
|
239
239
|
*
|
|
240
240
|
* @see
|
|
241
241
|
* - [Package Naming Guidelines](https://docs.npmjs.com/package-name-guidelines)
|
|
@@ -285,7 +285,7 @@ export function packageJsonMissingName_0021(): QuickMessage {
|
|
|
285
285
|
* specification.
|
|
286
286
|
*
|
|
287
287
|
* @see
|
|
288
|
-
* - [
|
|
288
|
+
* - [npm on Semantic Versioning](https://docs.npmjs.com/about-semantic-versioning)
|
|
289
289
|
*
|
|
290
290
|
* @example
|
|
291
291
|
* Check the contents of the available package.json:
|
|
@@ -330,7 +330,7 @@ export function packageJsonMissingVersion_0022(): QuickMessage {
|
|
|
330
330
|
* and which ones can remain at their current version.
|
|
331
331
|
*
|
|
332
332
|
* @see
|
|
333
|
-
* - [
|
|
333
|
+
* - [npm Install](https://docs.npmjs.com/cli/install)
|
|
334
334
|
*
|
|
335
335
|
* @example
|
|
336
336
|
* Check that the package is indeed installed:
|
|
@@ -370,7 +370,7 @@ export function packageNotInstalled_0023(name: string): QuickMessage {
|
|
|
370
370
|
* versions. If no release for the given version was found then an error is emitted.
|
|
371
371
|
*
|
|
372
372
|
* @see
|
|
373
|
-
* - [StackOverflow Listing
|
|
373
|
+
* - [StackOverflow Listing npm Versions](https://stackoverflow.com/questions/41415945/how-to-list-all-versions-of-an-npm-module)
|
|
374
374
|
*
|
|
375
375
|
* @example
|
|
376
376
|
* Check that the version is valid:
|
|
@@ -481,7 +481,7 @@ export function projectReferenceNotSupported_0032(fullPath: string): QuickMessag
|
|
|
481
481
|
* CLI via command line parameters.
|
|
482
482
|
*
|
|
483
483
|
* @see
|
|
484
|
-
* - [
|
|
484
|
+
* - [npm Package Specification](https://docs.npmjs.com/files/package.json)
|
|
485
485
|
*
|
|
486
486
|
* @example
|
|
487
487
|
* Make sure you are in the right directory by calling commands such as
|
|
@@ -611,7 +611,7 @@ export function invalidPiletPackage_0042(): QuickMessage {
|
|
|
611
611
|
* Even though everything seems to be correct on the first glance it may be that the
|
|
612
612
|
* actual reference is broken. This could be due to various reasons.
|
|
613
613
|
*
|
|
614
|
-
* -
|
|
614
|
+
* - npm linking is broken
|
|
615
615
|
* - The dependencies have not been installed yet (run `npm i`)
|
|
616
616
|
* - The Piral instance's name is invalid (e.g., due to a typo)
|
|
617
617
|
*
|
|
@@ -762,8 +762,8 @@ export function cannotFindFile_0046(file: string): QuickMessage {
|
|
|
762
762
|
* Since the local resolution only works against a filename the update process has also to be triggered with
|
|
763
763
|
* a file location. Otherwise, there is no chance to know a different file location.
|
|
764
764
|
*
|
|
765
|
-
* Potentially, you wanted to switch / resolve the module from
|
|
766
|
-
* obtain the Piral instance from
|
|
765
|
+
* Potentially, you wanted to switch / resolve the module from npm instead. Therefore, we are then trying to
|
|
766
|
+
* obtain the Piral instance from npm instead using the known name.
|
|
767
767
|
*
|
|
768
768
|
* @see
|
|
769
769
|
* - [Local File Dependencies](https://stackoverflow.com/questions/14381898/local-dependency-in-package-json)
|
|
@@ -800,11 +800,11 @@ export function localeFileForUpgradeMissing_0050(): QuickMessage {
|
|
|
800
800
|
* Right now we only support "latest" for Git resolved Piral instances. In this scenario we obtain the
|
|
801
801
|
* current head from the repository's default branch and update accordingly.
|
|
802
802
|
*
|
|
803
|
-
* Potentially, you wanted to switch / resolve the module from
|
|
804
|
-
* obtain the Piral instance from
|
|
803
|
+
* Potentially, you wanted to switch / resolve the module from npm instead. Therefore, we are then trying to
|
|
804
|
+
* obtain the Piral instance from npm instead using the known name.
|
|
805
805
|
*
|
|
806
806
|
* @see
|
|
807
|
-
* - [Git Dependencies in
|
|
807
|
+
* - [Git Dependencies in npm](https://medium.com/@jonchurch/use-github-branch-as-dependency-in-package-json-5eb609c81f1a)
|
|
808
808
|
*
|
|
809
809
|
* @example
|
|
810
810
|
* You may have set up the pilet using a locally available tgz file. In this case your original command may
|
|
@@ -944,6 +944,7 @@ export function cannotResolveVersion_0052(name: string): QuickMessage {
|
|
|
944
944
|
* }
|
|
945
945
|
* }
|
|
946
946
|
* }
|
|
947
|
+
* ```
|
|
947
948
|
*/
|
|
948
949
|
export function cannotResolveDependency_0053(name: string, rootDir: string): QuickMessage {
|
|
949
950
|
return [LogLevels.warning, '0053', `Could not resolve "${name}" from "${rootDir}". Taking "latest" version.`];
|
|
@@ -995,7 +996,7 @@ export function missingPiletFeedUrl_0060(): QuickMessage {
|
|
|
995
996
|
* directly.
|
|
996
997
|
*
|
|
997
998
|
* @see
|
|
998
|
-
* - [
|
|
999
|
+
* - [npm Pack](https://docs.npmjs.com/cli-commands/pack.html)
|
|
999
1000
|
*
|
|
1000
1001
|
* @example
|
|
1001
1002
|
* Make sure to have build a pilet beforehand:
|
|
@@ -1277,10 +1278,10 @@ export function failedHttpGet_0068(error: string): QuickMessage {
|
|
|
1277
1278
|
*
|
|
1278
1279
|
* @abstract
|
|
1279
1280
|
* While submitting the HTTP get request an error was reported.
|
|
1280
|
-
*
|
|
1281
|
+
*
|
|
1281
1282
|
* Potentially, the server returned some more indicative error message. In this
|
|
1282
1283
|
* case read it carefully to know what version was already published.
|
|
1283
|
-
*
|
|
1284
|
+
*
|
|
1284
1285
|
* In any case only the documentation of the corresponding feed service can be
|
|
1285
1286
|
* conclusive how this can be resolved. Presumably, some payment of some fee
|
|
1286
1287
|
* is necessary to publish pilets.
|
|
@@ -1299,28 +1300,28 @@ export function failedToUploadPayment_0161(response: any): QuickMessage {
|
|
|
1299
1300
|
*
|
|
1300
1301
|
* @abstract
|
|
1301
1302
|
* While submitting the HTTP get request an error was reported.
|
|
1302
|
-
*
|
|
1303
|
+
*
|
|
1303
1304
|
* Potentially, the server returned some more indicative error message. In this
|
|
1304
1305
|
* case read it carefully to know what version was already published.
|
|
1305
|
-
*
|
|
1306
|
+
*
|
|
1306
1307
|
* In any case you need to change the version to continue. You can do that by
|
|
1307
1308
|
* editing the "version" field in the pilet's package.json or using `npm version`.
|
|
1308
1309
|
*
|
|
1309
1310
|
* @example
|
|
1310
1311
|
* If you already published the pilet, e.g., via
|
|
1311
|
-
*
|
|
1312
|
+
*
|
|
1312
1313
|
* ```sh
|
|
1313
1314
|
* pilet publish --api-key ... --url ...
|
|
1314
1315
|
* ```
|
|
1315
|
-
*
|
|
1316
|
+
*
|
|
1316
1317
|
* then doing this again without any change should result in this error.
|
|
1317
|
-
*
|
|
1318
|
+
*
|
|
1318
1319
|
* Now we can patch-upgrade the version of the pilet:
|
|
1319
|
-
*
|
|
1320
|
+
*
|
|
1320
1321
|
* ```sh
|
|
1321
1322
|
* npm version patch
|
|
1322
1323
|
* ```
|
|
1323
|
-
*
|
|
1324
|
+
*
|
|
1324
1325
|
* And try the `pilet publish` command again. This time it should just work.
|
|
1325
1326
|
*/
|
|
1326
1327
|
export function failedToUploadVersion_0162(response: any): QuickMessage {
|
|
@@ -1337,10 +1338,10 @@ export function failedToUploadVersion_0162(response: any): QuickMessage {
|
|
|
1337
1338
|
*
|
|
1338
1339
|
* @abstract
|
|
1339
1340
|
* While submitting the HTTP get request an error was reported.
|
|
1340
|
-
*
|
|
1341
|
+
*
|
|
1341
1342
|
* Potentially, the server returned some more indicative error message. In this
|
|
1342
1343
|
* case read it carefully to know how much the limit was exceeded.
|
|
1343
|
-
*
|
|
1344
|
+
*
|
|
1344
1345
|
* In any case the pilet must be somehow trimmed down. Most often, the size is
|
|
1345
1346
|
* dominantly determined by some external packages that are referened. Use a
|
|
1346
1347
|
* page such as bundlephobia.com or some IDE tools to find out which packages
|
|
@@ -1541,10 +1542,10 @@ export function entryPointDoesNotExist_0073(app: string): QuickMessage {
|
|
|
1541
1542
|
* point for the bundler.
|
|
1542
1543
|
*
|
|
1543
1544
|
* @see
|
|
1544
|
-
* - [
|
|
1545
|
+
* - [npm Init](https://docs.npmjs.com/cli/init)
|
|
1545
1546
|
*
|
|
1546
1547
|
* @example
|
|
1547
|
-
* You can create a new
|
|
1548
|
+
* You can create a new npm project using the `npm init` command. This will essentially guide
|
|
1548
1549
|
* you through a number of decisions for creating a proper package.json.
|
|
1549
1550
|
*
|
|
1550
1551
|
* Even better you could start a new Piral instance using the following command:
|
|
@@ -1577,10 +1578,10 @@ export function packageJsonMissing_0074(): QuickMessage {
|
|
|
1577
1578
|
* point for the bundler.
|
|
1578
1579
|
*
|
|
1579
1580
|
* @see
|
|
1580
|
-
* - [
|
|
1581
|
+
* - [npm Init](https://docs.npmjs.com/cli/init)
|
|
1581
1582
|
*
|
|
1582
1583
|
* @example
|
|
1583
|
-
* You can create a new
|
|
1584
|
+
* You can create a new npm project using the `npm init` command. This will essentially guide
|
|
1584
1585
|
* you through a number of decisions for creating a proper package.json.
|
|
1585
1586
|
*
|
|
1586
1587
|
* Even better you could start a new pilet using the following command:
|
|
@@ -1855,7 +1856,7 @@ export function toolingIncompatible_0101(piralVersion: string, cliVersion: strin
|
|
|
1855
1856
|
*
|
|
1856
1857
|
* @example
|
|
1857
1858
|
* The following command first removes the output directory, then starts the build,
|
|
1858
|
-
* and finally publishes the emulator to
|
|
1859
|
+
* and finally publishes the emulator to npm.
|
|
1859
1860
|
*
|
|
1860
1861
|
* ```sh
|
|
1861
1862
|
* rm -rf dist
|
|
@@ -1881,7 +1882,7 @@ export function publishDirectoryMissing_0110(directory: string): QuickMessage {
|
|
|
1881
1882
|
*
|
|
1882
1883
|
* @example
|
|
1883
1884
|
* The following command first removes the output directory, then starts the build,
|
|
1884
|
-
* and finally publishes the emulator to
|
|
1885
|
+
* and finally publishes the emulator to npm.
|
|
1885
1886
|
*
|
|
1886
1887
|
* ```sh
|
|
1887
1888
|
* rm -rf dist
|
|
@@ -1960,11 +1961,15 @@ export function publishProviderMissing_0113(providerName: string, availableProvi
|
|
|
1960
1961
|
* ```sh
|
|
1961
1962
|
* piral publish --type release --provider xcopy --fields.target "/temp/dest"
|
|
1962
1963
|
* ```
|
|
1963
|
-
*
|
|
1964
|
+
*
|
|
1964
1965
|
* The type is "release".
|
|
1965
1966
|
*/
|
|
1966
1967
|
export function publishEmulatorSourcesInvalid_0114(): QuickMessage {
|
|
1967
|
-
return [
|
|
1968
|
+
return [
|
|
1969
|
+
LogLevels.error,
|
|
1970
|
+
'0114',
|
|
1971
|
+
`The command "publish" cannot be done with "--type emulator-sources". Use another type instead.`,
|
|
1972
|
+
];
|
|
1968
1973
|
}
|
|
1969
1974
|
|
|
1970
1975
|
/**
|
|
@@ -1986,7 +1991,7 @@ export function publishEmulatorSourcesInvalid_0114(): QuickMessage {
|
|
|
1986
1991
|
* - The API for opening the default browser is invalid
|
|
1987
1992
|
*
|
|
1988
1993
|
* @see
|
|
1989
|
-
* - [
|
|
1994
|
+
* - [npm Open Package](https://www.npmjs.com/package/open)
|
|
1990
1995
|
*
|
|
1991
1996
|
* @example
|
|
1992
1997
|
* The browser is usually just opened via the command line:
|
|
@@ -2018,7 +2023,7 @@ export function failedToOpenBrowser_0170(error: string): QuickMessage {
|
|
|
2018
2023
|
*
|
|
2019
2024
|
* The v1 version has better support for older browsers, but requires a polyfill to work
|
|
2020
2025
|
* correctly. This polyfill is part of the standard Piral polyfills.
|
|
2021
|
-
*
|
|
2026
|
+
*
|
|
2022
2027
|
* The v2 version uses a SystemJS format for the pilet. It has the broadest browser support
|
|
2023
2028
|
* but requires the custom format as output. Most bundlers support SystemJS directly or
|
|
2024
2029
|
* indirectly, making it a quite broad choice.
|
|
@@ -2058,6 +2063,7 @@ export function invalidSchemaVersion_0171(schemaVersion: string, schemas: Array<
|
|
|
2058
2063
|
* @see
|
|
2059
2064
|
* - [Webpack](https://webpack.js.org)
|
|
2060
2065
|
* - [Parcel](https://parceljs.org)
|
|
2066
|
+
* - [esbuild](https://esbuild.github.io)
|
|
2061
2067
|
* - [Pluggable bundlers](https://docs.piral.io/reference/documentation/bundlers)
|
|
2062
2068
|
*
|
|
2063
2069
|
* @example
|
|
@@ -2089,6 +2095,7 @@ export function bundlerMissing_0172(bundlerName: string, installed: Array<string
|
|
|
2089
2095
|
* @see
|
|
2090
2096
|
* - [Webpack](https://webpack.js.org)
|
|
2091
2097
|
* - [Parcel](https://parceljs.org)
|
|
2098
|
+
* - [esbuild](https://esbuild.github.io)
|
|
2092
2099
|
* - [Pluggable bundlers](https://docs.piral.io/reference/documentation/bundlers)
|
|
2093
2100
|
*
|
|
2094
2101
|
* @example
|
|
@@ -2120,6 +2127,7 @@ export function defaultBundlerMissing_0173(): QuickMessage {
|
|
|
2120
2127
|
* @see
|
|
2121
2128
|
* - [Webpack](https://webpack.js.org)
|
|
2122
2129
|
* - [Parcel](https://parceljs.org)
|
|
2130
|
+
* - [esbuild](https://esbuild.github.io)
|
|
2123
2131
|
* - [Pluggable bundlers](https://docs.piral.io/reference/documentation/bundlers)
|
|
2124
2132
|
*
|
|
2125
2133
|
* @example
|
package/src/types/common.ts
CHANGED
package/src/types/public.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { Argv, Arguments } from 'yargs';
|
|
2
|
-
import {
|
|
3
|
-
RuleRunner,
|
|
4
|
-
PiletRuleContext,
|
|
5
|
-
PiralRuleContext,
|
|
6
|
-
Bundler,
|
|
7
|
-
BundleDetails,
|
|
8
|
-
LogLevels,
|
|
9
|
-
SharedDependency,
|
|
10
|
-
ReleaseProvider,
|
|
11
|
-
} from './common';
|
|
2
|
+
import { RuleRunner, PiletRuleContext, PiralRuleContext, LogLevels, SharedDependency, ReleaseProvider } from './common';
|
|
12
3
|
|
|
13
4
|
export interface ToolCommandRunner<U = {}> {
|
|
14
5
|
(args: Arguments<U>): void | Promise<void>;
|
|
@@ -131,28 +122,85 @@ export interface BuildPiletParameters extends BaseBundleParameters {
|
|
|
131
122
|
version: PiletSchemaVersion;
|
|
132
123
|
}
|
|
133
124
|
|
|
134
|
-
export interface
|
|
135
|
-
|
|
125
|
+
export interface BundlerPrepareArgs<T> {
|
|
126
|
+
(args: T): T | Promise<T>;
|
|
136
127
|
}
|
|
137
128
|
|
|
138
|
-
export interface
|
|
129
|
+
export interface BaseBundlerDefinition<T> {
|
|
130
|
+
path: string;
|
|
131
|
+
prepare?: BundlerPrepareArgs<T>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface WatchPiralBundlerDefinition extends BaseBundlerDefinition<WatchPiralParameters> {}
|
|
135
|
+
|
|
136
|
+
export interface DebugPiralBundlerDefinition extends BaseBundlerDefinition<DebugPiralParameters> {
|
|
139
137
|
flags?: ToolCommandFlagsSetter;
|
|
140
|
-
run(args: DebugPiralParameters): Promise<Bundler>;
|
|
141
138
|
}
|
|
142
139
|
|
|
143
|
-
export interface BuildPiralBundlerDefinition {
|
|
140
|
+
export interface BuildPiralBundlerDefinition extends BaseBundlerDefinition<BuildPiralParameters> {
|
|
144
141
|
flags?: ToolCommandFlagsSetter;
|
|
145
|
-
run(args: BuildPiralParameters): Promise<BundleDetails>;
|
|
146
142
|
}
|
|
147
143
|
|
|
148
|
-
export interface DebugPiletBundlerDefinition {
|
|
144
|
+
export interface DebugPiletBundlerDefinition extends BaseBundlerDefinition<DebugPiletParameters> {
|
|
149
145
|
flags?: ToolCommandFlagsSetter;
|
|
150
|
-
run(args: DebugPiletParameters): Promise<Bundler>;
|
|
151
146
|
}
|
|
152
147
|
|
|
153
|
-
export interface BuildPiletBundlerDefinition {
|
|
148
|
+
export interface BuildPiletBundlerDefinition extends BaseBundlerDefinition<BuildPiletParameters> {
|
|
154
149
|
flags?: ToolCommandFlagsSetter;
|
|
155
|
-
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface PiralBuildHandler {
|
|
153
|
+
create(config: {
|
|
154
|
+
root: string;
|
|
155
|
+
entryFiles: string;
|
|
156
|
+
outDir: string;
|
|
157
|
+
outFile: string;
|
|
158
|
+
externals: Array<string>;
|
|
159
|
+
emulator: boolean;
|
|
160
|
+
sourceMaps: boolean;
|
|
161
|
+
contentHash: boolean;
|
|
162
|
+
minify: boolean;
|
|
163
|
+
publicUrl: string;
|
|
164
|
+
hmr: boolean;
|
|
165
|
+
logLevel: LogLevels;
|
|
166
|
+
watch: boolean;
|
|
167
|
+
args: any;
|
|
168
|
+
}): Promise<BundleHandlerResponse>;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface PiletBuildHandler {
|
|
172
|
+
create(config: {
|
|
173
|
+
root: string;
|
|
174
|
+
piral: string;
|
|
175
|
+
entryModule: string;
|
|
176
|
+
targetDir: string;
|
|
177
|
+
outDir: string;
|
|
178
|
+
outFile: string;
|
|
179
|
+
externals: Array<string>;
|
|
180
|
+
importmap: Array<SharedDependency>;
|
|
181
|
+
version: PiletSchemaVersion;
|
|
182
|
+
develop: boolean;
|
|
183
|
+
sourceMaps: boolean;
|
|
184
|
+
contentHash: boolean;
|
|
185
|
+
minify: boolean;
|
|
186
|
+
logLevel: LogLevels;
|
|
187
|
+
watch: boolean;
|
|
188
|
+
args: any;
|
|
189
|
+
}): Promise<BundleHandlerResponse>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface BundleResult {
|
|
193
|
+
outDir: string;
|
|
194
|
+
outFile: string;
|
|
195
|
+
hash?: string;
|
|
196
|
+
name?: string;
|
|
197
|
+
requireRef?: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface BundleHandlerResponse {
|
|
201
|
+
onStart(cb: () => void): void;
|
|
202
|
+
onEnd(cb: (result: BundleResult) => void): void;
|
|
203
|
+
bundle(): Promise<BundleResult>;
|
|
156
204
|
}
|
|
157
205
|
|
|
158
206
|
export interface BundlerDefinition {
|