@module-federation/cli 0.19.1 → 0.20.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.
- package/dist/index.cjs.js +117 -537
- package/dist/index.cjs.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -21,590 +21,170 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
21
21
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
22
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
23
|
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
-
***************************************************************************** */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} catch (e) {
|
|
42
|
-
reject(e);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function rejected(value) {
|
|
46
|
-
try {
|
|
47
|
-
step(generator["throw"](value));
|
|
48
|
-
} catch (e) {
|
|
49
|
-
reject(e);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function step(result) {
|
|
53
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
54
|
-
}
|
|
55
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
typeof SuppressedError === "function" ? SuppressedError : function _SuppressedError(error, suppressed, message) {
|
|
59
|
-
var e = new Error(message);
|
|
60
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
24
|
+
***************************************************************************** */
|
|
25
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
39
|
+
var e = new Error(message);
|
|
40
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
61
41
|
};
|
|
62
42
|
|
|
63
|
-
|
|
43
|
+
const applyCommonOptions = (command) => {
|
|
64
44
|
command.option('-c --config <config>', 'specify the configuration file, can be a relative or absolute path');
|
|
65
|
-
command.option('-m --mode <mode>', 'Specify the runtime environment. You can choose "dev" or "prod". The default value is "dev". After setting, the process.env.NODE_ENV environment variable will be automatically injected with "development" or "production" according to the value.',
|
|
66
|
-
|
|
45
|
+
command.option('-m --mode <mode>', 'Specify the runtime environment. You can choose "dev" or "prod". The default value is "dev". After setting, the process.env.NODE_ENV environment variable will be automatically injected with "development" or "production" according to the value.', (value) => {
|
|
46
|
+
const validChoices = {
|
|
67
47
|
dev: 'development',
|
|
68
|
-
prod: 'production'
|
|
48
|
+
prod: 'production',
|
|
69
49
|
};
|
|
70
50
|
if (!Object.keys(validChoices).includes(value)) {
|
|
71
|
-
throw new Error(
|
|
51
|
+
throw new Error(`Invalid mode: ${value}. Valid choices are: ${Object.keys(validChoices).join(', ')}`);
|
|
72
52
|
}
|
|
73
|
-
|
|
53
|
+
const targetEnv = validChoices[value];
|
|
74
54
|
if (process.env.NODE_ENV !== targetEnv) {
|
|
75
|
-
console.log(
|
|
55
|
+
console.log(`process.env.NODE_ENV is set to ${targetEnv}`);
|
|
76
56
|
}
|
|
77
57
|
process.env.NODE_ENV = targetEnv;
|
|
78
58
|
return value;
|
|
79
59
|
}, 'dev');
|
|
80
60
|
};
|
|
81
61
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
raw = strings.slice(0);
|
|
85
|
-
}
|
|
86
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
87
|
-
raw: {
|
|
88
|
-
value: Object.freeze(raw)
|
|
89
|
-
}
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
function _templateObject() {
|
|
93
|
-
var data = _tagged_template_literal([
|
|
94
|
-
"{bold {cyan ",
|
|
95
|
-
"}}"
|
|
96
|
-
]);
|
|
97
|
-
_templateObject = function _templateObject() {
|
|
98
|
-
return data;
|
|
99
|
-
};
|
|
100
|
-
return data;
|
|
101
|
-
}
|
|
102
|
-
var PREFIX = '[ Module Federation CLI ]';
|
|
103
|
-
var logger = sdk.createLogger(chalk(_templateObject(), PREFIX));
|
|
62
|
+
const PREFIX = '[ Module Federation CLI ]';
|
|
63
|
+
const logger = sdk.createLogger(chalk `{bold {cyan ${PREFIX}}}`);
|
|
104
64
|
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
case 4:
|
|
144
|
-
_.label++;
|
|
145
|
-
return {
|
|
146
|
-
value: op[1],
|
|
147
|
-
done: false
|
|
148
|
-
};
|
|
149
|
-
case 5:
|
|
150
|
-
_.label++;
|
|
151
|
-
y = op[1];
|
|
152
|
-
op = [
|
|
153
|
-
0
|
|
154
|
-
];
|
|
155
|
-
continue;
|
|
156
|
-
case 7:
|
|
157
|
-
op = _.ops.pop();
|
|
158
|
-
_.trys.pop();
|
|
159
|
-
continue;
|
|
160
|
-
default:
|
|
161
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
162
|
-
_ = 0;
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
166
|
-
_.label = op[1];
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
170
|
-
_.label = t[1];
|
|
171
|
-
t = op;
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
if (t && _.label < t[2]) {
|
|
175
|
-
_.label = t[2];
|
|
176
|
-
_.ops.push(op);
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
if (t[2]) _.ops.pop();
|
|
180
|
-
_.trys.pop();
|
|
181
|
-
continue;
|
|
65
|
+
function dts(options_1, _a) {
|
|
66
|
+
return __awaiter(this, arguments, void 0, function* (options, { readConfig }) {
|
|
67
|
+
const { fetch = true, generate = true, root = process.cwd(), output, config, } = options;
|
|
68
|
+
const mfConfig = yield readConfig(config);
|
|
69
|
+
if (!dtsPlugin.isTSProject(mfConfig.dts, root)) {
|
|
70
|
+
logger.error('dts is only supported for TypeScript projects');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const normalizedDtsOptions = dtsPlugin.normalizeDtsOptions(mfConfig, root, {
|
|
74
|
+
defaultGenerateOptions: {
|
|
75
|
+
generateAPITypes: true,
|
|
76
|
+
compileInChildProcess: false,
|
|
77
|
+
abortOnError: true,
|
|
78
|
+
extractThirdParty: false,
|
|
79
|
+
extractRemoteTypes: false,
|
|
80
|
+
},
|
|
81
|
+
defaultConsumeOptions: {
|
|
82
|
+
abortOnError: true,
|
|
83
|
+
consumeAPITypes: true,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
if (!normalizedDtsOptions) {
|
|
87
|
+
logger.error('dts is not enabled in module-federation.config.ts');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (fetch) {
|
|
91
|
+
const dtsManagerOptions = dtsPlugin.normalizeConsumeTypesOptions({
|
|
92
|
+
context: root,
|
|
93
|
+
dtsOptions: normalizedDtsOptions,
|
|
94
|
+
pluginOptions: mfConfig,
|
|
95
|
+
});
|
|
96
|
+
if (!dtsManagerOptions) {
|
|
97
|
+
logger.warn('dts.consumeTypes is not enabled in module-federation.config.ts, skip fetching remote types');
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
logger.debug('start fetching remote types...');
|
|
101
|
+
yield dtsPlugin.consumeTypesAPI(dtsManagerOptions);
|
|
102
|
+
logger.debug('fetch remote types success!');
|
|
182
103
|
}
|
|
183
|
-
op = body.call(thisArg, _);
|
|
184
|
-
} catch (e) {
|
|
185
|
-
op = [
|
|
186
|
-
6,
|
|
187
|
-
e
|
|
188
|
-
];
|
|
189
|
-
y = 0;
|
|
190
|
-
} finally{
|
|
191
|
-
f = t = 0;
|
|
192
104
|
}
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return _ts_generator$2(this, function(_state) {
|
|
204
|
-
switch(_state.label){
|
|
205
|
-
case 0:
|
|
206
|
-
readConfig = param.readConfig;
|
|
207
|
-
_options_fetch = options.fetch, fetch = _options_fetch === void 0 ? true : _options_fetch, _options_generate = options.generate, generate = _options_generate === void 0 ? true : _options_generate, _options_root = options.root, root = _options_root === void 0 ? process.cwd() : _options_root, output = options.output, config = options.config;
|
|
208
|
-
return [
|
|
209
|
-
4,
|
|
210
|
-
readConfig(config)
|
|
211
|
-
];
|
|
212
|
-
case 1:
|
|
213
|
-
mfConfig = _state.sent();
|
|
214
|
-
if (!dtsPlugin.isTSProject(mfConfig.dts, root)) {
|
|
215
|
-
logger.error('dts is only supported for TypeScript projects');
|
|
216
|
-
return [
|
|
217
|
-
2
|
|
218
|
-
];
|
|
219
|
-
}
|
|
220
|
-
normalizedDtsOptions = dtsPlugin.normalizeDtsOptions(mfConfig, root, {
|
|
221
|
-
defaultGenerateOptions: {
|
|
222
|
-
generateAPITypes: true,
|
|
223
|
-
compileInChildProcess: false,
|
|
224
|
-
abortOnError: true,
|
|
225
|
-
extractThirdParty: false,
|
|
226
|
-
extractRemoteTypes: false
|
|
227
|
-
},
|
|
228
|
-
defaultConsumeOptions: {
|
|
229
|
-
abortOnError: true,
|
|
230
|
-
consumeAPITypes: true
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
if (!normalizedDtsOptions) {
|
|
234
|
-
logger.error('dts is not enabled in module-federation.config.ts');
|
|
235
|
-
return [
|
|
236
|
-
2
|
|
237
|
-
];
|
|
238
|
-
}
|
|
239
|
-
if (!fetch) return [
|
|
240
|
-
3,
|
|
241
|
-
4
|
|
242
|
-
];
|
|
243
|
-
dtsManagerOptions = dtsPlugin.normalizeConsumeTypesOptions({
|
|
244
|
-
context: root,
|
|
245
|
-
dtsOptions: normalizedDtsOptions,
|
|
246
|
-
pluginOptions: mfConfig
|
|
247
|
-
});
|
|
248
|
-
if (!!dtsManagerOptions) return [
|
|
249
|
-
3,
|
|
250
|
-
2
|
|
251
|
-
];
|
|
252
|
-
logger.warn('dts.consumeTypes is not enabled in module-federation.config.ts, skip fetching remote types');
|
|
253
|
-
return [
|
|
254
|
-
3,
|
|
255
|
-
4
|
|
256
|
-
];
|
|
257
|
-
case 2:
|
|
258
|
-
logger.debug('start fetching remote types...');
|
|
259
|
-
return [
|
|
260
|
-
4,
|
|
261
|
-
dtsPlugin.consumeTypesAPI(dtsManagerOptions)
|
|
262
|
-
];
|
|
263
|
-
case 3:
|
|
264
|
-
_state.sent();
|
|
265
|
-
logger.debug('fetch remote types success!');
|
|
266
|
-
_state.label = 4;
|
|
267
|
-
case 4:
|
|
268
|
-
if (!generate) return [
|
|
269
|
-
3,
|
|
270
|
-
6
|
|
271
|
-
];
|
|
272
|
-
dtsManagerOptions1 = dtsPlugin.normalizeGenerateTypesOptions({
|
|
273
|
-
context: root,
|
|
274
|
-
outputDir: output,
|
|
275
|
-
dtsOptions: normalizedDtsOptions,
|
|
276
|
-
pluginOptions: mfConfig
|
|
277
|
-
});
|
|
278
|
-
if (!dtsManagerOptions1) {
|
|
279
|
-
logger.warn('dts.generateTypes is not enabled in module-federation.config.ts, skip generating types');
|
|
280
|
-
return [
|
|
281
|
-
2
|
|
282
|
-
];
|
|
283
|
-
}
|
|
284
|
-
logger.debug('start generating types...');
|
|
285
|
-
return [
|
|
286
|
-
4,
|
|
287
|
-
dtsPlugin.generateTypesAPI({
|
|
288
|
-
dtsManagerOptions: dtsManagerOptions1
|
|
289
|
-
})
|
|
290
|
-
];
|
|
291
|
-
case 5:
|
|
292
|
-
_state.sent();
|
|
293
|
-
logger.debug('generate types success!');
|
|
294
|
-
_state.label = 6;
|
|
295
|
-
case 6:
|
|
296
|
-
return [
|
|
297
|
-
2
|
|
298
|
-
];
|
|
105
|
+
if (generate) {
|
|
106
|
+
const dtsManagerOptions = dtsPlugin.normalizeGenerateTypesOptions({
|
|
107
|
+
context: root,
|
|
108
|
+
outputDir: output,
|
|
109
|
+
dtsOptions: normalizedDtsOptions,
|
|
110
|
+
pluginOptions: mfConfig,
|
|
111
|
+
});
|
|
112
|
+
if (!dtsManagerOptions) {
|
|
113
|
+
logger.warn('dts.generateTypes is not enabled in module-federation.config.ts, skip generating types');
|
|
114
|
+
return;
|
|
299
115
|
}
|
|
300
|
-
|
|
116
|
+
logger.debug('start generating types...');
|
|
117
|
+
yield dtsPlugin.generateTypesAPI({ dtsManagerOptions });
|
|
118
|
+
logger.debug('generate types success!');
|
|
119
|
+
}
|
|
301
120
|
});
|
|
302
121
|
}
|
|
303
122
|
|
|
304
|
-
function prepareCli(
|
|
305
|
-
var welcomeMsg = param.welcomeMsg;
|
|
123
|
+
function prepareCli({ welcomeMsg }) {
|
|
306
124
|
if (!process.env.NODE_ENV) {
|
|
307
125
|
process.env.NODE_ENV = 'development';
|
|
308
126
|
}
|
|
309
|
-
|
|
310
|
-
if (!npm_execpath ||
|
|
127
|
+
const { npm_execpath } = process.env;
|
|
128
|
+
if (!npm_execpath ||
|
|
129
|
+
npm_execpath.includes('npx-cli.js') ||
|
|
130
|
+
npm_execpath.includes('.bun')) {
|
|
311
131
|
console.log();
|
|
312
132
|
}
|
|
313
133
|
logger.info(welcomeMsg);
|
|
314
134
|
}
|
|
315
135
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
trys: [],
|
|
324
|
-
ops: []
|
|
325
|
-
};
|
|
326
|
-
return g = {
|
|
327
|
-
next: verb(0),
|
|
328
|
-
"throw": verb(1),
|
|
329
|
-
"return": verb(2)
|
|
330
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
331
|
-
return this;
|
|
332
|
-
}), g;
|
|
333
|
-
function verb(n) {
|
|
334
|
-
return function(v) {
|
|
335
|
-
return step([
|
|
336
|
-
n,
|
|
337
|
-
v
|
|
338
|
-
]);
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
function step(op) {
|
|
342
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
343
|
-
while(_)try {
|
|
344
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
345
|
-
if (y = 0, t) op = [
|
|
346
|
-
op[0] & 2,
|
|
347
|
-
t.value
|
|
348
|
-
];
|
|
349
|
-
switch(op[0]){
|
|
350
|
-
case 0:
|
|
351
|
-
case 1:
|
|
352
|
-
t = op;
|
|
353
|
-
break;
|
|
354
|
-
case 4:
|
|
355
|
-
_.label++;
|
|
356
|
-
return {
|
|
357
|
-
value: op[1],
|
|
358
|
-
done: false
|
|
359
|
-
};
|
|
360
|
-
case 5:
|
|
361
|
-
_.label++;
|
|
362
|
-
y = op[1];
|
|
363
|
-
op = [
|
|
364
|
-
0
|
|
365
|
-
];
|
|
366
|
-
continue;
|
|
367
|
-
case 7:
|
|
368
|
-
op = _.ops.pop();
|
|
369
|
-
_.trys.pop();
|
|
370
|
-
continue;
|
|
371
|
-
default:
|
|
372
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
373
|
-
_ = 0;
|
|
374
|
-
continue;
|
|
375
|
-
}
|
|
376
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
377
|
-
_.label = op[1];
|
|
378
|
-
break;
|
|
379
|
-
}
|
|
380
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
381
|
-
_.label = t[1];
|
|
382
|
-
t = op;
|
|
383
|
-
break;
|
|
384
|
-
}
|
|
385
|
-
if (t && _.label < t[2]) {
|
|
386
|
-
_.label = t[2];
|
|
387
|
-
_.ops.push(op);
|
|
388
|
-
break;
|
|
389
|
-
}
|
|
390
|
-
if (t[2]) _.ops.pop();
|
|
391
|
-
_.trys.pop();
|
|
392
|
-
continue;
|
|
393
|
-
}
|
|
394
|
-
op = body.call(thisArg, _);
|
|
395
|
-
} catch (e) {
|
|
396
|
-
op = [
|
|
397
|
-
6,
|
|
398
|
-
e
|
|
399
|
-
];
|
|
400
|
-
y = 0;
|
|
401
|
-
} finally{
|
|
402
|
-
f = t = 0;
|
|
403
|
-
}
|
|
404
|
-
if (op[0] & 5) throw op[1];
|
|
405
|
-
return {
|
|
406
|
-
value: op[0] ? op[1] : void 0,
|
|
407
|
-
done: true
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
var DEFAULT_CONFIG_PATH = 'module-federation.config.ts';
|
|
412
|
-
var getConfigPath = function(userConfigPath) {
|
|
413
|
-
var defaultPath = path.resolve(process.cwd(), DEFAULT_CONFIG_PATH);
|
|
414
|
-
var filepath = userConfigPath !== null && userConfigPath !== void 0 ? userConfigPath : defaultPath;
|
|
415
|
-
return path.isAbsolute(filepath) ? filepath : path.resolve(process.cwd(), filepath);
|
|
136
|
+
const DEFAULT_CONFIG_PATH = 'module-federation.config.ts';
|
|
137
|
+
const getConfigPath = (userConfigPath) => {
|
|
138
|
+
const defaultPath = path.resolve(process.cwd(), DEFAULT_CONFIG_PATH);
|
|
139
|
+
const filepath = userConfigPath !== null && userConfigPath !== void 0 ? userConfigPath : defaultPath;
|
|
140
|
+
return path.isAbsolute(filepath)
|
|
141
|
+
? filepath
|
|
142
|
+
: path.resolve(process.cwd(), filepath);
|
|
416
143
|
};
|
|
417
144
|
function readConfig(userConfigPath) {
|
|
418
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
return [
|
|
425
|
-
4,
|
|
426
|
-
nodeBundleRequire.bundle(configPath)
|
|
427
|
-
];
|
|
428
|
-
case 1:
|
|
429
|
-
preBundlePath = _state.sent();
|
|
430
|
-
return [
|
|
431
|
-
4,
|
|
432
|
-
import(url.pathToFileURL(preBundlePath).href)
|
|
433
|
-
];
|
|
434
|
-
case 2:
|
|
435
|
-
mfConfig = _state.sent().default.default;
|
|
436
|
-
return [
|
|
437
|
-
2,
|
|
438
|
-
mfConfig
|
|
439
|
-
];
|
|
440
|
-
}
|
|
441
|
-
});
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
const configPath = getConfigPath(userConfigPath);
|
|
147
|
+
const preBundlePath = yield nodeBundleRequire.bundle(configPath);
|
|
148
|
+
const mfConfig = (yield import(url.pathToFileURL(preBundlePath).href)).default
|
|
149
|
+
.default;
|
|
150
|
+
return mfConfig;
|
|
442
151
|
});
|
|
443
152
|
}
|
|
444
153
|
|
|
445
|
-
function _ts_generator(thisArg, body) {
|
|
446
|
-
var f, y, t, g, _ = {
|
|
447
|
-
label: 0,
|
|
448
|
-
sent: function() {
|
|
449
|
-
if (t[0] & 1) throw t[1];
|
|
450
|
-
return t[1];
|
|
451
|
-
},
|
|
452
|
-
trys: [],
|
|
453
|
-
ops: []
|
|
454
|
-
};
|
|
455
|
-
return g = {
|
|
456
|
-
next: verb(0),
|
|
457
|
-
"throw": verb(1),
|
|
458
|
-
"return": verb(2)
|
|
459
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
460
|
-
return this;
|
|
461
|
-
}), g;
|
|
462
|
-
function verb(n) {
|
|
463
|
-
return function(v) {
|
|
464
|
-
return step([
|
|
465
|
-
n,
|
|
466
|
-
v
|
|
467
|
-
]);
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
function step(op) {
|
|
471
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
472
|
-
while(_)try {
|
|
473
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
474
|
-
if (y = 0, t) op = [
|
|
475
|
-
op[0] & 2,
|
|
476
|
-
t.value
|
|
477
|
-
];
|
|
478
|
-
switch(op[0]){
|
|
479
|
-
case 0:
|
|
480
|
-
case 1:
|
|
481
|
-
t = op;
|
|
482
|
-
break;
|
|
483
|
-
case 4:
|
|
484
|
-
_.label++;
|
|
485
|
-
return {
|
|
486
|
-
value: op[1],
|
|
487
|
-
done: false
|
|
488
|
-
};
|
|
489
|
-
case 5:
|
|
490
|
-
_.label++;
|
|
491
|
-
y = op[1];
|
|
492
|
-
op = [
|
|
493
|
-
0
|
|
494
|
-
];
|
|
495
|
-
continue;
|
|
496
|
-
case 7:
|
|
497
|
-
op = _.ops.pop();
|
|
498
|
-
_.trys.pop();
|
|
499
|
-
continue;
|
|
500
|
-
default:
|
|
501
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
502
|
-
_ = 0;
|
|
503
|
-
continue;
|
|
504
|
-
}
|
|
505
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
506
|
-
_.label = op[1];
|
|
507
|
-
break;
|
|
508
|
-
}
|
|
509
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
510
|
-
_.label = t[1];
|
|
511
|
-
t = op;
|
|
512
|
-
break;
|
|
513
|
-
}
|
|
514
|
-
if (t && _.label < t[2]) {
|
|
515
|
-
_.label = t[2];
|
|
516
|
-
_.ops.push(op);
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
if (t[2]) _.ops.pop();
|
|
520
|
-
_.trys.pop();
|
|
521
|
-
continue;
|
|
522
|
-
}
|
|
523
|
-
op = body.call(thisArg, _);
|
|
524
|
-
} catch (e) {
|
|
525
|
-
op = [
|
|
526
|
-
6,
|
|
527
|
-
e
|
|
528
|
-
];
|
|
529
|
-
y = 0;
|
|
530
|
-
} finally{
|
|
531
|
-
f = t = 0;
|
|
532
|
-
}
|
|
533
|
-
if (op[0] & 5) throw op[1];
|
|
534
|
-
return {
|
|
535
|
-
value: op[0] ? op[1] : void 0,
|
|
536
|
-
done: true
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
154
|
function cli(cliOptions) {
|
|
541
|
-
|
|
542
|
-
var name = cliOptions.name, version = cliOptions.version, applyCommands = cliOptions.applyCommands;
|
|
155
|
+
const { name, version, applyCommands } = cliOptions;
|
|
543
156
|
commander.program.name(name).usage('<command> [options]').version(version);
|
|
544
|
-
|
|
545
|
-
dtsCommand
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
157
|
+
const dtsCommand = commander.program.command('dts');
|
|
158
|
+
dtsCommand
|
|
159
|
+
.option('--root <root>', 'specify the project root directory')
|
|
160
|
+
.option('--output <output>', 'specify the generated dts output directory')
|
|
161
|
+
.option('--fetch <boolean>', 'fetch types from remote, default is true', (value) => value === 'true', true)
|
|
162
|
+
.option('--generate <boolean>', 'generate types, default is true', (value) => value === 'true', true);
|
|
550
163
|
applyCommonOptions(dtsCommand);
|
|
551
|
-
dtsCommand
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
]);
|
|
563
|
-
return [
|
|
564
|
-
4,
|
|
565
|
-
dts(options, cliOptions)
|
|
566
|
-
];
|
|
567
|
-
case 1:
|
|
568
|
-
_state.sent();
|
|
569
|
-
return [
|
|
570
|
-
3,
|
|
571
|
-
3
|
|
572
|
-
];
|
|
573
|
-
case 2:
|
|
574
|
-
err = _state.sent();
|
|
575
|
-
console.error(err);
|
|
576
|
-
process.exit(1);
|
|
577
|
-
return [
|
|
578
|
-
3,
|
|
579
|
-
3
|
|
580
|
-
];
|
|
581
|
-
case 3:
|
|
582
|
-
return [
|
|
583
|
-
2
|
|
584
|
-
];
|
|
585
|
-
}
|
|
586
|
-
});
|
|
587
|
-
});
|
|
588
|
-
});
|
|
164
|
+
dtsCommand
|
|
165
|
+
.description('generate or fetch the mf types')
|
|
166
|
+
.action((options) => __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
try {
|
|
168
|
+
yield dts(options, cliOptions);
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
console.error(err);
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
}));
|
|
589
175
|
if (typeof applyCommands === 'function') {
|
|
590
176
|
applyCommands(commander.program, applyCommonOptions);
|
|
591
177
|
}
|
|
592
178
|
commander.program.parse();
|
|
593
179
|
}
|
|
594
180
|
function runCli(options) {
|
|
595
|
-
|
|
596
|
-
loggerPrefix: PREFIX,
|
|
597
|
-
welcomeMsg: "".concat("Module Federation v".concat("0.19.1"), "\n"),
|
|
598
|
-
name: 'mf',
|
|
599
|
-
readConfig: readConfig,
|
|
600
|
-
version: "0.19.1",
|
|
601
|
-
applyCommands: function() {}
|
|
602
|
-
}, options);
|
|
181
|
+
const normalizedOptions = Object.assign({ loggerPrefix: PREFIX, welcomeMsg: `${`Module Federation v${"0.20.0"}`}\n`, name: 'mf', readConfig, version: "0.20.0", applyCommands: () => { } }, options);
|
|
603
182
|
logger.setPrefix(normalizedOptions.loggerPrefix);
|
|
604
183
|
prepareCli(normalizedOptions);
|
|
605
184
|
try {
|
|
606
185
|
cli(normalizedOptions);
|
|
607
|
-
}
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
608
188
|
console.error(err);
|
|
609
189
|
}
|
|
610
190
|
}
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/@rollup+plugin-typescript@12.1.2_rollup@4.40.0_tslib@2.8.1_typescript@5.8.3/node_modules/tslib/tslib.es6.js","../src/utils/apply-common-options.ts","../src/utils/logger.ts","../src/commands/dts.ts","../src/utils/prepare.ts","../src/utils/readConfig.ts","../src/cli.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","export const applyCommonOptions = (command) => {\n command.option('-c --config <config>', 'specify the configuration file, can be a relative or absolute path');\n command.option('-m --mode <mode>', 'Specify the runtime environment. You can choose \"dev\" or \"prod\". The default value is \"dev\". After setting, the process.env.NODE_ENV environment variable will be automatically injected with \"development\" or \"production\" according to the value.', (value) => {\n const validChoices = {\n dev: 'development',\n prod: 'production',\n };\n if (!Object.keys(validChoices).includes(value)) {\n throw new Error(`Invalid mode: ${value}. Valid choices are: ${Object.keys(validChoices).join(', ')}`);\n }\n const targetEnv = validChoices[value];\n if (process.env.NODE_ENV !== targetEnv) {\n console.log(`process.env.NODE_ENV is set to ${targetEnv}`);\n }\n process.env.NODE_ENV = targetEnv;\n return value;\n }, 'dev');\n};\n","import { createLogger } from '@module-federation/sdk';\nimport chalk from 'chalk';\nexport const PREFIX = '[ Module Federation CLI ]';\nconst logger = createLogger(chalk `{bold {cyan ${PREFIX}}}`);\nexport default logger;\n","import { __awaiter } from \"tslib\";\nimport { isTSProject, normalizeDtsOptions, generateTypesAPI, consumeTypesAPI, normalizeGenerateTypesOptions, normalizeConsumeTypesOptions, } from '@module-federation/dts-plugin';\nimport logger from '../utils/logger';\nexport function dts(options_1, _a) {\n return __awaiter(this, arguments, void 0, function* (options, { readConfig }) {\n const { fetch = true, generate = true, root = process.cwd(), output, config, } = options;\n const mfConfig = yield readConfig(config);\n if (!isTSProject(mfConfig.dts, root)) {\n logger.error('dts is only supported for TypeScript projects');\n return;\n }\n const normalizedDtsOptions = normalizeDtsOptions(mfConfig, root, {\n defaultGenerateOptions: {\n generateAPITypes: true,\n compileInChildProcess: false,\n abortOnError: true,\n extractThirdParty: false,\n extractRemoteTypes: false,\n },\n defaultConsumeOptions: {\n abortOnError: true,\n consumeAPITypes: true,\n },\n });\n if (!normalizedDtsOptions) {\n logger.error('dts is not enabled in module-federation.config.ts');\n return;\n }\n if (fetch) {\n const dtsManagerOptions = normalizeConsumeTypesOptions({\n context: root,\n dtsOptions: normalizedDtsOptions,\n pluginOptions: mfConfig,\n });\n if (!dtsManagerOptions) {\n logger.warn('dts.consumeTypes is not enabled in module-federation.config.ts, skip fetching remote types');\n }\n else {\n logger.debug('start fetching remote types...');\n yield consumeTypesAPI(dtsManagerOptions);\n logger.debug('fetch remote types success!');\n }\n }\n if (generate) {\n const dtsManagerOptions = normalizeGenerateTypesOptions({\n context: root,\n outputDir: output,\n dtsOptions: normalizedDtsOptions,\n pluginOptions: mfConfig,\n });\n if (!dtsManagerOptions) {\n logger.warn('dts.generateTypes is not enabled in module-federation.config.ts, skip generating types');\n return;\n }\n logger.debug('start generating types...');\n yield generateTypesAPI({ dtsManagerOptions });\n logger.debug('generate types success!');\n }\n });\n}\n","import logger from './logger';\nexport function prepareCli({ welcomeMsg }) {\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = 'development';\n }\n const { npm_execpath } = process.env;\n if (!npm_execpath ||\n npm_execpath.includes('npx-cli.js') ||\n npm_execpath.includes('.bun')) {\n console.log();\n }\n logger.info(welcomeMsg);\n}\n","import { __awaiter } from \"tslib\";\nimport path from 'path';\nimport { bundle } from '@modern-js/node-bundle-require';\nimport { pathToFileURL } from 'url';\nconst DEFAULT_CONFIG_PATH = 'module-federation.config.ts';\nexport const getConfigPath = (userConfigPath) => {\n const defaultPath = path.resolve(process.cwd(), DEFAULT_CONFIG_PATH);\n const filepath = userConfigPath !== null && userConfigPath !== void 0 ? userConfigPath : defaultPath;\n return path.isAbsolute(filepath)\n ? filepath\n : path.resolve(process.cwd(), filepath);\n};\nexport function readConfig(userConfigPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const configPath = getConfigPath(userConfigPath);\n const preBundlePath = yield bundle(configPath);\n const mfConfig = (yield import(pathToFileURL(preBundlePath).href)).default\n .default;\n return mfConfig;\n });\n}\n","import { __awaiter } from \"tslib\";\nimport { program } from 'commander';\nimport { applyCommonOptions } from './utils/apply-common-options';\nimport { dts } from './commands/dts';\nimport { prepareCli } from './utils/prepare';\nimport logger, { PREFIX } from './utils/logger';\nimport { readConfig } from './utils/readConfig';\nfunction cli(cliOptions) {\n const { name, version, applyCommands } = cliOptions;\n program.name(name).usage('<command> [options]').version(version);\n const dtsCommand = program.command('dts');\n dtsCommand\n .option('--root <root>', 'specify the project root directory')\n .option('--output <output>', 'specify the generated dts output directory')\n .option('--fetch <boolean>', 'fetch types from remote, default is true', (value) => value === 'true', true)\n .option('--generate <boolean>', 'generate types, default is true', (value) => value === 'true', true);\n applyCommonOptions(dtsCommand);\n dtsCommand\n .description('generate or fetch the mf types')\n .action((options) => __awaiter(this, void 0, void 0, function* () {\n try {\n yield dts(options, cliOptions);\n }\n catch (err) {\n console.error(err);\n process.exit(1);\n }\n }));\n if (typeof applyCommands === 'function') {\n applyCommands(program, applyCommonOptions);\n }\n program.parse();\n}\nexport function runCli(options) {\n const normalizedOptions = Object.assign({ loggerPrefix: PREFIX, welcomeMsg: `${`Module Federation v${__VERSION__}`}\\n`, name: 'mf', readConfig, version: __VERSION__, applyCommands: () => { } }, options);\n logger.setPrefix(normalizedOptions.loggerPrefix);\n prepareCli(normalizedOptions);\n try {\n cli(normalizedOptions);\n }\n catch (err) {\n console.error(err);\n }\n}\n"],"names":["createLogger","isTSProject","normalizeDtsOptions","normalizeConsumeTypesOptions","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AAE,UAAU,EAAE,OAAO,EAAE,QAAW,EAAE,aAAa,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,CAAC;AAC9M,IAAI,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,YAAY,CAAC;AACpD,IAAI,UAAU,CAAC,iBAAiB,CAAC;AACjC,IAAI,IAAI;AACR,QAAQ,GAAG,CAAC,iBAAiB,CAAC;AAC9B;AACA,IAAI,OAAO,GAAG,EAAE;AAChB,QAAQ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;AAC1B;AACA;;;;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Module Federation CLI",
|
|
6
6
|
"homepage": "https://module-federation.io",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"commander": "11.1.0",
|
|
27
27
|
"chalk": "3.0.0",
|
|
28
28
|
"@modern-js/node-bundle-require": "2.68.2",
|
|
29
|
-
"@module-federation/
|
|
30
|
-
"@module-federation/
|
|
29
|
+
"@module-federation/sdk": "0.20.0",
|
|
30
|
+
"@module-federation/dts-plugin": "0.20.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "~16.11.7"
|