@rsdoctor/graph 1.2.3 → 1.2.4-beta.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 (122) hide show
  1. package/dist/{type/graph → graph}/chunk-graph/asset.d.ts +0 -1
  2. package/dist/{type/graph → graph}/chunk-graph/chunk.d.ts +0 -1
  3. package/dist/{type/graph → graph}/chunk-graph/entrypoint.d.ts +0 -1
  4. package/dist/{type/graph → graph}/chunk-graph/graph.d.ts +0 -1
  5. package/dist/{type/graph → graph}/chunk-graph/index.d.ts +0 -1
  6. package/dist/{type/graph → graph}/index.d.ts +0 -1
  7. package/dist/{type/graph → graph}/module-graph/dependency.d.ts +0 -1
  8. package/dist/{type/graph → graph}/module-graph/graph.d.ts +0 -1
  9. package/dist/{type/graph → graph}/module-graph/index.d.ts +0 -1
  10. package/dist/{type/graph → graph}/module-graph/module.d.ts +1 -2
  11. package/dist/{type/graph → graph}/module-graph/statement.d.ts +0 -1
  12. package/dist/{type/graph → graph}/module-graph/tree-shaking/export.d.ts +0 -1
  13. package/dist/{type/graph → graph}/module-graph/tree-shaking/index.d.ts +0 -1
  14. package/dist/{type/graph → graph}/module-graph/tree-shaking/module.d.ts +0 -1
  15. package/dist/{type/graph → graph}/module-graph/tree-shaking/sideEffect.d.ts +0 -1
  16. package/dist/{type/graph → graph}/module-graph/tree-shaking/types.d.ts +0 -1
  17. package/dist/{type/graph → graph}/module-graph/tree-shaking/variable.d.ts +0 -1
  18. package/dist/{type/graph → graph}/module-graph/types.d.ts +0 -1
  19. package/dist/{type/graph → graph}/module-graph/utils.d.ts +0 -1
  20. package/dist/{type/graph → graph}/package-graph/dependency.d.ts +0 -1
  21. package/dist/{type/graph → graph}/package-graph/graph.d.ts +0 -1
  22. package/dist/{type/graph → graph}/package-graph/index.d.ts +0 -1
  23. package/dist/{type/graph → graph}/package-graph/package.d.ts +0 -1
  24. package/dist/{type/graph → graph}/package-graph/types.d.ts +0 -1
  25. package/dist/{type/graph → graph}/package-graph/utils.d.ts +0 -1
  26. package/dist/index.cjs +1541 -0
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.js +1452 -0
  29. package/dist/transform/chunks/assetsContent.d.ts +4 -0
  30. package/dist/transform/chunks/assetsModules.d.ts +22 -0
  31. package/dist/transform/chunks/chunkTransform.d.ts +5 -0
  32. package/dist/transform/chunks/index.d.ts +3 -0
  33. package/dist/transform/index.d.ts +4 -0
  34. package/dist/transform/module-graph/compatible.d.ts +8 -0
  35. package/dist/transform/module-graph/index.d.ts +3 -0
  36. package/dist/transform/module-graph/transform.d.ts +7 -0
  37. package/dist/transform/module-graph/utils.d.ts +13 -0
  38. package/dist/transform/trans-utils/index.d.ts +1 -0
  39. package/dist/transform/trans-utils/transStats.d.ts +10 -0
  40. package/dist/transform/webpack/compatible.d.ts +16 -0
  41. package/dist/types/index.d.ts +1 -0
  42. package/dist/types/transform.d.ts +6 -0
  43. package/package.json +19 -9
  44. package/dist/cjs/graph/chunk-graph/asset.js +0 -72
  45. package/dist/cjs/graph/chunk-graph/chunk.js +0 -121
  46. package/dist/cjs/graph/chunk-graph/entrypoint.js +0 -73
  47. package/dist/cjs/graph/chunk-graph/graph.js +0 -109
  48. package/dist/cjs/graph/chunk-graph/index.js +0 -87
  49. package/dist/cjs/graph/index.js +0 -78
  50. package/dist/cjs/graph/module-graph/dependency.js +0 -100
  51. package/dist/cjs/graph/module-graph/graph.js +0 -319
  52. package/dist/cjs/graph/module-graph/index.js +0 -105
  53. package/dist/cjs/graph/module-graph/module.js +0 -328
  54. package/dist/cjs/graph/module-graph/statement.js +0 -92
  55. package/dist/cjs/graph/module-graph/tree-shaking/export.js +0 -102
  56. package/dist/cjs/graph/module-graph/tree-shaking/index.js +0 -96
  57. package/dist/cjs/graph/module-graph/tree-shaking/module.js +0 -100
  58. package/dist/cjs/graph/module-graph/tree-shaking/sideEffect.js +0 -89
  59. package/dist/cjs/graph/module-graph/tree-shaking/types.js +0 -18
  60. package/dist/cjs/graph/module-graph/tree-shaking/variable.js +0 -69
  61. package/dist/cjs/graph/module-graph/types.js +0 -18
  62. package/dist/cjs/graph/module-graph/utils.js +0 -63
  63. package/dist/cjs/graph/package-graph/dependency.js +0 -64
  64. package/dist/cjs/graph/package-graph/graph.js +0 -170
  65. package/dist/cjs/graph/package-graph/index.js +0 -87
  66. package/dist/cjs/graph/package-graph/package.js +0 -125
  67. package/dist/cjs/graph/package-graph/types.js +0 -18
  68. package/dist/cjs/graph/package-graph/utils.js +0 -61
  69. package/dist/cjs/index.js +0 -60
  70. package/dist/esm/graph/chunk-graph/asset.mjs +0 -38
  71. package/dist/esm/graph/chunk-graph/chunk.mjs +0 -87
  72. package/dist/esm/graph/chunk-graph/entrypoint.mjs +0 -39
  73. package/dist/esm/graph/chunk-graph/graph.mjs +0 -75
  74. package/dist/esm/graph/chunk-graph/index.mjs +0 -4
  75. package/dist/esm/graph/index.mjs +0 -3
  76. package/dist/esm/graph/module-graph/dependency.mjs +0 -66
  77. package/dist/esm/graph/module-graph/graph.mjs +0 -285
  78. package/dist/esm/graph/module-graph/index.mjs +0 -6
  79. package/dist/esm/graph/module-graph/module.mjs +0 -284
  80. package/dist/esm/graph/module-graph/statement.mjs +0 -58
  81. package/dist/esm/graph/module-graph/tree-shaking/export.mjs +0 -68
  82. package/dist/esm/graph/module-graph/tree-shaking/index.mjs +0 -5
  83. package/dist/esm/graph/module-graph/tree-shaking/module.mjs +0 -66
  84. package/dist/esm/graph/module-graph/tree-shaking/sideEffect.mjs +0 -55
  85. package/dist/esm/graph/module-graph/tree-shaking/types.mjs +0 -0
  86. package/dist/esm/graph/module-graph/tree-shaking/variable.mjs +0 -35
  87. package/dist/esm/graph/module-graph/types.mjs +0 -0
  88. package/dist/esm/graph/module-graph/utils.mjs +0 -23
  89. package/dist/esm/graph/package-graph/dependency.mjs +0 -30
  90. package/dist/esm/graph/package-graph/graph.mjs +0 -123
  91. package/dist/esm/graph/package-graph/index.mjs +0 -4
  92. package/dist/esm/graph/package-graph/package.mjs +0 -91
  93. package/dist/esm/graph/package-graph/types.mjs +0 -0
  94. package/dist/esm/graph/package-graph/utils.mjs +0 -24
  95. package/dist/esm/index.mjs +0 -1
  96. package/dist/type/graph/chunk-graph/asset.d.ts.map +0 -1
  97. package/dist/type/graph/chunk-graph/chunk.d.ts.map +0 -1
  98. package/dist/type/graph/chunk-graph/entrypoint.d.ts.map +0 -1
  99. package/dist/type/graph/chunk-graph/graph.d.ts.map +0 -1
  100. package/dist/type/graph/chunk-graph/index.d.ts.map +0 -1
  101. package/dist/type/graph/index.d.ts.map +0 -1
  102. package/dist/type/graph/module-graph/dependency.d.ts.map +0 -1
  103. package/dist/type/graph/module-graph/graph.d.ts.map +0 -1
  104. package/dist/type/graph/module-graph/index.d.ts.map +0 -1
  105. package/dist/type/graph/module-graph/module.d.ts.map +0 -1
  106. package/dist/type/graph/module-graph/statement.d.ts.map +0 -1
  107. package/dist/type/graph/module-graph/tree-shaking/export.d.ts.map +0 -1
  108. package/dist/type/graph/module-graph/tree-shaking/index.d.ts.map +0 -1
  109. package/dist/type/graph/module-graph/tree-shaking/module.d.ts.map +0 -1
  110. package/dist/type/graph/module-graph/tree-shaking/sideEffect.d.ts.map +0 -1
  111. package/dist/type/graph/module-graph/tree-shaking/types.d.ts.map +0 -1
  112. package/dist/type/graph/module-graph/tree-shaking/variable.d.ts.map +0 -1
  113. package/dist/type/graph/module-graph/types.d.ts.map +0 -1
  114. package/dist/type/graph/module-graph/utils.d.ts.map +0 -1
  115. package/dist/type/graph/package-graph/dependency.d.ts.map +0 -1
  116. package/dist/type/graph/package-graph/graph.d.ts.map +0 -1
  117. package/dist/type/graph/package-graph/index.d.ts.map +0 -1
  118. package/dist/type/graph/package-graph/package.d.ts.map +0 -1
  119. package/dist/type/graph/package-graph/types.d.ts.map +0 -1
  120. package/dist/type/graph/package-graph/utils.d.ts.map +0 -1
  121. package/dist/type/index.d.ts +0 -2
  122. package/dist/type/index.d.ts.map +0 -1
@@ -1,328 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.d = (exports1, definition)=>{
14
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
- enumerable: true,
16
- get: definition[key]
17
- });
18
- };
19
- })();
20
- (()=>{
21
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
- })();
23
- (()=>{
24
- __webpack_require__.r = (exports1)=>{
25
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
- value: 'Module'
27
- });
28
- Object.defineProperty(exports1, '__esModule', {
29
- value: true
30
- });
31
- };
32
- })();
33
- var __webpack_exports__ = {};
34
- __webpack_require__.r(__webpack_exports__);
35
- __webpack_require__.d(__webpack_exports__, {
36
- Module: ()=>Module
37
- });
38
- const types_namespaceObject = require("@rsdoctor/types");
39
- const external_path_namespaceObject = require("path");
40
- var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
41
- const common_namespaceObject = require("@rsdoctor/utils/common");
42
- const external_dependency_js_namespaceObject = require("./dependency.js");
43
- const external_statement_js_namespaceObject = require("./statement.js");
44
- const external_utils_js_namespaceObject = require("./utils.js");
45
- const external_node_zlib_namespaceObject = require("node:zlib");
46
- let module_id = 1;
47
- class Module {
48
- static init() {
49
- module_id = 1;
50
- }
51
- get rootModule() {
52
- return this.modules.find((item)=>item.path === this.path);
53
- }
54
- get isPreferSource() {
55
- if ('boolean' == typeof this._isPreferSource) return this._isPreferSource;
56
- const result = this.source.source.length > 0 && 'test code' !== this.source.source && Boolean(this.sourceMap);
57
- this._isPreferSource = result;
58
- return result;
59
- }
60
- addBailoutReason(reason) {
61
- this.bailoutReason.push(reason);
62
- }
63
- getBailoutReason() {
64
- return this.bailoutReason;
65
- }
66
- getChunks() {
67
- return this.chunks.slice();
68
- }
69
- addChunk(chunk) {
70
- if (!this.chunks.includes(chunk)) {
71
- this.chunks.push(chunk);
72
- chunk.addModule(this);
73
- }
74
- }
75
- removeChunk(chunk) {
76
- this.chunks = this.chunks.filter((item)=>item !== chunk);
77
- }
78
- getDependencies() {
79
- return this.dependencies.slice();
80
- }
81
- getDependencyByRequest(request) {
82
- return this.dependencies.find((item)=>item.request === request);
83
- }
84
- getDependencyByModule(module) {
85
- return this.dependencies.find((item)=>item.originDependency === module || item.dependency === module);
86
- }
87
- addDependency(request, module, kind, statements) {
88
- const dep = new external_dependency_js_namespaceObject.Dependency(request, this, module, kind, statements);
89
- if (this.dependencies.every((item)=>!item.isSameWithoutStatements(dep))) {
90
- this.dependencies.push(dep);
91
- module.addImported(this);
92
- if (module.rootModule) module.rootModule.addImported(this);
93
- return dep;
94
- }
95
- }
96
- removeDependency(dep) {
97
- this.dependencies = this.dependencies.filter((item)=>item === dep);
98
- }
99
- removeDependencyByModule(module) {
100
- const dep = this.getDependencyByModule(module);
101
- if (dep) this.removeDependency(dep);
102
- }
103
- getImported() {
104
- return this.imported.slice();
105
- }
106
- addImported(module) {
107
- if (!this.imported.includes(module)) this.imported.push(module);
108
- }
109
- removeImported(module) {
110
- this.imported = this.imported.filter((item)=>item === module);
111
- }
112
- setProgram(program) {
113
- this.program = program;
114
- }
115
- getProgram() {
116
- return this.program;
117
- }
118
- setSource(input) {
119
- const { source } = this;
120
- source.source = input.source ?? source.source;
121
- source.transformed = input.transformed ?? source.transformed;
122
- source.parsedSource = input.parsedSource ?? source.parsedSource;
123
- }
124
- getSource(type = types_namespaceObject.SDK.ToDataType.Normal) {
125
- if (type === types_namespaceObject.SDK.ToDataType.NoCode) return {
126
- source: '',
127
- transformed: '',
128
- parsedSource: ''
129
- };
130
- if (type === types_namespaceObject.SDK.ToDataType.NoSourceAndAssets || type === types_namespaceObject.SDK.ToDataType.NoSource) return {
131
- source: '',
132
- transformed: '',
133
- parsedSource: this.isPreferSource ? '' : this.source.parsedSource
134
- };
135
- if (type === types_namespaceObject.SDK.ToDataType.All) return {
136
- source: this.source.source,
137
- transformed: this.source.transformed,
138
- parsedSource: this.isPreferSource ? '' : this.source.parsedSource
139
- };
140
- return {
141
- source: this.source.source,
142
- transformed: '',
143
- parsedSource: this.isPreferSource ? '' : this.source.parsedSource
144
- };
145
- }
146
- setSourceMap(sourceMap) {
147
- this.sourceMap = sourceMap;
148
- }
149
- getSourceMap() {
150
- return this.sourceMap;
151
- }
152
- setSize(input) {
153
- const { size } = this;
154
- size.sourceSize = input.sourceSize ?? size.sourceSize;
155
- size.transformedSize = input.transformedSize ?? size.transformedSize;
156
- size.parsedSize = input.parsedSize ?? size.parsedSize;
157
- if ('number' == typeof input.gzipSize) size.gzipSize = input.gzipSize;
158
- else {
159
- const code = this.source.parsedSource || this.source.source;
160
- if (code && 'string' == typeof code && code.length > 0) try {
161
- size.gzipSize = (0, external_node_zlib_namespaceObject.gzipSync)(code, {
162
- level: 9
163
- }).length;
164
- } catch (e) {
165
- size.gzipSize = 0;
166
- }
167
- }
168
- }
169
- getSize() {
170
- return {
171
- ...this.size
172
- };
173
- }
174
- getStatement(transformed) {
175
- return new external_statement_js_namespaceObject.Statement(this, {
176
- source: this.getSourceRange(transformed),
177
- transformed: {
178
- start: {
179
- ...transformed.start
180
- },
181
- end: transformed.end ? {
182
- ...transformed.end
183
- } : void 0
184
- }
185
- });
186
- }
187
- getSourceRange(transformed) {
188
- const { sourceMap } = this;
189
- if (!sourceMap) return;
190
- const source = {
191
- start: {}
192
- };
193
- const startInSource = sourceMap.originalPositionFor({
194
- line: transformed.start.line ?? 0,
195
- column: transformed.start.column ?? 0,
196
- bias: 1
197
- });
198
- if (common_namespaceObject.Lodash.isNumber(startInSource.line)) source.start = {
199
- line: startInSource.line,
200
- column: startInSource.column ?? void 0
201
- };
202
- if (transformed.end) {
203
- const endInSource = sourceMap.originalPositionFor({
204
- line: transformed.end.line ?? 0,
205
- column: transformed.end.column ?? 0
206
- });
207
- if (common_namespaceObject.Lodash.isNumber(endInSource.line)) source.end = {
208
- line: endInSource.line,
209
- column: endInSource.column ?? void 0
210
- };
211
- }
212
- return source;
213
- }
214
- addNormalModule(module) {
215
- if (!this.modules.includes(module)) {
216
- this.modules.push(module);
217
- module.addConcatenationModule(this);
218
- }
219
- }
220
- getNormalModules() {
221
- return this.modules.slice();
222
- }
223
- addConcatenationModule(module) {
224
- if (!this.concatenationModules.includes(module)) this.concatenationModules.push(module);
225
- }
226
- addIssuerPath(issuerPath) {
227
- var _this_issuerPath;
228
- if (!(null == (_this_issuerPath = this.issuerPath) ? void 0 : _this_issuerPath.length)) this.issuerPath = issuerPath;
229
- }
230
- getIssuerPath() {
231
- return this.issuerPath;
232
- }
233
- getConcatenationModules() {
234
- return this.concatenationModules.slice();
235
- }
236
- toData(contextPath) {
237
- var _this_issuerPath;
238
- const { isPreferSource } = this;
239
- const moduleName = (0, external_utils_js_namespaceObject.getModuleName)(this.webpackId);
240
- const data = {
241
- id: this.id,
242
- renderId: this.renderId,
243
- webpackId: contextPath && moduleName.indexOf('.') > 0 ? external_path_default().relative(contextPath, moduleName) : this.webpackId,
244
- path: this.path,
245
- isPreferSource,
246
- dependencies: this.dependencies.map((item)=>item.id),
247
- imported: this.imported.map((item)=>item.id),
248
- chunks: this.chunks.map((item)=>item.id),
249
- size: this.getSize(),
250
- kind: this.kind,
251
- ...this.layer ? {
252
- layer: this.layer
253
- } : {},
254
- issuerPath: (null == (_this_issuerPath = this.issuerPath) ? void 0 : _this_issuerPath.filter((issuer)=>issuer.moduleId).map((issuer)=>issuer.moduleId)) || [],
255
- bailoutReason: this.bailoutReason
256
- };
257
- if (this.meta.hasSetEsModuleStatement || this.meta.strictHarmonyModule) {
258
- data.meta = {};
259
- if (this.meta.hasSetEsModuleStatement) data.meta.hasSetEsModuleStatement = true;
260
- if (this.meta.strictHarmonyModule) data.meta.strictHarmonyModule = true;
261
- }
262
- if (this.isEntry) data.isEntry = this.isEntry;
263
- if (this.modules.length > 0) data.modules = this.modules.map((item)=>item.id);
264
- if (this.rootModule) data.rootModule = this.rootModule.id;
265
- if (this.concatenationModules.length > 0) data.concatenationModules = this.concatenationModules.map((data)=>data.id);
266
- return data;
267
- }
268
- setId(id) {
269
- this.id = id;
270
- }
271
- setRenderId(renderId) {
272
- this.renderId = renderId;
273
- }
274
- setChunks(chunks) {
275
- this.chunks = chunks;
276
- }
277
- setDependencies(dependencies) {
278
- this.dependencies = dependencies;
279
- }
280
- setImported(imported) {
281
- this.imported = imported;
282
- }
283
- setModules(modules) {
284
- this.modules = modules;
285
- }
286
- setConcatenationModules(modules) {
287
- this.concatenationModules = modules;
288
- }
289
- constructor(webpackId, path, isEntry = false, kind = types_namespaceObject.SDK.ModuleKind.Normal, renderId, layer = ''){
290
- this.issuerPath = [];
291
- this.bailoutReason = [];
292
- this.source = {
293
- source: '',
294
- transformed: '',
295
- parsedSource: ''
296
- };
297
- this.size = {
298
- sourceSize: 0,
299
- transformedSize: 0,
300
- parsedSize: 0,
301
- gzipSize: 0
302
- };
303
- this.chunks = [];
304
- this.dependencies = [];
305
- this.imported = [];
306
- this.modules = [];
307
- this.concatenationModules = [];
308
- this.meta = {
309
- hasSetEsModuleStatement: false,
310
- strictHarmonyModule: false
311
- };
312
- this.id = module_id++;
313
- this.webpackId = webpackId;
314
- this.path = path;
315
- this.isEntry = isEntry;
316
- this.kind = kind;
317
- this.renderId = renderId;
318
- this.layer = layer;
319
- }
320
- }
321
- Module.kind = types_namespaceObject.SDK.ModuleKind;
322
- exports.Module = __webpack_exports__.Module;
323
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
324
- "Module"
325
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
326
- Object.defineProperty(exports, '__esModule', {
327
- value: true
328
- });
@@ -1,92 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- Statement: ()=>Statement
28
- });
29
- const external_utils_js_namespaceObject = require("./utils.js");
30
- class Statement {
31
- static getDefaultStatement(module) {
32
- const defaultPosition = {
33
- line: 1,
34
- column: 0
35
- };
36
- const defaultRange = {
37
- start: {
38
- ...defaultPosition
39
- },
40
- end: {
41
- ...defaultPosition
42
- }
43
- };
44
- return new Statement(module, {
45
- source: {
46
- ...defaultRange
47
- },
48
- transformed: {
49
- ...defaultRange
50
- }
51
- });
52
- }
53
- isSame(statement) {
54
- return this.module.id === statement.module.id && (0, external_utils_js_namespaceObject.isSameRange)(this.position.transformed, statement.position.transformed);
55
- }
56
- getSourcePosition() {
57
- const { module, position } = this;
58
- if (position.source) return position.source;
59
- if (module.getSourceMap()) {
60
- position.source = module.getSourceRange(position.transformed);
61
- return position.source;
62
- }
63
- }
64
- getLineCode() {
65
- const useSource = this.module.isPreferSource && this.position.source;
66
- const sourceCode = this.module.getSource();
67
- const source = useSource ? sourceCode.source : sourceCode.transformed;
68
- const line = useSource ? this.position.source.start.line : this.position.transformed.start.line;
69
- if ('number' == typeof line) return source.split('\n')[line - 1];
70
- }
71
- toData() {
72
- const position = {
73
- transformed: this.position.transformed
74
- };
75
- if (this.position.source) position.source = this.position.source;
76
- return {
77
- position,
78
- module: this.module.id
79
- };
80
- }
81
- constructor(module, position){
82
- this.module = module;
83
- this.position = position;
84
- }
85
- }
86
- exports.Statement = __webpack_exports__.Statement;
87
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
88
- "Statement"
89
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
90
- Object.defineProperty(exports, '__esModule', {
91
- value: true
92
- });
@@ -1,102 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- ExportInfo: ()=>ExportInfo
28
- });
29
- let id = 1;
30
- class ExportInfo {
31
- static init() {
32
- id = 1;
33
- }
34
- get isReExport() {
35
- return Boolean(this.from);
36
- }
37
- set variable(data) {
38
- this._variable = data;
39
- }
40
- get variable() {
41
- var _this_getRecursiveExport;
42
- if (this._variable) return this._variable;
43
- if (!this.from || false === this._variable) {
44
- this._variable = false;
45
- return;
46
- }
47
- const result = null == (_this_getRecursiveExport = this.getRecursiveExport()) ? void 0 : _this_getRecursiveExport.variable;
48
- if (!result) this._variable = false;
49
- return result;
50
- }
51
- addSideEffect(info) {
52
- if (this._sideEffects.every((item)=>item.id !== info.id)) {
53
- this._sideEffects.push(info);
54
- if (this.from) this.from.addSideEffect(info);
55
- }
56
- }
57
- getSideEffects() {
58
- return this._sideEffects.slice();
59
- }
60
- setFromExport(from) {
61
- this.from = from;
62
- }
63
- getRecursiveExport(depth = 1 / 0) {
64
- if (0 === depth) throw new Error('`getRecursiveExport` method parameter depth must be greater than 1.');
65
- if (!this.from) return this;
66
- let currentDepth = 0;
67
- let current = this;
68
- while(current.from && currentDepth < depth){
69
- currentDepth++;
70
- current = current.from;
71
- }
72
- return current;
73
- }
74
- toData() {
75
- const data = {
76
- id: this.id,
77
- name: this.name,
78
- isReExport: this.isReExport,
79
- used: this._sideEffects.map((item)=>item.id)
80
- };
81
- if (this.from) {
82
- data.from = this.from.id;
83
- data.root = this.getRecursiveExport().id;
84
- }
85
- if (this.variable) data.variable = this.variable.id;
86
- return data;
87
- }
88
- constructor(name, identifier, variable){
89
- this.id = id++;
90
- this._sideEffects = [];
91
- this.name = name;
92
- this.identifier = identifier;
93
- this._variable = variable;
94
- }
95
- }
96
- exports.ExportInfo = __webpack_exports__.ExportInfo;
97
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
98
- "ExportInfo"
99
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
100
- Object.defineProperty(exports, '__esModule', {
101
- value: true
102
- });
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __webpack_modules__ = {
3
- "./export": function(module) {
4
- module.exports = require("./export.js");
5
- },
6
- "./module": function(module) {
7
- module.exports = require("./module.js");
8
- },
9
- "./sideEffect": function(module) {
10
- module.exports = require("./sideEffect.js");
11
- },
12
- "./types": function(module) {
13
- module.exports = require("./types.js");
14
- },
15
- "./variable": function(module) {
16
- module.exports = require("./variable.js");
17
- }
18
- };
19
- var __webpack_module_cache__ = {};
20
- function __webpack_require__(moduleId) {
21
- var cachedModule = __webpack_module_cache__[moduleId];
22
- if (void 0 !== cachedModule) return cachedModule.exports;
23
- var module = __webpack_module_cache__[moduleId] = {
24
- exports: {}
25
- };
26
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
27
- return module.exports;
28
- }
29
- (()=>{
30
- __webpack_require__.n = (module)=>{
31
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
32
- __webpack_require__.d(getter, {
33
- a: getter
34
- });
35
- return getter;
36
- };
37
- })();
38
- (()=>{
39
- __webpack_require__.d = (exports1, definition)=>{
40
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
41
- enumerable: true,
42
- get: definition[key]
43
- });
44
- };
45
- })();
46
- (()=>{
47
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
48
- })();
49
- (()=>{
50
- __webpack_require__.r = (exports1)=>{
51
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
52
- value: 'Module'
53
- });
54
- Object.defineProperty(exports1, '__esModule', {
55
- value: true
56
- });
57
- };
58
- })();
59
- var __webpack_exports__ = {};
60
- (()=>{
61
- __webpack_require__.r(__webpack_exports__);
62
- var _module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./module");
63
- var __WEBPACK_REEXPORT_OBJECT__ = {};
64
- for(var __WEBPACK_IMPORT_KEY__ in _module__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
65
- return _module__WEBPACK_IMPORTED_MODULE_0__[key];
66
- }).bind(0, __WEBPACK_IMPORT_KEY__);
67
- __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
68
- var _export__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./export");
69
- var __WEBPACK_REEXPORT_OBJECT__ = {};
70
- for(var __WEBPACK_IMPORT_KEY__ in _export__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
71
- return _export__WEBPACK_IMPORTED_MODULE_1__[key];
72
- }).bind(0, __WEBPACK_IMPORT_KEY__);
73
- __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
74
- var _variable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./variable");
75
- var __WEBPACK_REEXPORT_OBJECT__ = {};
76
- for(var __WEBPACK_IMPORT_KEY__ in _variable__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
77
- return _variable__WEBPACK_IMPORTED_MODULE_2__[key];
78
- }).bind(0, __WEBPACK_IMPORT_KEY__);
79
- __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
80
- var _sideEffect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./sideEffect");
81
- var __WEBPACK_REEXPORT_OBJECT__ = {};
82
- for(var __WEBPACK_IMPORT_KEY__ in _sideEffect__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
83
- return _sideEffect__WEBPACK_IMPORTED_MODULE_3__[key];
84
- }).bind(0, __WEBPACK_IMPORT_KEY__);
85
- __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
86
- var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./types");
87
- var __WEBPACK_REEXPORT_OBJECT__ = {};
88
- for(var __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_4__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
89
- return _types__WEBPACK_IMPORTED_MODULE_4__[key];
90
- }).bind(0, __WEBPACK_IMPORT_KEY__);
91
- __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
92
- })();
93
- for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
- Object.defineProperty(exports, '__esModule', {
95
- value: true
96
- });