piral-cli 1.4.0-beta.6250 → 1.4.0-beta.6252

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 (162) hide show
  1. package/lib/api.js +8 -17
  2. package/lib/api.js.map +1 -1
  3. package/lib/apps/add-piral-instance-pilet.js +20 -31
  4. package/lib/apps/add-piral-instance-pilet.js.map +1 -1
  5. package/lib/apps/build-pilet.js +139 -147
  6. package/lib/apps/build-pilet.js.map +1 -1
  7. package/lib/apps/build-piral.js +130 -144
  8. package/lib/apps/build-piral.js.map +1 -1
  9. package/lib/apps/debug-pilet.js +107 -119
  10. package/lib/apps/debug-pilet.js.map +1 -1
  11. package/lib/apps/debug-piral.js +62 -70
  12. package/lib/apps/debug-piral.js.map +1 -1
  13. package/lib/apps/declaration-piral.js +6 -17
  14. package/lib/apps/declaration-piral.js.map +1 -1
  15. package/lib/apps/new-pilet.js +71 -82
  16. package/lib/apps/new-pilet.js.map +1 -1
  17. package/lib/apps/new-piral.js +42 -53
  18. package/lib/apps/new-piral.js.map +1 -1
  19. package/lib/apps/pack-pilet.js +7 -18
  20. package/lib/apps/pack-pilet.js.map +1 -1
  21. package/lib/apps/publish-pilet.js +127 -141
  22. package/lib/apps/publish-pilet.js.map +1 -1
  23. package/lib/apps/publish-piral.js +48 -63
  24. package/lib/apps/publish-piral.js.map +1 -1
  25. package/lib/apps/remove-piral-instance-pilet.js +30 -35
  26. package/lib/apps/remove-piral-instance-pilet.js.map +1 -1
  27. package/lib/apps/run-emulator-piral.js +49 -61
  28. package/lib/apps/run-emulator-piral.js.map +1 -1
  29. package/lib/apps/upgrade-pilet.js +64 -76
  30. package/lib/apps/upgrade-pilet.js.map +1 -1
  31. package/lib/apps/upgrade-piral.js +31 -43
  32. package/lib/apps/upgrade-piral.js.map +1 -1
  33. package/lib/apps/validate-pilet.js +34 -45
  34. package/lib/apps/validate-pilet.js.map +1 -1
  35. package/lib/apps/validate-piral.js +29 -51
  36. package/lib/apps/validate-piral.js.map +1 -1
  37. package/lib/build/bundler-calls.js +12 -3
  38. package/lib/build/bundler-calls.js.map +1 -1
  39. package/lib/build/run-build-pilet.js +5 -14
  40. package/lib/build/run-build-pilet.js.map +1 -1
  41. package/lib/build/run-build-piral.js +5 -14
  42. package/lib/build/run-build-piral.js.map +1 -1
  43. package/lib/build/run-debug-mono-piral.js +5 -14
  44. package/lib/build/run-debug-mono-piral.js.map +1 -1
  45. package/lib/build/run-debug-pilet.js +5 -14
  46. package/lib/build/run-debug-pilet.js.map +1 -1
  47. package/lib/build/run-debug-piral.js +5 -14
  48. package/lib/build/run-debug-piral.js.map +1 -1
  49. package/lib/bundler.js +100 -127
  50. package/lib/bundler.js.map +1 -1
  51. package/lib/commands.js +5 -1
  52. package/lib/commands.js.map +1 -1
  53. package/lib/common/browser.js +13 -26
  54. package/lib/common/browser.js.map +1 -1
  55. package/lib/common/compatibility.js +10 -21
  56. package/lib/common/compatibility.js.map +1 -1
  57. package/lib/common/declaration.js +80 -101
  58. package/lib/common/declaration.js.map +1 -1
  59. package/lib/common/emulator.js +186 -182
  60. package/lib/common/emulator.js.map +1 -1
  61. package/lib/common/http.js +7 -4
  62. package/lib/common/http.js.map +1 -1
  63. package/lib/common/importmap.js +172 -187
  64. package/lib/common/importmap.js.map +1 -1
  65. package/lib/common/injectors.js +4 -1
  66. package/lib/common/injectors.js.map +1 -1
  67. package/lib/common/inspect.js +5 -2
  68. package/lib/common/inspect.js.map +1 -1
  69. package/lib/common/interactive.js +9 -15
  70. package/lib/common/interactive.js.map +1 -1
  71. package/lib/common/io.js +256 -299
  72. package/lib/common/io.js.map +1 -1
  73. package/lib/common/language.js +21 -5
  74. package/lib/common/language.js.map +1 -1
  75. package/lib/common/npm.js +193 -228
  76. package/lib/common/npm.js.map +1 -1
  77. package/lib/common/pack.js +71 -86
  78. package/lib/common/pack.js.map +1 -1
  79. package/lib/common/package.js +426 -448
  80. package/lib/common/package.js.map +1 -1
  81. package/lib/common/parallel.js +12 -23
  82. package/lib/common/parallel.js.map +1 -1
  83. package/lib/common/patcher.js +54 -71
  84. package/lib/common/patcher.js.map +1 -1
  85. package/lib/common/platform.js +1 -12
  86. package/lib/common/platform.js.map +1 -1
  87. package/lib/common/port.js +11 -24
  88. package/lib/common/port.js.map +1 -1
  89. package/lib/common/rules.js +6 -17
  90. package/lib/common/rules.js.map +1 -1
  91. package/lib/common/scaffold.js +52 -59
  92. package/lib/common/scaffold.js.map +1 -1
  93. package/lib/common/shell.js +49 -58
  94. package/lib/common/shell.js.map +1 -1
  95. package/lib/common/spec.js +1 -1
  96. package/lib/common/spec.js.map +1 -1
  97. package/lib/common/template.js +3 -14
  98. package/lib/common/template.js.map +1 -1
  99. package/lib/common/watcher.js +7 -16
  100. package/lib/common/watcher.js.map +1 -1
  101. package/lib/common/website.d.ts +1 -0
  102. package/lib/common/website.js +67 -57
  103. package/lib/common/website.js.map +1 -1
  104. package/lib/injectors/pilet-injector.js +138 -145
  105. package/lib/injectors/pilet-injector.js.map +1 -1
  106. package/lib/injectors/piral-injector.js +55 -67
  107. package/lib/injectors/piral-injector.js.map +1 -1
  108. package/lib/messages.d.ts +81 -0
  109. package/lib/messages.js +94 -1
  110. package/lib/messages.js.map +1 -1
  111. package/lib/npm-clients/bun.js +36 -60
  112. package/lib/npm-clients/bun.js.map +1 -1
  113. package/lib/npm-clients/index.js +10 -21
  114. package/lib/npm-clients/index.js.map +1 -1
  115. package/lib/npm-clients/lerna.js +48 -72
  116. package/lib/npm-clients/lerna.js.map +1 -1
  117. package/lib/npm-clients/npm.js +69 -105
  118. package/lib/npm-clients/npm.js.map +1 -1
  119. package/lib/npm-clients/pnp.js +35 -59
  120. package/lib/npm-clients/pnp.js.map +1 -1
  121. package/lib/npm-clients/pnpm.js +35 -59
  122. package/lib/npm-clients/pnpm.js.map +1 -1
  123. package/lib/npm-clients/rush.js +53 -77
  124. package/lib/npm-clients/rush.js.map +1 -1
  125. package/lib/npm-clients/yarn.js +35 -59
  126. package/lib/npm-clients/yarn.js.map +1 -1
  127. package/lib/platforms/node.js +4 -17
  128. package/lib/platforms/node.js.map +1 -1
  129. package/lib/platforms/web.js +81 -96
  130. package/lib/platforms/web.js.map +1 -1
  131. package/lib/plugin.js +56 -75
  132. package/lib/plugin.js.map +1 -1
  133. package/lib/questionnaire.js +46 -12
  134. package/lib/questionnaire.js.map +1 -1
  135. package/lib/release.js +32 -47
  136. package/lib/release.js.map +1 -1
  137. package/lib/rules/index.js +10 -23
  138. package/lib/rules/index.js.map +1 -1
  139. package/lib/rules/pilet-has-externals-as-peers.js +34 -45
  140. package/lib/rules/pilet-has-externals-as-peers.js.map +1 -1
  141. package/lib/rules/pilet-has-no-self-reference.js +16 -27
  142. package/lib/rules/pilet-has-no-self-reference.js.map +1 -1
  143. package/lib/rules/pilet-has-non-conflicting-css.js +27 -42
  144. package/lib/rules/pilet-has-non-conflicting-css.js.map +1 -1
  145. package/lib/rules/pilet-stays-small.js +20 -33
  146. package/lib/rules/pilet-stays-small.js.map +1 -1
  147. package/lib/rules/pilet-uses-latest-piral.js +17 -28
  148. package/lib/rules/pilet-uses-latest-piral.js.map +1 -1
  149. package/lib/rules/piral-has-valid-devDependencies.js +4 -1
  150. package/lib/rules/piral-has-valid-devDependencies.js.map +1 -1
  151. package/lib/runner.js +3 -12
  152. package/lib/runner.js.map +1 -1
  153. package/lib/select.js +21 -32
  154. package/lib/select.js.map +1 -1
  155. package/lib/start.js +6 -17
  156. package/lib/start.js.map +1 -1
  157. package/package.json +2 -2
  158. package/src/apps/build-piral.test.ts +1 -1
  159. package/src/common/package.ts +9 -2
  160. package/src/common/website.ts +43 -15
  161. package/src/injectors/pilet-injector.ts +12 -2
  162. package/src/messages.ts +93 -0
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.buildPiral = exports.buildPiralDefaults = void 0;
13
4
  const path_1 = require("path");
@@ -33,145 +24,140 @@ exports.buildPiralDefaults = {
33
24
  contentHash: true,
34
25
  optimizeModules: false,
35
26
  };
36
- function runLifecycle(root, scripts, type) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- const script = scripts === null || scripts === void 0 ? void 0 : scripts[type];
39
- if (script) {
40
- (0, common_1.log)('generalDebug_0003', `Running "${type}" ("${script}") ...`);
41
- yield (0, common_1.runScript)(script, root);
42
- (0, common_1.log)('generalDebug_0003', `Finished running "${type}".`);
43
- }
44
- else {
45
- (0, common_1.log)('generalDebug_0003', `No script for "${type}" found ...`);
46
- }
47
- });
27
+ async function runLifecycle(root, scripts, type) {
28
+ const script = scripts?.[type];
29
+ if (script) {
30
+ (0, common_1.log)('generalDebug_0003', `Running "${type}" ("${script}") ...`);
31
+ await (0, common_1.runScript)(script, root);
32
+ (0, common_1.log)('generalDebug_0003', `Finished running "${type}".`);
33
+ }
34
+ else {
35
+ (0, common_1.log)('generalDebug_0003', `No script for "${type}" found ...`);
36
+ }
48
37
  }
49
- function buildPiral(baseDir = process.cwd(), options = {}) {
50
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const { entry = exports.buildPiralDefaults.entry, target = exports.buildPiralDefaults.target, publicUrl: originalPublicUrl = exports.buildPiralDefaults.publicUrl, logLevel = exports.buildPiralDefaults.logLevel, minify = exports.buildPiralDefaults.minify, sourceMaps = exports.buildPiralDefaults.sourceMaps, watch = exports.buildPiralDefaults.watch, contentHash = exports.buildPiralDefaults.contentHash, subdir = exports.buildPiralDefaults.subdir, fresh = exports.buildPiralDefaults.fresh, type = exports.buildPiralDefaults.type, optimizeModules = exports.buildPiralDefaults.optimizeModules, _ = {}, hooks = {}, bundlerName, } = options;
53
- const publicUrl = (0, common_1.normalizePublicUrl)(originalPublicUrl);
54
- const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
55
- const useSubdir = type === 'all' || subdir;
56
- (0, common_1.setLogLevel)(logLevel);
57
- yield ((_a = hooks.onBegin) === null || _a === void 0 ? void 0 : _a.call(hooks, { options, fullBase }));
58
- (0, common_1.progress)('Reading configuration ...');
59
- const entryFiles = yield (0, common_1.retrievePiralRoot)(fullBase, entry);
60
- const { name, root, ignored, externals, scripts } = yield (0, common_1.retrievePiletsInfo)(entryFiles);
61
- const piralInstances = [name];
62
- const dest = (0, common_1.getDestination)(entryFiles, (0, path_1.resolve)(fullBase, target));
63
- yield (0, common_1.checkCliCompatibility)(root);
64
- (0, common_1.validateSharedDependencies)(externals);
65
- if (fresh) {
66
- (0, common_1.progress)('Removing output directory ...');
67
- yield (0, common_1.removeDirectory)(dest.outDir);
38
+ async function buildPiral(baseDir = process.cwd(), options = {}) {
39
+ const { entry = exports.buildPiralDefaults.entry, target = exports.buildPiralDefaults.target, publicUrl: originalPublicUrl = exports.buildPiralDefaults.publicUrl, logLevel = exports.buildPiralDefaults.logLevel, minify = exports.buildPiralDefaults.minify, sourceMaps = exports.buildPiralDefaults.sourceMaps, watch = exports.buildPiralDefaults.watch, contentHash = exports.buildPiralDefaults.contentHash, subdir = exports.buildPiralDefaults.subdir, fresh = exports.buildPiralDefaults.fresh, type = exports.buildPiralDefaults.type, optimizeModules = exports.buildPiralDefaults.optimizeModules, _ = {}, hooks = {}, bundlerName, } = options;
40
+ const publicUrl = (0, common_1.normalizePublicUrl)(originalPublicUrl);
41
+ const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
42
+ const useSubdir = type === 'all' || subdir;
43
+ (0, common_1.setLogLevel)(logLevel);
44
+ await hooks.onBegin?.({ options, fullBase });
45
+ (0, common_1.progress)('Reading configuration ...');
46
+ const entryFiles = await (0, common_1.retrievePiralRoot)(fullBase, entry);
47
+ const { name, root, ignored, externals, scripts } = await (0, common_1.retrievePiletsInfo)(entryFiles);
48
+ const piralInstances = [name];
49
+ const dest = (0, common_1.getDestination)(entryFiles, (0, path_1.resolve)(fullBase, target));
50
+ await (0, common_1.checkCliCompatibility)(root);
51
+ (0, common_1.validateSharedDependencies)(externals);
52
+ if (fresh) {
53
+ (0, common_1.progress)('Removing output directory ...');
54
+ await (0, common_1.removeDirectory)(dest.outDir);
55
+ }
56
+ // either 'emulator-*' or 'all'
57
+ if (type === emulatorName || type === emulatorSourcesName || type === emulatorWebsiteName || type === allName) {
58
+ const emulatorPublicUrl = '/';
59
+ const targetDir = useSubdir ? (0, path_1.join)(dest.outDir, emulatorName) : dest.outDir;
60
+ const appDir = type !== emulatorWebsiteName ? (0, path_1.join)(targetDir, 'app') : targetDir;
61
+ (0, common_1.progress)('Starting emulator build ...');
62
+ // since we create this anyway let's just pretend we want to have it clean!
63
+ await (0, common_1.removeDirectory)(targetDir);
64
+ await hooks.beforeBuild?.({ root, publicUrl: emulatorPublicUrl, externals, entryFiles, targetDir, piralInstances });
65
+ (0, common_1.logInfo)(`Bundle ${emulatorName} ...`);
66
+ const { dir: outDir, name: outFile, hash, } = await (0, bundler_1.callPiralBuild)({
67
+ root,
68
+ piralInstances,
69
+ emulator: true,
70
+ standalone: false,
71
+ optimizeModules,
72
+ sourceMaps,
73
+ watch,
74
+ contentHash,
75
+ minify: false,
76
+ externals: (0, common_1.flattenExternals)(externals),
77
+ publicUrl: emulatorPublicUrl,
78
+ entryFiles,
79
+ logLevel,
80
+ ignored,
81
+ outDir: appDir,
82
+ outFile: dest.outFile,
83
+ _,
84
+ }, bundlerName);
85
+ await hooks.afterBuild?.({
86
+ root,
87
+ publicUrl: emulatorPublicUrl,
88
+ externals,
89
+ entryFiles,
90
+ targetDir,
91
+ piralInstances,
92
+ hash,
93
+ outDir,
94
+ outFile,
95
+ });
96
+ await runLifecycle(root, scripts, 'piral:postbuild');
97
+ await runLifecycle(root, scripts, `piral:postbuild-${emulatorName}`);
98
+ await hooks.beforeEmulator?.({ root, externals, targetDir, outDir });
99
+ const rootDir = await (type !== emulatorWebsiteName
100
+ ? (0, common_1.createEmulatorSources)(root, externals, outDir, outFile, logLevel)
101
+ : (0, common_1.createEmulatorWebsite)(root, externals, outDir, outFile, logLevel));
102
+ await hooks.afterEmulator?.({ root, externals, targetDir, outDir, rootDir });
103
+ if (type === allName || type === emulatorName) {
104
+ await hooks.beforePackage?.({ root, externals, targetDir, outDir, rootDir });
105
+ await (0, common_1.packageEmulator)(rootDir);
106
+ await hooks.afterPackage?.({ root, externals, targetDir, outDir, rootDir });
107
+ (0, common_1.logDone)(`Emulator package available in "${rootDir}".`);
68
108
  }
69
- // either 'emulator-*' or 'all'
70
- if (type === emulatorName || type === emulatorSourcesName || type === emulatorWebsiteName || type === allName) {
71
- const emulatorPublicUrl = '/';
72
- const targetDir = useSubdir ? (0, path_1.join)(dest.outDir, emulatorName) : dest.outDir;
73
- const appDir = type !== emulatorWebsiteName ? (0, path_1.join)(targetDir, 'app') : targetDir;
74
- (0, common_1.progress)('Starting emulator build ...');
75
- // since we create this anyway let's just pretend we want to have it clean!
76
- yield (0, common_1.removeDirectory)(targetDir);
77
- yield ((_b = hooks.beforeBuild) === null || _b === void 0 ? void 0 : _b.call(hooks, { root, publicUrl: emulatorPublicUrl, externals, entryFiles, targetDir, piralInstances }));
78
- (0, common_1.logInfo)(`Bundle ${emulatorName} ...`);
79
- const { dir: outDir, name: outFile, hash, } = yield (0, bundler_1.callPiralBuild)({
80
- root,
81
- piralInstances,
82
- emulator: true,
83
- standalone: false,
84
- optimizeModules,
85
- sourceMaps,
86
- watch,
87
- contentHash,
88
- minify: false,
89
- externals: (0, common_1.flattenExternals)(externals),
90
- publicUrl: emulatorPublicUrl,
91
- entryFiles,
92
- logLevel,
93
- ignored,
94
- outDir: appDir,
95
- outFile: dest.outFile,
96
- _,
97
- }, bundlerName);
98
- yield ((_c = hooks.afterBuild) === null || _c === void 0 ? void 0 : _c.call(hooks, {
99
- root,
100
- publicUrl: emulatorPublicUrl,
101
- externals,
102
- entryFiles,
103
- targetDir,
104
- piralInstances,
105
- hash,
106
- outDir,
107
- outFile,
108
- }));
109
- yield runLifecycle(root, scripts, 'piral:postbuild');
110
- yield runLifecycle(root, scripts, `piral:postbuild-${emulatorName}`);
111
- yield ((_d = hooks.beforeEmulator) === null || _d === void 0 ? void 0 : _d.call(hooks, { root, externals, targetDir, outDir }));
112
- const rootDir = yield (type !== emulatorWebsiteName
113
- ? (0, common_1.createEmulatorSources)(root, externals, outDir, outFile, logLevel)
114
- : (0, common_1.createEmulatorWebsite)(root, externals, outDir, outFile, logLevel));
115
- yield ((_e = hooks.afterEmulator) === null || _e === void 0 ? void 0 : _e.call(hooks, { root, externals, targetDir, outDir, rootDir }));
116
- if (type === allName || type === emulatorName) {
117
- yield ((_f = hooks.beforePackage) === null || _f === void 0 ? void 0 : _f.call(hooks, { root, externals, targetDir, outDir, rootDir }));
118
- yield (0, common_1.packageEmulator)(rootDir);
119
- yield ((_g = hooks.afterPackage) === null || _g === void 0 ? void 0 : _g.call(hooks, { root, externals, targetDir, outDir, rootDir }));
120
- (0, common_1.logDone)(`Emulator package available in "${rootDir}".`);
121
- }
122
- else if (type === emulatorSourcesName) {
123
- (0, common_1.logDone)(`Emulator sources available in "${rootDir}".`);
124
- }
125
- else if (type === emulatorWebsiteName) {
126
- (0, common_1.logDone)(`Emulator website available in "${rootDir}".`);
127
- }
128
- (0, common_1.logReset)();
109
+ else if (type === emulatorSourcesName) {
110
+ (0, common_1.logDone)(`Emulator sources available in "${rootDir}".`);
129
111
  }
130
- // either 'release' or 'all'
131
- if (type === releaseName || type === allName) {
132
- const targetDir = useSubdir ? (0, path_1.join)(dest.outDir, releaseName) : dest.outDir;
133
- (0, common_1.progress)('Starting release build ...');
134
- // since we create this anyway let's just pretend we want to have it clean!
135
- yield (0, common_1.removeDirectory)(targetDir);
136
- (0, common_1.logInfo)(`Bundle ${releaseName} ...`);
137
- yield ((_h = hooks.beforeBuild) === null || _h === void 0 ? void 0 : _h.call(hooks, { root, publicUrl, externals, entryFiles, targetDir, piralInstances }));
138
- const { dir: outDir, name: outFile, hash, } = yield (0, bundler_1.callPiralBuild)({
139
- root,
140
- piralInstances,
141
- emulator: false,
142
- standalone: false,
143
- optimizeModules,
144
- sourceMaps,
145
- watch,
146
- contentHash,
147
- minify,
148
- externals: (0, common_1.flattenExternals)(externals),
149
- publicUrl,
150
- outFile: dest.outFile,
151
- outDir: targetDir,
152
- entryFiles,
153
- logLevel,
154
- ignored,
155
- _,
156
- }, bundlerName);
157
- yield ((_j = hooks.afterBuild) === null || _j === void 0 ? void 0 : _j.call(hooks, {
158
- root,
159
- publicUrl,
160
- externals,
161
- entryFiles,
162
- targetDir,
163
- piralInstances,
164
- outDir,
165
- outFile,
166
- hash,
167
- }));
168
- yield runLifecycle(root, scripts, 'piral:postbuild');
169
- yield runLifecycle(root, scripts, `piral:postbuild-${releaseName}`);
170
- (0, common_1.logDone)(`Files for publication available in "${outDir}".`);
171
- (0, common_1.logReset)();
112
+ else if (type === emulatorWebsiteName) {
113
+ (0, common_1.logDone)(`Emulator website available in "${rootDir}".`);
172
114
  }
173
- yield ((_k = hooks.onEnd) === null || _k === void 0 ? void 0 : _k.call(hooks, { root }));
174
- });
115
+ (0, common_1.logReset)();
116
+ }
117
+ // either 'release' or 'all'
118
+ if (type === releaseName || type === allName) {
119
+ const targetDir = useSubdir ? (0, path_1.join)(dest.outDir, releaseName) : dest.outDir;
120
+ (0, common_1.progress)('Starting release build ...');
121
+ // since we create this anyway let's just pretend we want to have it clean!
122
+ await (0, common_1.removeDirectory)(targetDir);
123
+ (0, common_1.logInfo)(`Bundle ${releaseName} ...`);
124
+ await hooks.beforeBuild?.({ root, publicUrl, externals, entryFiles, targetDir, piralInstances });
125
+ const { dir: outDir, name: outFile, hash, } = await (0, bundler_1.callPiralBuild)({
126
+ root,
127
+ piralInstances,
128
+ emulator: false,
129
+ standalone: false,
130
+ optimizeModules,
131
+ sourceMaps,
132
+ watch,
133
+ contentHash,
134
+ minify,
135
+ externals: (0, common_1.flattenExternals)(externals),
136
+ publicUrl,
137
+ outFile: dest.outFile,
138
+ outDir: targetDir,
139
+ entryFiles,
140
+ logLevel,
141
+ ignored,
142
+ _,
143
+ }, bundlerName);
144
+ await hooks.afterBuild?.({
145
+ root,
146
+ publicUrl,
147
+ externals,
148
+ entryFiles,
149
+ targetDir,
150
+ piralInstances,
151
+ outDir,
152
+ outFile,
153
+ hash,
154
+ });
155
+ await runLifecycle(root, scripts, 'piral:postbuild');
156
+ await runLifecycle(root, scripts, `piral:postbuild-${releaseName}`);
157
+ (0, common_1.logDone)(`Files for publication available in "${outDir}".`);
158
+ (0, common_1.logReset)();
159
+ }
160
+ await hooks.onEnd?.({ root });
175
161
  }
176
162
  exports.buildPiral = buildPiral;
177
163
  //# sourceMappingURL=build-piral.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-piral.js","sourceRoot":"","sources":["../../src/apps/build-piral.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAqC;AACrC,wCAA4C;AAC5C,oCAAqD;AACrD,sCAmBmB;AAEnB,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAwFlC,QAAA,kBAAkB,GAAsB;IACnD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,iBAAS,CAAC,IAAI;IACxB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,IAAI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K,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAChC,CAAC;AA/KD,gCA+KC"}
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.debugPilet = exports.debugPiletDefaults = void 0;
13
4
  const path_1 = require("path");
@@ -31,11 +22,11 @@ function byPort(a, b) {
31
22
  return a[1] - b[1];
32
23
  }
33
24
  function getOrMakeApps({ apps, publicUrl }, logLevel) {
34
- return Promise.all(apps.map(({ emulator, appFile, appPackage, appPort }) => __awaiter(this, void 0, void 0, function* () {
25
+ return Promise.all(apps.map(async ({ emulator, appFile, appPackage, appPort }) => {
35
26
  if (!emulator) {
36
27
  const piralInstances = [appPackage.name];
37
- const { externals, root, ignored } = yield (0, common_1.retrievePiletsInfo)(appFile);
38
- const { dir } = yield (0, bundler_1.callDebugPiralFromMonoRepo)({
28
+ const { externals, root, ignored } = await (0, common_1.retrievePiletsInfo)(appFile);
29
+ const { dir } = await (0, bundler_1.callDebugPiralFromMonoRepo)({
39
30
  root,
40
31
  optimizeModules: false,
41
32
  publicUrl,
@@ -49,7 +40,7 @@ function getOrMakeApps({ apps, publicUrl }, logLevel) {
49
40
  return [dir, appPort];
50
41
  }
51
42
  return [(0, path_1.dirname)(appFile), appPort];
52
- })));
43
+ }));
53
44
  }
54
45
  function checkSanity(pilets) {
55
46
  for (let i = 1; i < pilets.length; i++) {
@@ -81,119 +72,116 @@ function checkSanity(pilets) {
81
72
  }
82
73
  }
83
74
  }
84
- function debugPilet(baseDir = process.cwd(), options = {}) {
85
- var _a, _b;
86
- return __awaiter(this, void 0, void 0, function* () {
87
- const { entry = exports.debugPiletDefaults.entry, target = exports.debugPiletDefaults.target, open = exports.debugPiletDefaults.open, hmr = exports.debugPiletDefaults.hmr, port: originalPort = exports.debugPiletDefaults.port, publicUrl: originalPublicUrl = exports.debugPiletDefaults.publicUrl, logLevel = exports.debugPiletDefaults.logLevel, concurrency = exports.debugPiletDefaults.concurrency, krasrc: customkrasrc = exports.debugPiletDefaults.krasrc, optimizeModules = exports.debugPiletDefaults.optimizeModules, schemaVersion: originalSchemaVersion = exports.debugPiletDefaults.schemaVersion, _ = {}, hooks = {}, bundlerName, app, appInstanceDir, feed, } = options;
88
- const publicUrl = (0, common_1.normalizePublicUrl)(originalPublicUrl);
89
- const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
90
- (0, common_1.setLogLevel)(logLevel);
91
- yield ((_a = hooks.onBegin) === null || _a === void 0 ? void 0 : _a.call(hooks, { options, fullBase }));
92
- const watcherRef = yield (0, common_1.watcherTask)((watcherContext) => __awaiter(this, void 0, void 0, function* () {
93
- var _c, _d, _e, _f, _g;
94
- (0, common_1.progress)('Reading configuration ...');
95
- const entryList = Array.isArray(entry) ? entry : [entry];
96
- const multi = entryList.length > 1 || entryList[0].indexOf('*') !== -1;
97
- (0, common_1.log)('generalDebug_0003', `Looking for (${multi ? 'multi' : 'single'}) "${entryList.join('", "')}" in "${fullBase}".`);
98
- const allEntries = yield (0, common_1.matchAnyPilet)(fullBase, entryList);
99
- const maxListeners = Math.max(2 + allEntries.length * 2, 16);
100
- (0, common_1.log)('generalDebug_0003', `Found the following entries: ${allEntries.join(', ')}`);
101
- if (allEntries.length === 0) {
102
- (0, common_1.fail)('entryFileMissing_0077');
103
- }
104
- (_c = process.stderr) === null || _c === void 0 ? void 0 : _c.setMaxListeners(maxListeners);
105
- (_d = process.stdout) === null || _d === void 0 ? void 0 : _d.setMaxListeners(maxListeners);
106
- (_e = process.stdin) === null || _e === void 0 ? void 0 : _e.setMaxListeners(maxListeners);
107
- const pilets = yield (0, common_1.concurrentWorkers)(allEntries, concurrency, (entryModule) => __awaiter(this, void 0, void 0, function* () {
108
- var _h;
109
- const targetDir = (0, path_1.dirname)(entryModule);
110
- const { peerDependencies, peerModules, root, apps, ignored, importmap, schema } = yield (0, common_1.retrievePiletData)(targetDir, app);
111
- const schemaVersion = originalSchemaVersion || schema || common_1.config.schemaVersion || common_1.defaultSchemaVersion;
112
- const piralInstances = apps.map((m) => m.appPackage.name);
113
- const externals = (0, common_1.combinePiletExternals)(piralInstances, peerDependencies, peerModules, importmap);
114
- const mocks = (0, path_1.join)(targetDir, 'mocks');
115
- const dest = (0, path_1.resolve)(root, target);
116
- const outDir = (0, path_1.dirname)(dest);
117
- const outFile = (0, path_1.basename)(dest);
118
- const mocksExists = yield (0, common_1.checkExistingDirectory)(mocks);
119
- (0, common_1.validateSharedDependencies)(importmap);
120
- yield ((_h = hooks.beforeBuild) === null || _h === void 0 ? void 0 : _h.call(hooks, { root, publicUrl, importmap, entryModule, schemaVersion }));
121
- watcherContext.watch((0, path_1.join)(root, common_1.packageJson));
122
- watcherContext.watch((0, path_1.join)(root, common_1.piletJson));
123
- const bundler = yield (0, bundler_1.callPiletDebug)({
75
+ async function debugPilet(baseDir = process.cwd(), options = {}) {
76
+ const { entry = exports.debugPiletDefaults.entry, target = exports.debugPiletDefaults.target, open = exports.debugPiletDefaults.open, hmr = exports.debugPiletDefaults.hmr, port: originalPort = exports.debugPiletDefaults.port, publicUrl: originalPublicUrl = exports.debugPiletDefaults.publicUrl, logLevel = exports.debugPiletDefaults.logLevel, concurrency = exports.debugPiletDefaults.concurrency, krasrc: customkrasrc = exports.debugPiletDefaults.krasrc, optimizeModules = exports.debugPiletDefaults.optimizeModules, schemaVersion: originalSchemaVersion = exports.debugPiletDefaults.schemaVersion, _ = {}, hooks = {}, bundlerName, app, appInstanceDir, feed, } = options;
77
+ const publicUrl = (0, common_1.normalizePublicUrl)(originalPublicUrl);
78
+ const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
79
+ (0, common_1.setLogLevel)(logLevel);
80
+ await hooks.onBegin?.({ options, fullBase });
81
+ const watcherRef = await (0, common_1.watcherTask)(async (watcherContext) => {
82
+ (0, common_1.progress)('Reading configuration ...');
83
+ const entryList = Array.isArray(entry) ? entry : [entry];
84
+ const multi = entryList.length > 1 || entryList[0].indexOf('*') !== -1;
85
+ (0, common_1.log)('generalDebug_0003', `Looking for (${multi ? 'multi' : 'single'}) "${entryList.join('", "')}" in "${fullBase}".`);
86
+ const allEntries = await (0, common_1.matchAnyPilet)(fullBase, entryList);
87
+ const maxListeners = Math.max(2 + allEntries.length * 2, 16);
88
+ (0, common_1.log)('generalDebug_0003', `Found the following entries: ${allEntries.join(', ')}`);
89
+ if (allEntries.length === 0) {
90
+ (0, common_1.fail)('entryFileMissing_0077');
91
+ }
92
+ process.stderr?.setMaxListeners(maxListeners);
93
+ process.stdout?.setMaxListeners(maxListeners);
94
+ process.stdin?.setMaxListeners(maxListeners);
95
+ const pilets = await (0, common_1.concurrentWorkers)(allEntries, concurrency, async (entryModule) => {
96
+ const targetDir = (0, path_1.dirname)(entryModule);
97
+ const { peerDependencies, peerModules, root, apps, ignored, importmap, schema } = await (0, common_1.retrievePiletData)(targetDir, app);
98
+ const schemaVersion = originalSchemaVersion || schema || common_1.config.schemaVersion || common_1.defaultSchemaVersion;
99
+ const piralInstances = apps.map((m) => m.appPackage.name);
100
+ const externals = (0, common_1.combinePiletExternals)(piralInstances, peerDependencies, peerModules, importmap);
101
+ const mocks = (0, path_1.join)(targetDir, 'mocks');
102
+ const dest = (0, path_1.resolve)(root, target);
103
+ const outDir = (0, path_1.dirname)(dest);
104
+ const outFile = (0, path_1.basename)(dest);
105
+ const mocksExists = await (0, common_1.checkExistingDirectory)(mocks);
106
+ (0, common_1.validateSharedDependencies)(importmap);
107
+ await hooks.beforeBuild?.({ root, publicUrl, importmap, entryModule, schemaVersion });
108
+ watcherContext.watch((0, path_1.join)(root, common_1.packageJson));
109
+ watcherContext.watch((0, path_1.join)(root, common_1.piletJson));
110
+ const bundler = await (0, bundler_1.callPiletDebug)({
111
+ root,
112
+ piralInstances,
113
+ optimizeModules,
114
+ hmr,
115
+ externals,
116
+ targetDir,
117
+ importmap,
118
+ outFile,
119
+ outDir,
120
+ entryModule: `./${(0, path_1.relative)(root, entryModule)}`,
121
+ logLevel,
122
+ version: schemaVersion,
123
+ ignored,
124
+ _,
125
+ }, bundlerName);
126
+ bundler.on((args) => {
127
+ hooks.afterBuild?.({
128
+ ...args,
124
129
  root,
125
- piralInstances,
126
- optimizeModules,
127
- hmr,
128
- externals,
129
- targetDir,
130
+ publicUrl,
130
131
  importmap,
132
+ entryModule,
133
+ schemaVersion,
134
+ bundler,
131
135
  outFile,
132
136
  outDir,
133
- entryModule: `./${(0, path_1.relative)(root, entryModule)}`,
134
- logLevel,
135
- version: schemaVersion,
136
- ignored,
137
- _,
138
- }, bundlerName);
139
- bundler.on((args) => {
140
- var _a;
141
- (_a = hooks.afterBuild) === null || _a === void 0 ? void 0 : _a.call(hooks, Object.assign(Object.assign({}, args), { root,
142
- publicUrl,
143
- importmap,
144
- entryModule,
145
- schemaVersion,
146
- bundler,
147
- outFile,
148
- outDir }));
149
- });
150
- return {
151
- apps,
152
- publicUrl,
153
- externals,
154
- bundler,
155
- mocks: mocksExists ? mocks : undefined,
156
- root,
157
- };
158
- }));
159
- // sanity check see #250
160
- checkSanity(pilets);
161
- yield ((_f = hooks.beforeApp) === null || _f === void 0 ? void 0 : _f.call(hooks, { appInstanceDir, pilets }));
162
- const appInstances = appInstanceDir
163
- ? [[appInstanceDir, 0]]
164
- : yield getOrMakeApps(pilets[0], logLevel);
165
- Promise.all(pilets.map((p) => p.bundler.ready())).then(() => (0, common_1.logDone)(`Ready!`));
166
- pilets.forEach((p) => p.bundler.start());
167
- if (appInstances.length === 0) {
168
- appInstances.push([undefined, originalPort]);
169
- }
170
- yield Promise.all(appInstances.sort(byPort).map(([appDir, appPort], i) => __awaiter(this, void 0, void 0, function* () {
171
- const platform = (0, common_1.configurePlatform)();
172
- const suggestedPort = appPort || originalPort + i;
173
- yield platform.startModule({
174
- appDir,
175
- pilets,
176
- customkrasrc,
177
- feed,
178
- fullBase,
179
- hooks,
180
- open,
181
- originalPort: suggestedPort,
182
- publicUrl,
183
- maxListeners,
184
- registerEnd(cb) {
185
- return watcherContext.onClean(cb);
186
- },
187
- registerWatcher(file) {
188
- return watcherContext.watch(file);
189
- },
190
137
  });
191
- })));
192
- yield ((_g = hooks.afterApp) === null || _g === void 0 ? void 0 : _g.call(hooks, { appInstanceDir, pilets }));
138
+ });
139
+ return {
140
+ apps,
141
+ publicUrl,
142
+ externals,
143
+ bundler,
144
+ mocks: mocksExists ? mocks : undefined,
145
+ root,
146
+ };
147
+ });
148
+ // sanity check see #250
149
+ checkSanity(pilets);
150
+ await hooks.beforeApp?.({ appInstanceDir, pilets });
151
+ const appInstances = appInstanceDir
152
+ ? [[appInstanceDir, 0]]
153
+ : await getOrMakeApps(pilets[0], logLevel);
154
+ Promise.all(pilets.map((p) => p.bundler.ready())).then(() => (0, common_1.logDone)(`Ready!`));
155
+ pilets.forEach((p) => p.bundler.start());
156
+ if (appInstances.length === 0) {
157
+ appInstances.push([undefined, originalPort]);
158
+ }
159
+ await Promise.all(appInstances.sort(byPort).map(async ([appDir, appPort], i) => {
160
+ const platform = (0, common_1.configurePlatform)();
161
+ const suggestedPort = appPort || originalPort + i;
162
+ await platform.startModule({
163
+ appDir,
164
+ pilets,
165
+ customkrasrc,
166
+ feed,
167
+ fullBase,
168
+ hooks,
169
+ open,
170
+ originalPort: suggestedPort,
171
+ publicUrl,
172
+ maxListeners,
173
+ registerEnd(cb) {
174
+ return watcherContext.onClean(cb);
175
+ },
176
+ registerWatcher(file) {
177
+ return watcherContext.watch(file);
178
+ },
179
+ });
193
180
  }));
194
- yield Promise.all([watcherRef.end]);
195
- yield ((_b = hooks.onEnd) === null || _b === void 0 ? void 0 : _b.call(hooks, {}));
181
+ await hooks.afterApp?.({ appInstanceDir, pilets });
196
182
  });
183
+ await Promise.all([watcherRef.end]);
184
+ await hooks.onEnd?.({});
197
185
  }
198
186
  exports.debugPilet = debugPilet;
199
187
  //# sourceMappingURL=debug-pilet.js.map