@module-federation/esbuild 0.0.95 → 0.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/lib/collect-exports.js +151 -0
- package/dist/adapters/lib/collect-exports.mjs +87 -0
- package/dist/adapters/lib/commonjs.js +260 -0
- package/dist/adapters/lib/commonjs.mjs +209 -0
- package/dist/adapters/lib/containerPlugin.js +232 -0
- package/dist/adapters/lib/containerPlugin.mjs +182 -0
- package/dist/adapters/lib/containerReference.js +219 -0
- package/dist/adapters/lib/containerReference.mjs +154 -0
- package/dist/adapters/lib/lexer.js +184 -0
- package/dist/adapters/lib/lexer.mjs +138 -0
- package/dist/adapters/lib/linkRemotesPlugin.js +115 -0
- package/dist/adapters/lib/linkRemotesPlugin.mjs +50 -0
- package/dist/adapters/lib/manifest.js +229 -0
- package/dist/adapters/lib/manifest.mjs +168 -0
- package/dist/adapters/lib/plugin.js +339 -0
- package/dist/adapters/lib/plugin.mjs +282 -0
- package/dist/adapters/lib/react-replacements.js +81 -0
- package/dist/adapters/lib/react-replacements.mjs +35 -0
- package/dist/adapters/lib/transform.js +169 -0
- package/dist/adapters/lib/transform.mjs +120 -0
- package/dist/adapters/lib/utils.js +83 -0
- package/dist/adapters/lib/utils.mjs +33 -0
- package/dist/build.js +131 -473
- package/dist/build.mjs +13 -380
- package/dist/index.js +41 -26
- package/dist/index.mjs +4 -1
- package/dist/lib/config/configuration-context.js +70 -0
- package/dist/lib/config/configuration-context.mjs +20 -0
- package/dist/lib/config/federation-config.js +31 -0
- package/dist/lib/config/federation-config.mjs +4 -0
- package/dist/lib/config/share-utils.js +339 -0
- package/dist/lib/config/share-utils.mjs +254 -0
- package/dist/lib/config/with-native-federation.js +118 -0
- package/dist/lib/config/with-native-federation.mjs +71 -0
- package/dist/lib/core/build-adapter.js +70 -0
- package/dist/lib/core/build-adapter.mjs +18 -0
- package/dist/lib/core/createContainerTemplate.js +231 -0
- package/dist/lib/core/createContainerTemplate.mjs +185 -0
- package/dist/lib/core/default-skip-list.js +99 -0
- package/dist/lib/core/default-skip-list.mjs +47 -0
- package/dist/lib/core/federation-options.js +31 -0
- package/dist/lib/core/federation-options.mjs +4 -0
- package/dist/lib/core/get-externals.js +65 -0
- package/dist/lib/core/get-externals.mjs +19 -0
- package/dist/lib/core/load-federation-config.js +69 -0
- package/dist/lib/core/load-federation-config.mjs +20 -0
- package/dist/lib/core/write-federation-info.js +65 -0
- package/dist/lib/core/write-federation-info.mjs +16 -0
- package/dist/lib/utils/logger.js +111 -0
- package/dist/lib/utils/logger.mjs +46 -0
- package/dist/lib/utils/mapped-paths.js +94 -0
- package/dist/lib/utils/mapped-paths.mjs +46 -0
- package/dist/lib/utils/normalize.js +63 -0
- package/dist/lib/utils/normalize.mjs +17 -0
- package/dist/lib/utils/package-info.js +324 -0
- package/dist/lib/utils/package-info.mjs +265 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.js +79 -1231
- package/dist/plugin.mjs +2 -1187
- package/dist/resolve/esm-resolver.mjs +15 -22
- package/package.json +2 -2
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
reactReplacements: () => (reactReplacements)
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const reactReplacements = {
|
|
45
|
+
dev: {
|
|
46
|
+
'node_modules/react/index.js': {
|
|
47
|
+
file: 'node_modules/react/cjs/react.development.js'
|
|
48
|
+
},
|
|
49
|
+
'node_modules/react/jsx-dev-runtime.js': {
|
|
50
|
+
file: 'node_modules/react/cjs/react-jsx-dev-runtime.development.js'
|
|
51
|
+
},
|
|
52
|
+
'node_modules/react/jsx-runtime.js': {
|
|
53
|
+
file: 'node_modules/react/cjs/react-jsx-runtime.development.js'
|
|
54
|
+
},
|
|
55
|
+
'node_modules/react-dom/index.js': {
|
|
56
|
+
file: 'node_modules/react-dom/cjs/react-dom.development.js'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
prod: {
|
|
60
|
+
'node_modules/react/index.js': {
|
|
61
|
+
file: 'node_modules/react/cjs/react.production.min.js'
|
|
62
|
+
},
|
|
63
|
+
'node_modules/react/jsx-dev-runtime.js': {
|
|
64
|
+
file: 'node_modules/react/cjs/react-jsx-dev-runtime.production.min.js'
|
|
65
|
+
},
|
|
66
|
+
'node_modules/react/jsx-runtime.js': {
|
|
67
|
+
file: 'node_modules/react/cjs/react-jsx-runtime.production.min.js'
|
|
68
|
+
},
|
|
69
|
+
'node_modules/react-dom/index.js': {
|
|
70
|
+
file: 'node_modules/react-dom/cjs/react-dom.production.min.js'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.reactReplacements = __webpack_exports__.reactReplacements;
|
|
76
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
77
|
+
if(["reactReplacements"].indexOf(__webpack_i__) === -1) {
|
|
78
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
;// CONCATENATED MODULE: ./src/adapters/lib/react-replacements.ts
|
|
3
|
+
|
|
4
|
+
const reactReplacements = {
|
|
5
|
+
dev: {
|
|
6
|
+
'node_modules/react/index.js': {
|
|
7
|
+
file: 'node_modules/react/cjs/react.development.js'
|
|
8
|
+
},
|
|
9
|
+
'node_modules/react/jsx-dev-runtime.js': {
|
|
10
|
+
file: 'node_modules/react/cjs/react-jsx-dev-runtime.development.js'
|
|
11
|
+
},
|
|
12
|
+
'node_modules/react/jsx-runtime.js': {
|
|
13
|
+
file: 'node_modules/react/cjs/react-jsx-runtime.development.js'
|
|
14
|
+
},
|
|
15
|
+
'node_modules/react-dom/index.js': {
|
|
16
|
+
file: 'node_modules/react-dom/cjs/react-dom.development.js'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
prod: {
|
|
20
|
+
'node_modules/react/index.js': {
|
|
21
|
+
file: 'node_modules/react/cjs/react.production.min.js'
|
|
22
|
+
},
|
|
23
|
+
'node_modules/react/jsx-dev-runtime.js': {
|
|
24
|
+
file: 'node_modules/react/cjs/react-jsx-dev-runtime.production.min.js'
|
|
25
|
+
},
|
|
26
|
+
'node_modules/react/jsx-runtime.js': {
|
|
27
|
+
file: 'node_modules/react/cjs/react-jsx-runtime.production.min.js'
|
|
28
|
+
},
|
|
29
|
+
'node_modules/react-dom/index.js': {
|
|
30
|
+
file: 'node_modules/react-dom/cjs/react-dom.production.min.js'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { reactReplacements };
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
transform: () => (/* binding */ transform)
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
;// CONCATENATED MODULE: external "esbuild"
|
|
48
|
+
const external_esbuild_namespaceObject = require("esbuild");
|
|
49
|
+
;// CONCATENATED MODULE: external "path"
|
|
50
|
+
const external_path_namespaceObject = require("path");
|
|
51
|
+
;// CONCATENATED MODULE: ./src/adapters/lib/transform.ts
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
const targets = {
|
|
55
|
+
esnext: 'esnext',
|
|
56
|
+
es2015: 'es2015',
|
|
57
|
+
es2016: 'es2016',
|
|
58
|
+
es2017: 'es2017',
|
|
59
|
+
es2018: 'es2018',
|
|
60
|
+
es2019: 'es2019',
|
|
61
|
+
es2020: 'es2020',
|
|
62
|
+
es2021: 'es2021',
|
|
63
|
+
es2022: 'es2022'
|
|
64
|
+
};
|
|
65
|
+
async function transform(input) {
|
|
66
|
+
let target = 'esnext';
|
|
67
|
+
if (input.target && targets[input.target]) {
|
|
68
|
+
target = targets[input.target];
|
|
69
|
+
} else if (input.target) {
|
|
70
|
+
throw new Error('<400> invalid target');
|
|
71
|
+
}
|
|
72
|
+
let loader = 'js';
|
|
73
|
+
const extname = external_path_namespaceObject.extname(input.filename);
|
|
74
|
+
switch(extname){
|
|
75
|
+
case '.jsx':
|
|
76
|
+
loader = 'jsx';
|
|
77
|
+
break;
|
|
78
|
+
case '.ts':
|
|
79
|
+
loader = 'ts';
|
|
80
|
+
break;
|
|
81
|
+
case '.tsx':
|
|
82
|
+
loader = 'tsx';
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
const imports = {};
|
|
86
|
+
const trailingSlashImports = {};
|
|
87
|
+
let jsxImportSource = '';
|
|
88
|
+
if (input.importMap) {
|
|
89
|
+
const im = JSON.parse(input.importMap);
|
|
90
|
+
if (im.imports) {
|
|
91
|
+
for (const [key, value] of Object.entries(im.imports)){
|
|
92
|
+
if (typeof value === 'string' && value !== '') {
|
|
93
|
+
if (key.endsWith('/')) {
|
|
94
|
+
trailingSlashImports[key] = value;
|
|
95
|
+
} else {
|
|
96
|
+
if (key === '@jsxImportSource') {
|
|
97
|
+
jsxImportSource = value;
|
|
98
|
+
}
|
|
99
|
+
imports[key] = value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const onResolver = (args)=>{
|
|
106
|
+
let resolvedPath = args.path;
|
|
107
|
+
if (imports[resolvedPath]) {
|
|
108
|
+
resolvedPath = imports[resolvedPath];
|
|
109
|
+
} else {
|
|
110
|
+
for (const [key, value] of Object.entries(trailingSlashImports)){
|
|
111
|
+
if (resolvedPath.startsWith(key)) {
|
|
112
|
+
resolvedPath = value + resolvedPath.slice(key.length);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
path: resolvedPath,
|
|
119
|
+
external: true
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const stdin = {
|
|
123
|
+
contents: input.code,
|
|
124
|
+
resolveDir: '/',
|
|
125
|
+
sourcefile: input.filename,
|
|
126
|
+
loader: loader
|
|
127
|
+
};
|
|
128
|
+
const jsx = jsxImportSource ? 'automatic' : 'transform';
|
|
129
|
+
const opts = {
|
|
130
|
+
outdir: '/esbuild',
|
|
131
|
+
stdin: stdin,
|
|
132
|
+
platform: 'browser',
|
|
133
|
+
format: 'esm',
|
|
134
|
+
target: target,
|
|
135
|
+
jsx: jsx,
|
|
136
|
+
jsxImportSource: jsxImportSource,
|
|
137
|
+
bundle: true,
|
|
138
|
+
treeShaking: false,
|
|
139
|
+
minifyWhitespace: false,
|
|
140
|
+
minifySyntax: false,
|
|
141
|
+
write: false,
|
|
142
|
+
plugins: [
|
|
143
|
+
{
|
|
144
|
+
name: 'resolver',
|
|
145
|
+
setup (build) {
|
|
146
|
+
build.onResolve({
|
|
147
|
+
filter: /.*/
|
|
148
|
+
}, onResolver);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
const ret = await external_esbuild_namespaceObject.build(opts);
|
|
154
|
+
if (ret.errors.length > 0) {
|
|
155
|
+
throw new Error('<400> failed to validate code: ' + ret.errors[0].text);
|
|
156
|
+
}
|
|
157
|
+
if (!ret.outputFiles || ret.outputFiles.length === 0) {
|
|
158
|
+
throw new Error('<400> failed to validate code: no output files');
|
|
159
|
+
}
|
|
160
|
+
return ret.outputFiles[0].text;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
exports.transform = __webpack_exports__.transform;
|
|
164
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
165
|
+
if(["transform"].indexOf(__webpack_i__) === -1) {
|
|
166
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { build as external_esbuild_build } from "esbuild";
|
|
2
|
+
import { extname as external_path_extname } from "path";
|
|
3
|
+
|
|
4
|
+
;// CONCATENATED MODULE: external "esbuild"
|
|
5
|
+
|
|
6
|
+
;// CONCATENATED MODULE: external "path"
|
|
7
|
+
|
|
8
|
+
;// CONCATENATED MODULE: ./src/adapters/lib/transform.ts
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const targets = {
|
|
12
|
+
esnext: 'esnext',
|
|
13
|
+
es2015: 'es2015',
|
|
14
|
+
es2016: 'es2016',
|
|
15
|
+
es2017: 'es2017',
|
|
16
|
+
es2018: 'es2018',
|
|
17
|
+
es2019: 'es2019',
|
|
18
|
+
es2020: 'es2020',
|
|
19
|
+
es2021: 'es2021',
|
|
20
|
+
es2022: 'es2022'
|
|
21
|
+
};
|
|
22
|
+
async function transform(input) {
|
|
23
|
+
let target = 'esnext';
|
|
24
|
+
if (input.target && targets[input.target]) {
|
|
25
|
+
target = targets[input.target];
|
|
26
|
+
} else if (input.target) {
|
|
27
|
+
throw new Error('<400> invalid target');
|
|
28
|
+
}
|
|
29
|
+
let loader = 'js';
|
|
30
|
+
const extname = external_path_extname(input.filename);
|
|
31
|
+
switch(extname){
|
|
32
|
+
case '.jsx':
|
|
33
|
+
loader = 'jsx';
|
|
34
|
+
break;
|
|
35
|
+
case '.ts':
|
|
36
|
+
loader = 'ts';
|
|
37
|
+
break;
|
|
38
|
+
case '.tsx':
|
|
39
|
+
loader = 'tsx';
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
const imports = {};
|
|
43
|
+
const trailingSlashImports = {};
|
|
44
|
+
let jsxImportSource = '';
|
|
45
|
+
if (input.importMap) {
|
|
46
|
+
const im = JSON.parse(input.importMap);
|
|
47
|
+
if (im.imports) {
|
|
48
|
+
for (const [key, value] of Object.entries(im.imports)){
|
|
49
|
+
if (typeof value === 'string' && value !== '') {
|
|
50
|
+
if (key.endsWith('/')) {
|
|
51
|
+
trailingSlashImports[key] = value;
|
|
52
|
+
} else {
|
|
53
|
+
if (key === '@jsxImportSource') {
|
|
54
|
+
jsxImportSource = value;
|
|
55
|
+
}
|
|
56
|
+
imports[key] = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const onResolver = (args)=>{
|
|
63
|
+
let resolvedPath = args.path;
|
|
64
|
+
if (imports[resolvedPath]) {
|
|
65
|
+
resolvedPath = imports[resolvedPath];
|
|
66
|
+
} else {
|
|
67
|
+
for (const [key, value] of Object.entries(trailingSlashImports)){
|
|
68
|
+
if (resolvedPath.startsWith(key)) {
|
|
69
|
+
resolvedPath = value + resolvedPath.slice(key.length);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
path: resolvedPath,
|
|
76
|
+
external: true
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const stdin = {
|
|
80
|
+
contents: input.code,
|
|
81
|
+
resolveDir: '/',
|
|
82
|
+
sourcefile: input.filename,
|
|
83
|
+
loader: loader
|
|
84
|
+
};
|
|
85
|
+
const jsx = jsxImportSource ? 'automatic' : 'transform';
|
|
86
|
+
const opts = {
|
|
87
|
+
outdir: '/esbuild',
|
|
88
|
+
stdin: stdin,
|
|
89
|
+
platform: 'browser',
|
|
90
|
+
format: 'esm',
|
|
91
|
+
target: target,
|
|
92
|
+
jsx: jsx,
|
|
93
|
+
jsxImportSource: jsxImportSource,
|
|
94
|
+
bundle: true,
|
|
95
|
+
treeShaking: false,
|
|
96
|
+
minifyWhitespace: false,
|
|
97
|
+
minifySyntax: false,
|
|
98
|
+
write: false,
|
|
99
|
+
plugins: [
|
|
100
|
+
{
|
|
101
|
+
name: 'resolver',
|
|
102
|
+
setup (build) {
|
|
103
|
+
build.onResolve({
|
|
104
|
+
filter: /.*/
|
|
105
|
+
}, onResolver);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
const ret = await external_esbuild_build(opts);
|
|
111
|
+
if (ret.errors.length > 0) {
|
|
112
|
+
throw new Error('<400> failed to validate code: ' + ret.errors[0].text);
|
|
113
|
+
}
|
|
114
|
+
if (!ret.outputFiles || ret.outputFiles.length === 0) {
|
|
115
|
+
throw new Error('<400> failed to validate code: no output files');
|
|
116
|
+
}
|
|
117
|
+
return ret.outputFiles[0].text;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { transform };
|
|
@@ -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/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
|
+
cachedReduce: () => (cachedReduce),
|
|
42
|
+
makeLegalIdentifier: () => (makeLegalIdentifier),
|
|
43
|
+
orderedUniq: () => (orderedUniq)
|
|
44
|
+
});
|
|
45
|
+
function orderedUniq(array) {
|
|
46
|
+
// prettier-ignore
|
|
47
|
+
const ret = [], visited = new Set();
|
|
48
|
+
for (const val of array)if (!visited.has(val)) visited.add(val), ret.push(val);
|
|
49
|
+
return ret;
|
|
50
|
+
}
|
|
51
|
+
function cachedReduce(array, reducer, s) {
|
|
52
|
+
// prettier-ignore
|
|
53
|
+
const cache = [
|
|
54
|
+
s
|
|
55
|
+
];
|
|
56
|
+
let cacheLen = 1, last = s;
|
|
57
|
+
return (len)=>{
|
|
58
|
+
while(cacheLen <= len)cacheLen = cache.push(last = reducer(last, array[cacheLen - 1]));
|
|
59
|
+
return cache[len];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// from @rollup/pluginutils
|
|
63
|
+
const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
|
|
64
|
+
const builtin = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
|
|
65
|
+
const forbiddenIdentifiers = new Set(`${reservedWords} ${builtin}`.split(' '));
|
|
66
|
+
forbiddenIdentifiers.add('');
|
|
67
|
+
const makeLegalIdentifier = function makeLegalIdentifier(str) {
|
|
68
|
+
let identifier = str.replace(/-(\w)/g, (_, letter)=>letter.toUpperCase()).replace(/[^$_a-zA-Z0-9]/g, '_');
|
|
69
|
+
if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {
|
|
70
|
+
identifier = `_${identifier}`;
|
|
71
|
+
}
|
|
72
|
+
return identifier || '_';
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.cachedReduce = __webpack_exports__.cachedReduce;
|
|
76
|
+
exports.makeLegalIdentifier = __webpack_exports__.makeLegalIdentifier;
|
|
77
|
+
exports.orderedUniq = __webpack_exports__.orderedUniq;
|
|
78
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
79
|
+
if(["cachedReduce","makeLegalIdentifier","orderedUniq"].indexOf(__webpack_i__) === -1) {
|
|
80
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
;// CONCATENATED MODULE: ./src/adapters/lib/utils.ts
|
|
3
|
+
function orderedUniq(array) {
|
|
4
|
+
// prettier-ignore
|
|
5
|
+
const ret = [], visited = new Set();
|
|
6
|
+
for (const val of array)if (!visited.has(val)) visited.add(val), ret.push(val);
|
|
7
|
+
return ret;
|
|
8
|
+
}
|
|
9
|
+
function cachedReduce(array, reducer, s) {
|
|
10
|
+
// prettier-ignore
|
|
11
|
+
const cache = [
|
|
12
|
+
s
|
|
13
|
+
];
|
|
14
|
+
let cacheLen = 1, last = s;
|
|
15
|
+
return (len)=>{
|
|
16
|
+
while(cacheLen <= len)cacheLen = cache.push(last = reducer(last, array[cacheLen - 1]));
|
|
17
|
+
return cache[len];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
// from @rollup/pluginutils
|
|
21
|
+
const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
|
|
22
|
+
const builtin = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
|
|
23
|
+
const forbiddenIdentifiers = new Set(`${reservedWords} ${builtin}`.split(' '));
|
|
24
|
+
forbiddenIdentifiers.add('');
|
|
25
|
+
const utils_makeLegalIdentifier = function makeLegalIdentifier(str) {
|
|
26
|
+
let identifier = str.replace(/-(\w)/g, (_, letter)=>letter.toUpperCase()).replace(/[^$_a-zA-Z0-9]/g, '_');
|
|
27
|
+
if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {
|
|
28
|
+
identifier = `_${identifier}`;
|
|
29
|
+
}
|
|
30
|
+
return identifier || '_';
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { cachedReduce, utils_makeLegalIdentifier as makeLegalIdentifier, orderedUniq };
|