@module-federation/data-prefetch 1.0.16 → 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.
Files changed (98) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3 -1
  3. package/dist/LICENSE +21 -0
  4. package/dist/babel.cjs +95 -0
  5. package/dist/babel.d.ts +1 -0
  6. package/dist/babel.js +5 -0
  7. package/dist/cli/babel.cjs +115 -0
  8. package/dist/cli/babel.d.ts +2 -4
  9. package/dist/cli/babel.js +50 -82
  10. package/dist/cli/index.cjs +217 -0
  11. package/dist/cli/index.d.ts +5 -8
  12. package/dist/cli/index.js +150 -197
  13. package/dist/cli.cjs +95 -0
  14. package/dist/cli.d.ts +1 -0
  15. package/dist/cli.js +5 -0
  16. package/dist/common/constant.cjs +51 -0
  17. package/dist/common/constant.d.ts +1 -0
  18. package/dist/common/constant.js +5 -0
  19. package/dist/common/index.cjs +95 -0
  20. package/dist/common/index.js +5 -0
  21. package/dist/common/node-utils.cjs +100 -0
  22. package/dist/common/node-utils.d.ts +2 -0
  23. package/dist/common/node-utils.js +35 -0
  24. package/dist/common/runtime-utils.cjs +84 -0
  25. package/dist/common/runtime-utils.d.ts +5 -0
  26. package/dist/common/runtime-utils.js +29 -0
  27. package/dist/constant.cjs +51 -0
  28. package/dist/constant.d.ts +1 -0
  29. package/dist/constant.js +5 -0
  30. package/dist/index.cjs +106 -0
  31. package/dist/index.d.ts +2 -5
  32. package/dist/index.js +3 -346
  33. package/dist/logger/index.cjs +60 -0
  34. package/dist/logger/index.d.ts +2 -0
  35. package/dist/logger/index.js +10 -0
  36. package/dist/plugin.cjs +234 -0
  37. package/dist/plugin.d.ts +3 -5
  38. package/dist/plugin.js +167 -340
  39. package/dist/prefetch.cjs +197 -0
  40. package/dist/{prefetch-4e9646e4.d.ts → prefetch.d.ts} +14 -17
  41. package/dist/prefetch.js +149 -0
  42. package/dist/react/hooks.cjs +144 -0
  43. package/dist/react/hooks.d.ts +11 -0
  44. package/dist/react/hooks.js +86 -0
  45. package/dist/react/index.cjs +95 -0
  46. package/dist/react/index.d.ts +1 -16
  47. package/dist/react/index.js +2 -283
  48. package/dist/react/utils.cjs +65 -0
  49. package/dist/react/utils.d.ts +1 -0
  50. package/dist/react/utils.js +15 -0
  51. package/dist/react.cjs +95 -0
  52. package/dist/react.d.ts +1 -0
  53. package/dist/react.js +5 -0
  54. package/dist/universal/index.cjs +81 -0
  55. package/dist/universal/index.d.ts +2 -8
  56. package/dist/universal/index.js +24 -196
  57. package/dist/universal.cjs +95 -0
  58. package/dist/universal.d.ts +1 -0
  59. package/dist/universal.js +5 -0
  60. package/package.json +76 -40
  61. package/CHANGELOG.md +0 -9
  62. package/__tests__/babel.spec.ts +0 -75
  63. package/__tests__/prefetch.spec.ts +0 -138
  64. package/__tests__/react.spec.ts +0 -119
  65. package/dist/esm/chunk-AJPO2B2T.js +0 -30
  66. package/dist/esm/chunk-EZUCZHGV.js +0 -11
  67. package/dist/esm/chunk-ISLXMAIA.js +0 -155
  68. package/dist/esm/chunk-KI4QGPIS.js +0 -32
  69. package/dist/esm/chunk-TTJJJ2WZ.js +0 -7
  70. package/dist/esm/chunk-VVZ6XIM6.js +0 -166
  71. package/dist/esm/cli/babel.js +0 -57
  72. package/dist/esm/cli/index.js +0 -178
  73. package/dist/esm/index.js +0 -13
  74. package/dist/esm/plugin.js +0 -12
  75. package/dist/esm/react/index.js +0 -94
  76. package/dist/esm/shared/index.js +0 -27
  77. package/dist/esm/universal/index.js +0 -9
  78. package/dist/shared/index.d.ts +0 -5
  79. package/dist/shared/index.js +0 -48
  80. package/jest.config.js +0 -29
  81. package/project.json +0 -21
  82. package/src/cli/babel.ts +0 -94
  83. package/src/cli/index.ts +0 -171
  84. package/src/common/constant.ts +0 -1
  85. package/src/common/node-utils.ts +0 -24
  86. package/src/common/runtime-utils.ts +0 -34
  87. package/src/index.ts +0 -2
  88. package/src/logger/index.ts +0 -3
  89. package/src/plugin.ts +0 -191
  90. package/src/prefetch.ts +0 -207
  91. package/src/react/hooks.ts +0 -95
  92. package/src/react/index.ts +0 -1
  93. package/src/react/utils.ts +0 -11
  94. package/src/shared/index.ts +0 -26
  95. package/src/universal/index.ts +0 -27
  96. package/tsconfig.json +0 -27
  97. package/tsup.config.ts +0 -35
  98. /package/{src/common/index.ts → dist/common/index.d.ts} +0 -0
package/dist/cli/index.js CHANGED
@@ -1,205 +1,158 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
-
26
- // src/cli/index.ts
27
- var cli_exports = {};
28
- __export(cli_exports, {
29
- PrefetchPlugin: () => PrefetchPlugin,
30
- getFederationGlobalScope: () => getFederationGlobalScope
31
- });
32
- module.exports = __toCommonJS(cli_exports);
33
- var import_path2 = __toESM(require("path"));
34
- var import_fs_extra2 = __toESM(require("fs-extra"));
35
- var import_sdk2 = require("@module-federation/sdk");
36
- var import_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
37
-
38
- // src/common/constant.ts
39
- var TEMP_DIR = ".mf";
40
-
41
- // src/common/node-utils.ts
42
- var import_path = __toESM(require("path"));
43
- var import_fs_extra = __toESM(require("fs-extra"));
44
- var fileExistsWithCaseSync = (filepath) => {
45
- const dir = import_path.default.dirname(filepath);
46
- if (filepath === "/" || filepath === ".") {
47
- return true;
48
- }
49
- const filenames = import_fs_extra.default.readdirSync(dir);
50
- if (filenames.indexOf(import_path.default.basename(filepath)) === -1) {
51
- return false;
52
- }
53
- return fileExistsWithCaseSync(dir);
54
- };
55
- var fixPrefetchPath = (exposePath) => {
56
- const pathExt = [".js", ".ts"];
57
- const extReg = /\.(ts|js|tsx|jsx)$/;
58
- if (extReg.test(exposePath)) {
59
- return pathExt.map((ext) => exposePath.replace(extReg, `.prefetch${ext}`));
60
- } else {
61
- return pathExt.map((ext) => exposePath + `.prefetch${ext}`);
62
- }
63
- };
64
-
65
- // src/common/runtime-utils.ts
66
- var import_runtime = require("@module-federation/runtime");
67
- var import_sdk = require("@module-federation/sdk");
68
- var getPrefetchId = (id) => (0, import_sdk.encodeName)(`${id}/${import_sdk.MFPrefetchCommon.identifier}`);
69
-
70
- // src/cli/index.ts
71
- var { RuntimeGlobals, Template } = require((0, import_normalize_webpack_path.normalizeWebpackPath)("webpack"));
1
+ import path from "path";
2
+ import fs_extra from "fs-extra";
3
+ import { MFPrefetchCommon, bindLoggerToCompiler, createInfrastructureLogger, createLogger, encodeName } from "@module-federation/sdk";
4
+ import { normalizeWebpackPath } from "@module-federation/sdk/normalize-webpack-path";
5
+ import { TEMP_DIR } from "../common/constant.js";
6
+ import { fileExistsWithCaseSync, fixPrefetchPath } from "../common/node-utils.js";
7
+ import { getPrefetchId } from "../common/runtime-utils.js";
8
+ import { SHARED_STRATEGY } from "../constant.js";
9
+
10
+ ;// CONCATENATED MODULE: external "path"
11
+
12
+ ;// CONCATENATED MODULE: external "fs-extra"
13
+
14
+ ;// CONCATENATED MODULE: external "@module-federation/sdk"
15
+
16
+ ;// CONCATENATED MODULE: external "@module-federation/sdk/normalize-webpack-path"
17
+
18
+ ;// CONCATENATED MODULE: external "../common/constant.js"
19
+
20
+ ;// CONCATENATED MODULE: external "../common/node-utils.js"
21
+
22
+ ;// CONCATENATED MODULE: external "../common/runtime-utils.js"
23
+
24
+ ;// CONCATENATED MODULE: external "../constant.js"
25
+
26
+ ;// CONCATENATED MODULE: ./src/cli/index.ts
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+ const { RuntimeGlobals, Template } = require(normalizeWebpackPath('webpack'));
36
+ const createBundlerLogger = typeof createInfrastructureLogger === 'function' ? createInfrastructureLogger : createLogger;
37
+ const logger = createBundlerLogger('[ Module Federation Data Prefetch Plugin ]');
72
38
  function getFederationGlobalScope(runtimeGlobals) {
73
- return `${runtimeGlobals.require || "__webpack_require__"}.federation`;
39
+ return `${runtimeGlobals.require || '__webpack_require__'}.federation`;
74
40
  }
75
- var PrefetchPlugin = class {
76
- constructor(options) {
77
- this.options = options;
78
- this._reWriteExports = "";
79
- }
80
- apply(compiler) {
81
- var _a, _b;
82
- const { name, exposes } = this.options;
83
- if (!exposes) {
84
- return;
85
- }
86
- if (!compiler.options.context) {
87
- throw new Error("compiler.options.context is not defined");
88
- }
89
- const { runtimePlugins } = this.options;
90
- if (!Array.isArray(runtimePlugins)) {
91
- this.options.runtimePlugins = [];
92
- }
93
- const runtimePath = import_path2.default.resolve(__dirname, "../esm/plugin.js");
94
- const sharedPath = import_path2.default.resolve(__dirname, "../esm/shared/index.js");
95
- if (!((_a = this.options.runtimePlugins) == null ? void 0 : _a.includes(runtimePath))) {
96
- this.options.runtimePlugins.push(runtimePath);
97
- }
98
- if (!((_b = this.options.runtimePlugins) == null ? void 0 : _b.includes(sharedPath))) {
99
- this.options.runtimePlugins.push(sharedPath);
100
- }
101
- const encodedName = (0, import_sdk2.encodeName)(name);
102
- const asyncEntryPath = import_path2.default.resolve(
103
- compiler.options.context,
104
- `node_modules/${TEMP_DIR}/${encodedName}/bootstrap.js`
105
- );
106
- if (import_fs_extra2.default.existsSync(asyncEntryPath)) {
107
- import_fs_extra2.default.unlinkSync(asyncEntryPath);
108
- }
109
- if (!this.options.dataPrefetch) {
110
- return;
41
+ class PrefetchPlugin {
42
+ // eslint-disable-next-line max-lines-per-function
43
+ apply(compiler) {
44
+ var _this_options_runtimePlugins;
45
+ bindLoggerToCompiler(logger, compiler, 'PrefetchPlugin');
46
+ const { name, exposes } = this.options;
47
+ if (!exposes) {
48
+ return;
49
+ }
50
+ if (!compiler.options.context) {
51
+ throw new Error('compiler.options.context is not defined');
52
+ }
53
+ const { runtimePlugins } = this.options;
54
+ if (!Array.isArray(runtimePlugins)) {
55
+ this.options.runtimePlugins = [];
56
+ }
57
+ const runtimePath = path.resolve(__dirname, './plugin.esm.js');
58
+ if (!((_this_options_runtimePlugins = this.options.runtimePlugins) === null || _this_options_runtimePlugins === void 0 ? void 0 : _this_options_runtimePlugins.includes(runtimePath))) {
59
+ this.options.runtimePlugins.push(runtimePath);
60
+ }
61
+ if (this.options.shareStrategy !== SHARED_STRATEGY) {
62
+ this.options.shareStrategy = SHARED_STRATEGY;
63
+ logger.warn(`[Module Federation Data Prefetch]: Your shared strategy is set to '${SHARED_STRATEGY}', this is a necessary condition for data prefetch`);
64
+ }
65
+ const encodedName = encodeName(name);
66
+ const asyncEntryPath = path.resolve(compiler.options.context, `node_modules/${TEMP_DIR}/${encodedName}/bootstrap.js`);
67
+ if (fs_extra.existsSync(asyncEntryPath)) {
68
+ fs_extra.unlinkSync(asyncEntryPath);
69
+ }
70
+ if (!this.options.dataPrefetch) {
71
+ return;
72
+ }
73
+ const prefetchs = [];
74
+ const exposeAlias = Object.keys(exposes);
75
+ exposeAlias.forEach((alias)=>{
76
+ let exposePath;
77
+ // @ts-ignore
78
+ const exposeValue = exposes[alias];
79
+ if (typeof exposeValue === 'string') {
80
+ exposePath = exposeValue;
81
+ } else {
82
+ exposePath = exposeValue.import[0];
83
+ }
84
+ const targetPaths = fixPrefetchPath(exposePath);
85
+ for (const pathItem of targetPaths){
86
+ const absolutePath = path.resolve(compiler.options.context, pathItem);
87
+ if (fileExistsWithCaseSync(absolutePath)) {
88
+ prefetchs.push(pathItem);
89
+ const absoluteAlias = alias.replace('.', '');
90
+ this._reWriteExports += `export * as ${getPrefetchId(`${name}${absoluteAlias}`)} from '${absolutePath}';\n`;
91
+ break;
92
+ }
93
+ }
94
+ });
95
+ if (!this._reWriteExports) {
96
+ return;
97
+ }
98
+ const tempDirRealPath = path.resolve(compiler.options.context, 'node_modules', TEMP_DIR);
99
+ if (!fs_extra.existsSync(tempDirRealPath)) {
100
+ fs_extra.mkdirSync(tempDirRealPath);
101
+ }
102
+ if (!fs_extra.existsSync(`${tempDirRealPath}/${encodedName}`)) {
103
+ fs_extra.mkdirSync(`${tempDirRealPath}/${encodedName}`);
104
+ }
105
+ fs_extra.writeFileSync(asyncEntryPath, this._reWriteExports);
106
+ new compiler.webpack.DefinePlugin({
107
+ FederationDataPrefetch: JSON.stringify(asyncEntryPath)
108
+ }).apply(compiler);
111
109
  }
112
- const prefetchs = [];
113
- const exposeAlias = Object.keys(exposes);
114
- exposeAlias.forEach((alias) => {
115
- let exposePath;
116
- const exposeValue = exposes[alias];
117
- if (typeof exposeValue === "string") {
118
- exposePath = exposeValue;
119
- } else {
120
- exposePath = exposeValue.import[0];
121
- }
122
- const targetPaths = fixPrefetchPath(exposePath);
123
- for (const pathItem of targetPaths) {
124
- const absolutePath = import_path2.default.resolve(compiler.options.context, pathItem);
125
- if (fileExistsWithCaseSync(absolutePath)) {
126
- prefetchs.push(pathItem);
127
- const absoluteAlias = alias.replace(".", "");
128
- this._reWriteExports += `export * as ${getPrefetchId(
129
- `${name}${absoluteAlias}`
130
- )} from '${absolutePath}';
131
- `;
132
- break;
110
+ static addRuntime(compiler, options) {
111
+ const encodedName = encodeName(options.name);
112
+ if (!compiler.options.context) {
113
+ throw new Error('compiler.options.context is not defined');
133
114
  }
134
- }
135
- });
136
- if (!this._reWriteExports) {
137
- return;
115
+ const prefetchEntry = path.resolve(compiler.options.context, `node_modules/.mf/${encodedName}/bootstrap.js`);
116
+ const federationGlobal = getFederationGlobalScope(RuntimeGlobals || {});
117
+ return Template.asString([
118
+ fs_extra.existsSync(prefetchEntry) ? Template.indent([
119
+ 'function injectPrefetch() {',
120
+ Template.indent([
121
+ `globalThis.__FEDERATION__ = globalThis.__FEDERATION__ || {};`,
122
+ `globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}'] = globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}'] || {`,
123
+ `entryLoading: {},`,
124
+ `instance: new Map(),`,
125
+ `__PREFETCH_EXPORTS__: {},`,
126
+ `};`,
127
+ `globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}']['${MFPrefetchCommon.exportsKey}'] = globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}']['${MFPrefetchCommon.exportsKey}'] || {};`,
128
+ `globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}']['${MFPrefetchCommon.exportsKey}']['${options.name}'] = function(){ return import('${prefetchEntry}');}`
129
+ ]),
130
+ '}',
131
+ `${federationGlobal}.prefetch = injectPrefetch`
132
+ ]) : '',
133
+ Template.indent([
134
+ `if(!${federationGlobal}.isMFRemote && ${federationGlobal}.prefetch){`,
135
+ `${federationGlobal}.prefetch()`,
136
+ '}'
137
+ ])
138
+ ]);
138
139
  }
139
- const tempDirRealPath = import_path2.default.resolve(
140
- compiler.options.context,
141
- "node_modules",
142
- TEMP_DIR
143
- );
144
- if (!import_fs_extra2.default.existsSync(tempDirRealPath)) {
145
- import_fs_extra2.default.mkdirSync(tempDirRealPath);
140
+ static setRemoteIdentifier() {
141
+ const federationGlobal = getFederationGlobalScope(RuntimeGlobals || {});
142
+ return Template.indent([
143
+ `${federationGlobal}.isMFRemote = true;`
144
+ ]);
146
145
  }
147
- if (!import_fs_extra2.default.existsSync(`${tempDirRealPath}/${encodedName}`)) {
148
- import_fs_extra2.default.mkdirSync(`${tempDirRealPath}/${encodedName}`);
146
+ static removeRemoteIdentifier() {
147
+ const federationGlobal = getFederationGlobalScope(RuntimeGlobals || {});
148
+ return Template.indent([
149
+ `${federationGlobal}.isMFRemote = false;`
150
+ ]);
149
151
  }
150
- import_fs_extra2.default.writeFileSync(asyncEntryPath, this._reWriteExports);
151
- new compiler.webpack.DefinePlugin({
152
- FederationDataPrefetch: JSON.stringify(asyncEntryPath)
153
- }).apply(compiler);
154
- }
155
- static addRuntime(compiler, options) {
156
- const encodedName = (0, import_sdk2.encodeName)(options.name);
157
- if (!compiler.options.context) {
158
- throw new Error("compiler.options.context is not defined");
152
+ constructor(options){
153
+ this.options = options;
154
+ this._reWriteExports = '';
159
155
  }
160
- const prefetchEntry = import_path2.default.resolve(
161
- compiler.options.context,
162
- `node_modules/.mf/${encodedName}/bootstrap.js`
163
- );
164
- const federationGlobal = getFederationGlobalScope(
165
- RuntimeGlobals || {}
166
- );
167
- return Template.asString([
168
- import_fs_extra2.default.existsSync(prefetchEntry) ? Template.indent([
169
- "function injectPrefetch() {",
170
- `globalThis.__FEDERATION__ = globalThis.__FEDERATION__ || {};`,
171
- `globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}'] = globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}'] || {`,
172
- `entryLoading: {},`,
173
- `instance: new Map(),`,
174
- `__PREFETCH_EXPORTS__: {},`,
175
- `};`,
176
- `globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}']['${import_sdk2.MFPrefetchCommon.exportsKey}'] = globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}']['${import_sdk2.MFPrefetchCommon.exportsKey}'] || {};`,
177
- `globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}']['${import_sdk2.MFPrefetchCommon.exportsKey}']['${options.name}'] = import('${prefetchEntry}');`,
178
- "}",
179
- `${federationGlobal}.prefetch = injectPrefetch`
180
- ]) : "",
181
- Template.indent([
182
- `if(!${federationGlobal}.isMFRemote && ${federationGlobal}.prefetch){`,
183
- `${federationGlobal}.prefetch()`,
184
- "}"
185
- ])
186
- ]);
187
- }
188
- static setRemoteIdentifier() {
189
- const federationGlobal = getFederationGlobalScope(
190
- RuntimeGlobals || {}
191
- );
192
- return Template.indent([`${federationGlobal}.isMFRemote = true;`]);
193
- }
194
- static removeRemoteIdentifier() {
195
- const federationGlobal = getFederationGlobalScope(
196
- RuntimeGlobals || {}
197
- );
198
- return Template.indent([`${federationGlobal}.isMFRemote = false;`]);
199
- }
200
- };
201
- // Annotate the CommonJS export names for ESM import in node:
202
- 0 && (module.exports = {
203
- PrefetchPlugin,
204
- getFederationGlobalScope
205
- });
156
+ }
157
+
158
+ export { PrefetchPlugin, getFederationGlobalScope };
package/dist/cli.cjs ADDED
@@ -0,0 +1,95 @@
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
+ "./cli/index": (function (module) {
11
+ module.exports = require("./cli/index.cjs");
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
+ __webpack_require__.r(__webpack_exports__);
82
+ /* ESM import */var _cli_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./cli/index");
83
+ /* ESM import */var _cli_index__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_cli_index__WEBPACK_IMPORTED_MODULE_0__);
84
+
85
+ /* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
86
+ /* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _cli_index__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _cli_index__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
87
+ /* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
88
+
89
+
90
+ })();
91
+
92
+ for(var __webpack_i__ in __webpack_exports__) {
93
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
+ }
95
+ Object.defineProperty(exports, '__esModule', { value: true });
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './cli/index';
package/dist/cli.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./cli/index.js";
2
+
3
+ ;// CONCATENATED MODULE: ./src/cli.ts
4
+
5
+
@@ -0,0 +1,51 @@
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
+ TEMP_DIR: () => (TEMP_DIR)
42
+ });
43
+ const TEMP_DIR = '.mf';
44
+
45
+ exports.TEMP_DIR = __webpack_exports__.TEMP_DIR;
46
+ for(var __webpack_i__ in __webpack_exports__) {
47
+ if(["TEMP_DIR"].indexOf(__webpack_i__) === -1) {
48
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
49
+ }
50
+ }
51
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1 @@
1
+ export declare const TEMP_DIR = ".mf";
@@ -0,0 +1,5 @@
1
+
2
+ ;// CONCATENATED MODULE: ./src/common/constant.ts
3
+ const TEMP_DIR = '.mf';
4
+
5
+ export { TEMP_DIR };
@@ -0,0 +1,95 @@
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
+ "./constant": (function (module) {
11
+ module.exports = require("./constant.cjs");
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
+ __webpack_require__.r(__webpack_exports__);
82
+ /* ESM import */var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./constant");
83
+ /* ESM import */var _constant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_constant__WEBPACK_IMPORTED_MODULE_0__);
84
+
85
+ /* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
86
+ /* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _constant__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _constant__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
87
+ /* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
88
+
89
+
90
+ })();
91
+
92
+ for(var __webpack_i__ in __webpack_exports__) {
93
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
+ }
95
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,5 @@
1
+ export * from "./constant.js";
2
+
3
+ ;// CONCATENATED MODULE: ./src/common/index.ts
4
+
5
+