@cocos/ccbuild 1.0.0-alpha.9 → 1.0.0

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 (65) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +14 -14
  3. package/lib/api-builder.js +1 -1
  4. package/lib/build-engine/engine-js/index.d.ts +2 -2
  5. package/lib/build-engine/engine-js/index.d.ts.map +1 -1
  6. package/lib/build-engine/engine-js/index.js +458 -459
  7. package/lib/build-engine/engine-js/index.js.map +1 -1
  8. package/lib/build-engine/engine-js/rollup-plugins/asset-ref.d.ts +36 -36
  9. package/lib/build-engine/engine-js/rollup-plugins/asset-ref.js +87 -87
  10. package/lib/build-engine/engine-js/rollup-plugins/asset-ref.js.map +1 -1
  11. package/lib/build-engine/engine-js/rollup-plugins/asset-url.d.ts +7 -7
  12. package/lib/build-engine/engine-js/rollup-plugins/asset-url.js +92 -92
  13. package/lib/build-engine/engine-js/rollup-plugins/asset-url.js.map +1 -1
  14. package/lib/build-engine/engine-js/rollup-plugins/code-asset.d.ts +28 -28
  15. package/lib/build-engine/engine-js/rollup-plugins/code-asset.js +135 -135
  16. package/lib/build-engine/engine-js/rollup-plugins/code-asset.js.map +1 -1
  17. package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.d.ts +2 -2
  18. package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.js +37 -37
  19. package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.js.map +1 -1
  20. package/lib/build-engine/engine-js/rollup-plugins/ts-paths.d.ts +4 -4
  21. package/lib/build-engine/engine-js/rollup-plugins/ts-paths.js +42 -42
  22. package/lib/{engine-builder.d.ts → build-engine/engine-ts/engine-builder.d.ts} +53 -53
  23. package/lib/build-engine/engine-ts/engine-builder.d.ts.map +1 -0
  24. package/lib/{engine-builder.js → build-engine/engine-ts/engine-builder.js} +549 -549
  25. package/lib/build-engine/engine-ts/engine-builder.js.map +1 -0
  26. package/lib/build-engine/engine-ts/index.d.ts +3 -0
  27. package/lib/build-engine/engine-ts/index.d.ts.map +1 -0
  28. package/lib/build-engine/engine-ts/index.js +35 -0
  29. package/lib/build-engine/engine-ts/index.js.map +1 -0
  30. package/lib/build-engine/index.d.ts +125 -118
  31. package/lib/build-engine/index.d.ts.map +1 -1
  32. package/lib/build-engine/index.js +138 -124
  33. package/lib/build-engine/index.js.map +1 -1
  34. package/lib/index.d.ts +4 -4
  35. package/lib/index.d.ts.map +1 -1
  36. package/lib/index.js +33 -34
  37. package/lib/index.js.map +1 -1
  38. package/lib/module-resolver.d.ts +7 -7
  39. package/lib/module-resolver.js +28 -28
  40. package/lib/stats-query/config-interface.d.ts +129 -129
  41. package/lib/stats-query/config-interface.js +3 -3
  42. package/lib/stats-query/index.d.ts +161 -161
  43. package/lib/stats-query/index.d.ts.map +1 -1
  44. package/lib/stats-query/index.js +527 -527
  45. package/lib/stats-query/path-utils.d.ts +2 -2
  46. package/lib/stats-query/path-utils.js +35 -35
  47. package/lib/transformer/babel.d.ts +5 -5
  48. package/lib/transformer/babel.js +34 -34
  49. package/lib/transformer/index.d.ts +2 -2
  50. package/lib/transformer/index.js +28 -28
  51. package/lib/utils.d.ts +2 -2
  52. package/lib/utils.js +14 -14
  53. package/package.json +5 -2
  54. package/static/helper-dynamic-constants.txt +12 -12
  55. package/static/helper-global-exporter.txt +8 -8
  56. package/static/lib.dom.d.ts +20227 -20227
  57. package/lib/engine-builder.d.ts.map +0 -1
  58. package/lib/engine-builder.js.map +0 -1
  59. package/lib/stats-query/constant-manager.d.ts +0 -67
  60. package/lib/stats-query/constant-manager.d.ts.map +0 -1
  61. package/lib/stats-query/constant-manager.js +0 -263
  62. package/lib/stats-query/constant-manager.js.map +0 -1
  63. package/lib/transformer.js +0 -7
  64. package/lib/transformer.js.map +0 -1
  65. package/lib/tsdoc-metadata.json +0 -11
@@ -1,136 +1,136 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.codeAsset = void 0;
39
- const fs_extra_1 = __importDefault(require("fs-extra"));
40
- const path_1 = __importDefault(require("path"));
41
- const pluginUtils = __importStar(require("@rollup/pluginutils"));
42
- /**
43
- * Excludes specified modules clearly from rollup bundling.
44
- * Requests to these modules are remapped as another place holder module specifiers
45
- * and this plugin will produce a map which records the mapping info.
46
- *
47
- * For instance, give that we want to handle `'@cocos/physx'`. Some modules may have:
48
- * ```ts
49
- * import X from '@cocos/physx';
50
- * ```
51
- * As a result, first, the real `@cocos/physx` module would be wrapped as SystemJS module
52
- * and emitted to build output as a single code file, without bother to rollup(so that pretty fast).
53
- * Then, the bundle generates a module ID, let's say: `placeholder:/@cocos/physx`.
54
- * To use that bundle,
55
- * you need to properly map the `placeholder:/@cocos/physx` for example, through import map,
56
- * to the emitted file.
57
- * The `resultMapping` records which real module the `placeholder:/@cocos/physx` is mapped.
58
- *
59
- * The following requirements should be fulfilled:
60
- * - These modules are all CommonJS modules that only use `exports` and `module.exports`.
61
- * - The module format of rollup bundling should be SystemJS.
62
- */
63
- function codeAsset({ include, exclude, resultMapping, }) {
64
- const filter = pluginUtils.createFilter(include, exclude);
65
- const emitMap = {};
66
- return {
67
- name: '@cocos/build-engine|code-asset',
68
- resolveId(source, _importer) {
69
- if (!(source in emitMap)) {
70
- return null;
71
- }
72
- return {
73
- id: source,
74
- external: true,
75
- };
76
- },
77
- load(id) {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- if (!filter(id)) {
80
- return null;
81
- }
82
- const placeholderId = generatePlaceholderId(id);
83
- if (!placeholderId) {
84
- this.error(`Can not generate placeholder ID for module ${id}.`);
85
- }
86
- const referenceId = this.emitFile({
87
- type: 'asset',
88
- name: path_1.default.basename(id),
89
- // fileName: path,
90
- source: wrapAsmJs(yield fs_extra_1.default.readFile(id, 'utf8')),
91
- });
92
- const placeholderModuleSpecifier = `split:/${placeholderId}`;
93
- emitMap[placeholderModuleSpecifier] = referenceId;
94
- const code = `
95
- export * from '${placeholderModuleSpecifier}';
96
- import { default as D } from '${placeholderModuleSpecifier}';
97
- export { D as default };
98
- `;
99
- return code;
100
- });
101
- },
102
- generateBundle(_options, _bundle, _isWrite) {
103
- for (const [moduleId, rollupFileReferenceId] of Object.entries(emitMap)) {
104
- resultMapping[moduleId] = this.getFileName(rollupFileReferenceId);
105
- }
106
- },
107
- };
108
- }
109
- exports.codeAsset = codeAsset;
110
- function wrapAsmJs(code) {
111
- return `
112
- System.register([], function (_export) {
113
- return {
114
- execute() {
115
- const _cjsModule = { exports: {} };
116
- const _cjsExports = _cjsModule.exports;
117
- (function(module, exports){
118
- ${code}
119
- })(_cjsModule, _cjsExports);
120
- _export("default", _cjsModule.exports);
121
- },
122
- };
123
- });
124
- `;
125
- }
126
- function generatePlaceholderId(id) {
127
- const parts = id.split(/[\\\/]/g);
128
- if (parts.length !== 0) {
129
- const baseName = parts[parts.length - 1];
130
- if (baseName) {
131
- return baseName;
132
- }
133
- }
134
- return '';
135
- }
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.codeAsset = void 0;
39
+ const fs_extra_1 = __importDefault(require("fs-extra"));
40
+ const path_1 = __importDefault(require("path"));
41
+ const pluginUtils = __importStar(require("@rollup/pluginutils"));
42
+ /**
43
+ * Excludes specified modules clearly from rollup bundling.
44
+ * Requests to these modules are remapped as another place holder module specifiers
45
+ * and this plugin will produce a map which records the mapping info.
46
+ *
47
+ * For instance, give that we want to handle `'@cocos/physx'`. Some modules may have:
48
+ * ```ts
49
+ * import X from '@cocos/physx';
50
+ * ```
51
+ * As a result, first, the real `@cocos/physx` module would be wrapped as SystemJS module
52
+ * and emitted to build output as a single code file, without bother to rollup(so that pretty fast).
53
+ * Then, the bundle generates a module ID, let's say: `placeholder:/@cocos/physx`.
54
+ * To use that bundle,
55
+ * you need to properly map the `placeholder:/@cocos/physx` for example, through import map,
56
+ * to the emitted file.
57
+ * The `resultMapping` records which real module the `placeholder:/@cocos/physx` is mapped.
58
+ *
59
+ * The following requirements should be fulfilled:
60
+ * - These modules are all CommonJS modules that only use `exports` and `module.exports`.
61
+ * - The module format of rollup bundling should be SystemJS.
62
+ */
63
+ function codeAsset({ include, exclude, resultMapping, }) {
64
+ const filter = pluginUtils.createFilter(include, exclude);
65
+ const emitMap = {};
66
+ return {
67
+ name: '@cocos/ccbuild|code-asset',
68
+ resolveId(source, _importer) {
69
+ if (!(source in emitMap)) {
70
+ return null;
71
+ }
72
+ return {
73
+ id: source,
74
+ external: true,
75
+ };
76
+ },
77
+ load(id) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ if (!filter(id)) {
80
+ return null;
81
+ }
82
+ const placeholderId = generatePlaceholderId(id);
83
+ if (!placeholderId) {
84
+ this.error(`Can not generate placeholder ID for module ${id}.`);
85
+ }
86
+ const referenceId = this.emitFile({
87
+ type: 'asset',
88
+ name: path_1.default.basename(id),
89
+ // fileName: path,
90
+ source: wrapAsmJs(yield fs_extra_1.default.readFile(id, 'utf8')),
91
+ });
92
+ const placeholderModuleSpecifier = `split:/${placeholderId}`;
93
+ emitMap[placeholderModuleSpecifier] = referenceId;
94
+ const code = `
95
+ export * from '${placeholderModuleSpecifier}';
96
+ import { default as D } from '${placeholderModuleSpecifier}';
97
+ export { D as default };
98
+ `;
99
+ return code;
100
+ });
101
+ },
102
+ generateBundle(_options, _bundle, _isWrite) {
103
+ for (const [moduleId, rollupFileReferenceId] of Object.entries(emitMap)) {
104
+ resultMapping[moduleId] = this.getFileName(rollupFileReferenceId);
105
+ }
106
+ },
107
+ };
108
+ }
109
+ exports.codeAsset = codeAsset;
110
+ function wrapAsmJs(code) {
111
+ return `
112
+ System.register([], function (_export) {
113
+ return {
114
+ execute() {
115
+ const _cjsModule = { exports: {} };
116
+ const _cjsExports = _cjsModule.exports;
117
+ (function(module, exports){
118
+ ${code}
119
+ })(_cjsModule, _cjsExports);
120
+ _export("default", _cjsModule.exports);
121
+ },
122
+ };
123
+ });
124
+ `;
125
+ }
126
+ function generatePlaceholderId(id) {
127
+ const parts = id.split(/[\\\/]/g);
128
+ if (parts.length !== 0) {
129
+ const baseName = parts[parts.length - 1];
130
+ if (baseName) {
131
+ return baseName;
132
+ }
133
+ }
134
+ return '';
135
+ }
136
136
  //# sourceMappingURL=code-asset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-asset.js","sourceRoot":"","sources":["../../../../src/build-engine/engine-js/rollup-plugins/code-asset.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wDAA0B;AAC1B,gDAAsB;AACtB,iEAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;A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C,QAAQ,EAAE,qBAAqB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;gBACrE,aAAa,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;aACrE;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AA7DD,8BA6DC;AAED,SAAS,SAAS,CAAE,IAAY;IAC5B,OAAO;;;;;;;sBAOW,IAAI;;;;;;KAMrB,CAAC;AACN,CAAC;AAED,SAAS,qBAAqB,CAAE,EAAU;IACtC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,QAAQ,EAAE;YACV,OAAO,QAAQ,CAAC;SACnB;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"code-asset.js","sourceRoot":"","sources":["../../../../src/build-engine/engine-js/rollup-plugins/code-asset.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wDAA0B;AAC1B,gDAAsB;AACtB,iEAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,SAAS,CAAE,EACvB,OAAO,EACP,OAAO,EACP,aAAa,GAKhB;IACG,MAAM,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE1D,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,OAAO;QACH,IAAI,EAAE,2BAA2B;QAEjC,SAAS,CAAE,MAAM,EAAE,SAAS;YACxB,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,EAAE;gBACtB,OAAO,IAAI,CAAC;aACf;YACD,OAAO;gBACH,EAAE,EAAE,MAAM;gBACV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AK,CAAC,SAAS,CAAC,CAAC;IAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,QAAQ,EAAE;YACV,OAAO,QAAQ,CAAC;SACnB;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
@@ -1,3 +1,3 @@
1
- import * as rollup from 'rollup';
2
- export default function removeDeprecatedFeatures(range?: string): rollup.Plugin;
1
+ import * as rollup from 'rollup';
2
+ export default function removeDeprecatedFeatures(range?: string): rollup.Plugin;
3
3
  //# sourceMappingURL=remove-deprecated-features.d.ts.map
@@ -1,38 +1,38 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const semver_1 = __importDefault(require("semver"));
7
- const path_1 = __importDefault(require("path"));
8
- function removeDeprecatedFeatures(range) {
9
- const versionRange = range ? new semver_1.default.Range(range) : undefined;
10
- return {
11
- name: '@cocos/build-engine | remove-deprecated-features',
12
- load(id) {
13
- if (!path_1.default.isAbsolute(id)) {
14
- return null;
15
- }
16
- const stem = path_1.default.basename(id, path_1.default.extname(id));
17
- const match = /^deprecated(-)?(.*)/.exec(stem);
18
- if (!match) {
19
- return null;
20
- }
21
- const versionString = match[2];
22
- if (versionString.length !== 0) {
23
- const parsedVersion = semver_1.default.parse(versionString);
24
- if (!parsedVersion) {
25
- console.debug(`${id} looks like a deprecated module, but it contains an invalid version.`);
26
- return null;
27
- }
28
- if (versionRange && !semver_1.default.satisfies(parsedVersion, versionRange)) {
29
- return null;
30
- }
31
- }
32
- console.debug(`Exclude deprecated module ${id}`);
33
- return `export {}`;
34
- },
35
- };
36
- }
37
- exports.default = removeDeprecatedFeatures;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const semver_1 = __importDefault(require("semver"));
7
+ const path_1 = __importDefault(require("path"));
8
+ function removeDeprecatedFeatures(range) {
9
+ const versionRange = range ? new semver_1.default.Range(range) : undefined;
10
+ return {
11
+ name: '@cocos/ccbuild|remove-deprecated-features',
12
+ load(id) {
13
+ if (!path_1.default.isAbsolute(id)) {
14
+ return null;
15
+ }
16
+ const stem = path_1.default.basename(id, path_1.default.extname(id));
17
+ const match = /^deprecated(-)?(.*)/.exec(stem);
18
+ if (!match) {
19
+ return null;
20
+ }
21
+ const versionString = match[2];
22
+ if (versionString.length !== 0) {
23
+ const parsedVersion = semver_1.default.parse(versionString);
24
+ if (!parsedVersion) {
25
+ console.debug(`${id} looks like a deprecated module, but it contains an invalid version.`);
26
+ return null;
27
+ }
28
+ if (versionRange && !semver_1.default.satisfies(parsedVersion, versionRange)) {
29
+ return null;
30
+ }
31
+ }
32
+ console.debug(`Exclude deprecated module ${id}`);
33
+ return `export {}`;
34
+ },
35
+ };
36
+ }
37
+ exports.default = removeDeprecatedFeatures;
38
38
  //# sourceMappingURL=remove-deprecated-features.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove-deprecated-features.js","sourceRoot":"","sources":["../../../../src/build-engine/engine-js/rollup-plugins/remove-deprecated-features.ts"],"names":[],"mappings":";;;;;AACA,oDAA4B;AAC5B,gDAAsB;AAEtB,SAAwB,wBAAwB,CAAE,KAAc;IAC5D,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,gBAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,OAAO;QACH,IAAI,EAAE,kDAAkD;QAExD,IAAI,CAAQ,EAAU;YAClB,IAAI,CAAC,cAAE,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;gBACpB,OAAO,IAAI,CAAC;aACf;YAED,MAAM,IAAI,GAAG,cAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,cAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,CAAC,KAAK,EAAE;gBACR,OAAO,IAAI,CAAC;aACf;YAED,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5B,MAAM,aAAa,GAAG,gBAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBAClD,IAAI,CAAC,aAAa,EAAE;oBAChB,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,sEAAsE,CAAC,CAAC;oBAC3F,OAAO,IAAI,CAAC;iBACf;gBAED,IAAI,YAAY,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE;oBAChE,OAAO,IAAI,CAAC;iBACf;aACJ;YAED,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;YACjD,OAAO,WAAW,CAAC;QACvB,CAAC;KACJ,CAAC;AACN,CAAC;AAjCD,2CAiCC"}
1
+ {"version":3,"file":"remove-deprecated-features.js","sourceRoot":"","sources":["../../../../src/build-engine/engine-js/rollup-plugins/remove-deprecated-features.ts"],"names":[],"mappings":";;;;;AACA,oDAA4B;AAC5B,gDAAsB;AAEtB,SAAwB,wBAAwB,CAAE,KAAc;IAC5D,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,gBAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,OAAO;QACH,IAAI,EAAE,2CAA2C;QAEjD,IAAI,CAAQ,EAAU;YAClB,IAAI,CAAC,cAAE,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;gBACpB,OAAO,IAAI,CAAC;aACf;YAED,MAAM,IAAI,GAAG,cAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,cAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,CAAC,KAAK,EAAE;gBACR,OAAO,IAAI,CAAC;aACf;YAED,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5B,MAAM,aAAa,GAAG,gBAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBAClD,IAAI,CAAC,aAAa,EAAE;oBAChB,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,sEAAsE,CAAC,CAAC;oBAC3F,OAAO,IAAI,CAAC;iBACf;gBAED,IAAI,YAAY,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE;oBAChE,OAAO,IAAI,CAAC;iBACf;aACJ;YAED,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;YACjD,OAAO,WAAW,CAAC;QACvB,CAAC;KACJ,CAAC;AACN,CAAC;AAjCD,2CAiCC"}
@@ -1,5 +1,5 @@
1
- import * as rollup from 'rollup';
2
- export default function ({ configFileName, }: {
3
- configFileName: string;
4
- }): rollup.Plugin;
1
+ import * as rollup from 'rollup';
2
+ export default function ({ configFileName, }: {
3
+ configFileName: string;
4
+ }): rollup.Plugin;
5
5
  //# sourceMappingURL=ts-paths.d.ts.map
@@ -1,43 +1,43 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const typescript_1 = __importDefault(require("typescript"));
7
- const path_1 = __importDefault(require("path"));
8
- function default_1({ configFileName, }) {
9
- const parsedCommandLine = typescript_1.default.getParsedCommandLineOfConfigFile(configFileName, {}, {
10
- onUnRecoverableConfigFileDiagnostic: () => { },
11
- useCaseSensitiveFileNames: typescript_1.default.sys.useCaseSensitiveFileNames,
12
- readDirectory: typescript_1.default.sys.readDirectory,
13
- getCurrentDirectory: typescript_1.default.sys.getCurrentDirectory,
14
- fileExists: typescript_1.default.sys.fileExists,
15
- readFile: typescript_1.default.sys.readFile,
16
- });
17
- if (!parsedCommandLine) {
18
- throw new Error(`Failed to read tsconfig`);
19
- }
20
- const { baseUrl, paths } = parsedCommandLine.options;
21
- let resolveId;
22
- if (paths) {
23
- const baseUrlNormalized = path_1.default.resolve(configFileName, baseUrl !== null && baseUrl !== void 0 ? baseUrl : '.');
24
- const simpleMap = {};
25
- for (const [key, mapped] of Object.entries(paths)) {
26
- simpleMap[key] = path_1.default.resolve(baseUrlNormalized, mapped[0]);
27
- }
28
- resolveId = function (source, importer) {
29
- if (!(source in simpleMap)) {
30
- return null;
31
- }
32
- else {
33
- return simpleMap[source];
34
- }
35
- };
36
- }
37
- return {
38
- name: 'ts-paths',
39
- resolveId,
40
- };
41
- }
42
- exports.default = default_1;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const typescript_1 = __importDefault(require("typescript"));
7
+ const path_1 = __importDefault(require("path"));
8
+ function default_1({ configFileName, }) {
9
+ const parsedCommandLine = typescript_1.default.getParsedCommandLineOfConfigFile(configFileName, {}, {
10
+ onUnRecoverableConfigFileDiagnostic: () => { },
11
+ useCaseSensitiveFileNames: typescript_1.default.sys.useCaseSensitiveFileNames,
12
+ readDirectory: typescript_1.default.sys.readDirectory,
13
+ getCurrentDirectory: typescript_1.default.sys.getCurrentDirectory,
14
+ fileExists: typescript_1.default.sys.fileExists,
15
+ readFile: typescript_1.default.sys.readFile,
16
+ });
17
+ if (!parsedCommandLine) {
18
+ throw new Error(`Failed to read tsconfig`);
19
+ }
20
+ const { baseUrl, paths } = parsedCommandLine.options;
21
+ let resolveId;
22
+ if (paths) {
23
+ const baseUrlNormalized = path_1.default.resolve(configFileName, baseUrl !== null && baseUrl !== void 0 ? baseUrl : '.');
24
+ const simpleMap = {};
25
+ for (const [key, mapped] of Object.entries(paths)) {
26
+ simpleMap[key] = path_1.default.resolve(baseUrlNormalized, mapped[0]);
27
+ }
28
+ resolveId = function (source, importer) {
29
+ if (!(source in simpleMap)) {
30
+ return null;
31
+ }
32
+ else {
33
+ return simpleMap[source];
34
+ }
35
+ };
36
+ }
37
+ return {
38
+ name: 'ts-paths',
39
+ resolveId,
40
+ };
41
+ }
42
+ exports.default = default_1;
43
43
  //# sourceMappingURL=ts-paths.js.map
@@ -1,54 +1,54 @@
1
- import { StatsQuery } from "./stats-query";
2
- import ConstantManager = StatsQuery.ConstantManager;
3
- export declare namespace EngineBuilder {
4
- interface IBuildOptions {
5
- root: string;
6
- features?: string[];
7
- platform: ConstantManager.PlatformType;
8
- mode: ConstantManager.ModeType;
9
- flagConfig: Partial<ConstantManager.IFlagConfig>;
10
- outDir?: string;
11
- }
12
- interface IBuildResult {
13
- [outputFile: string]: IHandleResult;
14
- }
15
- interface IHandleResult {
16
- code: string;
17
- file: string;
18
- originalId: string;
19
- resolvedId: string;
20
- map: any;
21
- }
22
- interface ITransformResult {
23
- code: string;
24
- map?: any;
25
- depIdList: string[];
26
- }
27
- }
28
- export declare class EngineBuilder {
29
- private _options;
30
- private _entries;
31
- private _entriesForPass2;
32
- private _virtual2code;
33
- private _feature2NodeModule;
34
- private _nodeModules;
35
- private _virtualOverrides;
36
- private _buildTimeConstants;
37
- private _moduleOverrides;
38
- private _buildResult;
39
- private _resolveExtension;
40
- private _renameMap;
41
- build(options: EngineBuilder.IBuildOptions): Promise<EngineBuilder.IBuildResult>;
42
- private _initOptions;
43
- private _handleId;
44
- private _getOverrideId;
45
- private _resolve;
46
- private _resolveRelative;
47
- private _load;
48
- private _transform;
49
- private _lintImport;
50
- private _buildIndex;
51
- private _copyTypes;
52
- private _addNodeModulesDeps;
53
- }
1
+ import { StatsQuery } from "../../stats-query";
2
+ import ConstantManager = StatsQuery.ConstantManager;
3
+ export declare namespace EngineBuilder {
4
+ interface IBuildOptions {
5
+ root: string;
6
+ features?: string[];
7
+ platform: ConstantManager.PlatformType;
8
+ mode: ConstantManager.ModeType;
9
+ flagConfig: Partial<ConstantManager.IFlagConfig>;
10
+ outDir?: string;
11
+ }
12
+ interface IBuildResult {
13
+ [outputFile: string]: IHandleResult;
14
+ }
15
+ interface IHandleResult {
16
+ code: string;
17
+ file: string;
18
+ originalId: string;
19
+ resolvedId: string;
20
+ map: any;
21
+ }
22
+ interface ITransformResult {
23
+ code: string;
24
+ map?: any;
25
+ depIdList: string[];
26
+ }
27
+ }
28
+ export declare class EngineBuilder {
29
+ private _options;
30
+ private _entries;
31
+ private _entriesForPass2;
32
+ private _virtual2code;
33
+ private _feature2NodeModule;
34
+ private _nodeModules;
35
+ private _virtualOverrides;
36
+ private _buildTimeConstants;
37
+ private _moduleOverrides;
38
+ private _buildResult;
39
+ private _resolveExtension;
40
+ private _renameMap;
41
+ build(options: EngineBuilder.IBuildOptions): Promise<EngineBuilder.IBuildResult>;
42
+ private _initOptions;
43
+ private _handleId;
44
+ private _getOverrideId;
45
+ private _resolve;
46
+ private _resolveRelative;
47
+ private _load;
48
+ private _transform;
49
+ private _lintImport;
50
+ private _buildIndex;
51
+ private _copyTypes;
52
+ private _addNodeModulesDeps;
53
+ }
54
54
  //# sourceMappingURL=engine-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-builder.d.ts","sourceRoot":"","sources":["../../../src/build-engine/engine-ts/engine-builder.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAS/C,OAAO,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;AAGpD,yBAAiB,aAAa,CAAC;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