@module-federation/esbuild 0.0.0-chore-bump-node-22-20260710161714

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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -0
  3. package/dist/adapters/lib/collect-exports.d.ts +3 -0
  4. package/dist/adapters/lib/collect-exports.js +153 -0
  5. package/dist/adapters/lib/collect-exports.mjs +80 -0
  6. package/dist/adapters/lib/commonjs.d.ts +101 -0
  7. package/dist/adapters/lib/commonjs.js +258 -0
  8. package/dist/adapters/lib/commonjs.mjs +182 -0
  9. package/dist/adapters/lib/containerPlugin.d.ts +6 -0
  10. package/dist/adapters/lib/containerPlugin.js +233 -0
  11. package/dist/adapters/lib/containerPlugin.mjs +179 -0
  12. package/dist/adapters/lib/containerReference.d.ts +6 -0
  13. package/dist/adapters/lib/containerReference.js +257 -0
  14. package/dist/adapters/lib/containerReference.mjs +188 -0
  15. package/dist/adapters/lib/lexer.d.ts +9 -0
  16. package/dist/adapters/lib/lexer.js +187 -0
  17. package/dist/adapters/lib/lexer.mjs +136 -0
  18. package/dist/adapters/lib/linkRemotesPlugin.d.ts +6 -0
  19. package/dist/adapters/lib/linkRemotesPlugin.js +117 -0
  20. package/dist/adapters/lib/linkRemotesPlugin.mjs +48 -0
  21. package/dist/adapters/lib/manifest.d.ts +2 -0
  22. package/dist/adapters/lib/manifest.js +227 -0
  23. package/dist/adapters/lib/manifest.mjs +159 -0
  24. package/dist/adapters/lib/plugin.d.ts +8 -0
  25. package/dist/adapters/lib/plugin.js +340 -0
  26. package/dist/adapters/lib/plugin.mjs +247 -0
  27. package/dist/adapters/lib/react-replacements.d.ts +9 -0
  28. package/dist/adapters/lib/react-replacements.js +86 -0
  29. package/dist/adapters/lib/react-replacements.mjs +34 -0
  30. package/dist/adapters/lib/transform.d.ts +8 -0
  31. package/dist/adapters/lib/transform.js +171 -0
  32. package/dist/adapters/lib/transform.mjs +116 -0
  33. package/dist/adapters/lib/utils.d.ts +3 -0
  34. package/dist/adapters/lib/utils.js +87 -0
  35. package/dist/adapters/lib/utils.mjs +31 -0
  36. package/dist/build.d.ts +5 -0
  37. package/dist/build.js +140 -0
  38. package/dist/build.mjs +12 -0
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.js +55 -0
  41. package/dist/index.mjs +3 -0
  42. package/dist/lib/config/configuration-context.d.ts +7 -0
  43. package/dist/lib/config/configuration-context.js +73 -0
  44. package/dist/lib/config/configuration-context.mjs +18 -0
  45. package/dist/lib/config/federation-config.d.ts +30 -0
  46. package/dist/lib/config/federation-config.js +29 -0
  47. package/dist/lib/config/federation-config.mjs +3 -0
  48. package/dist/lib/config/share-utils.d.ts +29 -0
  49. package/dist/lib/config/share-utils.js +340 -0
  50. package/dist/lib/config/share-utils.mjs +245 -0
  51. package/dist/lib/config/with-native-federation.d.ts +23 -0
  52. package/dist/lib/config/with-native-federation.js +120 -0
  53. package/dist/lib/config/with-native-federation.mjs +66 -0
  54. package/dist/lib/core/build-adapter.d.ts +4 -0
  55. package/dist/lib/core/build-adapter.js +72 -0
  56. package/dist/lib/core/build-adapter.mjs +16 -0
  57. package/dist/lib/core/createContainerTemplate.d.ts +1 -0
  58. package/dist/lib/core/createContainerTemplate.js +235 -0
  59. package/dist/lib/core/createContainerTemplate.mjs +183 -0
  60. package/dist/lib/core/default-skip-list.d.ts +12 -0
  61. package/dist/lib/core/default-skip-list.js +103 -0
  62. package/dist/lib/core/default-skip-list.mjs +45 -0
  63. package/dist/lib/core/federation-options.d.ts +10 -0
  64. package/dist/lib/core/federation-options.js +29 -0
  65. package/dist/lib/core/federation-options.mjs +3 -0
  66. package/dist/lib/core/get-externals.d.ts +2 -0
  67. package/dist/lib/core/get-externals.js +68 -0
  68. package/dist/lib/core/get-externals.mjs +17 -0
  69. package/dist/lib/core/load-federation-config.d.ts +6 -0
  70. package/dist/lib/core/load-federation-config.js +71 -0
  71. package/dist/lib/core/load-federation-config.mjs +16 -0
  72. package/dist/lib/core/write-federation-info.d.ts +9 -0
  73. package/dist/lib/core/write-federation-info.js +67 -0
  74. package/dist/lib/core/write-federation-info.mjs +12 -0
  75. package/dist/lib/utils/logger.d.ts +11 -0
  76. package/dist/lib/utils/logger.js +113 -0
  77. package/dist/lib/utils/logger.mjs +44 -0
  78. package/dist/lib/utils/mapped-paths.d.ts +10 -0
  79. package/dist/lib/utils/mapped-paths.js +95 -0
  80. package/dist/lib/utils/mapped-paths.mjs +40 -0
  81. package/dist/lib/utils/normalize.d.ts +1 -0
  82. package/dist/lib/utils/normalize.js +66 -0
  83. package/dist/lib/utils/normalize.mjs +15 -0
  84. package/dist/lib/utils/package-info.d.ts +18 -0
  85. package/dist/lib/utils/package-info.js +325 -0
  86. package/dist/lib/utils/package-info.mjs +259 -0
  87. package/dist/plugin.d.ts +1 -0
  88. package/dist/plugin.js +96 -0
  89. package/dist/plugin.mjs +4 -0
  90. package/dist/resolve/esm-resolver.mjs +19 -0
  91. package/dist/resolve/package.json +3 -0
  92. package/dist/rslib-runtime.mjs +31 -0
  93. package/package.json +75 -0
@@ -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
+ // webpack/runtime/define_property_getters
13
+ (() => {
14
+ __webpack_require__.d = (exports, getters, values) => {
15
+ var define = (defs, kind) => {
16
+ for(var key in defs) {
17
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
19
+ }
20
+ }
21
+ };
22
+ define(getters, "get");
23
+ define(values, "value");
24
+ };
25
+ })();
26
+ // webpack/runtime/has_own_property
27
+ (() => {
28
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ })();
30
+ // webpack/runtime/make_namespace_object
31
+ (() => {
32
+ // define __esModule on exports
33
+ __webpack_require__.r = (exports) => {
34
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
35
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36
+ }
37
+ Object.defineProperty(exports, '__esModule', { value: true });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ __webpack_require__.r(__webpack_exports__);
42
+ function getExternals(config) {
43
+ const shared = Object.keys(config.shared ?? {});
44
+ const remotes = config.remotes ?? {};
45
+ const remoteKeys = Object.keys(remotes).reduce((acc, key)=>{
46
+ if (!key) return acc;
47
+ acc.push(key);
48
+ acc.push(key + '/*');
49
+ return acc;
50
+ }, []);
51
+ const externals = [
52
+ ...shared,
53
+ ...remoteKeys
54
+ ];
55
+ return externals;
56
+ }
57
+
58
+ __webpack_require__.d(__webpack_exports__, {
59
+ getExternals: () => (getExternals)
60
+ });
61
+
62
+ exports.getExternals = __webpack_exports__.getExternals;
63
+ for(var __rspack_i in __webpack_exports__) {
64
+ if(["getExternals"].indexOf(__rspack_i) === -1) {
65
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
66
+ }
67
+ }
68
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,17 @@
1
+ function getExternals(config) {
2
+ const shared = Object.keys(config.shared ?? {});
3
+ const remotes = config.remotes ?? {};
4
+ const remoteKeys = Object.keys(remotes).reduce((acc, key)=>{
5
+ if (!key) return acc;
6
+ acc.push(key);
7
+ acc.push(key + '/*');
8
+ return acc;
9
+ }, []);
10
+ const externals = [
11
+ ...shared,
12
+ ...remoteKeys
13
+ ];
14
+ return externals;
15
+ }
16
+
17
+ export { getExternals };
@@ -0,0 +1,6 @@
1
+ interface FederationOptions {
2
+ workspaceRoot: string;
3
+ federationConfig: string;
4
+ }
5
+ export declare function loadFederationConfig(fedOptions: FederationOptions): Promise<any>;
6
+ export {};
@@ -0,0 +1,71 @@
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
+ // webpack/runtime/define_property_getters
13
+ (() => {
14
+ __webpack_require__.d = (exports, getters, values) => {
15
+ var define = (defs, kind) => {
16
+ for(var key in defs) {
17
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
19
+ }
20
+ }
21
+ };
22
+ define(getters, "get");
23
+ define(values, "value");
24
+ };
25
+ })();
26
+ // webpack/runtime/has_own_property
27
+ (() => {
28
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ })();
30
+ // webpack/runtime/make_namespace_object
31
+ (() => {
32
+ // define __esModule on exports
33
+ __webpack_require__.r = (exports) => {
34
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
35
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36
+ }
37
+ Object.defineProperty(exports, '__esModule', { value: true });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ // ESM COMPAT FLAG
42
+ __webpack_require__.r(__webpack_exports__);
43
+
44
+ // EXPORTS
45
+ __webpack_require__.d(__webpack_exports__, {
46
+ loadFederationConfig: () => (/* binding */ loadFederationConfig)
47
+ });
48
+
49
+ ;// CONCATENATED MODULE: external "path"
50
+ const external_path_namespaceObject = require("path");
51
+ ;// CONCATENATED MODULE: external "fs"
52
+ const external_fs_namespaceObject = require("fs");
53
+ ;// CONCATENATED MODULE: ./src/lib/core/load-federation-config.ts
54
+
55
+
56
+ async function loadFederationConfig(fedOptions) {
57
+ const fullConfigPath = external_path_namespaceObject.join(fedOptions.workspaceRoot, fedOptions.federationConfig);
58
+ if (!external_fs_namespaceObject.existsSync(fullConfigPath)) {
59
+ throw new Error('Expected ' + fullConfigPath);
60
+ }
61
+ const config = await import(`${fullConfigPath}`);
62
+ return config;
63
+ }
64
+
65
+ exports.loadFederationConfig = __webpack_exports__.loadFederationConfig;
66
+ for(var __rspack_i in __webpack_exports__) {
67
+ if(["loadFederationConfig"].indexOf(__rspack_i) === -1) {
68
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
69
+ }
70
+ }
71
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,16 @@
1
+ import * as __rspack_external_path from "path";
2
+ import * as __rspack_external_fs from "fs";
3
+
4
+
5
+
6
+
7
+ async function loadFederationConfig(fedOptions) {
8
+ const fullConfigPath = __rspack_external_path.join(fedOptions.workspaceRoot, fedOptions.federationConfig);
9
+ if (!__rspack_external_fs.existsSync(fullConfigPath)) {
10
+ throw new Error('Expected ' + fullConfigPath);
11
+ }
12
+ const config = await import(`${fullConfigPath}`);
13
+ return config;
14
+ }
15
+
16
+ export { loadFederationConfig };
@@ -0,0 +1,9 @@
1
+ interface FederationInfo {
2
+ [key: string]: any;
3
+ }
4
+ interface FedOptions {
5
+ workspaceRoot: string;
6
+ outputPath: string;
7
+ }
8
+ export declare function writeFederationInfo(federationInfo: FederationInfo, fedOptions: FedOptions): void;
9
+ export {};
@@ -0,0 +1,67 @@
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
+ // webpack/runtime/define_property_getters
13
+ (() => {
14
+ __webpack_require__.d = (exports, getters, values) => {
15
+ var define = (defs, kind) => {
16
+ for(var key in defs) {
17
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
19
+ }
20
+ }
21
+ };
22
+ define(getters, "get");
23
+ define(values, "value");
24
+ };
25
+ })();
26
+ // webpack/runtime/has_own_property
27
+ (() => {
28
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ })();
30
+ // webpack/runtime/make_namespace_object
31
+ (() => {
32
+ // define __esModule on exports
33
+ __webpack_require__.r = (exports) => {
34
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
35
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36
+ }
37
+ Object.defineProperty(exports, '__esModule', { value: true });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ // ESM COMPAT FLAG
42
+ __webpack_require__.r(__webpack_exports__);
43
+
44
+ // EXPORTS
45
+ __webpack_require__.d(__webpack_exports__, {
46
+ writeFederationInfo: () => (/* binding */ writeFederationInfo)
47
+ });
48
+
49
+ ;// CONCATENATED MODULE: external "path"
50
+ const external_path_namespaceObject = require("path");
51
+ ;// CONCATENATED MODULE: external "fs"
52
+ const external_fs_namespaceObject = require("fs");
53
+ ;// CONCATENATED MODULE: ./src/lib/core/write-federation-info.ts
54
+
55
+
56
+ function writeFederationInfo(federationInfo, fedOptions) {
57
+ const metaDataPath = external_path_namespaceObject.join(fedOptions.workspaceRoot, fedOptions.outputPath, 'remoteEntry.json');
58
+ external_fs_namespaceObject.writeFileSync(metaDataPath, JSON.stringify(federationInfo, null, 2));
59
+ }
60
+
61
+ exports.writeFederationInfo = __webpack_exports__.writeFederationInfo;
62
+ for(var __rspack_i in __webpack_exports__) {
63
+ if(["writeFederationInfo"].indexOf(__rspack_i) === -1) {
64
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
65
+ }
66
+ }
67
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,12 @@
1
+ import * as __rspack_external_path from "path";
2
+ import * as __rspack_external_fs from "fs";
3
+
4
+
5
+
6
+
7
+ function writeFederationInfo(federationInfo, fedOptions) {
8
+ const metaDataPath = __rspack_external_path.join(fedOptions.workspaceRoot, fedOptions.outputPath, 'remoteEntry.json');
9
+ __rspack_external_fs.writeFileSync(metaDataPath, JSON.stringify(federationInfo, null, 2));
10
+ }
11
+
12
+ export { writeFederationInfo };
@@ -0,0 +1,11 @@
1
+ interface Logger {
2
+ error: (msg: string) => void;
3
+ warn: (msg: string) => void;
4
+ notice: (msg: string) => void;
5
+ info: (msg: string) => void;
6
+ verbose: (msg: string) => void;
7
+ debug: (msg: string) => void;
8
+ }
9
+ export declare const logger: Logger;
10
+ export declare const setLogLevel: (level: string) => void;
11
+ export {};
@@ -0,0 +1,113 @@
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
+ // webpack/runtime/compat_get_default_export
13
+ (() => {
14
+ // getDefaultExport function for compatibility with non-ESM modules
15
+ __webpack_require__.n = (module) => {
16
+ var getter = module && module.__esModule ?
17
+ () => (module['default']) :
18
+ () => (module);
19
+ __webpack_require__.d(getter, { a: getter });
20
+ return getter;
21
+ };
22
+
23
+ })();
24
+ // webpack/runtime/define_property_getters
25
+ (() => {
26
+ __webpack_require__.d = (exports, getters, values) => {
27
+ var define = (defs, kind) => {
28
+ for(var key in defs) {
29
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
30
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
31
+ }
32
+ }
33
+ };
34
+ define(getters, "get");
35
+ define(values, "value");
36
+ };
37
+ })();
38
+ // webpack/runtime/has_own_property
39
+ (() => {
40
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
41
+ })();
42
+ // webpack/runtime/make_namespace_object
43
+ (() => {
44
+ // define __esModule on exports
45
+ __webpack_require__.r = (exports) => {
46
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ }
49
+ Object.defineProperty(exports, '__esModule', { value: true });
50
+ };
51
+ })();
52
+ var __webpack_exports__ = {};
53
+ // ESM COMPAT FLAG
54
+ __webpack_require__.r(__webpack_exports__);
55
+
56
+ // EXPORTS
57
+ __webpack_require__.d(__webpack_exports__, {
58
+ logger: () => (/* binding */ logger),
59
+ setLogLevel: () => (/* binding */ setLogLevel)
60
+ });
61
+
62
+ ;// CONCATENATED MODULE: external "npmlog"
63
+ const external_npmlog_namespaceObject = require("npmlog");
64
+ var external_npmlog_default = /*#__PURE__*/__webpack_require__.n(external_npmlog_namespaceObject);
65
+ ;// CONCATENATED MODULE: ./src/lib/utils/logger.ts
66
+ /* eslint-disable @typescript-eslint/no-explicit-any */ //@ts-ignore
67
+
68
+ const levels = (external_npmlog_default()).levels;
69
+ external_npmlog_default().addLevel('error', levels.error, {
70
+ fg: 'brightWhite',
71
+ bg: 'red'
72
+ }, ' ERR! ');
73
+ external_npmlog_default().addLevel('warn', levels.info, {
74
+ fg: 'brightWhite',
75
+ bg: 'yellow'
76
+ }, ' WARN ');
77
+ external_npmlog_default().addLevel('info', levels.warn, {
78
+ fg: 'brightWhite',
79
+ bg: 'green'
80
+ }, ' INFO ');
81
+ external_npmlog_default().addLevel('notice', levels.notice, {
82
+ fg: 'black',
83
+ bg: 'brightYellow'
84
+ }, ' NOTE ');
85
+ external_npmlog_default().addLevel('verbose', levels.verbose, {
86
+ fg: 'brightWhite',
87
+ bg: 'brightBlue'
88
+ }, ' VRB! ');
89
+ external_npmlog_default().addLevel('silly', levels.silly, {
90
+ fg: 'black',
91
+ bg: 'white'
92
+ }, ' DBG! ');
93
+ const logger = {
94
+ error: (msg)=>external_npmlog_default().error('', msg),
95
+ warn: (msg)=>external_npmlog_default().warn('', msg),
96
+ notice: (msg)=>external_npmlog_default().notice('', msg),
97
+ info: (msg)=>external_npmlog_default().info('', msg),
98
+ verbose: (msg)=>external_npmlog_default().verbose('', msg),
99
+ debug: (msg)=>external_npmlog_default().silly('', msg)
100
+ };
101
+ const setLogLevel = (level)=>{
102
+ (external_npmlog_default()).level = level === 'debug' ? 'silly' : level;
103
+ };
104
+ setLogLevel('info');
105
+
106
+ exports.logger = __webpack_exports__.logger;
107
+ exports.setLogLevel = __webpack_exports__.setLogLevel;
108
+ for(var __rspack_i in __webpack_exports__) {
109
+ if(["logger","setLogLevel"].indexOf(__rspack_i) === -1) {
110
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
111
+ }
112
+ }
113
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,44 @@
1
+ import npmlog from "npmlog";
2
+
3
+
4
+ /* eslint-disable @typescript-eslint/no-explicit-any */ //@ts-ignore
5
+
6
+ const levels = npmlog.levels;
7
+ npmlog.addLevel('error', levels.error, {
8
+ fg: 'brightWhite',
9
+ bg: 'red'
10
+ }, ' ERR! ');
11
+ npmlog.addLevel('warn', levels.info, {
12
+ fg: 'brightWhite',
13
+ bg: 'yellow'
14
+ }, ' WARN ');
15
+ npmlog.addLevel('info', levels.warn, {
16
+ fg: 'brightWhite',
17
+ bg: 'green'
18
+ }, ' INFO ');
19
+ npmlog.addLevel('notice', levels.notice, {
20
+ fg: 'black',
21
+ bg: 'brightYellow'
22
+ }, ' NOTE ');
23
+ npmlog.addLevel('verbose', levels.verbose, {
24
+ fg: 'brightWhite',
25
+ bg: 'brightBlue'
26
+ }, ' VRB! ');
27
+ npmlog.addLevel('silly', levels.silly, {
28
+ fg: 'black',
29
+ bg: 'white'
30
+ }, ' DBG! ');
31
+ const logger = {
32
+ error: (msg)=>npmlog.error('', msg),
33
+ warn: (msg)=>npmlog.warn('', msg),
34
+ notice: (msg)=>npmlog.notice('', msg),
35
+ info: (msg)=>npmlog.info('', msg),
36
+ verbose: (msg)=>npmlog.verbose('', msg),
37
+ debug: (msg)=>npmlog.silly('', msg)
38
+ };
39
+ const setLogLevel = (level)=>{
40
+ npmlog.level = level === 'debug' ? 'silly' : level;
41
+ };
42
+ setLogLevel('info');
43
+
44
+ export { logger, setLogLevel };
@@ -0,0 +1,10 @@
1
+ export interface MappedPath {
2
+ key: string;
3
+ path: string;
4
+ }
5
+ export interface GetMappedPathsParams {
6
+ rootTsConfigPath: string;
7
+ sharedMappings?: string[];
8
+ rootPath?: string;
9
+ }
10
+ export declare function getMappedPaths({ rootTsConfigPath, sharedMappings, rootPath, }: GetMappedPathsParams): MappedPath[];
@@ -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
+ // The require scope
10
+ var __webpack_require__ = {};
11
+
12
+ // webpack/runtime/define_property_getters
13
+ (() => {
14
+ __webpack_require__.d = (exports, getters, values) => {
15
+ var define = (defs, kind) => {
16
+ for(var key in defs) {
17
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
19
+ }
20
+ }
21
+ };
22
+ define(getters, "get");
23
+ define(values, "value");
24
+ };
25
+ })();
26
+ // webpack/runtime/has_own_property
27
+ (() => {
28
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ })();
30
+ // webpack/runtime/make_namespace_object
31
+ (() => {
32
+ // define __esModule on exports
33
+ __webpack_require__.r = (exports) => {
34
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
35
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36
+ }
37
+ Object.defineProperty(exports, '__esModule', { value: true });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ // ESM COMPAT FLAG
42
+ __webpack_require__.r(__webpack_exports__);
43
+
44
+ // EXPORTS
45
+ __webpack_require__.d(__webpack_exports__, {
46
+ getMappedPaths: () => (/* binding */ getMappedPaths)
47
+ });
48
+
49
+ ;// CONCATENATED MODULE: external "path"
50
+ const external_path_namespaceObject = require("path");
51
+ ;// CONCATENATED MODULE: external "fs"
52
+ const external_fs_namespaceObject = require("fs");
53
+ ;// CONCATENATED MODULE: external "json5"
54
+ const external_json5_namespaceObject = require("json5");
55
+ ;// CONCATENATED MODULE: ./src/lib/utils/mapped-paths.ts
56
+
57
+
58
+
59
+ function getMappedPaths({ rootTsConfigPath, sharedMappings = [], rootPath }) {
60
+ const result = [];
61
+ if (!external_path_namespaceObject.isAbsolute(rootTsConfigPath)) {
62
+ throw new Error('SharedMappings.register: tsConfigPath needs to be an absolute path!');
63
+ }
64
+ if (!rootPath) {
65
+ rootPath = external_path_namespaceObject.normalize(external_path_namespaceObject.dirname(rootTsConfigPath));
66
+ }
67
+ const shareAll = sharedMappings.length === 0;
68
+ const tsConfig = external_json5_namespaceObject.parse(external_fs_namespaceObject.readFileSync(rootTsConfigPath, {
69
+ encoding: 'utf-8'
70
+ }));
71
+ const mappings = tsConfig?.compilerOptions?.paths;
72
+ if (!mappings) {
73
+ return result;
74
+ }
75
+ for(const key in mappings){
76
+ if (Object.prototype.hasOwnProperty.call(mappings, key)) {
77
+ const libPath = external_path_namespaceObject.normalize(external_path_namespaceObject.join(rootPath, mappings[key][0]));
78
+ if (sharedMappings.includes(key) || shareAll) {
79
+ result.push({
80
+ key,
81
+ path: libPath
82
+ });
83
+ }
84
+ }
85
+ }
86
+ return result;
87
+ }
88
+
89
+ exports.getMappedPaths = __webpack_exports__.getMappedPaths;
90
+ for(var __rspack_i in __webpack_exports__) {
91
+ if(["getMappedPaths"].indexOf(__rspack_i) === -1) {
92
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
93
+ }
94
+ }
95
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,40 @@
1
+ import * as __rspack_external_path from "path";
2
+ import * as __rspack_external_fs from "fs";
3
+ import * as __rspack_external_json5 from "json5";
4
+
5
+
6
+
7
+
8
+
9
+
10
+ function getMappedPaths({ rootTsConfigPath, sharedMappings = [], rootPath }) {
11
+ const result = [];
12
+ if (!__rspack_external_path.isAbsolute(rootTsConfigPath)) {
13
+ throw new Error('SharedMappings.register: tsConfigPath needs to be an absolute path!');
14
+ }
15
+ if (!rootPath) {
16
+ rootPath = __rspack_external_path.normalize(__rspack_external_path.dirname(rootTsConfigPath));
17
+ }
18
+ const shareAll = sharedMappings.length === 0;
19
+ const tsConfig = __rspack_external_json5.parse(__rspack_external_fs.readFileSync(rootTsConfigPath, {
20
+ encoding: 'utf-8'
21
+ }));
22
+ const mappings = tsConfig?.compilerOptions?.paths;
23
+ if (!mappings) {
24
+ return result;
25
+ }
26
+ for(const key in mappings){
27
+ if (Object.prototype.hasOwnProperty.call(mappings, key)) {
28
+ const libPath = __rspack_external_path.normalize(__rspack_external_path.join(rootPath, mappings[key][0]));
29
+ if (sharedMappings.includes(key) || shareAll) {
30
+ result.push({
31
+ key,
32
+ path: libPath
33
+ });
34
+ }
35
+ }
36
+ }
37
+ return result;
38
+ }
39
+
40
+ export { getMappedPaths };
@@ -0,0 +1 @@
1
+ export declare function normalize(path: string, trailingSlash?: boolean): string;
@@ -0,0 +1,66 @@
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
+ // webpack/runtime/define_property_getters
13
+ (() => {
14
+ __webpack_require__.d = (exports, getters, values) => {
15
+ var define = (defs, kind) => {
16
+ for(var key in defs) {
17
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
19
+ }
20
+ }
21
+ };
22
+ define(getters, "get");
23
+ define(values, "value");
24
+ };
25
+ })();
26
+ // webpack/runtime/has_own_property
27
+ (() => {
28
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ })();
30
+ // webpack/runtime/make_namespace_object
31
+ (() => {
32
+ // define __esModule on exports
33
+ __webpack_require__.r = (exports) => {
34
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
35
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36
+ }
37
+ Object.defineProperty(exports, '__esModule', { value: true });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ __webpack_require__.r(__webpack_exports__);
42
+ function normalize(path, trailingSlash) {
43
+ let cand = path.replace(/\\/g, '/');
44
+ if (typeof trailingSlash === 'undefined') {
45
+ return cand;
46
+ }
47
+ while(cand.endsWith('/')){
48
+ cand = cand.substring(0, cand.length - 1);
49
+ }
50
+ if (trailingSlash) {
51
+ return cand + '/';
52
+ }
53
+ return cand;
54
+ }
55
+
56
+ __webpack_require__.d(__webpack_exports__, {
57
+ normalize: () => (normalize)
58
+ });
59
+
60
+ exports.normalize = __webpack_exports__.normalize;
61
+ for(var __rspack_i in __webpack_exports__) {
62
+ if(["normalize"].indexOf(__rspack_i) === -1) {
63
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
64
+ }
65
+ }
66
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,15 @@
1
+ function normalize(path, trailingSlash) {
2
+ let cand = path.replace(/\\/g, '/');
3
+ if (typeof trailingSlash === 'undefined') {
4
+ return cand;
5
+ }
6
+ while(cand.endsWith('/')){
7
+ cand = cand.substring(0, cand.length - 1);
8
+ }
9
+ if (trailingSlash) {
10
+ return cand + '/';
11
+ }
12
+ return cand;
13
+ }
14
+
15
+ export { normalize };