piral-cli 1.0.0-pre.2296 → 1.0.1-beta.5640

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -9,19 +9,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.installPackage = exports.installDependencies = void 0;
12
+ exports.listProjects = exports.isProject = exports.initProject = exports.detectClient = exports.installPackage = exports.uninstallPackage = exports.installDependencies = void 0;
13
13
  const path_1 = require("path");
14
14
  const log_1 = require("../log");
15
+ const io_1 = require("../io");
15
16
  const scripts_1 = require("../scripts");
16
17
  const MemoryStream_1 = require("../MemoryStream");
18
+ // Helpers:
17
19
  function runYarnProcess(args, target, output) {
18
- log_1.log('generalDebug_0003', 'Starting the Yarn process ...');
19
- const cwd = path_1.resolve(process.cwd(), target);
20
- return scripts_1.runCommand('yarn', args, cwd, output);
20
+ (0, log_1.log)('generalDebug_0003', 'Starting the Yarn Classic process ...');
21
+ const cwd = (0, path_1.resolve)(process.cwd(), target);
22
+ return (0, scripts_1.runCommand)('yarn', args, cwd, output);
21
23
  }
22
24
  function convert(flags) {
23
25
  return flags.map((flag) => {
24
26
  switch (flag) {
27
+ case '--save-exact':
28
+ return '--exact';
25
29
  case '--save-dev':
26
30
  return '--dev';
27
31
  case '--no-save':
@@ -32,22 +36,69 @@ function convert(flags) {
32
36
  }
33
37
  });
34
38
  }
39
+ // Client interface functions:
35
40
  function installDependencies(target = '.', ...flags) {
36
41
  return __awaiter(this, void 0, void 0, function* () {
37
42
  const ms = new MemoryStream_1.MemoryStream();
38
43
  yield runYarnProcess(['install', ...convert(flags)], target, ms);
39
- log_1.log('generalDebug_0003', `Yarn install dependencies result: ${ms.value}`);
44
+ (0, log_1.log)('generalDebug_0003', `Yarn Classic install dependencies result: ${ms.value}`);
40
45
  return ms.value;
41
46
  });
42
47
  }
43
48
  exports.installDependencies = installDependencies;
49
+ function uninstallPackage(packageRef, target = '.', ...flags) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ const ms = new MemoryStream_1.MemoryStream();
52
+ yield runYarnProcess(['remove', packageRef, ...convert(flags)], target, ms);
53
+ (0, log_1.log)('generalDebug_0003', `Yarn Classic remove package result: ${ms.value}`);
54
+ return ms.value;
55
+ });
56
+ }
57
+ exports.uninstallPackage = uninstallPackage;
44
58
  function installPackage(packageRef, target = '.', ...flags) {
45
59
  return __awaiter(this, void 0, void 0, function* () {
46
60
  const ms = new MemoryStream_1.MemoryStream();
47
61
  yield runYarnProcess(['add', packageRef, ...convert(flags)], target, ms);
48
- log_1.log('generalDebug_0003', `Yarn install package result: ${ms.value}`);
62
+ (0, log_1.log)('generalDebug_0003', `Yarn Classic add package result: ${ms.value}`);
49
63
  return ms.value;
50
64
  });
51
65
  }
52
66
  exports.installPackage = installPackage;
67
+ function detectClient(root, stopDir = (0, path_1.resolve)(root, '/')) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ return !!(yield (0, io_1.findFile)(root, 'yarn.lock', stopDir));
70
+ });
71
+ }
72
+ exports.detectClient = detectClient;
73
+ function initProject(projectName, target) {
74
+ return __awaiter(this, void 0, void 0, function* () { });
75
+ }
76
+ exports.initProject = initProject;
77
+ function isProject(root, packageRef) {
78
+ var _a;
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const details = yield listProjects(root);
81
+ if (typeof details === 'object') {
82
+ return typeof ((_a = details === null || details === void 0 ? void 0 : details[packageRef]) === null || _a === void 0 ? void 0 : _a.location) === 'string';
83
+ }
84
+ return false;
85
+ });
86
+ }
87
+ exports.isProject = isProject;
88
+ // Functions to exclusively use from yarn client:
89
+ function listProjects(target) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const ms = new MemoryStream_1.MemoryStream();
92
+ try {
93
+ yield runYarnProcess(['workspaces', 'info'], target, ms);
94
+ }
95
+ catch (e) {
96
+ (0, log_1.log)('generalDebug_0003', `yarn workspaces error: ${e}`);
97
+ return {};
98
+ }
99
+ (0, log_1.log)('generalDebug_0003', `yarn workspaces result: ${ms.value}`);
100
+ return JSON.parse(ms.value);
101
+ });
102
+ }
103
+ exports.listProjects = listProjects;
53
104
  //# sourceMappingURL=yarn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../../src/common/clients/yarn.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA+B;AAC/B,gCAA6B;AAC7B,wCAAwC;AACxC,kDAA+C;AAE/C,SAAS,cAAc,CAAC,IAAmB,EAAE,MAAc,EAAE,MAA8B;IACzF,SAAG,CAAC,mBAAmB,EAAE,+BAA+B,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,cAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3C,OAAO,oBAAU,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,OAAO,CAAC,KAAoB;IACnC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,QAAQ,IAAI,EAAE;YACZ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F,MAAM,cAAc,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;SAC1D;QAAC,OAAO,CAAC,EAAE;YACV,IAAA,SAAG,EAAC,mBAAmB,EAAE,0BAA0B,CAAC,EAAE,CAAC,CAAC;YACxD,OAAO,EAAE,CAAC;SACX;QAED,IAAA,SAAG,EAAC,mBAAmB,EAAE,2BAA2B,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CAAA;AAZD,oCAYC"}
@@ -12,13 +12,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.checkCliCompatibility = exports.checkAppShellCompatibility = void 0;
13
13
  const info_1 = require("./info");
14
14
  const package_1 = require("./package");
15
+ const constants_1 = require("./constants");
15
16
  const log_1 = require("./log");
16
17
  function checkAppShellCompatibility(piralVersion) {
17
- log_1.log('generalDebug_0003', `Checking compatibility ...`);
18
- const compatible = info_1.findCompatVersion(piralVersion);
19
- log_1.log('generalDebug_0003', `Used versions: "${compatible}" and "${info_1.compatVersion}".`);
18
+ (0, log_1.log)('generalDebug_0003', `Checking compatibility ...`);
19
+ if (!piralVersion) {
20
+ (0, log_1.log)('appShellMaybeIncompatible_0102', info_1.cliVersion);
21
+ return false;
22
+ }
23
+ const compatible = (0, info_1.findCompatVersion)(piralVersion);
24
+ (0, log_1.log)('generalDebug_0003', `Used versions: "${compatible}" and "${info_1.compatVersion}".`);
20
25
  if (info_1.compatVersion !== compatible) {
21
- log_1.log('appShellIncompatible_0100', piralVersion, info_1.cliVersion);
26
+ (0, log_1.log)('appShellIncompatible_0100', piralVersion, info_1.cliVersion);
22
27
  return false;
23
28
  }
24
29
  return true;
@@ -26,12 +31,12 @@ function checkAppShellCompatibility(piralVersion) {
26
31
  exports.checkAppShellCompatibility = checkAppShellCompatibility;
27
32
  function checkCliCompatibility(root) {
28
33
  return __awaiter(this, void 0, void 0, function* () {
29
- log_1.log('generalDebug_0003', `Checking compatibility ...`);
30
- const piralVersion = yield package_1.findPackageVersion(root, 'piral-base');
31
- const compatible = info_1.findCompatVersion(piralVersion);
32
- log_1.log('generalDebug_0003', `Used versions: "${compatible}" and "${info_1.compatVersion}".`);
34
+ (0, log_1.log)('generalDebug_0003', `Checking compatibility ...`);
35
+ const piralVersion = yield (0, package_1.findPackageVersion)(root, constants_1.frameworkLibs);
36
+ const compatible = (0, info_1.findCompatVersion)(piralVersion);
37
+ (0, log_1.log)('generalDebug_0003', `Used versions: "${compatible}" and "${info_1.compatVersion}".`);
33
38
  if (info_1.compatVersion !== compatible) {
34
- log_1.log('toolingIncompatible_0101', piralVersion, info_1.cliVersion);
39
+ (0, log_1.log)('toolingIncompatible_0101', piralVersion, info_1.cliVersion);
35
40
  return false;
36
41
  }
37
42
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../../src/common/compatibility.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAsE;AACtE,uCAA+C;AAC/C,+BAA4B;AAE5B,SAAgB,0BAA0B,CAAC,YAAoB;IAC7D,SAAG,CAAC,mBAAmB,EAAE,4BAA4B,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,wBAAiB,CAAC,YAAY,CAAC,CAAC;IACnD,SAAG,CAAC,mBAAmB,EAAE,mBAAmB,UAAU,UAAU,oBAAa,IAAI,CAAC,CAAC;IAEnF,IAAI,oBAAa,KAAK,UAAU,EAAE;QAChC,SAAG,CAAC,2BAA2B,EAAE,YAAY,EAAE,iBAAU,CAAC,CAAC;QAC3D,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,gEAWC;AAED,SAAsB,qBAAqB,CAAC,IAAY;;QACtD,SAAG,CAAC,mBAAmB,EAAE,4BAA4B,CAAC,CAAC;QACvD,MAAM,YAAY,GAAG,MAAM,4BAAkB,CAAC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,UAAU,GAAG,IAAA,wBAAiB,EAAC,YAAY,CAAC,CAAC;QACnD,IAAA,SAAG,EAAC,mBAAmB,EAAE,mBAAmB,UAAU,UAAU,oBAAa,IAAI,CAAC,CAAC;QAEnF,IAAI,oBAAa,KAAK,UAAU,EAAE;YAChC,IAAA,SAAG,EAAC,0BAA0B,EAAE,YAAY,EAAE,iBAAU,CAAC,CAAC;YAC1D,OAAO,KAAK,CAAC;SACd;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAZD,sDAYC"}
@@ -1,12 +1,63 @@
1
- import { NpmClientType } from '../types';
1
+ import { SourceLanguage, NpmClientType, PiletSchemaVersion } from '../types';
2
2
  export interface PiralCliConfig {
3
+ /**
4
+ * Key to be used for all servers in case there is
5
+ * no specialized key in apiKeys specified.
6
+ */
3
7
  apiKey?: string;
8
+ /**
9
+ * Feed URL to API key specifications.
10
+ */
4
11
  apiKeys?: Record<string, string>;
12
+ /**
13
+ * URL to be used for publishing a pilet in case
14
+ * there is no specialized key in url specified.
15
+ */
5
16
  url?: string;
17
+ /**
18
+ * Path to a custom certificate file.
19
+ */
6
20
  cert?: string;
21
+ /**
22
+ * Selects the default npm client to use.
23
+ */
7
24
  npmClient?: NpmClientType;
25
+ /**
26
+ * Selects the default bundler to use, if
27
+ * none given and found.
28
+ */
8
29
  bundler?: string;
30
+ /**
31
+ * Selects the default pilet API path to use.
32
+ */
9
33
  piletApi?: string;
34
+ /**
35
+ * Sets the validators configuration for a Piral instance.
36
+ */
10
37
  validators?: Record<string, any>;
38
+ /**
39
+ * Sets the schema version to be used for pilets.
40
+ */
41
+ schemaVersion?: PiletSchemaVersion;
42
+ /**
43
+ * Automatically open the browser.
44
+ */
45
+ openBrowser?: boolean;
46
+ /**
47
+ * Port number.
48
+ */
49
+ port?: number;
50
+ /**
51
+ * Template language.
52
+ */
53
+ language?: SourceLanguage;
54
+ /**
55
+ * Host name.
56
+ */
57
+ host?: string;
58
+ /**
59
+ * Npm registry.
60
+ */
61
+ registry?: string;
11
62
  }
12
63
  export declare const config: PiralCliConfig;
@@ -1,42 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.config = void 0;
4
+ const constants_1 = require("./constants");
4
5
  const external_1 = require("../external");
5
- exports.config = external_1.rc('piral', {
6
- /**
7
- * Key to be used for all servers in case there is
8
- * no specialized key in apiKeys specified.
9
- */
6
+ exports.config = (0, external_1.rc)('piral', {
10
7
  apiKey: undefined,
11
- /**
12
- * Hostname to API key specifications.
13
- */
14
8
  apiKeys: {},
15
- /**
16
- * URL to be used for publishing a pilet in case
17
- * there is no specialized key in url specified.
18
- */
19
9
  url: undefined,
20
- /**
21
- * Path to a custom certificate file.
22
- */
23
10
  cert: undefined,
24
- /**
25
- * Selects the default npm client to use.
26
- */
27
11
  npmClient: 'npm',
28
- /**
29
- * Selects the default bundler to use, if
30
- * none given and found.
31
- */
32
- bundler: 'webpack',
33
- /**
34
- * Selects the default pilet API path to use.
35
- */
12
+ bundler: 'webpack5',
36
13
  piletApi: '/$pilet-api',
37
- /**
38
- * Sets the validators configuration for a Piral instance.
39
- */
40
14
  validators: {},
41
- });
15
+ schemaVersion: 'v2',
16
+ openBrowser: false,
17
+ port: 1234,
18
+ language: 'ts',
19
+ host: 'localhost',
20
+ registry: constants_1.defaultRegistry,
21
+ }, {});
42
22
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/common/config.ts"],"names":[],"mappings":";;;AAAA,0CAAiC;AAcpB,QAAA,MAAM,GAAmB,aAAE,CAAC,OAAO,EAAE;IAChD;;;OAGG;IACH,MAAM,EAAE,SAAS;IACjB;;OAEG;IACH,OAAO,EAAE,EAAE;IACX;;;OAGG;IACH,GAAG,EAAE,SAAS;IACd;;OAEG;IACH,IAAI,EAAE,SAAS;IACf;;OAEG;IACH,SAAS,EAAE,KAAK;IAChB;;;OAGG;IACH,OAAO,EAAE,SAAS;IAClB;;OAEG;IACH,QAAQ,EAAE,aAAa;IACvB;;OAEG;IACH,UAAU,EAAE,EAAE;CACf,CAAC,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/common/config.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAC9C,0CAAiC;AAiEpB,QAAA,MAAM,GAAmB,IAAA,aAAE,EACtC,OAAO,EACP;IACE,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,EAAE;IACX,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,KAAc;IACzB,OAAO,EAAE,UAAmB;IAC5B,QAAQ,EAAE,aAAa;IACvB,UAAU,EAAE,EAAE;IACd,aAAa,EAAE,IAAa;IAC5B,WAAW,EAAE,KAAK;IAClB,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,IAAa;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,2BAAe;CAC1B,EACD,EAAE,CACH,CAAC"}
@@ -1,7 +1,15 @@
1
1
  export declare const defaultRegistry = "https://registry.npmjs.org/";
2
2
  export declare const filesTar = "files";
3
+ export declare const packageJson = "package.json";
4
+ export declare const piralJson = "piral.json";
5
+ export declare const piletJson = "pilet.json";
3
6
  export declare const filesOnceTar = "files_once";
4
- export declare const piralBaseRoot = "piral-base/lib/types";
7
+ export declare const piralBaseRoot = "piral-base/package.json";
8
+ export declare const defaultSchemaVersion = "v2";
9
+ export declare const frameworkLibs: ("piral" | "piral-core" | "piral-base")[];
10
+ export declare const piletJsonSchemaUrl = "https://docs.piral.io/schemas/pilet-v0.json";
11
+ export declare const piralJsonSchemaUrl = "https://docs.piral.io/schemas/piral-v0.json";
5
12
  export declare const entryModuleExtensions: string[];
13
+ export declare const bundlerNames: ("webpack" | "esbuild" | "parcel" | "parcel2" | "rollup" | "rspack" | "webpack5" | "vite" | "xbuild")[];
6
14
  export declare const declarationEntryExtensions: string[];
7
- export declare const coreExternals: string[];
15
+ export declare const legacyCoreExternals: string[];
@@ -1,13 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.coreExternals = exports.declarationEntryExtensions = exports.entryModuleExtensions = exports.piralBaseRoot = exports.filesOnceTar = exports.filesTar = exports.defaultRegistry = void 0;
3
+ exports.legacyCoreExternals = exports.declarationEntryExtensions = exports.bundlerNames = exports.entryModuleExtensions = exports.piralJsonSchemaUrl = exports.piletJsonSchemaUrl = exports.frameworkLibs = exports.defaultSchemaVersion = exports.piralBaseRoot = exports.filesOnceTar = exports.piletJson = exports.piralJson = exports.packageJson = exports.filesTar = exports.defaultRegistry = void 0;
4
4
  exports.defaultRegistry = 'https://registry.npmjs.org/';
5
5
  exports.filesTar = 'files';
6
+ exports.packageJson = 'package.json';
7
+ exports.piralJson = 'piral.json';
8
+ exports.piletJson = 'pilet.json';
6
9
  exports.filesOnceTar = 'files_once';
7
- exports.piralBaseRoot = 'piral-base/lib/types';
10
+ exports.piralBaseRoot = 'piral-base/package.json';
11
+ exports.defaultSchemaVersion = 'v2';
12
+ exports.frameworkLibs = ['piral', 'piral-core', 'piral-base'];
13
+ exports.piletJsonSchemaUrl = 'https://docs.piral.io/schemas/pilet-v0.json';
14
+ exports.piralJsonSchemaUrl = 'https://docs.piral.io/schemas/piral-v0.json';
8
15
  exports.entryModuleExtensions = ['.ts', '.tsx', '.js', '.jsx'];
9
- exports.declarationEntryExtensions = ['.html', ...exports.entryModuleExtensions];
10
- exports.coreExternals = [
16
+ exports.bundlerNames = [
17
+ 'esbuild',
18
+ 'parcel',
19
+ 'parcel2',
20
+ 'rollup',
21
+ 'rspack',
22
+ 'webpack',
23
+ 'webpack5',
24
+ 'vite',
25
+ 'xbuild',
26
+ ];
27
+ exports.declarationEntryExtensions = ['.html', '.pug', ...exports.entryModuleExtensions];
28
+ exports.legacyCoreExternals = [
11
29
  '@dbeining/react-atom',
12
30
  '@libre/atom',
13
31
  'history',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,6BAA6B,CAAC;AAChD,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,YAAY,GAAG,YAAY,CAAC;AAC5B,QAAA,aAAa,GAAG,sBAAsB,CAAC;AACvC,QAAA,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACvD,QAAA,0BAA0B,GAAG,CAAC,OAAO,EAAE,GAAG,6BAAqB,CAAC,CAAC;AACjE,QAAA,aAAa,GAAG;IAC3B,sBAAsB;IACtB,aAAa;IACb,SAAS;IACT,OAAO;IACP,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB,OAAO;IACP,gBAAgB;CACjB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,6BAA6B,CAAC;AAChD,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,WAAW,GAAG,cAAc,CAAC;AAC7B,QAAA,SAAS,GAAG,YAAY,CAAC;AACzB,QAAA,SAAS,GAAG,YAAY,CAAC;AACzB,QAAA,YAAY,GAAG,YAAY,CAAC;AAC5B,QAAA,aAAa,GAAG,yBAAyB,CAAC;AAC1C,QAAA,oBAAoB,GAAG,IAAI,CAAC;AAC5B,QAAA,aAAa,GAAG,CAAC,OAAgB,EAAE,YAAqB,EAAE,YAAqB,CAAC,CAAC;AACjF,QAAA,kBAAkB,GAAG,6CAA6C,CAAC;AACnE,QAAA,kBAAkB,GAAG,6CAA6C,CAAC;AACnE,QAAA,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACvD,QAAA,YAAY,GAAG;IAC1B,SAAkB;IAClB,QAAiB;IACjB,SAAkB;IAClB,QAAiB;IACjB,QAAiB;IACjB,SAAkB;IAClB,UAAmB;IACnB,MAAe;IACf,QAAiB;CAClB,CAAC;AACW,QAAA,0BAA0B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,6BAAqB,CAAC,CAAC;AACzE,QAAA,mBAAmB,GAAG;IACjC,sBAAsB;IACtB,aAAa;IACb,SAAS;IACT,OAAO;IACP,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB,OAAO;IACP,gBAAgB;CACjB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { ForceOverwrite } from './enums';
2
2
  import { LogLevels } from '../types';
3
- export declare function createDeclaration(baseDir: string, entry: string, target: string, forceOverwrite: ForceOverwrite, logLevel: LogLevels): Promise<void>;
3
+ export declare function createPiletDeclaration(name: string, root: string, entry: string, allowedImports: Array<string>, target: string, forceOverwrite: ForceOverwrite, logLevel: LogLevels): Promise<void>;
4
+ export declare function createPiralDeclaration(baseDir: string, entry: string, target: string, forceOverwrite: ForceOverwrite, logLevel: LogLevels): Promise<void>;
@@ -9,31 +9,60 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createDeclaration = void 0;
12
+ exports.createPiralDeclaration = exports.createPiletDeclaration = void 0;
13
13
  const dets_1 = require("dets");
14
14
  const path_1 = require("path");
15
15
  const log_1 = require("./log");
16
- const npm_1 = require("./npm");
17
16
  const package_1 = require("./package");
18
17
  const constants_1 = require("./constants");
19
18
  const io_1 = require("./io");
20
- function findPiralBaseApi(root) {
21
- var _a;
19
+ const external_1 = require("../external");
20
+ function findPiralBaseRoot(root, framework) {
21
+ const piralJson = `${framework}/package.json`;
22
+ if (piralJson !== constants_1.piralBaseRoot) {
23
+ try {
24
+ const packageJsonPath = (0, external_1.getModulePath)(root, piralJson);
25
+ return (0, path_1.dirname)(packageJsonPath);
26
+ }
27
+ catch (_a) { }
28
+ }
29
+ return root;
30
+ }
31
+ function findPiralBaseApi(root, framework) {
32
+ // for some package managers, e.g., pnpm we need to first go into
33
+ // some specifics before being able to retrieve "piral-base"
34
+ const baseRoot = findPiralBaseRoot(root, framework);
22
35
  try {
23
- return (_a = require
24
- .resolve(constants_1.piralBaseRoot, {
25
- paths: [root],
26
- })) === null || _a === void 0 ? void 0 : _a.replace(/\.js$/, '.d.ts');
36
+ const packageJsonPath = (0, external_1.getModulePath)(baseRoot, constants_1.piralBaseRoot);
37
+ const projectDir = (0, path_1.dirname)(packageJsonPath);
38
+ const project = require(packageJsonPath);
39
+ // By default support for piral-base < 0.15
40
+ const { piletApiTypings = 'lib/types.d.ts' } = project;
41
+ return [
42
+ {
43
+ file: (0, path_1.resolve)(projectDir, piletApiTypings),
44
+ name: 'PiletApi',
45
+ },
46
+ ];
27
47
  }
28
- catch (_b) {
29
- return undefined;
48
+ catch (err) {
49
+ (0, log_1.log)('generalError_0002', `Could not find the root API of "piral-base" from "${root}": ${err}`);
50
+ return [];
30
51
  }
31
52
  }
32
53
  function findDeclaredTypings(root) {
33
54
  try {
34
- const { typings } = require(path_1.resolve(root, 'package.json'));
55
+ const { typings, extraTypes } = require((0, path_1.resolve)(root, 'package.json'));
56
+ if (extraTypes) {
57
+ if (typeof extraTypes === 'string') {
58
+ return [(0, path_1.resolve)(root, extraTypes)];
59
+ }
60
+ else if (Array.isArray(extraTypes)) {
61
+ return extraTypes.filter((types) => typeof types === 'string').map((types) => (0, path_1.resolve)(root, types));
62
+ }
63
+ }
35
64
  if (typings) {
36
- return [path_1.resolve(root, typings)];
65
+ return [(0, path_1.resolve)(root, typings)];
37
66
  }
38
67
  }
39
68
  catch (_a) { }
@@ -43,7 +72,7 @@ function getAllFiles(entryModules) {
43
72
  return __awaiter(this, void 0, void 0, function* () {
44
73
  const files = [];
45
74
  const pattern = '**/+(*.ts|*.tsx|*.js|*.jsx)';
46
- const allFiles = yield Promise.all(entryModules.map((m) => io_1.matchFiles(path_1.dirname(m), pattern)));
75
+ const allFiles = yield Promise.all(entryModules.map((m) => (0, io_1.matchFiles)((0, path_1.dirname)(m), pattern)));
47
76
  for (const found of allFiles) {
48
77
  files.push(...found.filter((file) => !files.includes(file)));
49
78
  }
@@ -52,59 +81,87 @@ function getAllFiles(entryModules) {
52
81
  }
53
82
  function getEntryModules(entryFiles) {
54
83
  return __awaiter(this, void 0, void 0, function* () {
55
- if (!constants_1.entryModuleExtensions.includes(path_1.extname(entryFiles).toLowerCase())) {
56
- const appFile = yield io_1.readText(path_1.dirname(entryFiles), path_1.basename(entryFiles));
57
- const entryModules = yield io_1.getEntryFiles(appFile, path_1.dirname(entryFiles));
84
+ if (!constants_1.entryModuleExtensions.includes((0, path_1.extname)(entryFiles).toLowerCase())) {
85
+ const appFile = yield (0, io_1.readText)((0, path_1.dirname)(entryFiles), (0, path_1.basename)(entryFiles));
86
+ const entryModules = yield (0, io_1.getEntryFiles)(appFile, (0, path_1.dirname)(entryFiles));
58
87
  return entryModules;
59
88
  }
60
89
  return [entryFiles];
61
90
  });
62
91
  }
63
- function createDeclaration(baseDir, entry, target, forceOverwrite, logLevel) {
92
+ function createLogger() {
93
+ return {
94
+ error(message) {
95
+ throw new Error(message);
96
+ },
97
+ info(message) {
98
+ (0, log_1.logInfo)(message);
99
+ },
100
+ verbose(message) {
101
+ (0, log_1.logVerbose)(message);
102
+ },
103
+ warn(message) {
104
+ (0, log_1.logWarn)(message);
105
+ },
106
+ };
107
+ }
108
+ function createDeclarationFile(options, source, target, forceOverwrite) {
64
109
  return __awaiter(this, void 0, void 0, function* () {
65
- log_1.progress('Reading configuration ...');
66
- const entryFiles = yield package_1.retrievePiralRoot(baseDir, entry);
67
- const { name, root, externals } = yield package_1.retrievePiletsInfo(entryFiles);
68
- const allowedImports = npm_1.makeExternals(externals);
69
- const entryModules = yield getEntryModules(entryFiles);
70
- const files = yield getAllFiles(entryModules);
71
- log_1.progress('Bundling declaration file ...');
110
+ (0, log_1.progress)('Bundling declaration file ...');
72
111
  try {
73
- const result = dets_1.generateDeclaration({
74
- name,
75
- root,
76
- files,
77
- types: findDeclaredTypings(root),
78
- apis: [
79
- {
80
- file: findPiralBaseApi(root),
81
- name: 'PiletApi',
82
- },
83
- ],
84
- imports: allowedImports,
85
- logLevel,
86
- logger: {
87
- error(message) {
88
- throw new Error(message);
89
- },
90
- info(message) {
91
- log_1.logInfo(message);
92
- },
93
- verbose(message) {
94
- log_1.logVerbose(message);
95
- },
96
- warn(message) {
97
- log_1.logWarn(message);
98
- },
99
- },
100
- });
101
- log_1.progress('Writing declaration file ...');
102
- yield io_1.createFileIfNotExists(target, 'index.d.ts', result, forceOverwrite);
112
+ const result = (0, dets_1.generateDeclaration)(options);
113
+ (0, log_1.progress)('Writing declaration file ...');
114
+ yield (0, io_1.createFileIfNotExists)(target, 'index.d.ts', result, forceOverwrite);
103
115
  }
104
116
  catch (ex) {
105
- log_1.log('declarationCouldNotBeGenerated_0076', baseDir, ex);
117
+ (0, log_1.log)('declarationCouldNotBeGenerated_0076', source, ex);
118
+ }
119
+ });
120
+ }
121
+ function createPiletDeclaration(name, root, entry, allowedImports, target, forceOverwrite, logLevel) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const files = yield getAllFiles([entry]);
124
+ const types = findDeclaredTypings(root);
125
+ const options = {
126
+ name,
127
+ root,
128
+ files,
129
+ types: [...types, ...files],
130
+ plugins: [(0, dets_1.createExcludePlugin)([name])],
131
+ apis: [],
132
+ noModuleDeclaration: true,
133
+ imports: allowedImports,
134
+ logLevel,
135
+ logger: createLogger(),
136
+ };
137
+ return yield createDeclarationFile(options, root, target, forceOverwrite);
138
+ });
139
+ }
140
+ exports.createPiletDeclaration = createPiletDeclaration;
141
+ function createPiralDeclaration(baseDir, entry, target, forceOverwrite, logLevel) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ (0, log_1.progress)('Reading configuration ...');
144
+ const entryFiles = yield (0, package_1.retrievePiralRoot)(baseDir, entry);
145
+ const { name, root, externals, framework } = yield (0, package_1.retrievePiletsInfo)(entryFiles);
146
+ const entryModules = yield getEntryModules(entryFiles);
147
+ const files = yield getAllFiles(entryModules);
148
+ const options = {
149
+ name,
150
+ root,
151
+ files,
152
+ types: findDeclaredTypings(root),
153
+ apis: findPiralBaseApi(root, framework),
154
+ noModuleDeclaration: true,
155
+ imports: (0, package_1.flattenExternals)(externals),
156
+ logLevel,
157
+ logger: createLogger(),
158
+ };
159
+ (0, package_1.validateSharedDependencies)(externals);
160
+ if (options.apis.length) {
161
+ return yield createDeclarationFile(options, baseDir, target, forceOverwrite);
106
162
  }
163
+ (0, log_1.log)('declarationCouldNotBeGenerated_0076', baseDir, 'The main Pilet API interface could not be found.');
107
164
  });
108
165
  }
109
- exports.createDeclaration = createDeclaration;
166
+ exports.createPiralDeclaration = createPiralDeclaration;
110
167
  //# sourceMappingURL=declaration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"declaration.js","sourceRoot":"","sources":["../../src/common/declaration.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA2C;AAC3C,+BAA2D;AAC3D,+BAAoE;AACpE,+BAAsC;AAEtC,uCAAkE;AAClE,2CAAmE;AACnE,6BAAkF;AAGlF,SAAS,gBAAgB,CAAC,IAAY;;IACpC,IAAI;QACF,aAAO,OAAO;aACX,OAAO,CAAC,yBAAa,EAAE;YACtB,KAAK,EAAE,CAAC,IAAI,CAAC;SACd,CAAC,0CACA,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE;KAC/B;IAAC,WAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,IAAI;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,cAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;QAE3D,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,cAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;SACjC;KACF;IAAC,WAAM,GAAE;IAEV,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAe,WA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C;YACvC,mBAAmB,EAAE,IAAI;YACzB,OAAO,EAAE,IAAA,0BAAgB,EAAC,SAAS,CAAC;YACpC,QAAQ;YACR,MAAM,EAAE,YAAY,EAAE;SACvB,CAAC;QAEF,IAAA,oCAA0B,EAAC,SAAS,CAAC,CAAC;QAEtC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;YACvB,OAAO,MAAM,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;SAC9E;QAED,IAAA,SAAG,EAAC,qCAAqC,EAAE,OAAO,EAAE,kDAAkD,CAAC,CAAC;IAC1G,CAAC;CAAA;AA/BD,wDA+BC"}
@@ -1,2 +1,10 @@
1
1
  export declare const liveIcon: string;
2
2
  export declare const settingsIcon: string;
3
+ export declare const cactusIcon: string;
4
+ export declare const clapIcon: string;
5
+ export declare const sparklesIcon: string;
6
+ export declare const unicornIcon: string;
7
+ export declare const caterpillerIcon: string;
8
+ export declare const butterflyIcon: string;
9
+ export declare const zapIcon: string;
10
+ export declare const rainbowIcon: string;
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settingsIcon = exports.liveIcon = void 0;
3
+ exports.rainbowIcon = exports.zapIcon = exports.butterflyIcon = exports.caterpillerIcon = exports.unicornIcon = exports.sparklesIcon = exports.clapIcon = exports.cactusIcon = exports.settingsIcon = exports.liveIcon = void 0;
4
4
  const info_1 = require("./info");
5
5
  const supportsEmoji = !info_1.isWindows || process.env.TERM === 'xterm-256color';
6
+ // see https://unicode.org/emoji/charts/full-emoji-list.html
6
7
  exports.liveIcon = supportsEmoji ? '🚀 ' : '>';
7
8
  exports.settingsIcon = supportsEmoji ? '🔧 ' : '>';
9
+ exports.cactusIcon = supportsEmoji ? '👻 ' : '>';
10
+ exports.clapIcon = supportsEmoji ? '👏 ' : '^';
11
+ exports.sparklesIcon = supportsEmoji ? '✨ ' : '>';
12
+ exports.unicornIcon = supportsEmoji ? '🦄 ' : '>';
13
+ exports.caterpillerIcon = supportsEmoji ? '🐛 ' : '+';
14
+ exports.butterflyIcon = supportsEmoji ? '🦋 ' : '+';
15
+ exports.zapIcon = supportsEmoji ? '⚡ ' : '>';
16
+ exports.rainbowIcon = supportsEmoji ? '🌈 ' : '~';
8
17
  //# sourceMappingURL=emoji.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"emoji.js","sourceRoot":"","sources":["../../src/common/emoji.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AAEnC,MAAM,aAAa,GAAG,CAAC,gBAAS,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAE7D,QAAA,QAAQ,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AACvC,QAAA,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC"}
1
+ {"version":3,"file":"emoji.js","sourceRoot":"","sources":["../../src/common/emoji.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AAEnC,MAAM,aAAa,GAAG,CAAC,gBAAS,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAE1E,4DAA4D;AAC/C,QAAA,QAAQ,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AACvC,QAAA,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AAC3C,QAAA,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AACzC,QAAA,QAAQ,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AACvC,QAAA,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AAC1C,QAAA,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AAC1C,QAAA,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9C,QAAA,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AAC5C,QAAA,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AACrC,QAAA,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC"}
@@ -1,3 +1,3 @@
1
- import { LogLevels } from '../types';
2
- export declare function createEmulatorSources(sourceDir: string, targetDir: string, targetFile: string, logLevel: LogLevels): Promise<string>;
1
+ import { LogLevels, SharedDependency } from '../types';
2
+ export declare function createEmulatorSources(sourceDir: string, externals: Array<SharedDependency>, targetDir: string, targetFile: string, logLevel: LogLevels): Promise<string>;
3
3
  export declare function packageEmulator(rootDir: string): Promise<void>;