@module-federation/cli 0.24.1 → 2.0.1
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/bin/mf.js +1 -1
- package/dist/cli.js +123 -0
- package/dist/commands/dts.js +130 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +58 -0
- package/dist/types.js +31 -0
- package/dist/utils/apply-common-options.js +68 -0
- package/dist/utils/logger.js +79 -0
- package/dist/utils/prepare.js +83 -0
- package/dist/utils/readConfig.js +122 -0
- package/package.json +4 -4
- package/dist/__tests__/fixtures/complex-config.d.ts +0 -18
- package/dist/__tests__/fixtures/test-config.d.ts +0 -22
- package/dist/__tests__/readConfig.integration.test.d.ts +0 -1
- package/dist/index.cjs.js +0 -199
- package/dist/index.cjs.js.map +0 -1
- package/dist/src/index.d.ts +0 -1
- /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
- /package/dist/{src/commands → commands}/dts.d.ts +0 -0
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{src/utils → utils}/apply-common-options.d.ts +0 -0
- /package/dist/{src/utils → utils}/logger.d.ts +0 -0
- /package/dist/{src/utils → utils}/prepare.d.ts +0 -0
- /package/dist/{src/utils → utils}/readConfig.d.ts +0 -0
package/bin/mf.js
CHANGED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/compat_get_default_export
|
|
14
|
+
(() => {
|
|
15
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
16
|
+
__webpack_require__.n = (module) => {
|
|
17
|
+
var getter = module && module.__esModule ?
|
|
18
|
+
() => (module['default']) :
|
|
19
|
+
() => (module);
|
|
20
|
+
__webpack_require__.d(getter, { a: getter });
|
|
21
|
+
return getter;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
})();
|
|
25
|
+
// webpack/runtime/define_property_getters
|
|
26
|
+
(() => {
|
|
27
|
+
__webpack_require__.d = (exports, definition) => {
|
|
28
|
+
for(var key in definition) {
|
|
29
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
// webpack/runtime/has_own_property
|
|
36
|
+
(() => {
|
|
37
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
38
|
+
})();
|
|
39
|
+
// webpack/runtime/make_namespace_object
|
|
40
|
+
(() => {
|
|
41
|
+
// define __esModule on exports
|
|
42
|
+
__webpack_require__.r = (exports) => {
|
|
43
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
44
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
45
|
+
}
|
|
46
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
/************************************************************************/
|
|
50
|
+
var __webpack_exports__ = {};
|
|
51
|
+
// ESM COMPAT FLAG
|
|
52
|
+
__webpack_require__.r(__webpack_exports__);
|
|
53
|
+
|
|
54
|
+
// EXPORTS
|
|
55
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
56
|
+
runCli: () => (/* binding */ runCli)
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
;// CONCATENATED MODULE: external "commander"
|
|
60
|
+
const external_commander_namespaceObject = require("commander");
|
|
61
|
+
;// CONCATENATED MODULE: external "./utils/apply-common-options.js"
|
|
62
|
+
const apply_common_options_js_namespaceObject = require("./utils/apply-common-options.js");
|
|
63
|
+
;// CONCATENATED MODULE: external "./commands/dts.js"
|
|
64
|
+
const dts_js_namespaceObject = require("./commands/dts.js");
|
|
65
|
+
;// CONCATENATED MODULE: external "./utils/prepare.js"
|
|
66
|
+
const prepare_js_namespaceObject = require("./utils/prepare.js");
|
|
67
|
+
;// CONCATENATED MODULE: external "./utils/logger.js"
|
|
68
|
+
const logger_js_namespaceObject = require("./utils/logger.js");
|
|
69
|
+
var logger_js_default = /*#__PURE__*/__webpack_require__.n(logger_js_namespaceObject);
|
|
70
|
+
;// CONCATENATED MODULE: external "./utils/readConfig.js"
|
|
71
|
+
const readConfig_js_namespaceObject = require("./utils/readConfig.js");
|
|
72
|
+
;// CONCATENATED MODULE: ./src/cli.ts
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
function cli(cliOptions) {
|
|
80
|
+
const { name, version, applyCommands } = cliOptions;
|
|
81
|
+
external_commander_namespaceObject.program.name(name).usage('<command> [options]').version(version);
|
|
82
|
+
const dtsCommand = external_commander_namespaceObject.program.command('dts');
|
|
83
|
+
dtsCommand.option('--root <root>', 'specify the project root directory').option('--output <output>', 'specify the generated dts output directory').option('--fetch <boolean>', 'fetch types from remote, default is true', (value)=>value === 'true', true).option('--generate <boolean>', 'generate types, default is true', (value)=>value === 'true', true);
|
|
84
|
+
(0,apply_common_options_js_namespaceObject.applyCommonOptions)(dtsCommand);
|
|
85
|
+
dtsCommand.description('generate or fetch the mf types').action(async (options)=>{
|
|
86
|
+
try {
|
|
87
|
+
await (0,dts_js_namespaceObject.dts)(options, cliOptions);
|
|
88
|
+
} catch (err) {
|
|
89
|
+
console.error(err);
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if (typeof applyCommands === 'function') {
|
|
94
|
+
applyCommands(external_commander_namespaceObject.program, apply_common_options_js_namespaceObject.applyCommonOptions);
|
|
95
|
+
}
|
|
96
|
+
external_commander_namespaceObject.program.parse();
|
|
97
|
+
}
|
|
98
|
+
function runCli(options) {
|
|
99
|
+
const normalizedOptions = {
|
|
100
|
+
loggerPrefix: logger_js_namespaceObject.PREFIX,
|
|
101
|
+
welcomeMsg: `${`Module Federation v${"2.0.1"}`}\n`,
|
|
102
|
+
name: 'mf',
|
|
103
|
+
readConfig: readConfig_js_namespaceObject.readConfig,
|
|
104
|
+
version: "2.0.1",
|
|
105
|
+
applyCommands: ()=>{},
|
|
106
|
+
...options
|
|
107
|
+
};
|
|
108
|
+
logger_js_default().setPrefix(normalizedOptions.loggerPrefix);
|
|
109
|
+
(0,prepare_js_namespaceObject.prepareCli)(normalizedOptions);
|
|
110
|
+
try {
|
|
111
|
+
cli(normalizedOptions);
|
|
112
|
+
} catch (err) {
|
|
113
|
+
console.error(err);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
exports.runCli = __webpack_exports__.runCli;
|
|
118
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
119
|
+
if(["runCli"].indexOf(__webpack_i__) === -1) {
|
|
120
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/compat_get_default_export
|
|
14
|
+
(() => {
|
|
15
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
16
|
+
__webpack_require__.n = (module) => {
|
|
17
|
+
var getter = module && module.__esModule ?
|
|
18
|
+
() => (module['default']) :
|
|
19
|
+
() => (module);
|
|
20
|
+
__webpack_require__.d(getter, { a: getter });
|
|
21
|
+
return getter;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
})();
|
|
25
|
+
// webpack/runtime/define_property_getters
|
|
26
|
+
(() => {
|
|
27
|
+
__webpack_require__.d = (exports, definition) => {
|
|
28
|
+
for(var key in definition) {
|
|
29
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
// webpack/runtime/has_own_property
|
|
36
|
+
(() => {
|
|
37
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
38
|
+
})();
|
|
39
|
+
// webpack/runtime/make_namespace_object
|
|
40
|
+
(() => {
|
|
41
|
+
// define __esModule on exports
|
|
42
|
+
__webpack_require__.r = (exports) => {
|
|
43
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
44
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
45
|
+
}
|
|
46
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
/************************************************************************/
|
|
50
|
+
var __webpack_exports__ = {};
|
|
51
|
+
// ESM COMPAT FLAG
|
|
52
|
+
__webpack_require__.r(__webpack_exports__);
|
|
53
|
+
|
|
54
|
+
// EXPORTS
|
|
55
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
56
|
+
dts: () => (/* binding */ dts)
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
;// CONCATENATED MODULE: external "@module-federation/dts-plugin"
|
|
60
|
+
const dts_plugin_namespaceObject = require("@module-federation/dts-plugin");
|
|
61
|
+
;// CONCATENATED MODULE: external "../utils/logger.js"
|
|
62
|
+
const logger_js_namespaceObject = require("../utils/logger.js");
|
|
63
|
+
var logger_js_default = /*#__PURE__*/__webpack_require__.n(logger_js_namespaceObject);
|
|
64
|
+
;// CONCATENATED MODULE: ./src/commands/dts.ts
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
async function dts(options, { readConfig }) {
|
|
68
|
+
const { fetch = true, generate = true, root = process.cwd(), output, config } = options;
|
|
69
|
+
const mfConfig = await readConfig(config);
|
|
70
|
+
if (!(0,dts_plugin_namespaceObject.isTSProject)(mfConfig.dts, root)) {
|
|
71
|
+
logger_js_default().error('dts is only supported for TypeScript projects');
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const normalizedDtsOptions = (0,dts_plugin_namespaceObject.normalizeDtsOptions)(mfConfig, root, {
|
|
75
|
+
defaultGenerateOptions: {
|
|
76
|
+
generateAPITypes: true,
|
|
77
|
+
compileInChildProcess: false,
|
|
78
|
+
abortOnError: true,
|
|
79
|
+
extractThirdParty: false,
|
|
80
|
+
extractRemoteTypes: false
|
|
81
|
+
},
|
|
82
|
+
defaultConsumeOptions: {
|
|
83
|
+
abortOnError: true,
|
|
84
|
+
consumeAPITypes: true
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
if (!normalizedDtsOptions) {
|
|
88
|
+
logger_js_default().error('dts is not enabled in module-federation.config.ts');
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (fetch) {
|
|
92
|
+
const dtsManagerOptions = (0,dts_plugin_namespaceObject.normalizeConsumeTypesOptions)({
|
|
93
|
+
context: root,
|
|
94
|
+
dtsOptions: normalizedDtsOptions,
|
|
95
|
+
pluginOptions: mfConfig
|
|
96
|
+
});
|
|
97
|
+
if (!dtsManagerOptions) {
|
|
98
|
+
logger_js_default().warn('dts.consumeTypes is not enabled in module-federation.config.ts, skip fetching remote types');
|
|
99
|
+
} else {
|
|
100
|
+
logger_js_default().debug('start fetching remote types...');
|
|
101
|
+
await (0,dts_plugin_namespaceObject.consumeTypesAPI)(dtsManagerOptions);
|
|
102
|
+
logger_js_default().debug('fetch remote types success!');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (generate) {
|
|
106
|
+
const dtsManagerOptions = (0,dts_plugin_namespaceObject.normalizeGenerateTypesOptions)({
|
|
107
|
+
context: root,
|
|
108
|
+
outputDir: output,
|
|
109
|
+
dtsOptions: normalizedDtsOptions,
|
|
110
|
+
pluginOptions: mfConfig
|
|
111
|
+
});
|
|
112
|
+
if (!dtsManagerOptions) {
|
|
113
|
+
logger_js_default().warn('dts.generateTypes is not enabled in module-federation.config.ts, skip generating types');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
logger_js_default().debug('start generating types...');
|
|
117
|
+
await (0,dts_plugin_namespaceObject.generateTypesAPI)({
|
|
118
|
+
dtsManagerOptions
|
|
119
|
+
});
|
|
120
|
+
logger_js_default().debug('generate types success!');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
exports.dts = __webpack_exports__.dts;
|
|
125
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
126
|
+
if(["dts"].indexOf(__webpack_i__) === -1) {
|
|
127
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { runCli } from './cli';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
// ESM COMPAT FLAG
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
|
|
42
|
+
// EXPORTS
|
|
43
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
runCli: () => (/* reexport */ external_cli_js_namespaceObject.runCli)
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
;// CONCATENATED MODULE: external "./cli.js"
|
|
48
|
+
const external_cli_js_namespaceObject = require("./cli.js");
|
|
49
|
+
;// CONCATENATED MODULE: ./src/index.ts
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
exports.runCli = __webpack_exports__.runCli;
|
|
53
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
54
|
+
if(["runCli"].indexOf(__webpack_i__) === -1) {
|
|
55
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/make_namespace_object
|
|
14
|
+
(() => {
|
|
15
|
+
// define __esModule on exports
|
|
16
|
+
__webpack_require__.r = (exports) => {
|
|
17
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
18
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
/************************************************************************/
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
29
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
30
|
+
}
|
|
31
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
__webpack_require__.r(__webpack_exports__);
|
|
40
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
41
|
+
applyCommonOptions: () => (applyCommonOptions)
|
|
42
|
+
});
|
|
43
|
+
const applyCommonOptions = (command)=>{
|
|
44
|
+
command.option('-c --config <config>', 'specify the configuration file, can be a relative or absolute path');
|
|
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 = {
|
|
47
|
+
dev: 'development',
|
|
48
|
+
prod: 'production'
|
|
49
|
+
};
|
|
50
|
+
if (!Object.keys(validChoices).includes(value)) {
|
|
51
|
+
throw new Error(`Invalid mode: ${value}. Valid choices are: ${Object.keys(validChoices).join(', ')}`);
|
|
52
|
+
}
|
|
53
|
+
const targetEnv = validChoices[value];
|
|
54
|
+
if (process.env.NODE_ENV !== targetEnv) {
|
|
55
|
+
console.log(`process.env.NODE_ENV is set to ${targetEnv}`);
|
|
56
|
+
}
|
|
57
|
+
process.env.NODE_ENV = targetEnv;
|
|
58
|
+
return value;
|
|
59
|
+
}, 'dev');
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
exports.applyCommonOptions = __webpack_exports__.applyCommonOptions;
|
|
63
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
64
|
+
if(["applyCommonOptions"].indexOf(__webpack_i__) === -1) {
|
|
65
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/compat_get_default_export
|
|
14
|
+
(() => {
|
|
15
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
16
|
+
__webpack_require__.n = (module) => {
|
|
17
|
+
var getter = module && module.__esModule ?
|
|
18
|
+
() => (module['default']) :
|
|
19
|
+
() => (module);
|
|
20
|
+
__webpack_require__.d(getter, { a: getter });
|
|
21
|
+
return getter;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
})();
|
|
25
|
+
// webpack/runtime/define_property_getters
|
|
26
|
+
(() => {
|
|
27
|
+
__webpack_require__.d = (exports, definition) => {
|
|
28
|
+
for(var key in definition) {
|
|
29
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
// webpack/runtime/has_own_property
|
|
36
|
+
(() => {
|
|
37
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
38
|
+
})();
|
|
39
|
+
// webpack/runtime/make_namespace_object
|
|
40
|
+
(() => {
|
|
41
|
+
// define __esModule on exports
|
|
42
|
+
__webpack_require__.r = (exports) => {
|
|
43
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
44
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
45
|
+
}
|
|
46
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
/************************************************************************/
|
|
50
|
+
var __webpack_exports__ = {};
|
|
51
|
+
// ESM COMPAT FLAG
|
|
52
|
+
__webpack_require__.r(__webpack_exports__);
|
|
53
|
+
|
|
54
|
+
// EXPORTS
|
|
55
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
56
|
+
PREFIX: () => (/* binding */ PREFIX),
|
|
57
|
+
"default": () => (/* binding */ utils_logger)
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
;// CONCATENATED MODULE: external "@module-federation/sdk"
|
|
61
|
+
const sdk_namespaceObject = require("@module-federation/sdk");
|
|
62
|
+
;// CONCATENATED MODULE: external "chalk"
|
|
63
|
+
const external_chalk_namespaceObject = require("chalk");
|
|
64
|
+
var external_chalk_default = /*#__PURE__*/__webpack_require__.n(external_chalk_namespaceObject);
|
|
65
|
+
;// CONCATENATED MODULE: ./src/utils/logger.ts
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const PREFIX = '[ Module Federation CLI ]';
|
|
69
|
+
const logger = (0,sdk_namespaceObject.createLogger)(external_chalk_default()`{bold {cyan ${PREFIX}}}`);
|
|
70
|
+
/* ESM default export */ const utils_logger = (logger);
|
|
71
|
+
|
|
72
|
+
exports.PREFIX = __webpack_exports__.PREFIX;
|
|
73
|
+
exports["default"] = __webpack_exports__["default"];
|
|
74
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
75
|
+
if(["PREFIX","default"].indexOf(__webpack_i__) === -1) {
|
|
76
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/compat_get_default_export
|
|
14
|
+
(() => {
|
|
15
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
16
|
+
__webpack_require__.n = (module) => {
|
|
17
|
+
var getter = module && module.__esModule ?
|
|
18
|
+
() => (module['default']) :
|
|
19
|
+
() => (module);
|
|
20
|
+
__webpack_require__.d(getter, { a: getter });
|
|
21
|
+
return getter;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
})();
|
|
25
|
+
// webpack/runtime/define_property_getters
|
|
26
|
+
(() => {
|
|
27
|
+
__webpack_require__.d = (exports, definition) => {
|
|
28
|
+
for(var key in definition) {
|
|
29
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
// webpack/runtime/has_own_property
|
|
36
|
+
(() => {
|
|
37
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
38
|
+
})();
|
|
39
|
+
// webpack/runtime/make_namespace_object
|
|
40
|
+
(() => {
|
|
41
|
+
// define __esModule on exports
|
|
42
|
+
__webpack_require__.r = (exports) => {
|
|
43
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
44
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
45
|
+
}
|
|
46
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
/************************************************************************/
|
|
50
|
+
var __webpack_exports__ = {};
|
|
51
|
+
// ESM COMPAT FLAG
|
|
52
|
+
__webpack_require__.r(__webpack_exports__);
|
|
53
|
+
|
|
54
|
+
// EXPORTS
|
|
55
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
56
|
+
prepareCli: () => (/* binding */ prepareCli)
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
;// CONCATENATED MODULE: external "./logger.js"
|
|
60
|
+
const external_logger_js_namespaceObject = require("./logger.js");
|
|
61
|
+
var external_logger_js_default = /*#__PURE__*/__webpack_require__.n(external_logger_js_namespaceObject);
|
|
62
|
+
;// CONCATENATED MODULE: ./src/utils/prepare.ts
|
|
63
|
+
|
|
64
|
+
function prepareCli({ welcomeMsg }) {
|
|
65
|
+
if (!process.env.NODE_ENV) {
|
|
66
|
+
process.env.NODE_ENV = 'development';
|
|
67
|
+
}
|
|
68
|
+
// Print a blank line to keep the greet log nice.
|
|
69
|
+
// Some package managers automatically output a blank line, some do not.
|
|
70
|
+
const { npm_execpath } = process.env;
|
|
71
|
+
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) {
|
|
72
|
+
console.log();
|
|
73
|
+
}
|
|
74
|
+
external_logger_js_default().info(welcomeMsg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
exports.prepareCli = __webpack_exports__.prepareCli;
|
|
78
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
79
|
+
if(["prepareCli"].indexOf(__webpack_i__) === -1) {
|
|
80
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
var __webpack_modules__ = ({
|
|
10
|
+
"jiti": (function (module) {
|
|
11
|
+
module.exports = require("jiti");
|
|
12
|
+
|
|
13
|
+
}),
|
|
14
|
+
|
|
15
|
+
});
|
|
16
|
+
/************************************************************************/
|
|
17
|
+
// The module cache
|
|
18
|
+
var __webpack_module_cache__ = {};
|
|
19
|
+
|
|
20
|
+
// The require function
|
|
21
|
+
function __webpack_require__(moduleId) {
|
|
22
|
+
|
|
23
|
+
// Check if module is in cache
|
|
24
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
25
|
+
if (cachedModule !== undefined) {
|
|
26
|
+
return cachedModule.exports;
|
|
27
|
+
}
|
|
28
|
+
// Create a new module (and put it into the cache)
|
|
29
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
30
|
+
exports: {}
|
|
31
|
+
});
|
|
32
|
+
// Execute the module function
|
|
33
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
34
|
+
|
|
35
|
+
// Return the exports of the module
|
|
36
|
+
return module.exports;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/************************************************************************/
|
|
41
|
+
// webpack/runtime/compat_get_default_export
|
|
42
|
+
(() => {
|
|
43
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
44
|
+
__webpack_require__.n = (module) => {
|
|
45
|
+
var getter = module && module.__esModule ?
|
|
46
|
+
() => (module['default']) :
|
|
47
|
+
() => (module);
|
|
48
|
+
__webpack_require__.d(getter, { a: getter });
|
|
49
|
+
return getter;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
})();
|
|
53
|
+
// webpack/runtime/define_property_getters
|
|
54
|
+
(() => {
|
|
55
|
+
__webpack_require__.d = (exports, definition) => {
|
|
56
|
+
for(var key in definition) {
|
|
57
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
58
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
// webpack/runtime/has_own_property
|
|
64
|
+
(() => {
|
|
65
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
66
|
+
})();
|
|
67
|
+
// webpack/runtime/make_namespace_object
|
|
68
|
+
(() => {
|
|
69
|
+
// define __esModule on exports
|
|
70
|
+
__webpack_require__.r = (exports) => {
|
|
71
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
72
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
73
|
+
}
|
|
74
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
/************************************************************************/
|
|
78
|
+
var __webpack_exports__ = {};
|
|
79
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
80
|
+
(() => {
|
|
81
|
+
// ESM COMPAT FLAG
|
|
82
|
+
__webpack_require__.r(__webpack_exports__);
|
|
83
|
+
|
|
84
|
+
// EXPORTS
|
|
85
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
86
|
+
getConfigPath: () => (/* binding */ getConfigPath),
|
|
87
|
+
readConfig: () => (/* binding */ readConfig)
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
;// CONCATENATED MODULE: external "path"
|
|
91
|
+
const external_path_namespaceObject = require("path");
|
|
92
|
+
var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_namespaceObject);
|
|
93
|
+
;// CONCATENATED MODULE: ./src/utils/readConfig.ts
|
|
94
|
+
|
|
95
|
+
const { createJiti } = __webpack_require__("jiti");
|
|
96
|
+
const DEFAULT_CONFIG_PATH = 'module-federation.config.ts';
|
|
97
|
+
const getConfigPath = (userConfigPath)=>{
|
|
98
|
+
const defaultPath = external_path_default().resolve(process.cwd(), DEFAULT_CONFIG_PATH);
|
|
99
|
+
const filepath = userConfigPath ?? defaultPath;
|
|
100
|
+
return external_path_default().isAbsolute(filepath) ? filepath : external_path_default().resolve(process.cwd(), filepath);
|
|
101
|
+
};
|
|
102
|
+
async function readConfig(userConfigPath) {
|
|
103
|
+
const configPath = getConfigPath(userConfigPath);
|
|
104
|
+
const jit = createJiti(__filename, {
|
|
105
|
+
interopDefault: true,
|
|
106
|
+
esmResolve: true
|
|
107
|
+
});
|
|
108
|
+
const configModule = await jit(configPath);
|
|
109
|
+
const resolvedConfig = configModule && typeof configModule === 'object' && 'default' in configModule ? configModule.default : configModule;
|
|
110
|
+
return resolvedConfig;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
})();
|
|
114
|
+
|
|
115
|
+
exports.getConfigPath = __webpack_exports__.getConfigPath;
|
|
116
|
+
exports.readConfig = __webpack_exports__.readConfig;
|
|
117
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
118
|
+
if(["getConfigPath","readConfig"].indexOf(__webpack_i__) === -1) {
|
|
119
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Module Federation CLI",
|
|
6
6
|
"homepage": "https://module-federation.io",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"main": "./dist/index.
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
23
|
"bin"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"commander": "11.1.0",
|
|
27
27
|
"chalk": "3.0.0",
|
|
28
28
|
"jiti": "2.4.2",
|
|
29
|
-
"@module-federation/sdk": "0.
|
|
30
|
-
"@module-federation/dts-plugin": "0.
|
|
29
|
+
"@module-federation/sdk": "2.0.1",
|
|
30
|
+
"@module-federation/dts-plugin": "2.0.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^20.19.5"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface SharedConfig {
|
|
2
|
-
singleton?: boolean;
|
|
3
|
-
requiredVersion?: string;
|
|
4
|
-
strictVersion?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: {
|
|
7
|
-
name: string;
|
|
8
|
-
filename: string;
|
|
9
|
-
exposes: {
|
|
10
|
-
"./Button": string;
|
|
11
|
-
"./Header": string;
|
|
12
|
-
"./Footer": string;
|
|
13
|
-
};
|
|
14
|
-
shared: Record<string, SharedConfig>;
|
|
15
|
-
remotes: Record<string, string>;
|
|
16
|
-
sharedScope: "default";
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
name: string;
|
|
3
|
-
filename: string;
|
|
4
|
-
exposes: {
|
|
5
|
-
'./Button': string;
|
|
6
|
-
'./Header': string;
|
|
7
|
-
};
|
|
8
|
-
shared: {
|
|
9
|
-
react: {
|
|
10
|
-
singleton: boolean;
|
|
11
|
-
requiredVersion: string;
|
|
12
|
-
};
|
|
13
|
-
'react-dom': {
|
|
14
|
-
singleton: boolean;
|
|
15
|
-
requiredVersion: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
remotes: {
|
|
19
|
-
'remote-app': string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/index.cjs.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var commander = require('commander');
|
|
4
|
-
var dtsPlugin = require('@module-federation/dts-plugin');
|
|
5
|
-
var sdk = require('@module-federation/sdk');
|
|
6
|
-
var chalk = require('chalk');
|
|
7
|
-
var path = require('path');
|
|
8
|
-
|
|
9
|
-
/******************************************************************************
|
|
10
|
-
Copyright (c) Microsoft Corporation.
|
|
11
|
-
|
|
12
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
-
purpose with or without fee is hereby granted.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
-
***************************************************************************** */
|
|
23
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
27
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
37
|
-
var e = new Error(message);
|
|
38
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const applyCommonOptions = (command) => {
|
|
42
|
-
command.option('-c --config <config>', 'specify the configuration file, can be a relative or absolute path');
|
|
43
|
-
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) => {
|
|
44
|
-
const validChoices = {
|
|
45
|
-
dev: 'development',
|
|
46
|
-
prod: 'production',
|
|
47
|
-
};
|
|
48
|
-
if (!Object.keys(validChoices).includes(value)) {
|
|
49
|
-
throw new Error(`Invalid mode: ${value}. Valid choices are: ${Object.keys(validChoices).join(', ')}`);
|
|
50
|
-
}
|
|
51
|
-
const targetEnv = validChoices[value];
|
|
52
|
-
if (process.env.NODE_ENV !== targetEnv) {
|
|
53
|
-
console.log(`process.env.NODE_ENV is set to ${targetEnv}`);
|
|
54
|
-
}
|
|
55
|
-
process.env.NODE_ENV = targetEnv;
|
|
56
|
-
return value;
|
|
57
|
-
}, 'dev');
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const PREFIX = '[ Module Federation CLI ]';
|
|
61
|
-
const logger = sdk.createLogger(chalk `{bold {cyan ${PREFIX}}}`);
|
|
62
|
-
|
|
63
|
-
function dts(options_1, _a) {
|
|
64
|
-
return __awaiter(this, arguments, void 0, function* (options, { readConfig }) {
|
|
65
|
-
const { fetch = true, generate = true, root = process.cwd(), output, config, } = options;
|
|
66
|
-
const mfConfig = yield readConfig(config);
|
|
67
|
-
if (!dtsPlugin.isTSProject(mfConfig.dts, root)) {
|
|
68
|
-
logger.error('dts is only supported for TypeScript projects');
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const normalizedDtsOptions = dtsPlugin.normalizeDtsOptions(mfConfig, root, {
|
|
72
|
-
defaultGenerateOptions: {
|
|
73
|
-
generateAPITypes: true,
|
|
74
|
-
compileInChildProcess: false,
|
|
75
|
-
abortOnError: true,
|
|
76
|
-
extractThirdParty: false,
|
|
77
|
-
extractRemoteTypes: false,
|
|
78
|
-
},
|
|
79
|
-
defaultConsumeOptions: {
|
|
80
|
-
abortOnError: true,
|
|
81
|
-
consumeAPITypes: true,
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
if (!normalizedDtsOptions) {
|
|
85
|
-
logger.error('dts is not enabled in module-federation.config.ts');
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (fetch) {
|
|
89
|
-
const dtsManagerOptions = dtsPlugin.normalizeConsumeTypesOptions({
|
|
90
|
-
context: root,
|
|
91
|
-
dtsOptions: normalizedDtsOptions,
|
|
92
|
-
pluginOptions: mfConfig,
|
|
93
|
-
});
|
|
94
|
-
if (!dtsManagerOptions) {
|
|
95
|
-
logger.warn('dts.consumeTypes is not enabled in module-federation.config.ts, skip fetching remote types');
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
logger.debug('start fetching remote types...');
|
|
99
|
-
yield dtsPlugin.consumeTypesAPI(dtsManagerOptions);
|
|
100
|
-
logger.debug('fetch remote types success!');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (generate) {
|
|
104
|
-
const dtsManagerOptions = dtsPlugin.normalizeGenerateTypesOptions({
|
|
105
|
-
context: root,
|
|
106
|
-
outputDir: output,
|
|
107
|
-
dtsOptions: normalizedDtsOptions,
|
|
108
|
-
pluginOptions: mfConfig,
|
|
109
|
-
});
|
|
110
|
-
if (!dtsManagerOptions) {
|
|
111
|
-
logger.warn('dts.generateTypes is not enabled in module-federation.config.ts, skip generating types');
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
logger.debug('start generating types...');
|
|
115
|
-
yield dtsPlugin.generateTypesAPI({ dtsManagerOptions });
|
|
116
|
-
logger.debug('generate types success!');
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function prepareCli({ welcomeMsg }) {
|
|
122
|
-
if (!process.env.NODE_ENV) {
|
|
123
|
-
process.env.NODE_ENV = 'development';
|
|
124
|
-
}
|
|
125
|
-
const { npm_execpath } = process.env;
|
|
126
|
-
if (!npm_execpath ||
|
|
127
|
-
npm_execpath.includes('npx-cli.js') ||
|
|
128
|
-
npm_execpath.includes('.bun')) {
|
|
129
|
-
console.log();
|
|
130
|
-
}
|
|
131
|
-
logger.info(welcomeMsg);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const { createJiti } = require('jiti');
|
|
135
|
-
const DEFAULT_CONFIG_PATH = 'module-federation.config.ts';
|
|
136
|
-
const getConfigPath = (userConfigPath) => {
|
|
137
|
-
const defaultPath = path.resolve(process.cwd(), DEFAULT_CONFIG_PATH);
|
|
138
|
-
const filepath = userConfigPath !== null && userConfigPath !== void 0 ? userConfigPath : defaultPath;
|
|
139
|
-
return path.isAbsolute(filepath)
|
|
140
|
-
? filepath
|
|
141
|
-
: path.resolve(process.cwd(), filepath);
|
|
142
|
-
};
|
|
143
|
-
function readConfig(userConfigPath) {
|
|
144
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
const configPath = getConfigPath(userConfigPath);
|
|
146
|
-
const jit = createJiti(__filename, {
|
|
147
|
-
interopDefault: true,
|
|
148
|
-
esmResolve: true,
|
|
149
|
-
});
|
|
150
|
-
const configModule = yield jit(configPath);
|
|
151
|
-
const resolvedConfig = (configModule &&
|
|
152
|
-
typeof configModule === 'object' &&
|
|
153
|
-
'default' in configModule
|
|
154
|
-
? configModule.default
|
|
155
|
-
: configModule);
|
|
156
|
-
return resolvedConfig;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function cli(cliOptions) {
|
|
161
|
-
const { name, version, applyCommands } = cliOptions;
|
|
162
|
-
commander.program.name(name).usage('<command> [options]').version(version);
|
|
163
|
-
const dtsCommand = commander.program.command('dts');
|
|
164
|
-
dtsCommand
|
|
165
|
-
.option('--root <root>', 'specify the project root directory')
|
|
166
|
-
.option('--output <output>', 'specify the generated dts output directory')
|
|
167
|
-
.option('--fetch <boolean>', 'fetch types from remote, default is true', (value) => value === 'true', true)
|
|
168
|
-
.option('--generate <boolean>', 'generate types, default is true', (value) => value === 'true', true);
|
|
169
|
-
applyCommonOptions(dtsCommand);
|
|
170
|
-
dtsCommand
|
|
171
|
-
.description('generate or fetch the mf types')
|
|
172
|
-
.action((options) => __awaiter(this, void 0, void 0, function* () {
|
|
173
|
-
try {
|
|
174
|
-
yield dts(options, cliOptions);
|
|
175
|
-
}
|
|
176
|
-
catch (err) {
|
|
177
|
-
console.error(err);
|
|
178
|
-
process.exit(1);
|
|
179
|
-
}
|
|
180
|
-
}));
|
|
181
|
-
if (typeof applyCommands === 'function') {
|
|
182
|
-
applyCommands(commander.program, applyCommonOptions);
|
|
183
|
-
}
|
|
184
|
-
commander.program.parse();
|
|
185
|
-
}
|
|
186
|
-
function runCli(options) {
|
|
187
|
-
const normalizedOptions = Object.assign({ loggerPrefix: PREFIX, welcomeMsg: `${`Module Federation v${"0.24.1"}`}\n`, name: 'mf', readConfig, version: "0.24.1", applyCommands: () => { } }, options);
|
|
188
|
-
logger.setPrefix(normalizedOptions.loggerPrefix);
|
|
189
|
-
prepareCli(normalizedOptions);
|
|
190
|
-
try {
|
|
191
|
-
cli(normalizedOptions);
|
|
192
|
-
}
|
|
193
|
-
catch (err) {
|
|
194
|
-
console.error(err);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
exports.runCli = runCli;
|
|
199
|
-
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/@rollup+plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.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';\nconst { createJiti } = require('jiti');\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 jit = createJiti(__filename, {\n interopDefault: true,\n esmResolve: true,\n });\n const configModule = yield jit(configPath);\n const resolvedConfig = (configModule &&\n typeof configModule === 'object' &&\n 'default' in configModule\n ? configModule.default\n : configModule);\n return resolvedConfig;\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","consumeTypesAPI","normalizeGenerateTypesOptions","generateTypesAPI","program"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkGA;AACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AAC7D,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,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,UAAU,CAAC,iBAAiB,CAAC;AACjC,IAAI,IAAI;AACR,QAAQ,GAAG,CAAC,iBAAiB,CAAC;AAC9B,IAAI;AACJ,IAAI,OAAO,GAAG,EAAE;AAChB,QAAQ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;AAC1B,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { runCli } from './cli';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|