piral-cli 0.14.1 → 0.14.3-beta.3296

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.
Files changed (52) hide show
  1. package/lib/apps/build-pilet.d.ts +6 -2
  2. package/lib/apps/build-pilet.js +92 -38
  3. package/lib/apps/build-pilet.js.map +1 -1
  4. package/lib/apps/debug-pilet.d.ts +2 -2
  5. package/lib/apps/publish-pilet.d.ts +9 -1
  6. package/lib/apps/publish-pilet.js +64 -28
  7. package/lib/apps/publish-pilet.js.map +1 -1
  8. package/lib/build/bundler-calls.js +8 -2
  9. package/lib/build/bundler-calls.js.map +1 -1
  10. package/lib/commands.js +12 -2
  11. package/lib/commands.js.map +1 -1
  12. package/lib/common/compatibility.js +4 -0
  13. package/lib/common/compatibility.js.map +1 -1
  14. package/lib/common/index.d.ts +1 -0
  15. package/lib/common/index.js +1 -0
  16. package/lib/common/index.js.map +1 -1
  17. package/lib/common/io.js +12 -4
  18. package/lib/common/io.js.map +1 -1
  19. package/lib/common/npm.d.ts +2 -1
  20. package/lib/common/npm.js +34 -8
  21. package/lib/common/npm.js.map +1 -1
  22. package/lib/common/spec.d.ts +29 -0
  23. package/lib/common/spec.js +57 -0
  24. package/lib/common/spec.js.map +1 -0
  25. package/lib/helpers.d.ts +3 -2
  26. package/lib/helpers.js +3 -2
  27. package/lib/helpers.js.map +1 -1
  28. package/lib/injectors/pilet.d.ts +2 -2
  29. package/lib/injectors/pilet.js +32 -74
  30. package/lib/injectors/pilet.js.map +1 -1
  31. package/lib/messages.d.ts +14 -1
  32. package/lib/messages.js +23 -3
  33. package/lib/messages.js.map +1 -1
  34. package/lib/rules/pilet-uses-latest-piral.js +17 -8
  35. package/lib/rules/pilet-uses-latest-piral.js.map +1 -1
  36. package/lib/types/public.d.ts +1 -0
  37. package/package.json +2 -2
  38. package/src/apps/build-pilet.ts +144 -46
  39. package/src/apps/debug-pilet.ts +2 -2
  40. package/src/apps/publish-pilet.ts +99 -29
  41. package/src/build/bundler-calls.ts +10 -2
  42. package/src/commands.ts +14 -3
  43. package/src/common/compatibility.ts +6 -0
  44. package/src/common/index.ts +1 -0
  45. package/src/common/io.ts +16 -6
  46. package/src/common/npm.ts +44 -11
  47. package/src/common/spec.ts +58 -0
  48. package/src/helpers.ts +10 -2
  49. package/src/injectors/pilet.ts +31 -78
  50. package/src/messages.ts +22 -2
  51. package/src/rules/pilet-uses-latest-piral.ts +21 -11
  52. package/src/types/public.ts +2 -0
package/src/messages.ts CHANGED
@@ -1026,8 +1026,8 @@ export function missingPiletFeedUrl_0060(): QuickMessage {
1026
1026
  * Using multiple commands is preferred if you use custom options, otherwise
1027
1027
  * just go for the single command.
1028
1028
  */
1029
- export function missingPiletTarball_0061(source: string): QuickMessage {
1030
- return [LogLevels.error, '0061', `No files found using pattern "${source}".`];
1029
+ export function missingPiletTarball_0061(sources: Array<string>): QuickMessage {
1030
+ return [LogLevels.error, '0061', `No files found using pattern "${sources.join('", "')}".`];
1031
1031
  }
1032
1032
 
1033
1033
  /**
@@ -1842,6 +1842,26 @@ export function toolingIncompatible_0101(piralVersion: string, cliVersion: strin
1842
1842
  ];
1843
1843
  }
1844
1844
 
1845
+ /**
1846
+ * @kind Info
1847
+ *
1848
+ * @summary
1849
+ * The Piral CLI could not detect the tooling version used by the app shell. Therefore, it may be incompatible to the
1850
+ * currently used version of the piral-cli. Keep an eye on weird errors.
1851
+ *
1852
+ * @abstract
1853
+ * The emulator contains a special section to inform the Piral CLI about the used version of the tooling. This is
1854
+ * important to detect potential alignment or incompatibilities. The used version of the emulator does not contain
1855
+ * this information and therefore may be incompatible.
1856
+ */
1857
+ export function appShellMaybeIncompatible_0102(cliVersion: string): QuickMessage {
1858
+ return [
1859
+ LogLevels.info,
1860
+ '0100',
1861
+ `The Piral instance's CLI version is unknown and may be incompatible to the used version (${cliVersion}).`,
1862
+ ];
1863
+ }
1864
+
1845
1865
  /**
1846
1866
  * @kind Error
1847
1867
  *
@@ -1,4 +1,4 @@
1
- import { findLatestVersion } from '../common';
1
+ import { isMonorepoPackageRef, findLatestVersion } from '../common';
2
2
  import { PiletRuleContext } from '../types';
3
3
 
4
4
  export type Options = 'suggest' | 'required' | 'ignore';
@@ -13,17 +13,27 @@ export default async function (context: PiletRuleContext, options: Options = 'su
13
13
  const isfixed = demanded.startsWith('git+') || demanded.startsWith('file:');
14
14
 
15
15
  if (!isfixed) {
16
- const latestVersion = await findLatestVersion(name);
16
+ const isMonorepoRef = await isMonorepoPackageRef(name, context.root);
17
17
 
18
- if (version !== latestVersion) {
19
- const notify = options === 'required' ? context.error : context.warning;
20
- notify(
21
- `
22
- The used version of "${name}" is outdated.
23
- Expected: v${latestVersion}.
24
- Received: v${version}.
25
- `,
26
- );
18
+ // either we are not in a monorepo or the app shell is not part of the monorepo
19
+ if (!isMonorepoRef) {
20
+ const latestVersion = await findLatestVersion(name).catch((err) => {
21
+ context.warning(`
22
+ The used version of "${name}" could not be determined: ${err}.
23
+ `);
24
+ return version;
25
+ });
26
+
27
+ if (version !== latestVersion) {
28
+ const notify = options === 'required' ? context.error : context.warning;
29
+ notify(
30
+ `
31
+ The used version of "${name}" is outdated.
32
+ Expected: v${latestVersion}.
33
+ Received: v${version}.
34
+ `,
35
+ );
36
+ }
27
37
  }
28
38
  }
29
39
  }
@@ -217,6 +217,8 @@ export type PiletPublishSource = 'local' | 'npm' | 'remote';
217
217
 
218
218
  export type PiralBuildType = 'all' | 'release' | 'emulator' | 'emulator-sources';
219
219
 
220
+ export type PiletBuildType = 'default' | 'standalone';
221
+
220
222
  export type PackageType = 'registry' | 'file' | 'git';
221
223
 
222
224
  export type NpmClientType = 'npm' | 'yarn' | 'pnpm';