piral-cli 0.14.0-beta.3156 → 0.14.0-beta.3184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apps/new-pilet.d.ts +1 -1
- package/lib/apps/new-pilet.js +3 -3
- package/lib/apps/new-piral.d.ts +1 -1
- package/lib/apps/new-piral.js +2 -2
- 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 +2 -2
- package/lib/apps/upgrade-pilet.js +1 -1
- package/lib/apps/upgrade-piral.d.ts +2 -2
- package/lib/apps/upgrade-piral.js +1 -1
- package/lib/bundler.js +1 -1
- package/lib/commands.js +8 -8
- package/lib/commands.js.map +1 -1
- package/lib/common/clients/npm.js +10 -10
- package/lib/common/emulator.js +1 -1
- package/lib/common/npm.js +6 -6
- package/lib/messages.d.ts +20 -20
- package/lib/messages.js +25 -21
- package/lib/messages.js.map +1 -1
- package/package.json +2 -2
- package/src/apps/new-pilet.ts +4 -4
- package/src/apps/new-piral.ts +3 -3
- 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 +3 -3
- package/src/apps/upgrade-piral.ts +3 -3
- package/src/bundler.ts +1 -1
- package/src/commands.ts +16 -10
- package/src/common/clients/npm.ts +10 -10
- package/src/common/emulator.ts +1 -1
- package/src/common/npm.test.ts +4 -4
- package/src/common/npm.ts +6 -6
- package/src/messages.ts +25 -21
package/src/common/npm.ts
CHANGED
|
@@ -69,27 +69,27 @@ export async function getLernaNpmClient(root: string): Promise<NpmClientType> {
|
|
|
69
69
|
*/
|
|
70
70
|
export async function determineNpmClient(root: string, selected?: NpmClientType): Promise<NpmClientType> {
|
|
71
71
|
if (!selected || !clientTypeKeys.includes(selected)) {
|
|
72
|
-
log('generalDebug_0003', 'No
|
|
72
|
+
log('generalDebug_0003', 'No npm client selected. Checking for lock files ...');
|
|
73
73
|
const [hasNpm, hasYarn, hasPnpm] = await Promise.all([detectNpm(root), detectYarn(root), detectPnpm(root)]);
|
|
74
74
|
const found = +hasNpm + +hasYarn + +hasPnpm;
|
|
75
|
-
log('generalDebug_0003', `Results of the lock file check:
|
|
75
|
+
log('generalDebug_0003', `Results of the lock file check: npm = ${hasNpm}, Yarn = ${hasYarn}, Pnpm = ${hasPnpm}`);
|
|
76
76
|
const defaultClient = config.npmClient;
|
|
77
77
|
|
|
78
78
|
if (found !== 1) {
|
|
79
79
|
const lernaClient = await getLernaNpmClient(root);
|
|
80
80
|
|
|
81
81
|
if (clientTypeKeys.includes(lernaClient)) {
|
|
82
|
-
log('generalDebug_0003', `Found valid
|
|
82
|
+
log('generalDebug_0003', `Found valid npm client via Lerna: ${lernaClient}.`);
|
|
83
83
|
return lernaClient;
|
|
84
84
|
}
|
|
85
85
|
} else if (hasNpm) {
|
|
86
|
-
log('generalDebug_0003', `Found valid
|
|
86
|
+
log('generalDebug_0003', `Found valid npm client via lockfile.`);
|
|
87
87
|
return 'npm';
|
|
88
88
|
} else if (hasYarn) {
|
|
89
89
|
log('generalDebug_0003', `Found valid Yarn client via lockfile.`);
|
|
90
90
|
return 'yarn';
|
|
91
91
|
} else if (hasPnpm) {
|
|
92
|
-
log('generalDebug_0003', `Found valid
|
|
92
|
+
log('generalDebug_0003', `Found valid pnpm client via lockfile.`);
|
|
93
93
|
return 'pnpm';
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -98,7 +98,7 @@ export async function determineNpmClient(root: string, selected?: NpmClientType)
|
|
|
98
98
|
return defaultClient;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
log('generalDebug_0003', 'Using the default
|
|
101
|
+
log('generalDebug_0003', 'Using the default npm client.');
|
|
102
102
|
return 'npm';
|
|
103
103
|
}
|
|
104
104
|
|
package/src/messages.ts
CHANGED
|
@@ -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
|
|
@@ -995,7 +995,7 @@ export function missingPiletFeedUrl_0060(): QuickMessage {
|
|
|
995
995
|
* directly.
|
|
996
996
|
*
|
|
997
997
|
* @see
|
|
998
|
-
* - [
|
|
998
|
+
* - [npm Pack](https://docs.npmjs.com/cli-commands/pack.html)
|
|
999
999
|
*
|
|
1000
1000
|
* @example
|
|
1001
1001
|
* Make sure to have build a pilet beforehand:
|
|
@@ -1541,10 +1541,10 @@ export function entryPointDoesNotExist_0073(app: string): QuickMessage {
|
|
|
1541
1541
|
* point for the bundler.
|
|
1542
1542
|
*
|
|
1543
1543
|
* @see
|
|
1544
|
-
* - [
|
|
1544
|
+
* - [npm Init](https://docs.npmjs.com/cli/init)
|
|
1545
1545
|
*
|
|
1546
1546
|
* @example
|
|
1547
|
-
* You can create a new
|
|
1547
|
+
* You can create a new npm project using the `npm init` command. This will essentially guide
|
|
1548
1548
|
* you through a number of decisions for creating a proper package.json.
|
|
1549
1549
|
*
|
|
1550
1550
|
* Even better you could start a new Piral instance using the following command:
|
|
@@ -1577,10 +1577,10 @@ export function packageJsonMissing_0074(): QuickMessage {
|
|
|
1577
1577
|
* point for the bundler.
|
|
1578
1578
|
*
|
|
1579
1579
|
* @see
|
|
1580
|
-
* - [
|
|
1580
|
+
* - [npm Init](https://docs.npmjs.com/cli/init)
|
|
1581
1581
|
*
|
|
1582
1582
|
* @example
|
|
1583
|
-
* You can create a new
|
|
1583
|
+
* You can create a new npm project using the `npm init` command. This will essentially guide
|
|
1584
1584
|
* you through a number of decisions for creating a proper package.json.
|
|
1585
1585
|
*
|
|
1586
1586
|
* Even better you could start a new pilet using the following command:
|
|
@@ -1855,7 +1855,7 @@ export function toolingIncompatible_0101(piralVersion: string, cliVersion: strin
|
|
|
1855
1855
|
*
|
|
1856
1856
|
* @example
|
|
1857
1857
|
* The following command first removes the output directory, then starts the build,
|
|
1858
|
-
* and finally publishes the emulator to
|
|
1858
|
+
* and finally publishes the emulator to npm.
|
|
1859
1859
|
*
|
|
1860
1860
|
* ```sh
|
|
1861
1861
|
* rm -rf dist
|
|
@@ -1881,7 +1881,7 @@ export function publishDirectoryMissing_0110(directory: string): QuickMessage {
|
|
|
1881
1881
|
*
|
|
1882
1882
|
* @example
|
|
1883
1883
|
* The following command first removes the output directory, then starts the build,
|
|
1884
|
-
* and finally publishes the emulator to
|
|
1884
|
+
* and finally publishes the emulator to npm.
|
|
1885
1885
|
*
|
|
1886
1886
|
* ```sh
|
|
1887
1887
|
* rm -rf dist
|
|
@@ -1964,7 +1964,11 @@ export function publishProviderMissing_0113(providerName: string, availableProvi
|
|
|
1964
1964
|
* The type is "release".
|
|
1965
1965
|
*/
|
|
1966
1966
|
export function publishEmulatorSourcesInvalid_0114(): QuickMessage {
|
|
1967
|
-
return [
|
|
1967
|
+
return [
|
|
1968
|
+
LogLevels.error,
|
|
1969
|
+
'0114',
|
|
1970
|
+
`The command "publish" cannot be done with "--type emulator-sources". Use another type instead.`,
|
|
1971
|
+
];
|
|
1968
1972
|
}
|
|
1969
1973
|
|
|
1970
1974
|
/**
|
|
@@ -1986,7 +1990,7 @@ export function publishEmulatorSourcesInvalid_0114(): QuickMessage {
|
|
|
1986
1990
|
* - The API for opening the default browser is invalid
|
|
1987
1991
|
*
|
|
1988
1992
|
* @see
|
|
1989
|
-
* - [
|
|
1993
|
+
* - [npm Open Package](https://www.npmjs.com/package/open)
|
|
1990
1994
|
*
|
|
1991
1995
|
* @example
|
|
1992
1996
|
* The browser is usually just opened via the command line:
|