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.
Files changed (408) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +30 -7
  3. package/lib/api.js +23 -23
  4. package/lib/api.js.map +1 -1
  5. package/lib/apps/add-piral-instance-pilet.d.ts +26 -0
  6. package/lib/apps/add-piral-instance-pilet.js +53 -0
  7. package/lib/apps/add-piral-instance-pilet.js.map +1 -0
  8. package/lib/apps/build-pilet.d.ts +33 -2
  9. package/lib/apps/build-pilet.js +159 -32
  10. package/lib/apps/build-pilet.js.map +1 -1
  11. package/lib/apps/build-piral.d.ts +18 -1
  12. package/lib/apps/build-piral.js +68 -52
  13. package/lib/apps/build-piral.js.map +1 -1
  14. package/lib/apps/debug-pilet.d.ts +38 -2
  15. package/lib/apps/debug-pilet.js +150 -108
  16. package/lib/apps/debug-pilet.js.map +1 -1
  17. package/lib/apps/debug-piral.d.ts +23 -0
  18. package/lib/apps/debug-piral.js +63 -52
  19. package/lib/apps/debug-piral.js.map +1 -1
  20. package/lib/apps/declaration-piral.js +5 -3
  21. package/lib/apps/declaration-piral.js.map +1 -1
  22. package/lib/apps/index.d.ts +3 -0
  23. package/lib/apps/index.js +8 -1
  24. package/lib/apps/index.js.map +1 -1
  25. package/lib/apps/new-pilet.d.ts +7 -3
  26. package/lib/apps/new-pilet.js +47 -52
  27. package/lib/apps/new-pilet.js.map +1 -1
  28. package/lib/apps/new-piral.d.ts +7 -3
  29. package/lib/apps/new-piral.js +33 -23
  30. package/lib/apps/new-piral.js.map +1 -1
  31. package/lib/apps/pack-pilet.d.ts +9 -0
  32. package/lib/apps/pack-pilet.js +6 -13
  33. package/lib/apps/pack-pilet.js.map +1 -1
  34. package/lib/apps/publish-pilet.d.ts +23 -3
  35. package/lib/apps/publish-pilet.js +112 -62
  36. package/lib/apps/publish-pilet.js.map +1 -1
  37. package/lib/apps/publish-piral.d.ts +6 -2
  38. package/lib/apps/publish-piral.js +30 -26
  39. package/lib/apps/publish-piral.js.map +1 -1
  40. package/lib/apps/remove-piral-instance-pilet.d.ts +22 -0
  41. package/lib/apps/remove-piral-instance-pilet.js +52 -0
  42. package/lib/apps/remove-piral-instance-pilet.js.map +1 -0
  43. package/lib/apps/run-emulator-piral.d.ts +34 -0
  44. package/lib/apps/run-emulator-piral.js +91 -0
  45. package/lib/apps/run-emulator-piral.js.map +1 -0
  46. package/lib/apps/upgrade-pilet.d.ts +6 -2
  47. package/lib/apps/upgrade-pilet.js +41 -43
  48. package/lib/apps/upgrade-pilet.js.map +1 -1
  49. package/lib/apps/upgrade-piral.d.ts +2 -2
  50. package/lib/apps/upgrade-piral.js +21 -20
  51. package/lib/apps/upgrade-piral.js.map +1 -1
  52. package/lib/apps/validate-pilet.js +30 -36
  53. package/lib/apps/validate-pilet.js.map +1 -1
  54. package/lib/apps/validate-piral.js +13 -10
  55. package/lib/apps/validate-piral.js.map +1 -1
  56. package/lib/build/bundler-calls.d.ts +3 -0
  57. package/lib/build/bundler-calls.js +117 -0
  58. package/lib/build/bundler-calls.js.map +1 -0
  59. package/lib/build/run-build-pilet.d.ts +1 -0
  60. package/lib/build/run-build-pilet.js +65 -0
  61. package/lib/build/run-build-pilet.js.map +1 -0
  62. package/lib/build/run-build-piral.d.ts +1 -0
  63. package/lib/build/run-build-piral.js +67 -0
  64. package/lib/build/run-build-piral.js.map +1 -0
  65. package/lib/build/run-debug-mono-piral.d.ts +1 -0
  66. package/lib/build/run-debug-mono-piral.js +70 -0
  67. package/lib/build/run-debug-mono-piral.js.map +1 -0
  68. package/lib/build/run-debug-pilet.d.ts +1 -0
  69. package/lib/build/run-debug-pilet.js +89 -0
  70. package/lib/build/run-debug-pilet.js.map +1 -0
  71. package/lib/build/run-debug-piral.d.ts +1 -0
  72. package/lib/build/run-debug-piral.js +85 -0
  73. package/lib/build/run-debug-piral.js.map +1 -0
  74. package/lib/bundler.js +75 -26
  75. package/lib/bundler.js.map +1 -1
  76. package/lib/cli.js +7 -4
  77. package/lib/cli.js.map +1 -1
  78. package/lib/commands.js +266 -46
  79. package/lib/commands.js.map +1 -1
  80. package/lib/common/archive.d.ts +4 -0
  81. package/lib/common/archive.js +31 -10
  82. package/lib/common/archive.js.map +1 -1
  83. package/lib/common/browser.d.ts +2 -1
  84. package/lib/common/browser.js +17 -8
  85. package/lib/common/browser.js.map +1 -1
  86. package/lib/common/clients/index.d.ts +21 -0
  87. package/lib/common/clients/index.js +48 -0
  88. package/lib/common/clients/index.js.map +1 -0
  89. package/lib/common/clients/lerna.d.ts +7 -1
  90. package/lib/common/clients/lerna.js +93 -7
  91. package/lib/common/clients/lerna.js.map +1 -1
  92. package/lib/common/clients/npm.d.ts +6 -1
  93. package/lib/common/clients/npm.js +66 -18
  94. package/lib/common/clients/npm.js.map +1 -1
  95. package/lib/common/clients/pnp.d.ts +7 -0
  96. package/lib/common/clients/pnp.js +104 -0
  97. package/lib/common/clients/pnp.js.map +1 -0
  98. package/lib/common/clients/pnpm.d.ts +5 -0
  99. package/lib/common/clients/pnpm.js +55 -6
  100. package/lib/common/clients/pnpm.js.map +1 -1
  101. package/lib/common/clients/rush.d.ts +7 -0
  102. package/lib/common/clients/rush.js +127 -0
  103. package/lib/common/clients/rush.js.map +1 -0
  104. package/lib/common/clients/yarn.d.ts +5 -0
  105. package/lib/common/clients/yarn.js +57 -6
  106. package/lib/common/clients/yarn.js.map +1 -1
  107. package/lib/common/compatibility.js +14 -9
  108. package/lib/common/compatibility.js.map +1 -1
  109. package/lib/common/config.d.ts +52 -1
  110. package/lib/common/config.js +10 -30
  111. package/lib/common/config.js.map +1 -1
  112. package/lib/common/constants.d.ts +10 -2
  113. package/lib/common/constants.js +22 -4
  114. package/lib/common/constants.js.map +1 -1
  115. package/lib/common/declaration.d.ts +2 -1
  116. package/lib/common/declaration.js +113 -56
  117. package/lib/common/declaration.js.map +1 -1
  118. package/lib/common/emoji.d.ts +8 -0
  119. package/lib/common/emoji.js +10 -1
  120. package/lib/common/emoji.js.map +1 -1
  121. package/lib/common/emulator.d.ts +2 -2
  122. package/lib/common/emulator.js +45 -32
  123. package/lib/common/emulator.js.map +1 -1
  124. package/lib/common/enums.d.ts +0 -4
  125. package/lib/common/enums.js +1 -6
  126. package/lib/common/enums.js.map +1 -1
  127. package/lib/common/envs.js +16 -5
  128. package/lib/common/envs.js.map +1 -1
  129. package/lib/common/hash.d.ts +1 -0
  130. package/lib/common/hash.js +8 -3
  131. package/lib/common/hash.js.map +1 -1
  132. package/lib/common/http.d.ts +5 -2
  133. package/lib/common/http.js +65 -23
  134. package/lib/common/http.js.map +1 -1
  135. package/lib/common/importmap.d.ts +2 -0
  136. package/lib/common/importmap.js +202 -0
  137. package/lib/common/importmap.js.map +1 -0
  138. package/lib/common/index.d.ts +10 -0
  139. package/lib/common/index.js +15 -1
  140. package/lib/common/index.js.map +1 -1
  141. package/lib/common/info.d.ts +5 -0
  142. package/lib/common/info.js +9 -2
  143. package/lib/common/info.js.map +1 -1
  144. package/lib/common/injectors.d.ts +36 -8
  145. package/lib/common/injectors.js +46 -19
  146. package/lib/common/injectors.js.map +1 -1
  147. package/lib/common/inspect.d.ts +5 -3
  148. package/lib/common/inspect.js +15 -15
  149. package/lib/common/inspect.js.map +1 -1
  150. package/lib/common/interactive.d.ts +9 -0
  151. package/lib/common/interactive.js +60 -1
  152. package/lib/common/interactive.js.map +1 -1
  153. package/lib/common/io.d.ts +9 -3
  154. package/lib/common/io.js +219 -116
  155. package/lib/common/io.js.map +1 -1
  156. package/lib/common/language.d.ts +9 -6
  157. package/lib/common/language.js +68 -12
  158. package/lib/common/language.js.map +1 -1
  159. package/lib/common/log.d.ts +5 -3
  160. package/lib/common/log.js +34 -48
  161. package/lib/common/log.js.map +1 -1
  162. package/lib/common/npm.d.ts +17 -16
  163. package/lib/common/npm.js +262 -158
  164. package/lib/common/npm.js.map +1 -1
  165. package/lib/common/pack.js +47 -26
  166. package/lib/common/pack.js.map +1 -1
  167. package/lib/common/package.d.ts +43 -20
  168. package/lib/common/package.js +377 -213
  169. package/lib/common/package.js.map +1 -1
  170. package/lib/common/parallel.d.ts +1 -0
  171. package/lib/common/parallel.js +29 -0
  172. package/lib/common/parallel.js.map +1 -0
  173. package/lib/common/patcher.js +20 -20
  174. package/lib/common/patcher.js.map +1 -1
  175. package/lib/common/platform.d.ts +13 -0
  176. package/lib/common/platform.js +29 -0
  177. package/lib/common/platform.js.map +1 -0
  178. package/lib/common/port.d.ts +1 -0
  179. package/lib/common/port.js +14 -4
  180. package/lib/common/port.js.map +1 -1
  181. package/lib/common/rules.js +4 -4
  182. package/lib/common/rules.js.map +1 -1
  183. package/lib/common/scaffold.d.ts +18 -4
  184. package/lib/common/scaffold.js +59 -36
  185. package/lib/common/scaffold.js.map +1 -1
  186. package/lib/common/scripts.js +8 -8
  187. package/lib/common/scripts.js.map +1 -1
  188. package/lib/common/shell.d.ts +2 -0
  189. package/lib/common/shell.js +33 -0
  190. package/lib/common/shell.js.map +1 -0
  191. package/lib/common/spec.d.ts +29 -0
  192. package/lib/common/spec.js +69 -0
  193. package/lib/common/spec.js.map +1 -0
  194. package/lib/common/template.d.ts +1 -2
  195. package/lib/common/template.js +23 -22
  196. package/lib/common/template.js.map +1 -1
  197. package/lib/common/url.d.ts +1 -0
  198. package/lib/common/url.js +17 -0
  199. package/lib/common/url.js.map +1 -0
  200. package/lib/common/utils.d.ts +1 -0
  201. package/lib/common/utils.js +8 -0
  202. package/lib/common/utils.js.map +1 -0
  203. package/lib/common/version.d.ts +2 -0
  204. package/lib/common/version.js +130 -0
  205. package/lib/common/version.js.map +1 -0
  206. package/lib/common/watcher.d.ts +13 -0
  207. package/lib/common/watcher.js +78 -0
  208. package/lib/common/watcher.js.map +1 -0
  209. package/lib/external/index.js +59413 -57862
  210. package/lib/helpers.d.ts +6 -6
  211. package/lib/helpers.js +10 -25
  212. package/lib/helpers.js.map +1 -1
  213. package/lib/index.js +5 -1
  214. package/lib/index.js.map +1 -1
  215. package/lib/inject.js +2 -2
  216. package/lib/inject.js.map +1 -1
  217. package/lib/injectors/pilet-injector.d.ts +75 -0
  218. package/lib/injectors/pilet-injector.js +246 -0
  219. package/lib/injectors/pilet-injector.js.map +1 -0
  220. package/lib/injectors/{piral.d.ts → piral-injector.d.ts} +10 -2
  221. package/lib/injectors/piral-injector.js +97 -0
  222. package/lib/injectors/piral-injector.js.map +1 -0
  223. package/lib/messages.d.ts +567 -47
  224. package/lib/messages.js +638 -51
  225. package/lib/messages.js.map +1 -1
  226. package/lib/pb-cli.js +1 -1
  227. package/lib/pb-cli.js.map +1 -1
  228. package/lib/pilet-cli.js +1 -1
  229. package/lib/pilet-cli.js.map +1 -1
  230. package/lib/piral-cli.js +1 -1
  231. package/lib/piral-cli.js.map +1 -1
  232. package/lib/platforms/node.d.ts +8 -0
  233. package/lib/platforms/node.js +30 -0
  234. package/lib/platforms/node.js.map +1 -0
  235. package/lib/platforms/web.d.ts +8 -0
  236. package/lib/platforms/web.js +120 -0
  237. package/lib/platforms/web.js.map +1 -0
  238. package/lib/plugin.js +36 -11
  239. package/lib/plugin.js.map +1 -1
  240. package/lib/questionnaire.d.ts +1 -1
  241. package/lib/questionnaire.js +9 -4
  242. package/lib/questionnaire.js.map +1 -1
  243. package/lib/release.d.ts +1 -1
  244. package/lib/release.js +38 -6
  245. package/lib/release.js.map +1 -1
  246. package/lib/resolvers.js +13 -13
  247. package/lib/resolvers.js.map +1 -1
  248. package/lib/rules/index.js +8 -8
  249. package/lib/rules/index.js.map +1 -1
  250. package/lib/rules/pilet-has-externals-as-peers.d.ts +1 -1
  251. package/lib/rules/pilet-has-externals-as-peers.js +9 -7
  252. package/lib/rules/pilet-has-externals-as-peers.js.map +1 -1
  253. package/lib/rules/pilet-has-no-self-reference.d.ts +1 -1
  254. package/lib/rules/pilet-has-no-self-reference.js +2 -2
  255. package/lib/rules/pilet-has-no-self-reference.js.map +1 -1
  256. package/lib/rules/pilet-has-no-third-party-dependency.d.ts +1 -1
  257. package/lib/rules/pilet-stays-small.d.ts +1 -1
  258. package/lib/rules/pilet-stays-small.js +4 -4
  259. package/lib/rules/pilet-stays-small.js.map +1 -1
  260. package/lib/rules/pilet-uses-latest-piral.d.ts +1 -1
  261. package/lib/rules/pilet-uses-latest-piral.js +18 -9
  262. package/lib/rules/pilet-uses-latest-piral.js.map +1 -1
  263. package/lib/rules/piral-depends-on-piral.d.ts +1 -1
  264. package/lib/rules/piral-entry-ends-with-html.d.ts +1 -1
  265. package/lib/rules/piral-entry-ends-with-html.js +1 -1
  266. package/lib/rules/piral-entry-ends-with-html.js.map +1 -1
  267. package/lib/rules/piral-has-valid-devDependencies.d.ts +1 -1
  268. package/lib/rules/piral-has-valid-externals.d.ts +1 -1
  269. package/lib/rules/piral-has-valid-externals.js +10 -24
  270. package/lib/rules/piral-has-valid-externals.js.map +1 -1
  271. package/lib/rules/piral-has-valid-files.d.ts +1 -1
  272. package/lib/rules/piral-has-valid-files.js +5 -5
  273. package/lib/rules/piral-has-valid-files.js.map +1 -1
  274. package/lib/rules/piral-has-valid-scripts.d.ts +1 -1
  275. package/lib/runner.js +1 -1
  276. package/lib/runner.js.map +1 -1
  277. package/lib/select.js +6 -6
  278. package/lib/select.js.map +1 -1
  279. package/lib/types/common.d.ts +88 -8
  280. package/lib/types/common.js.map +1 -1
  281. package/lib/types/index.js +5 -1
  282. package/lib/types/index.js.map +1 -1
  283. package/lib/types/internal.d.ts +12 -13
  284. package/lib/types/public.d.ts +89 -23
  285. package/package.json +19 -16
  286. package/src/apps/add-piral-instance-pilet.ts +98 -0
  287. package/src/apps/build-pilet.ts +286 -38
  288. package/src/apps/build-piral.test.ts +20 -7
  289. package/src/apps/build-piral.ts +90 -39
  290. package/src/apps/debug-pilet.ts +229 -123
  291. package/src/apps/debug-piral.ts +121 -68
  292. package/src/apps/declaration-piral.ts +4 -2
  293. package/src/apps/index.ts +3 -0
  294. package/src/apps/new-pilet.test.ts +28 -11
  295. package/src/apps/new-pilet.ts +60 -48
  296. package/src/apps/new-piral.test.ts +25 -13
  297. package/src/apps/new-piral.ts +43 -19
  298. package/src/apps/pack-pilet.test.ts +2 -2
  299. package/src/apps/pack-pilet.ts +12 -10
  300. package/src/apps/publish-pilet.ts +148 -43
  301. package/src/apps/publish-piral.ts +38 -11
  302. package/src/apps/remove-piral-instance-pilet.ts +92 -0
  303. package/src/apps/run-emulator-piral.ts +154 -0
  304. package/src/apps/upgrade-pilet.ts +37 -31
  305. package/src/apps/upgrade-piral.ts +9 -7
  306. package/src/apps/validate-pilet.ts +30 -22
  307. package/src/apps/validate-piral.ts +5 -2
  308. package/src/build/bundler-calls.ts +133 -0
  309. package/src/build/run-build-pilet.ts +91 -0
  310. package/src/build/run-build-piral.ts +93 -0
  311. package/src/build/run-debug-mono-piral.ts +86 -0
  312. package/src/build/run-debug-pilet.ts +116 -0
  313. package/src/build/run-debug-piral.ts +105 -0
  314. package/src/bundler.test.ts +86 -68
  315. package/src/bundler.ts +74 -19
  316. package/src/cli.ts +6 -2
  317. package/src/commands.ts +273 -44
  318. package/src/common/archive.test.ts +51 -45
  319. package/src/common/archive.ts +28 -1
  320. package/src/common/browser.test.ts +20 -10
  321. package/src/common/browser.ts +13 -6
  322. package/src/common/clients/index.ts +41 -0
  323. package/src/common/clients/lerna.ts +85 -1
  324. package/src/common/clients/npm.ts +56 -14
  325. package/src/common/clients/pnp.ts +84 -0
  326. package/src/common/clients/pnpm.ts +45 -1
  327. package/src/common/clients/rush.ts +118 -0
  328. package/src/common/clients/yarn.ts +49 -3
  329. package/src/common/compatibility.ts +8 -1
  330. package/src/common/config.ts +57 -22
  331. package/src/common/constants.ts +21 -3
  332. package/src/common/declaration.ts +124 -50
  333. package/src/common/emoji.ts +9 -0
  334. package/src/common/emulator.ts +43 -23
  335. package/src/common/enums.ts +0 -5
  336. package/src/common/envs.ts +15 -3
  337. package/src/common/hash.ts +5 -0
  338. package/src/common/http.test.ts +76 -64
  339. package/src/common/http.ts +88 -24
  340. package/src/common/importmap.ts +242 -0
  341. package/src/common/index.ts +10 -0
  342. package/src/common/info.ts +9 -1
  343. package/src/common/injectors.ts +49 -22
  344. package/src/common/inspect.ts +13 -14
  345. package/src/common/interactive.test.ts +6 -0
  346. package/src/common/interactive.ts +69 -1
  347. package/src/common/io.ts +199 -82
  348. package/src/common/language.ts +87 -10
  349. package/src/common/log.ts +32 -46
  350. package/src/common/npm.test.ts +187 -166
  351. package/src/common/npm.ts +263 -119
  352. package/src/common/pack.test.ts +11 -13
  353. package/src/common/pack.ts +60 -21
  354. package/src/common/package.test.ts +59 -49
  355. package/src/common/package.ts +406 -167
  356. package/src/common/parallel.test.ts +28 -0
  357. package/src/common/parallel.ts +21 -0
  358. package/src/common/platform.ts +31 -0
  359. package/src/common/port.test.ts +4 -1
  360. package/src/common/port.ts +10 -0
  361. package/src/common/rules.test.ts +3 -3
  362. package/src/common/scaffold.ts +69 -41
  363. package/src/common/scripts.ts +5 -4
  364. package/src/common/shell.ts +34 -0
  365. package/src/common/spec.ts +69 -0
  366. package/src/common/template.ts +20 -18
  367. package/src/common/url.test.ts +28 -0
  368. package/src/common/url.ts +15 -0
  369. package/src/common/utils.ts +3 -0
  370. package/src/common/version.test.ts +233 -0
  371. package/src/common/version.ts +142 -0
  372. package/src/common/watcher.ts +89 -0
  373. package/src/external/index.test.ts +2 -2
  374. package/src/external/index.ts +7 -3
  375. package/src/external/resolve.ts +29 -0
  376. package/src/helpers.test.ts +2 -22
  377. package/src/helpers.ts +21 -30
  378. package/src/injectors/{pilet.test.ts → pilet-injector.test.ts} +13 -4
  379. package/src/injectors/pilet-injector.ts +346 -0
  380. package/src/injectors/{piral.test.ts → piral-injector.test.ts} +14 -5
  381. package/src/injectors/piral-injector.ts +130 -0
  382. package/src/messages.ts +649 -63
  383. package/src/platforms/node.ts +16 -0
  384. package/src/platforms/web.ts +148 -0
  385. package/src/plugin.ts +34 -5
  386. package/src/questionnaire.ts +17 -3
  387. package/src/release.ts +47 -5
  388. package/src/rules/index.ts +1 -1
  389. package/src/rules/pilet-has-externals-as-peers.test.ts +3 -2
  390. package/src/rules/pilet-has-externals-as-peers.ts +9 -7
  391. package/src/rules/pilet-has-no-self-reference.ts +1 -1
  392. package/src/rules/pilet-stays-small.ts +1 -1
  393. package/src/rules/pilet-uses-latest-piral.ts +22 -12
  394. package/src/rules/piral-has-valid-externals.ts +10 -29
  395. package/src/types/common.ts +99 -9
  396. package/src/types/internal.ts +14 -14
  397. package/src/types/public.ts +93 -27
  398. package/lib/external/child.js +0 -144
  399. package/lib/external/classes.trie +0 -0
  400. package/lib/external/xdg-open +0 -1066
  401. package/lib/injectors/pilet.d.ts +0 -47
  402. package/lib/injectors/pilet.js +0 -187
  403. package/lib/injectors/pilet.js.map +0 -1
  404. package/lib/injectors/piral.js +0 -62
  405. package/lib/injectors/piral.js.map +0 -1
  406. package/src/injectors/pilet.ts +0 -219
  407. package/src/injectors/piral.ts +0 -76
  408. package/templates/piral-index.js.ejs +0 -16
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.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).
@@ -180,6 +180,53 @@ export function appInstanceInvalid_0011(): QuickMessage {
180
180
  return [LogLevels.error, '0011', `Could not find a valid Piral instance.`];
181
181
  }
182
182
 
183
+ /**
184
+ * @kind Error
185
+ *
186
+ * @summary
187
+ * Reported when no valid Piral instance was specified.
188
+ *
189
+ * @abstract
190
+ * The Piral instance is defined either in the package.json or in the pilet.json.
191
+ *
192
+ * The resolution of the Piral instance is done via the `require.resolve` function of Node.js. Thus, if the defined module is simply not yet installed this error will be shown.
193
+ *
194
+ * @see
195
+ * - [npm i](https://docs.npmjs.com/cli/install)
196
+ * - [npm install is missing modules](https://stackoverflow.com/questions/24652681/npm-install-is-missing-modules)
197
+ *
198
+ * @example
199
+ * Assuming that the available pilet.json of your pilet contains content such as:
200
+ *
201
+ * ```json
202
+ * {
203
+ * // ...
204
+ * "piralInstances": {
205
+ * "my-app-shell": {}
206
+ * }
207
+ * }
208
+ * ```
209
+ *
210
+ * However, running
211
+ *
212
+ * ```sh
213
+ * ls node_modules/my-app-shell
214
+ * ```
215
+ *
216
+ * returns an error.
217
+ *
218
+ * To mitigate it try running
219
+ *
220
+ * ```sh
221
+ * npm i
222
+ * ```
223
+ *
224
+ * which will install all dependencies.
225
+ */
226
+ export function appInstancesNotGiven_0012(): QuickMessage {
227
+ return [LogLevels.error, '0012', `No Piral instances have been provided.`];
228
+ }
229
+
183
230
  /**
184
231
  * @kind Error
185
232
  *
@@ -198,7 +245,7 @@ export function appInstanceInvalid_0011(): QuickMessage {
198
245
  * project folder has a package.json in its root.
199
246
  *
200
247
  * @see
201
- * - [NPM Package Specification](https://docs.npmjs.com/files/package.json)
248
+ * - [npm Package Specification](https://docs.npmjs.com/files/package.json)
202
249
  *
203
250
  * @example
204
251
  * You can see if you are currently in a correct folder.
@@ -235,7 +282,7 @@ export function packageJsonNotFound_0020(): QuickMessage {
235
282
  * The name of the pilet is provided by the name field specified in its package.json.
236
283
  *
237
284
  * A valid package.json file requires a valid name. The name has to follow standard naming
238
- * conventions of the NPM system.
285
+ * conventions of the npm system.
239
286
  *
240
287
  * @see
241
288
  * - [Package Naming Guidelines](https://docs.npmjs.com/package-name-guidelines)
@@ -285,7 +332,7 @@ export function packageJsonMissingName_0021(): QuickMessage {
285
332
  * specification.
286
333
  *
287
334
  * @see
288
- * - [NPM on Semantic Versioning](https://docs.npmjs.com/about-semantic-versioning)
335
+ * - [npm on Semantic Versioning](https://docs.npmjs.com/about-semantic-versioning)
289
336
  *
290
337
  * @example
291
338
  * Check the contents of the available package.json:
@@ -330,7 +377,7 @@ export function packageJsonMissingVersion_0022(): QuickMessage {
330
377
  * and which ones can remain at their current version.
331
378
  *
332
379
  * @see
333
- * - [NPM Install](https://docs.npmjs.com/cli/install)
380
+ * - [npm Install](https://docs.npmjs.com/cli/install)
334
381
  *
335
382
  * @example
336
383
  * Check that the package is indeed installed:
@@ -370,7 +417,7 @@ export function packageNotInstalled_0023(name: string): QuickMessage {
370
417
  * versions. If no release for the given version was found then an error is emitted.
371
418
  *
372
419
  * @see
373
- * - [StackOverflow Listing NPM Versions](https://stackoverflow.com/questions/41415945/how-to-list-all-versions-of-an-npm-module)
420
+ * - [StackOverflow Listing npm Versions](https://stackoverflow.com/questions/41415945/how-to-list-all-versions-of-an-npm-module)
374
421
  *
375
422
  * @example
376
423
  * Check that the version is valid:
@@ -392,6 +439,273 @@ export function packageVersionInvalid_0024(version: string): QuickMessage {
392
439
  return [LogLevels.error, '0024', `The given package version "${version}" is invalid.`];
393
440
  }
394
441
 
442
+ /**
443
+ * @kind Error
444
+ *
445
+ * @summary
446
+ * Cannot add the shared dependency since its version constraint is not satisfied.
447
+ *
448
+ * @abstract
449
+ * The importmap definition allows you to define a version specifier separated with
450
+ * the '@' character. If you write down a version specifier then it has to be
451
+ * fulfilled already from the local version, otherwise the packaged version can
452
+ * potentially not be resolved at runtime. This would resolve in a pilet that fails
453
+ * when running in isolation and most likely fails when running with other pilets.
454
+ *
455
+ * @see
456
+ * - [import-maps specification](https://github.com/WICG/import-maps)
457
+ *
458
+ * @example
459
+ * Check the contents of the available package.json:
460
+ *
461
+ * ```sh
462
+ * cat package.json
463
+ * ```
464
+ *
465
+ * The displayed content should look similar to (i.e., contain an importmap such as):
466
+ *
467
+ * ```json
468
+ * {
469
+ * "importmap": {
470
+ * "imports": {
471
+ * "foo@^3.2.1": "foo"
472
+ * }
473
+ * }
474
+ * }
475
+ * ```
476
+ *
477
+ * For the error to occur the specifier (^3.2.1) potentially does not match the version (e.g., if
478
+ * the version of the dependency is 3.1.2).
479
+ *
480
+ * One strategy is to remove the specifier, which will automatically use the exact current version
481
+ * as specifier:
482
+ *
483
+ * ```json
484
+ * {
485
+ * "importmap": {
486
+ * "imports": {
487
+ * "foo": "foo"
488
+ * }
489
+ * }
490
+ * }
491
+ * ```
492
+ *
493
+ * The best way, however, is to look at the used version and adjust the specifier to be correct again.
494
+ * Alternatively, change the used version to satisfy the constraint again.
495
+ */
496
+ export function importMapVersionSpecNotSatisfied_0025(depName: string, version: string): QuickMessage {
497
+ return [LogLevels.error, '0025', `The dependency "${depName}" in only available in version "${version}".`];
498
+ }
499
+
500
+ /**
501
+ * @kind Error
502
+ *
503
+ * @summary
504
+ * The version spec part of the importmap identifer is invalid.
505
+ *
506
+ * @abstract
507
+ * The importmap definition allows you to define a version specifier separated with
508
+ * the '@' character. This part has to follow the semver convention and rules.
509
+ *
510
+ * Check your specifier via online tools such as "Semver check" to verify it is
511
+ * valid and follows the semver specification.
512
+ *
513
+ * @see
514
+ * - [Online Checker](https://jubianchi.github.io/semver-check/)
515
+ *
516
+ * @example
517
+ * Check the contents of the available package.json:
518
+ *
519
+ * ```sh
520
+ * cat package.json
521
+ * ```
522
+ *
523
+ * The displayed content should look similar to (i.e., contain an importmap such as):
524
+ *
525
+ * ```json
526
+ * {
527
+ * "importmap": {
528
+ * "imports": {
529
+ * "foo@bar": "foo"
530
+ * }
531
+ * }
532
+ * }
533
+ * ```
534
+ *
535
+ * For the error to occur the specifier (bar) is not following the semver specification.
536
+ *
537
+ * One way is to remove the version spec, which will resolve to an exact version specifier
538
+ * and therefore always works:
539
+ *
540
+ * ```json
541
+ * {
542
+ * "importmap": {
543
+ * "imports": {
544
+ * "foo": "foo"
545
+ * }
546
+ * }
547
+ * }
548
+ * ```
549
+ *
550
+ * The best way, however, is to look at the used version and adjust the specifier to be correct again,
551
+ * such as "^1.2.3" or "1.x" or "3" etc.
552
+ */
553
+ export function importMapVersionSpecInvalid_0026(depName: string): QuickMessage {
554
+ return [LogLevels.error, '0026', `The dependency "${depName}" has an invalid version spec.`];
555
+ }
556
+
557
+ /**
558
+ * @kind Error
559
+ *
560
+ * @summary
561
+ * The provided importmap reference could not be resolved.
562
+ *
563
+ * @abstract
564
+ * The importmap consists of keys and values. The keys represent the packages names and optional
565
+ * version specifiers to demand at runtime. The values represent the entry point or URL to use
566
+ * when the dependency is not yet loaded.
567
+ *
568
+ * In case of a non-URL value the reference has either to be a valid package name or a file path
569
+ * that leads to either a package or valid JS module. Either way, it needs to exist. If the path
570
+ * is invalid an error will be emitted.
571
+ *
572
+ * @see
573
+ * - [npm Install](https://docs.npmjs.com/cli/install)
574
+ *
575
+ * @example
576
+ * Check the contents of the available package.json:
577
+ *
578
+ * ```sh
579
+ * cat package.json
580
+ * ```
581
+ *
582
+ * The displayed content should look similar to (i.e., contain an importmap such as):
583
+ *
584
+ * ```json
585
+ * {
586
+ * "importmap": {
587
+ * "imports": {
588
+ * "foo@bar": "./node_modules/prect"
589
+ * }
590
+ * }
591
+ * }
592
+ * ```
593
+ *
594
+ * Note the potential misspelling. It maybe should have been "./node_modules/preact". In such
595
+ * cases the reference may not be resolved locally. If everything was written correctly the
596
+ * node modules are most likely not installed (correctly).
597
+ */
598
+ export function importMapReferenceNotFound_0027(dir: string, reference: string): QuickMessage {
599
+ return [
600
+ LogLevels.error,
601
+ '0027',
602
+ `The reference to "${reference}" could not be resolved from "${dir}". Are you sure the file or package exists?`,
603
+ ];
604
+ }
605
+
606
+ /**
607
+ * @kind Error
608
+ *
609
+ * @summary
610
+ * The provided importmap file could not be found.
611
+ *
612
+ * @abstract
613
+ * The importmap can be referenced in a file from the package.json. If the named
614
+ * file cannot be found the build process has to be stopped. Make sure that the
615
+ * file has been specified relative to the package.json where it was referenced
616
+ * from.
617
+ *
618
+ * @see
619
+ * - [import-maps specification](https://github.com/WICG/import-maps)
620
+ *
621
+ * @example
622
+ * Check the contents of the available package.json:
623
+ *
624
+ * ```sh
625
+ * cat package.json
626
+ * ```
627
+ *
628
+ * The displayed content should look similar to (i.e., contain an importmap such as):
629
+ *
630
+ * ```json
631
+ * {
632
+ * "importmap": "./import-map.json"
633
+ * }
634
+ * ```
635
+ *
636
+ * If the importmap has instead been (re)named "importmap.json" then this will not work.
637
+ * Likewise, with the reference above the file is expected to be in the same directory
638
+ * as the package.json. If it is, e.g., in the "src" subfolder you'd should reference it
639
+ * as "./src/import-map.json" instead.
640
+ */
641
+ export function importMapFileNotFound_0028(dir: string, file: string): QuickMessage {
642
+ return [LogLevels.error, '0028', `The importmap "${file}" could not be found at "${dir}".`];
643
+ }
644
+
645
+ /**
646
+ * @kind Warning
647
+ *
648
+ * @summary
649
+ * The given dependency seems to be a Piral plugin and should not be exposed
650
+ * as a shared dependency.
651
+ *
652
+ * @abstract
653
+ * While you should be quite restrictive in general regarding sharing dependencies,
654
+ * there are some dependencies that should never be shared. One area are dependencies
655
+ * that are only meant for the app shell and don't make sense somewhere else.
656
+ *
657
+ * Even though many dependencies might exist that fall into that area the only ones
658
+ * we know for sure are the so-called Piral plugins. These are dependencies that only
659
+ * make sense to be used within an app shell, i.e., a Piral instance (or host application).
660
+ *
661
+ * When the Piral CLI detects that you want to share such a dependency from an app shell,
662
+ * or alternatively within a pilet directly, it will print a warning. There might be false
663
+ * positives here, so having an error here might be a bit too much. Nevertheless, depending
664
+ * on your scenario you might want to treat these warnings as errors.
665
+ *
666
+ * @see
667
+ * - [Sharing dependencies](https://docs.piral.io/concepts/I08-importmap)
668
+ *
669
+ * @example
670
+ * Check the contents of the available package.json:
671
+ *
672
+ * ```sh
673
+ * cat package.json
674
+ * ```
675
+ *
676
+ * The displayed content should look similar to (i.e., contain an importmap such as):
677
+ *
678
+ * ```json
679
+ * {
680
+ * "importmap": {
681
+ * "imports": {
682
+ * "piral-ng": ""
683
+ * }
684
+ * }
685
+ * }
686
+ * ```
687
+ *
688
+ * This would share the whole Piral plugin, which does not make much sense. First of all,
689
+ * the plugin is presumably already installed - it even could only be installed in a
690
+ * Piral instance. Second, there is no use of the exported function somewhere else.
691
+ *
692
+ * Instead, you potentially might want to share a submodule. For instance, in the example
693
+ * above the "piral-ng/common" submodule should be shared.
694
+ *
695
+ * ```json
696
+ * {
697
+ * "importmap": {
698
+ * "imports": {
699
+ * "piral-ng/common": ""
700
+ * }
701
+ * }
702
+ * }
703
+ * ```
704
+ */
705
+ export function invalidSharedDependency_0029(name: string): QuickMessage {
706
+ return [LogLevels.warning, '0029', `The dependency "${name}" should not be shared.`];
707
+ }
708
+
395
709
  /**
396
710
  * @kind Error
397
711
  *
@@ -481,7 +795,7 @@ export function projectReferenceNotSupported_0032(fullPath: string): QuickMessag
481
795
  * CLI via command line parameters.
482
796
  *
483
797
  * @see
484
- * - [NPM Package Specification](https://docs.npmjs.com/files/package.json)
798
+ * - [npm Package Specification](https://docs.npmjs.com/files/package.json)
485
799
  *
486
800
  * @example
487
801
  * Make sure you are in the right directory by calling commands such as
@@ -527,7 +841,7 @@ export function invalidPiletTarget_0040(): QuickMessage {
527
841
  * contains an object with additional fields.
528
842
  *
529
843
  * @see
530
- * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/metadata#pilets---package-definition)
844
+ * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/C31-pilet-metadata)
531
845
  *
532
846
  * @example
533
847
  * Your pilet's package.json may look similar to the following snippet:
@@ -576,7 +890,7 @@ export function invalidPiletPackage_0041(): QuickMessage {
576
890
  * should contain (among others) a field `name` pointing to the Piral instance to use.
577
891
  *
578
892
  * @see
579
- * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/metadata#pilets---package-definition)
893
+ * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/C31-pilet-metadata)
580
894
  *
581
895
  * @example
582
896
  * If your Piral instance is called `my-piral` then the package.json may look similar to
@@ -611,12 +925,12 @@ export function invalidPiletPackage_0042(): QuickMessage {
611
925
  * Even though everything seems to be correct on the first glance it may be that the
612
926
  * actual reference is broken. This could be due to various reasons.
613
927
  *
614
- * - NPM linking is broken
928
+ * - npm linking is broken
615
929
  * - The dependencies have not been installed yet (run `npm i`)
616
930
  * - The Piral instance's name is invalid (e.g., due to a typo)
617
931
  *
618
932
  * @see
619
- * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/metadata#pilets---package-definition)
933
+ * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/C31-pilet-metadata)
620
934
  * - [Node Modules Loading](https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders)
621
935
  *
622
936
  * @example
@@ -750,6 +1064,41 @@ export function cannotFindFile_0046(file: string): QuickMessage {
750
1064
  return [LogLevels.error, '0046', `The file "${file}" does not exist!`];
751
1065
  }
752
1066
 
1067
+ /**
1068
+ * @kind Warning
1069
+ *
1070
+ * @summary
1071
+ * Reported when the provided / default port was not available.
1072
+ *
1073
+ * @abstract
1074
+ * By default, the debug commands spawn at the port 1234. However, under certain
1075
+ * circumstances (e.g., another debug command running somewhere) this port may not
1076
+ * be free.
1077
+ *
1078
+ * The piral-cli can select a new port, which is free, however, it will still report
1079
+ * a warning message in such cases. You can then always abort the current debug
1080
+ * process and start a new one - either closing the other run blocking the port or
1081
+ * explicitly selecting a new one using the `--port` flag.
1082
+ *
1083
+ * @see
1084
+ * - [Port (computer networking)](https://en.wikipedia.org/wiki/Port_(computer_networking))
1085
+ *
1086
+ * @example
1087
+ * If you start one process to debug an app shell using `piral debug` and another process
1088
+ * to debug some pilet using `pilet debug` both processes would want to run on the default
1089
+ * port 1234.
1090
+ *
1091
+ * As a mitigation you can now either be very explicit, e.g., `piral debug --port 1010` and
1092
+ * `pilet debug --port 1020` or you can just drop one of the two and always only run a single
1093
+ * debug process.
1094
+ *
1095
+ * In any case, running both without any options also works, but then a new port will be chosen.
1096
+ * The output of the Piral CLI will always show you what port is currently used.
1097
+ */
1098
+ export function portNotFree_0047(newPort: number, oldPort: number): QuickMessage {
1099
+ return [LogLevels.warning, '0047', `The selected port "${oldPort}" is already used. Changed port to "${newPort}".`];
1100
+ }
1101
+
753
1102
  /**
754
1103
  * @kind Warning
755
1104
  *
@@ -762,8 +1111,8 @@ export function cannotFindFile_0046(file: string): QuickMessage {
762
1111
  * Since the local resolution only works against a filename the update process has also to be triggered with
763
1112
  * a file location. Otherwise, there is no chance to know a different file location.
764
1113
  *
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.
1114
+ * Potentially, you wanted to switch / resolve the module from npm instead. Therefore, we are then trying to
1115
+ * obtain the Piral instance from npm instead using the known name.
767
1116
  *
768
1117
  * @see
769
1118
  * - [Local File Dependencies](https://stackoverflow.com/questions/14381898/local-dependency-in-package-json)
@@ -800,11 +1149,11 @@ export function localeFileForUpgradeMissing_0050(): QuickMessage {
800
1149
  * Right now we only support "latest" for Git resolved Piral instances. In this scenario we obtain the
801
1150
  * current head from the repository's default branch and update accordingly.
802
1151
  *
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.
1152
+ * Potentially, you wanted to switch / resolve the module from npm instead. Therefore, we are then trying to
1153
+ * obtain the Piral instance from npm instead using the known name.
805
1154
  *
806
1155
  * @see
807
- * - [Git Dependencies in NPM](https://medium.com/@jonchurch/use-github-branch-as-dependency-in-package-json-5eb609c81f1a)
1156
+ * - [Git Dependencies in npm](https://medium.com/@jonchurch/use-github-branch-as-dependency-in-package-json-5eb609c81f1a)
808
1157
  *
809
1158
  * @example
810
1159
  * You may have set up the pilet using a locally available tgz file. In this case your original command may
@@ -850,7 +1199,7 @@ export function gitLatestForUpgradeMissing_0051(): QuickMessage {
850
1199
  * - Disk failures
851
1200
  *
852
1201
  * @see
853
- * - [Piral Instance Package Definition](https://docs.piral.io/reference/documentation/metadata#piral-instance---package-definition)
1202
+ * - [Piral Instance Package Definition](https://docs.piral.io/reference/documentation/C21-piral-metadata)
854
1203
  *
855
1204
  * @example
856
1205
  * The primary example hits when a dev dependency was specified that is otherwise not given.
@@ -911,7 +1260,7 @@ export function cannotResolveVersion_0052(name: string): QuickMessage {
911
1260
  * - Disk failures
912
1261
  *
913
1262
  * @see
914
- * - [Piral Instance Package Definition](https://docs.piral.io/reference/documentation/metadata#piral-instance---package-definition)
1263
+ * - [Piral Instance Package Definition](https://docs.piral.io/reference/documentation/C21-piral-metadata)
915
1264
  *
916
1265
  * @example
917
1266
  * The primary example hits when a dev dependency was specified that is otherwise not given.
@@ -944,9 +1293,14 @@ export function cannotResolveVersion_0052(name: string): QuickMessage {
944
1293
  * }
945
1294
  * }
946
1295
  * }
1296
+ * ```
947
1297
  */
948
- export function cannotResolveDependency_0053(name: string, rootDir: string): QuickMessage {
949
- return [LogLevels.warning, '0053', `Could not resolve "${name}" from "${rootDir}". Taking "latest" version.`];
1298
+ export function cannotResolveDependency_0053(names: Array<string>, rootDir: string): QuickMessage {
1299
+ return [
1300
+ LogLevels.warning,
1301
+ '0053',
1302
+ `Could not resolve any package (tried "${names.join('", "')}") from "${rootDir}". Taking "latest" version.`,
1303
+ ];
950
1304
  }
951
1305
 
952
1306
  /**
@@ -995,7 +1349,7 @@ export function missingPiletFeedUrl_0060(): QuickMessage {
995
1349
  * directly.
996
1350
  *
997
1351
  * @see
998
- * - [NPM Pack](https://docs.npmjs.com/cli-commands/pack.html)
1352
+ * - [npm Pack](https://docs.npmjs.com/cli-commands/pack.html)
999
1353
  *
1000
1354
  * @example
1001
1355
  * Make sure to have build a pilet beforehand:
@@ -1025,8 +1379,8 @@ export function missingPiletFeedUrl_0060(): QuickMessage {
1025
1379
  * Using multiple commands is preferred if you use custom options, otherwise
1026
1380
  * just go for the single command.
1027
1381
  */
1028
- export function missingPiletTarball_0061(source: string): QuickMessage {
1029
- return [LogLevels.error, '0061', `No files found using pattern "${source}".`];
1382
+ export function missingPiletTarball_0061(sources: Array<string>): QuickMessage {
1383
+ return [LogLevels.error, '0061', `No files found using pattern "${sources.join('", "')}".`];
1030
1384
  }
1031
1385
 
1032
1386
  /**
@@ -1277,10 +1631,10 @@ export function failedHttpGet_0068(error: string): QuickMessage {
1277
1631
  *
1278
1632
  * @abstract
1279
1633
  * While submitting the HTTP get request an error was reported.
1280
- *
1634
+ *
1281
1635
  * Potentially, the server returned some more indicative error message. In this
1282
1636
  * case read it carefully to know what version was already published.
1283
- *
1637
+ *
1284
1638
  * In any case only the documentation of the corresponding feed service can be
1285
1639
  * conclusive how this can be resolved. Presumably, some payment of some fee
1286
1640
  * is necessary to publish pilets.
@@ -1299,28 +1653,28 @@ export function failedToUploadPayment_0161(response: any): QuickMessage {
1299
1653
  *
1300
1654
  * @abstract
1301
1655
  * While submitting the HTTP get request an error was reported.
1302
- *
1656
+ *
1303
1657
  * Potentially, the server returned some more indicative error message. In this
1304
1658
  * case read it carefully to know what version was already published.
1305
- *
1659
+ *
1306
1660
  * In any case you need to change the version to continue. You can do that by
1307
1661
  * editing the "version" field in the pilet's package.json or using `npm version`.
1308
1662
  *
1309
1663
  * @example
1310
1664
  * If you already published the pilet, e.g., via
1311
- *
1665
+ *
1312
1666
  * ```sh
1313
1667
  * pilet publish --api-key ... --url ...
1314
1668
  * ```
1315
- *
1669
+ *
1316
1670
  * then doing this again without any change should result in this error.
1317
- *
1671
+ *
1318
1672
  * Now we can patch-upgrade the version of the pilet:
1319
- *
1673
+ *
1320
1674
  * ```sh
1321
1675
  * npm version patch
1322
1676
  * ```
1323
- *
1677
+ *
1324
1678
  * And try the `pilet publish` command again. This time it should just work.
1325
1679
  */
1326
1680
  export function failedToUploadVersion_0162(response: any): QuickMessage {
@@ -1337,10 +1691,10 @@ export function failedToUploadVersion_0162(response: any): QuickMessage {
1337
1691
  *
1338
1692
  * @abstract
1339
1693
  * While submitting the HTTP get request an error was reported.
1340
- *
1694
+ *
1341
1695
  * Potentially, the server returned some more indicative error message. In this
1342
1696
  * case read it carefully to know how much the limit was exceeded.
1343
- *
1697
+ *
1344
1698
  * In any case the pilet must be somehow trimmed down. Most often, the size is
1345
1699
  * dominantly determined by some external packages that are referened. Use a
1346
1700
  * page such as bundlephobia.com or some IDE tools to find out which packages
@@ -1541,10 +1895,10 @@ export function entryPointDoesNotExist_0073(app: string): QuickMessage {
1541
1895
  * point for the bundler.
1542
1896
  *
1543
1897
  * @see
1544
- * - [NPM Init](https://docs.npmjs.com/cli/init)
1898
+ * - [npm Init](https://docs.npmjs.com/cli/init)
1545
1899
  *
1546
1900
  * @example
1547
- * You can create a new NPM project using the `npm init` command. This will essentially guide
1901
+ * You can create a new npm project using the `npm init` command. This will essentially guide
1548
1902
  * you through a number of decisions for creating a proper package.json.
1549
1903
  *
1550
1904
  * Even better you could start a new Piral instance using the following command:
@@ -1577,10 +1931,10 @@ export function packageJsonMissing_0074(): QuickMessage {
1577
1931
  * point for the bundler.
1578
1932
  *
1579
1933
  * @see
1580
- * - [NPM Init](https://docs.npmjs.com/cli/init)
1934
+ * - [npm Init](https://docs.npmjs.com/cli/init)
1581
1935
  *
1582
1936
  * @example
1583
- * You can create a new NPM project using the `npm init` command. This will essentially guide
1937
+ * You can create a new npm project using the `npm init` command. This will essentially guide
1584
1938
  * you through a number of decisions for creating a proper package.json.
1585
1939
  *
1586
1940
  * Even better you could start a new pilet using the following command:
@@ -1642,7 +1996,7 @@ export function packageJsonMissing_0075(): QuickMessage {
1642
1996
  * The TypeScript declaration generator will take all files as input to
1643
1997
  * gather all required information for constructing the API declaration.
1644
1998
  */
1645
- export function declarationCouldNotBeGenerated_0076(rootDir: string, error: Error): QuickMessage {
1999
+ export function declarationCouldNotBeGenerated_0076(rootDir: string, error: Error | string): QuickMessage {
1646
2000
  return [LogLevels.error, '0076', `Could not create the declaration in "${rootDir}". Error: ${error}`];
1647
2001
  }
1648
2002
 
@@ -1682,6 +2036,67 @@ export function entryFileMissing_0077(): QuickMessage {
1682
2036
  return [LogLevels.error, '0077', 'No valid entry file for the pilet found.'];
1683
2037
  }
1684
2038
 
2039
+ /**
2040
+ * @kind Warning
2041
+ *
2042
+ * @summary
2043
+ * The Piral instance is not referencing any framework package.
2044
+ *
2045
+ * @abstract
2046
+ * A Piral instance has to reference either `piral-base`, `piral-core`
2047
+ * or the whole `piral` framework package. If none of these dependencies
2048
+ * is found then no framework dependencies can be shared automatically.
2049
+ * Framework dependencies include react and react-router.
2050
+ *
2051
+ * @example
2052
+ * You might use a monorepo where most / all dependencies are declared in
2053
+ * a top-level package.json. Therefore, the package.json of the actual
2054
+ * Piral instance could look like this:
2055
+ *
2056
+ * ```json
2057
+ * {
2058
+ * "name": "my-piral-instance",
2059
+ * "version": "1.0.0",
2060
+ * "app": "./src/index.html",
2061
+ * "pilets": {}
2062
+ * }
2063
+ * ```
2064
+ *
2065
+ * While perfectly valid, this one lacks `dependencies` and `devDependencies`.
2066
+ * Surely, those are not really needed in the described case, but under
2067
+ * those conditions we cannot know what dependencies you may want to share. It
2068
+ * could be that you only reference `piral-base` and therefore don't want to
2069
+ * share anything except `tslib`. Or you use `piral-core` and also share things
2070
+ * like `react` or `react-router-dom`.
2071
+ *
2072
+ * Either way, in order to recognize that you'll need to include the correct
2073
+ * reference:
2074
+ *
2075
+ * ```json
2076
+ * {
2077
+ * "name": "my-piral-instance",
2078
+ * "version": "1.0.0",
2079
+ * "app": "./src/index.html",
2080
+ * "pilets": {},
2081
+ * "dependencies": {
2082
+ * "piral": "latest"
2083
+ * }
2084
+ * }
2085
+ * ```
2086
+ *
2087
+ * If you only want to use `piral-base` or `piral-core` then replace `piral` in
2088
+ * the example above. Also use the version that you'll like to use - `latest`
2089
+ * is just one example.
2090
+ *
2091
+ */
2092
+ export function frameworkLibMissing_0078(frameworkLibs: Array<string>): QuickMessage {
2093
+ return [
2094
+ LogLevels.warning,
2095
+ '0078',
2096
+ `Did not find any reference to either ${frameworkLibs.join(', ')}. No framework dependencies are shared.`,
2097
+ ];
2098
+ }
2099
+
1685
2100
  /**
1686
2101
  * @kind Error
1687
2102
  *
@@ -1841,6 +2256,26 @@ export function toolingIncompatible_0101(piralVersion: string, cliVersion: strin
1841
2256
  ];
1842
2257
  }
1843
2258
 
2259
+ /**
2260
+ * @kind Info
2261
+ *
2262
+ * @summary
2263
+ * The Piral CLI could not detect the tooling version used by the app shell. Therefore, it may be incompatible to the
2264
+ * currently used version of the piral-cli. Keep an eye on weird errors.
2265
+ *
2266
+ * @abstract
2267
+ * The emulator contains a special section to inform the Piral CLI about the used version of the tooling. This is
2268
+ * important to detect potential alignment or incompatibilities. The used version of the emulator does not contain
2269
+ * this information and therefore may be incompatible.
2270
+ */
2271
+ export function appShellMaybeIncompatible_0102(cliVersion: string): QuickMessage {
2272
+ return [
2273
+ LogLevels.info,
2274
+ '0100',
2275
+ `The Piral instance's CLI version is unknown and may be incompatible to the used version (${cliVersion}).`,
2276
+ ];
2277
+ }
2278
+
1844
2279
  /**
1845
2280
  * @kind Error
1846
2281
  *
@@ -1855,7 +2290,7 @@ export function toolingIncompatible_0101(piralVersion: string, cliVersion: strin
1855
2290
  *
1856
2291
  * @example
1857
2292
  * The following command first removes the output directory, then starts the build,
1858
- * and finally publishes the emulator to NPM.
2293
+ * and finally publishes the emulator to npm.
1859
2294
  *
1860
2295
  * ```sh
1861
2296
  * rm -rf dist
@@ -1881,7 +2316,7 @@ export function publishDirectoryMissing_0110(directory: string): QuickMessage {
1881
2316
  *
1882
2317
  * @example
1883
2318
  * The following command first removes the output directory, then starts the build,
1884
- * and finally publishes the emulator to NPM.
2319
+ * and finally publishes the emulator to npm.
1885
2320
  *
1886
2321
  * ```sh
1887
2322
  * rm -rf dist
@@ -1897,24 +2332,24 @@ export function publishEmulatorFilesUnexpected_0111(directory: string): QuickMes
1897
2332
  * @kind Error
1898
2333
  *
1899
2334
  * @summary
1900
- * The "xcopy" provider requires a "--fields.target" argument.
2335
+ * The "xcopy" provider requires a "--opts.target" argument.
1901
2336
  *
1902
2337
  * @abstract
1903
2338
  * The `piral publish --type release` command requires the selection of a suitable
1904
2339
  * provider for running successfully. The "xcopy" provider just copies the sources from
1905
2340
  * the output directory (source) to a specified target directory.
1906
2341
  *
1907
- * Make sure to supply the target directory via the `--fields.target` command line flag.
2342
+ * Make sure to supply the target directory via the `--opts.target` command line flag.
1908
2343
  *
1909
2344
  * @example
1910
2345
  * The following command would specify `/temp/dest` as target directory:
1911
2346
  *
1912
2347
  * ```sh
1913
- * piral publish --type release --provider xcopy --fields.target "/temp/dest"
2348
+ * piral publish --type release --provider xcopy --opts.target "/temp/dest"
1914
2349
  * ```
1915
2350
  */
1916
2351
  export function publishXcopyMissingTarget_0112(): QuickMessage {
1917
- return [LogLevels.error, '0112', `The "xcopy" provider requires a "--fields.target" argument.`];
2352
+ return [LogLevels.error, '0112', `The "xcopy" provider requires a "--opts.target" argument.`];
1918
2353
  }
1919
2354
 
1920
2355
  /**
@@ -1937,7 +2372,7 @@ export function publishXcopyMissingTarget_0112(): QuickMessage {
1937
2372
  * The following command uses the in-built "xcopy" provider for releasing to a local directory.
1938
2373
  *
1939
2374
  * ```sh
1940
- * piral publish --type release --provider xcopy --fields.target "/temp/dest"
2375
+ * piral publish --type release --provider xcopy --opts.target "/temp/dest"
1941
2376
  * ```
1942
2377
  */
1943
2378
  export function publishProviderMissing_0113(providerName: string, availableProviders: Array<string>): QuickMessage {
@@ -1958,13 +2393,73 @@ export function publishProviderMissing_0113(providerName: string, availableProvi
1958
2393
  * The following command uses the in-built "xcopy" provider for releasing to a local directory.
1959
2394
  *
1960
2395
  * ```sh
1961
- * piral publish --type release --provider xcopy --fields.target "/temp/dest"
2396
+ * piral publish --type release --provider xcopy --opts.target "/temp/dest"
1962
2397
  * ```
1963
- *
2398
+ *
1964
2399
  * The type is "release".
1965
2400
  */
1966
2401
  export function publishEmulatorSourcesInvalid_0114(): QuickMessage {
1967
- return [LogLevels.error, '0114', `The command "publish" cannot be done with "--type emulator-sources". Use another type instead.`];
2402
+ return [
2403
+ LogLevels.error,
2404
+ '0114',
2405
+ `The command "publish" cannot be done with "--type emulator-sources". Use another type instead.`,
2406
+ ];
2407
+ }
2408
+
2409
+ /**
2410
+ * @kind Error
2411
+ *
2412
+ * @summary
2413
+ * The "feed" provider requires a "--opts.url" argument.
2414
+ *
2415
+ * @abstract
2416
+ * The `piral publish --type release` command requires the selection of a suitable
2417
+ * provider for running successfully. The "feed" provider releases the files to
2418
+ * the a Piral Feed Service with the static page feature.
2419
+ *
2420
+ * Make sure to supply the URL for the feed service via the `--opts.url` command
2421
+ * line flag.
2422
+ *
2423
+ * @example
2424
+ * The following command would specify `https://feed.piral.cloud/api/v1/feed/sample/page`
2425
+ * for the feed service:
2426
+ *
2427
+ * ```sh
2428
+ * piral publish --type release --provider feed --opts.url "https://feed.piral.cloud/api/v1/feed/sample/page" --opts.apikey "foobar123"
2429
+ * ```
2430
+ */
2431
+ export function publishFeedMissingUrl_0115(): QuickMessage {
2432
+ return [LogLevels.error, '0115', `The "feed" provider requires a "--opts.url" argument.`];
2433
+ }
2434
+
2435
+ /**
2436
+ * @kind Error
2437
+ *
2438
+ * @summary
2439
+ * The "feed" provider requires a "--opts.version" argument.
2440
+ *
2441
+ * @abstract
2442
+ * The `piral publish --type release` command requires the selection of a suitable
2443
+ * provider for running successfully. The "feed" provider releases the files to
2444
+ * the a Piral Feed Service with the static page feature.
2445
+ *
2446
+ * Make sure to supply the version either explicitly via the `--opts.version` argument
2447
+ * or implicitly by having the artifacts stored in a sub-directory of the project's root,
2448
+ * which contains a package.json with the version to use.
2449
+ *
2450
+ * @example
2451
+ * The following command would specify version "1.2.3" for the feed service:
2452
+ *
2453
+ * ```sh
2454
+ * piral publish --type release --provider feed --opts.url "..." --opts.apikey "..." --opts.version "1.2.3"
2455
+ * ```
2456
+ */
2457
+ export function publishFeedMissingVersion_0116(): QuickMessage {
2458
+ return [
2459
+ LogLevels.error,
2460
+ '0116',
2461
+ `The "feed" provider requires either a "--opts.version" argument or a package.json with a version.`,
2462
+ ];
1968
2463
  }
1969
2464
 
1970
2465
  /**
@@ -1986,7 +2481,7 @@ export function publishEmulatorSourcesInvalid_0114(): QuickMessage {
1986
2481
  * - The API for opening the default browser is invalid
1987
2482
  *
1988
2483
  * @see
1989
- * - [NPM Open Package](https://www.npmjs.com/package/open)
2484
+ * - [npm Open Package](https://www.npmjs.com/package/open)
1990
2485
  *
1991
2486
  * @example
1992
2487
  * The browser is usually just opened via the command line:
@@ -2010,13 +2505,19 @@ export function failedToOpenBrowser_0170(error: string): QuickMessage {
2010
2505
  * the interpretation of compatible feed services slightly and has an impact of the usage
2011
2506
  * of the pilet in the browser.
2012
2507
  *
2013
- * The selected schema version needs to be either "v0" or "v1".
2508
+ * The selected schema version needs to be either "v0", "v1", or "v2".
2014
2509
  *
2015
2510
  * - v0: will download and evaluate the pilet explicitly
2016
- * - v1: will use a script tag for integration of the pilet (default)
2511
+ * - v1: will use a script tag for integration of the pilet
2512
+ * - v2: will use SystemJS for integration of the pilet (default)
2017
2513
  *
2018
2514
  * The v1 version has better support for older browsers, but requires a polyfill to work
2019
- * correctly. This polyfill is part of the standard Piral polyfills.
2515
+ * correctly. This polyfill is part of the `piral-ie11polyfills-utils` package.
2516
+ * Alternatively, use the `currentScript-polyfill` package.
2517
+ *
2518
+ * The v2 version uses a SystemJS format for the pilet. It has the broadest browser support
2519
+ * but requires the custom format as output. Most bundlers support SystemJS directly or
2520
+ * indirectly, making it a quite broad choice.
2020
2521
  *
2021
2522
  * @see
2022
2523
  * - [GitHub currentScript-polyfill](https://github.com/amiller-gh/currentScript-polyfill)
@@ -2041,8 +2542,8 @@ export function invalidSchemaVersion_0171(schemaVersion: string, schemas: Array<
2041
2542
  *
2042
2543
  * @abstract
2043
2544
  * Piral allows you to set up your own tooling for building and debugging. This
2044
- * is a powerful concept. By default, the Webpack bundler is used. Alternatives
2045
- * include Parcel and Rollup.
2545
+ * is a powerful concept. By default, the Webpack v5 bundler is used.
2546
+ * Alternatives include Parcel and Rollup.
2046
2547
  *
2047
2548
  * In case where multiple bundlers are installed the first one is picked. This
2048
2549
  * may not be what you want. In this scenario you can override the selection by
@@ -2053,7 +2554,9 @@ export function invalidSchemaVersion_0171(schemaVersion: string, schemas: Array<
2053
2554
  * @see
2054
2555
  * - [Webpack](https://webpack.js.org)
2055
2556
  * - [Parcel](https://parceljs.org)
2056
- * - [Pluggable bundlers](https://docs.piral.io/reference/documentation/bundlers)
2557
+ * - [esbuild](https://esbuild.github.io)
2558
+ * - [rspack](https://www.rspack.dev/)
2559
+ * - [Pluggable bundlers](https://docs.piral.io/concepts/T02-bundlers)
2057
2560
  *
2058
2561
  * @example
2059
2562
  * Use the following command to make the parcel bundler available:
@@ -2075,8 +2578,8 @@ export function bundlerMissing_0172(bundlerName: string, installed: Array<string
2075
2578
  *
2076
2579
  * @abstract
2077
2580
  * Piral allows you to set up your own tooling for building and debugging. This
2078
- * is a powerful concept. By default, the Webpack bundler is used. Alternatives
2079
- * include Parcel and Rollup.
2581
+ * is a powerful concept. By default, the Webpack v5 bundler is used.
2582
+ * Alternatives include Parcel and Rollup.
2080
2583
  *
2081
2584
  * In case where no bundler is installed and the default bundler could not be
2082
2585
  * successfully installed this error is shown.
@@ -2084,7 +2587,9 @@ export function bundlerMissing_0172(bundlerName: string, installed: Array<string
2084
2587
  * @see
2085
2588
  * - [Webpack](https://webpack.js.org)
2086
2589
  * - [Parcel](https://parceljs.org)
2087
- * - [Pluggable bundlers](https://docs.piral.io/reference/documentation/bundlers)
2590
+ * - [esbuild](https://esbuild.github.io)
2591
+ * - [rspack](https://www.rspack.dev/)
2592
+ * - [Pluggable bundlers](https://docs.piral.io/concepts/T02-bundlers)
2088
2593
  *
2089
2594
  * @example
2090
2595
  * Use the following command to make the parcel bundler available:
@@ -2115,7 +2620,9 @@ export function defaultBundlerMissing_0173(): QuickMessage {
2115
2620
  * @see
2116
2621
  * - [Webpack](https://webpack.js.org)
2117
2622
  * - [Parcel](https://parceljs.org)
2118
- * - [Pluggable bundlers](https://docs.piral.io/reference/documentation/bundlers)
2623
+ * - [esbuild](https://esbuild.github.io)
2624
+ * - [rspack](https://www.rspack.dev/)
2625
+ * - [Pluggable bundlers](https://docs.piral.io/concepts/T02-bundlers)
2119
2626
  *
2120
2627
  * @example
2121
2628
  * Use the following command to make the parcel bundler available:
@@ -2136,8 +2643,8 @@ export function bundlingFailed_0174(error: string): QuickMessage {
2136
2643
  *
2137
2644
  * @abstract
2138
2645
  * Piral allows you to set up your own tooling for building and debugging. This
2139
- * is a powerful concept. By default, the Webpack bundler is used. Alternatives
2140
- * include Parcel and Rollup.
2646
+ * is a powerful concept. By default, the Webpack v5 bundler is used.
2647
+ * Alternatives include Parcel and Rollup.
2141
2648
  *
2142
2649
  * In case where multiple bundlers are installed the first one is picked. This
2143
2650
  * may not be what you want. In this scenario you can explicitly set the bundler
@@ -2148,7 +2655,7 @@ export function bundlingFailed_0174(error: string): QuickMessage {
2148
2655
  * dependent we recommend setting the bundler explicitly.
2149
2656
  *
2150
2657
  * @see
2151
- * - [Pluggable bundlers](https://docs.piral.io/reference/documentation/bundlers)
2658
+ * - [Pluggable bundlers](https://docs.piral.io/concepts/T02-bundlers)
2152
2659
  *
2153
2660
  * @example
2154
2661
  * Use the following command to explicitly choose the Parcel bundler:
@@ -2166,6 +2673,85 @@ export function bundlerUnspecified_0175(available: Array<string>): QuickMessage
2166
2673
  ];
2167
2674
  }
2168
2675
 
2676
+ /**
2677
+ * @kind Warning
2678
+ *
2679
+ * @summary
2680
+ * No bundler has been installed yet.
2681
+ *
2682
+ * @abstract
2683
+ * Piral allows you to set up your own tooling for building and debugging. This
2684
+ * is a powerful concept. By default, the Webpack v5 bundler is used.
2685
+ * Alternatives include Parcel and Rollup.
2686
+ *
2687
+ * In case no bundler is yet installed the Piral CLI will automatically install
2688
+ * the default bundler. However, you should consider installing a bundler of your
2689
+ * choice (even if this could also be the default bundler) explicitly.
2690
+ *
2691
+ * @see
2692
+ * - [Pluggable bundlers](https://docs.piral.io/concepts/T02-bundlers)
2693
+ *
2694
+ * @example
2695
+ * Use the following command to install esbuild as a bundler with the npm client:
2696
+ *
2697
+ * ```sh
2698
+ * npm i piral-cli-esbuild --save-dev
2699
+ * ```
2700
+ */
2701
+ export function bundlerNotInstalled_0176(): QuickMessage {
2702
+ return [LogLevels.warning, '0176', `Installing default bundler since no bundler has been found.`];
2703
+ }
2704
+
2705
+ /**
2706
+ * @kind Warning
2707
+ *
2708
+ * @summary
2709
+ * No pilet.json has been found.
2710
+ *
2711
+ * @abstract
2712
+ * For some functionality such as multi Piral instance support when debugging
2713
+ * a pilet, a special file called pilet.json is required. While this file is
2714
+ * optional in general, it must be available for certain tasks such as adding
2715
+ * or removing a Piral instance for debugging purposes.
2716
+ *
2717
+ * @see
2718
+ * - [Pluggable bundlers](https://docs.piral.io/concepts/T02-bundlers)
2719
+ *
2720
+ * @example
2721
+ * If no pilet.json is yet available you can create one. It should be adjacent to
2722
+ * the package.json of your pilet, even though different locations are also possible.
2723
+ * By default, the following content can be used for an empty file:
2724
+ *
2725
+ * ```json
2726
+ * {
2727
+ * "$schema": "https://docs.piral.io/schemas/pilet-v0.json"
2728
+ * }
2729
+ * ```
2730
+ */
2731
+ export function piletJsonNotAvailable_0180(root: string): QuickMessage {
2732
+ return [LogLevels.warning, '0180', `No "pilet.json" was found for the pilet at "${root}".`];
2733
+ }
2734
+
2735
+ /**
2736
+ * @kind Error
2737
+ *
2738
+ * @summary
2739
+ * Using the given platform is not supported.
2740
+ *
2741
+ * @abstract
2742
+ * The Piral instance can run on multiple platforms. The platform is specified via
2743
+ * the piral.json file.
2744
+ *
2745
+ * The standard platform is "web", which starts a web server using the server
2746
+ * proxy kras.
2747
+ *
2748
+ * @example
2749
+ * (tbd)
2750
+ */
2751
+ export function platformNotSupported_0190(platform: string): QuickMessage {
2752
+ return [LogLevels.error, '0190', `The given platform "${platform}" is not supported.`];
2753
+ }
2754
+
2169
2755
  /**
2170
2756
  * @kind Warning
2171
2757
  *