@cocos/ccbuild 1.1.14 → 2.0.0-alpha.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.
- package/CHANGELOG.md +165 -165
- package/lib/src/index.d.ts +5 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/src/index.js +61 -0
- package/lib/src/index.js.map +1 -0
- package/{lib/build-engine → modules/build-engine/lib}/engine-js/index.d.ts +2 -3
- package/modules/build-engine/lib/engine-js/index.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-js/index.js +399 -0
- package/modules/build-engine/lib/engine-js/index.js.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts +58 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js +299 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/remove-deprecated-features.d.ts +3 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/remove-deprecated-features.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/remove-deprecated-features.js +42 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/remove-deprecated-features.js.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.d.ts +7 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.js +51 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.js.map +1 -0
- package/modules/build-engine/lib/engine-ts/engine-builder.d.ts +57 -0
- package/modules/build-engine/lib/engine-ts/engine-builder.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-ts/engine-builder.js +650 -0
- package/modules/build-engine/lib/engine-ts/engine-builder.js.map +1 -0
- package/modules/build-engine/lib/engine-ts/field-decorator-helper.d.ts +11 -0
- package/modules/build-engine/lib/engine-ts/field-decorator-helper.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-ts/field-decorator-helper.js +65 -0
- package/modules/build-engine/lib/engine-ts/field-decorator-helper.js.map +1 -0
- package/{lib/build-engine → modules/build-engine/lib}/engine-ts/index.d.ts +2 -3
- package/modules/build-engine/lib/engine-ts/index.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-ts/index.js +59 -0
- package/modules/build-engine/lib/engine-ts/index.js.map +1 -0
- package/{lib/build-engine → modules/build-engine/lib}/engine-ts/plugins/external-wasm-loader.d.ts +7 -7
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js +74 -0
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js.map +1 -0
- package/modules/build-engine/lib/engine-ts/plugins/interface.d.ts +20 -0
- package/modules/build-engine/lib/engine-ts/plugins/interface.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-ts/plugins/interface.js +5 -0
- package/modules/build-engine/lib/engine-ts/plugins/interface.js.map +1 -0
- package/modules/build-engine/lib/index.d.ts +145 -0
- package/modules/build-engine/lib/index.d.ts.map +1 -0
- package/modules/build-engine/lib/index.js +180 -0
- package/modules/build-engine/lib/index.js.map +1 -0
- package/modules/bundler/lib/index.d.ts +2 -0
- package/modules/bundler/lib/index.d.ts.map +1 -0
- package/modules/bundler/lib/index.js +39 -0
- package/{lib → modules/bundler/lib}/index.js.map +1 -1
- package/modules/bundler/lib/rollup/index.d.ts +3 -0
- package/modules/bundler/lib/rollup/index.d.ts.map +1 -0
- package/modules/bundler/lib/rollup/index.js +41 -0
- package/modules/bundler/lib/rollup/index.js.map +1 -0
- package/modules/bundler/lib/rollup/plugins.d.ts +8 -0
- package/modules/bundler/lib/rollup/plugins.d.ts.map +1 -0
- package/modules/bundler/lib/rollup/plugins.js +56 -0
- package/modules/bundler/lib/rollup/plugins.js.map +1 -0
- package/modules/modularize/lib/index.d.ts +20 -0
- package/modules/modularize/lib/index.d.ts.map +1 -0
- package/modules/modularize/lib/index.js +82 -0
- package/modules/modularize/lib/index.js.map +1 -0
- package/modules/stats-query/lib/config-interface.d.ts +129 -0
- package/modules/stats-query/lib/config-interface.d.ts.map +1 -0
- package/modules/stats-query/lib/config-interface.js +6 -0
- package/modules/stats-query/lib/config-interface.js.map +1 -0
- package/modules/stats-query/lib/index.d.ts +188 -0
- package/modules/stats-query/lib/index.d.ts.map +1 -0
- package/modules/stats-query/lib/index.js +579 -0
- package/modules/stats-query/lib/index.js.map +1 -0
- package/modules/transformer/lib/babel/index.d.ts +6 -0
- package/modules/transformer/lib/babel/index.d.ts.map +1 -0
- package/modules/transformer/lib/babel/index.js +47 -0
- package/modules/transformer/lib/babel/index.js.map +1 -0
- package/modules/transformer/lib/babel/plugins.d.ts +5 -0
- package/modules/transformer/lib/babel/plugins.d.ts.map +1 -0
- package/modules/transformer/lib/babel/plugins.js +22 -0
- package/modules/transformer/lib/babel/plugins.js.map +1 -0
- package/modules/transformer/lib/babel/presets.d.ts +3 -0
- package/modules/transformer/lib/babel/presets.d.ts.map +1 -0
- package/modules/transformer/lib/babel/presets.js +41 -0
- package/modules/transformer/lib/babel/presets.js.map +1 -0
- package/modules/transformer/lib/index.d.ts +2 -0
- package/modules/transformer/lib/index.d.ts.map +1 -0
- package/modules/transformer/lib/index.js +39 -0
- package/modules/transformer/lib/index.js.map +1 -0
- package/modules/utils/lib/index.d.ts +3 -0
- package/modules/utils/lib/index.d.ts.map +1 -0
- package/modules/utils/lib/index.js +38 -0
- package/modules/utils/lib/index.js.map +1 -0
- package/modules/utils/lib/path.d.ts +7 -0
- package/modules/utils/lib/path.d.ts.map +1 -0
- package/modules/utils/lib/path.js +105 -0
- package/modules/utils/lib/path.js.map +1 -0
- package/package.json +65 -75
- package/static/lib.dom.d.ts +953 -18846
- package/lib/api-builder.d.ts +0 -1
- package/lib/api-builder.d.ts.map +0 -1
- package/lib/api-builder.js +0 -2
- package/lib/api-builder.js.map +0 -1
- package/lib/build-engine/engine-js/index.d.ts.map +0 -1
- package/lib/build-engine/engine-js/index.js +0 -404
- package/lib/build-engine/engine-js/index.js.map +0 -1
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.d.ts +0 -58
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.d.ts.map +0 -1
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.js +0 -299
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.js.map +0 -1
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.d.ts +0 -3
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.d.ts.map +0 -1
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.js +0 -38
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.js.map +0 -1
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.d.ts +0 -5
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.d.ts.map +0 -1
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.js +0 -43
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.js.map +0 -1
- package/lib/build-engine/engine-ts/engine-builder.d.ts +0 -58
- package/lib/build-engine/engine-ts/engine-builder.d.ts.map +0 -1
- package/lib/build-engine/engine-ts/engine-builder.js +0 -632
- package/lib/build-engine/engine-ts/engine-builder.js.map +0 -1
- package/lib/build-engine/engine-ts/field-decorator-helper.d.ts +0 -10
- package/lib/build-engine/engine-ts/field-decorator-helper.d.ts.map +0 -1
- package/lib/build-engine/engine-ts/field-decorator-helper.js +0 -55
- package/lib/build-engine/engine-ts/field-decorator-helper.js.map +0 -1
- package/lib/build-engine/engine-ts/index.d.ts.map +0 -1
- package/lib/build-engine/engine-ts/index.js +0 -37
- package/lib/build-engine/engine-ts/index.js.map +0 -1
- package/lib/build-engine/engine-ts/plugins/external-wasm-loader.d.ts.map +0 -1
- package/lib/build-engine/engine-ts/plugins/external-wasm-loader.js +0 -66
- package/lib/build-engine/engine-ts/plugins/external-wasm-loader.js.map +0 -1
- package/lib/build-engine/engine-ts/plugins/interface.d.ts +0 -21
- package/lib/build-engine/engine-ts/plugins/interface.d.ts.map +0 -1
- package/lib/build-engine/engine-ts/plugins/interface.js +0 -2
- package/lib/build-engine/engine-ts/plugins/interface.js.map +0 -1
- package/lib/build-engine/index.d.ts +0 -146
- package/lib/build-engine/index.d.ts.map +0 -1
- package/lib/build-engine/index.js +0 -155
- package/lib/build-engine/index.js.map +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -34
- package/lib/module-resolver.d.ts +0 -8
- package/lib/module-resolver.d.ts.map +0 -1
- package/lib/module-resolver.js +0 -29
- package/lib/module-resolver.js.map +0 -1
- package/lib/stats-query/config-interface.d.ts +0 -130
- package/lib/stats-query/config-interface.d.ts.map +0 -1
- package/lib/stats-query/config-interface.js +0 -4
- package/lib/stats-query/config-interface.js.map +0 -1
- package/lib/stats-query/index.d.ts +0 -184
- package/lib/stats-query/index.d.ts.map +0 -1
- package/lib/stats-query/index.js +0 -532
- package/lib/stats-query/index.js.map +0 -1
- package/lib/stats-query/path-utils.d.ts +0 -3
- package/lib/stats-query/path-utils.d.ts.map +0 -1
- package/lib/stats-query/path-utils.js +0 -36
- package/lib/stats-query/path-utils.js.map +0 -1
- package/lib/transformer/babel.d.ts +0 -6
- package/lib/transformer/babel.d.ts.map +0 -1
- package/lib/transformer/babel.js +0 -35
- package/lib/transformer/babel.js.map +0 -1
- package/lib/transformer/index.d.ts +0 -3
- package/lib/transformer/index.d.ts.map +0 -1
- package/lib/transformer/index.js +0 -29
- package/lib/transformer/index.js.map +0 -1
- package/lib/utils.d.ts +0 -5
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -24
- package/lib/utils.js.map +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
6
|
+
resolve(value);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.next(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function rejected(value) {
|
|
18
|
+
try {
|
|
19
|
+
step(generator["throw"](value));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
reject(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function step(result) {
|
|
25
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
|
+
}
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
31
|
+
return mod && mod.__esModule ? mod : {
|
|
32
|
+
"default": mod
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36
|
+
value: true
|
|
37
|
+
});
|
|
38
|
+
exports.buildEngine = void 0;
|
|
39
|
+
const engine_js_1 = require("./engine-js");
|
|
40
|
+
const transformer_1 = require("../../transformer/lib/index.js");
|
|
41
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
42
|
+
const engine_ts_1 = require("./engine-ts");
|
|
43
|
+
function verifyCache(options) {
|
|
44
|
+
// TODO
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
function applyDefaultOptions(options) {
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = options.preserveType) !== null && _a !== void 0 ? _a : options.preserveType = false;
|
|
50
|
+
}
|
|
51
|
+
function buildEngine(options) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
applyDefaultOptions(options);
|
|
54
|
+
if (verifyCache(options)) {
|
|
55
|
+
throw 'TODO';
|
|
56
|
+
}
|
|
57
|
+
if (options.platform === 'OPEN_HARMONY') {
|
|
58
|
+
if (options.preserveType) {
|
|
59
|
+
// we use a custom engine builder for OPEN_HARMONY platform when enable preserveType option.
|
|
60
|
+
return (0, engine_ts_1.buildTsEngine)(options);
|
|
61
|
+
} else {
|
|
62
|
+
return (0, engine_js_1.buildJsEngine)(options);
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
if (options.preserveType) {
|
|
66
|
+
console.warn(`Currently we haven't support building ts engine on the platform ${options.platform}`);
|
|
67
|
+
}
|
|
68
|
+
return (0, engine_js_1.buildJsEngine)(options);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
exports.buildEngine = buildEngine;
|
|
73
|
+
(function (buildEngine) {
|
|
74
|
+
function transform(code, moduleOption, loose) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const babelFormat = moduleOptionsToBabelEnvModules(moduleOption);
|
|
77
|
+
const babelFileResult = yield transformer_1.babel.core.transformAsync(code, {
|
|
78
|
+
presets: [[transformer_1.babel.presets.presetEnv, {
|
|
79
|
+
modules: babelFormat,
|
|
80
|
+
loose: loose !== null && loose !== void 0 ? loose : true
|
|
81
|
+
}]]
|
|
82
|
+
});
|
|
83
|
+
if (!babelFileResult || !babelFileResult.code) {
|
|
84
|
+
throw new Error(`Failed to transform!`);
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
code: babelFileResult.code
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
buildEngine.transform = transform;
|
|
92
|
+
function moduleOptionsToBabelEnvModules(moduleOptions) {
|
|
93
|
+
switch (moduleOptions) {
|
|
94
|
+
case 'cjs':
|
|
95
|
+
return 'commonjs';
|
|
96
|
+
case 'system':
|
|
97
|
+
return 'systemjs';
|
|
98
|
+
case 'iife':
|
|
99
|
+
case 'esm':
|
|
100
|
+
return false;
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
102
|
+
default:
|
|
103
|
+
throw new Error(`Unknown module format ${moduleOptions}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function isSourceChanged(incrementalFile) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
let record;
|
|
109
|
+
try {
|
|
110
|
+
record = yield fs_extra_1.default.readJSON(incrementalFile);
|
|
111
|
+
} catch (_a) {
|
|
112
|
+
console.debug(`Failed to read incremental file: ${incrementalFile} - rebuild is needed.`);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
for (const file of Object.keys(record)) {
|
|
116
|
+
const mtime = record[file];
|
|
117
|
+
try {
|
|
118
|
+
/* eslint-disable-next-line no-await-in-loop */
|
|
119
|
+
const mtimeNow = (yield fs_extra_1.default.stat(file)).mtimeMs;
|
|
120
|
+
if (mtimeNow !== mtime) {
|
|
121
|
+
console.debug(`Source ${file} in watch files record ${incrementalFile} has a different time stamp - rebuild is needed.`);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
} catch (_b) {
|
|
125
|
+
console.debug(`Failed to read source ${file} in watch files record ${incrementalFile} - rebuild is needed.`);
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
buildEngine.isSourceChanged = isSourceChanged;
|
|
133
|
+
function _enumerateDependentFromDepGraph(metaExports, metaDepGraph, featureUnits) {
|
|
134
|
+
const result = [];
|
|
135
|
+
const visited = new Set();
|
|
136
|
+
const addChunk = chunkFileName => {
|
|
137
|
+
if (visited.has(chunkFileName)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
visited.add(chunkFileName);
|
|
141
|
+
result.push(chunkFileName);
|
|
142
|
+
if (metaDepGraph && chunkFileName in metaDepGraph) {
|
|
143
|
+
for (const dependencyChunk of metaDepGraph[chunkFileName]) {
|
|
144
|
+
addChunk(dependencyChunk);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
for (const featureUnit of featureUnits) {
|
|
149
|
+
const chunkFileName = metaExports[featureUnit];
|
|
150
|
+
if (!chunkFileName) {
|
|
151
|
+
console.error(`Feature unit ${featureUnit} is not in build result!`);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
addChunk(chunkFileName);
|
|
155
|
+
}
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Enumerates all chunk files that used by specified feature units.
|
|
160
|
+
* @param meta Metadata of build result.
|
|
161
|
+
* @param featureUnits Feature units.
|
|
162
|
+
*
|
|
163
|
+
* @deprecated since 1.1.11, please use `enumerateAllDependents` instead.
|
|
164
|
+
*/
|
|
165
|
+
function enumerateDependentChunks(meta, featureUnits) {
|
|
166
|
+
return _enumerateDependentFromDepGraph(meta.exports, meta.chunkDepGraph, featureUnits);
|
|
167
|
+
}
|
|
168
|
+
buildEngine.enumerateDependentChunks = enumerateDependentChunks;
|
|
169
|
+
/**
|
|
170
|
+
* Enumerates all chunk files and asset files that used by specified feature units.
|
|
171
|
+
* @param meta Metadata of build result.
|
|
172
|
+
* @param featureUnits Feature units.
|
|
173
|
+
*/
|
|
174
|
+
function enumerateAllDependents(meta, featureUnits) {
|
|
175
|
+
const dependentChunks = enumerateDependentChunks(meta, featureUnits);
|
|
176
|
+
const dependentAssets = _enumerateDependentFromDepGraph(meta.exports, meta.assetDepGraph, featureUnits);
|
|
177
|
+
return dependentAssets.concat(dependentChunks);
|
|
178
|
+
}
|
|
179
|
+
buildEngine.enumerateAllDependents = enumerateAllDependents;
|
|
180
|
+
})(buildEngine = exports.buildEngine || (exports.buildEngine = {}));
|
|
@@ -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OAAO,+BAA+B,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC3F,CAAC;IAFe,oCAAwB,2BAEvC,CAAA;IAED;;;;OAIG;IACH,SAAgB,sBAAsB,CAAE,IAAwB,EAAE,YAAsB;QACpF,MAAM,eAAe,GAAG,wBAAwB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACrE,MAAM,eAAe,GAAG,+BAA+B,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QACxG,OAAO,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACnD,CAAC;IAJe,kCAAsB,yBAIrC,CAAA;AACL,CAAC,EAxQgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAwQ3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,OAAO,EACH,MAAM,GACT,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
value: v
|
|
23
|
+
});
|
|
24
|
+
} : function (o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = this && this.__importStar || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
37
|
+
exports.rollup = void 0;
|
|
38
|
+
const rollup = __importStar(require("./rollup"));
|
|
39
|
+
exports.rollup = rollup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAG9B,wBAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rollup/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,OAAO,EACH,IAAI,EACJ,OAAO,GACV,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
value: v
|
|
23
|
+
});
|
|
24
|
+
} : function (o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = this && this.__importStar || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
37
|
+
exports.plugins = exports.core = void 0;
|
|
38
|
+
const core = __importStar(require("rollup"));
|
|
39
|
+
exports.core = core;
|
|
40
|
+
const plugins = __importStar(require("./plugins"));
|
|
41
|
+
exports.plugins = plugins;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rollup/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAI3B,oBAAI;AAHR,mDAAqC;AAIjC,0BAAO"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as babel from '@rollup/plugin-babel';
|
|
2
|
+
import json from '@rollup/plugin-json';
|
|
3
|
+
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
4
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
5
|
+
import virtual from '@rollup/plugin-virtual';
|
|
6
|
+
import terser from 'rollup-plugin-terser';
|
|
7
|
+
import typescript from '@rollup/plugin-typescript';
|
|
8
|
+
export { babel, json, nodeResolve, commonjs, virtual, terser, typescript };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/rollup/plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,UAAU,MAAM,2BAA2B,CAAC;AAGnD,OAAO,EACH,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,GAEb,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
value: v
|
|
23
|
+
});
|
|
24
|
+
} : function (o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = this && this.__importStar || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
35
|
+
return mod && mod.__esModule ? mod : {
|
|
36
|
+
"default": mod
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", {
|
|
40
|
+
value: true
|
|
41
|
+
});
|
|
42
|
+
exports.typescript = exports.terser = exports.virtual = exports.commonjs = exports.nodeResolve = exports.json = exports.babel = void 0;
|
|
43
|
+
const babel = __importStar(require("@rollup/plugin-babel"));
|
|
44
|
+
exports.babel = babel;
|
|
45
|
+
const plugin_json_1 = __importDefault(require("@rollup/plugin-json"));
|
|
46
|
+
exports.json = plugin_json_1.default;
|
|
47
|
+
const plugin_node_resolve_1 = __importDefault(require("@rollup/plugin-node-resolve"));
|
|
48
|
+
exports.nodeResolve = plugin_node_resolve_1.default;
|
|
49
|
+
const plugin_commonjs_1 = __importDefault(require("@rollup/plugin-commonjs"));
|
|
50
|
+
exports.commonjs = plugin_commonjs_1.default;
|
|
51
|
+
const plugin_virtual_1 = __importDefault(require("@rollup/plugin-virtual"));
|
|
52
|
+
exports.virtual = plugin_virtual_1.default;
|
|
53
|
+
const rollup_plugin_terser_1 = __importDefault(require("rollup-plugin-terser"));
|
|
54
|
+
exports.terser = rollup_plugin_terser_1.default;
|
|
55
|
+
const plugin_typescript_1 = __importDefault(require("@rollup/plugin-typescript"));
|
|
56
|
+
exports.typescript = plugin_typescript_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/rollup/plugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAA8C;AAU1C,sBAAK;AATT,sEAAuC;AAUnC,eAVG,qBAAI,CAUH;AATR,sFAAsD;AAUlD,sBAVG,6BAAW,CAUH;AATf,8EAA+C;AAU3C,mBAVG,yBAAQ,CAUH;AATZ,4EAA6C;AAUzC,kBAVG,wBAAO,CAUH;AATX,gFAA0C;AAUtC,iBAVG,8BAAM,CAUH;AATV,kFAAmD;AAU/C,qBAVG,2BAAU,CAUH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class MemoryFile {
|
|
2
|
+
path: string;
|
|
3
|
+
content: string;
|
|
4
|
+
constructor(path: string, content: string);
|
|
5
|
+
outputFile(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace ModuleManager {
|
|
8
|
+
interface InitOptions {
|
|
9
|
+
pkgName: string;
|
|
10
|
+
extendTsconfigPath: string;
|
|
11
|
+
}
|
|
12
|
+
interface ModuleInitResult {
|
|
13
|
+
memoryFiles: MemoryFile[];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare class ModuleManager {
|
|
17
|
+
private _filesToCopy;
|
|
18
|
+
private _filesToRender;
|
|
19
|
+
initModule(modulePath: string, options: ModuleManager.InitOptions): Promise<ModuleManager.ModuleInitResult>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,qBAAa,UAAU;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAK7B,UAAU,IAAK,OAAO,CAAC,IAAI,CAAC;CAG5C;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACnC,UAAiB,WAAW;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,kBAAkB,EAAE,MAAM,CAAC;KAC9B;IAED,UAAiB,gBAAgB;QAC7B,WAAW,EAAE,UAAU,EAAE,CAAC;KAC7B;CACJ;AAED,qBAAa,aAAa;IAEtB,OAAO,CAAC,YAAY,CAIlB;IAEF,OAAO,CAAC,cAAc,CAGpB;IAEI,UAAU,CAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC;CAgBrH"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
6
|
+
resolve(value);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.next(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function rejected(value) {
|
|
18
|
+
try {
|
|
19
|
+
step(generator["throw"](value));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
reject(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function step(result) {
|
|
25
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
|
+
}
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
31
|
+
return mod && mod.__esModule ? mod : {
|
|
32
|
+
"default": mod
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36
|
+
value: true
|
|
37
|
+
});
|
|
38
|
+
exports.ModuleManager = exports.MemoryFile = void 0;
|
|
39
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const ejs_1 = __importDefault(require("ejs"));
|
|
42
|
+
const utils_1 = require("../../utils/lib/index.js");
|
|
43
|
+
const absolutePath = (0, utils_1.absolutePathFuncFactory)(__dirname);
|
|
44
|
+
class MemoryFile {
|
|
45
|
+
constructor(path, content) {
|
|
46
|
+
this.path = path;
|
|
47
|
+
this.content = content;
|
|
48
|
+
}
|
|
49
|
+
outputFile() {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
yield fs_extra_1.default.outputFile(this.path, this.content, 'utf8');
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.MemoryFile = MemoryFile;
|
|
56
|
+
class ModuleManager {
|
|
57
|
+
constructor() {
|
|
58
|
+
this._filesToCopy = ['../static/jest.config.js', '../static/api-extractor.json', '../static/.gitignore'];
|
|
59
|
+
this._filesToRender = ['../static/package.ejson', '../static/tsconfig.ejson'];
|
|
60
|
+
}
|
|
61
|
+
initModule(modulePath, options) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const result = {
|
|
64
|
+
memoryFiles: []
|
|
65
|
+
};
|
|
66
|
+
yield Promise.all(this._filesToRender.map(filePath => absolutePath(filePath)).map(filePath => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const content = yield fs_extra_1.default.readFile(filePath, 'utf8');
|
|
68
|
+
const targetContent = ejs_1.default.render(content, options);
|
|
69
|
+
const targetFilePath = (0, utils_1.replaceExtname)((0, utils_1.rebasePath)(filePath, path_1.default.dirname(filePath), modulePath), '.json');
|
|
70
|
+
options.extendTsconfigPath = (0, utils_1.formatPath)(path_1.default.relative(modulePath, options.extendTsconfigPath));
|
|
71
|
+
result.memoryFiles.push(new MemoryFile(targetFilePath, targetContent));
|
|
72
|
+
})));
|
|
73
|
+
yield Promise.all(this._filesToCopy.map(filePath => absolutePath(filePath)).map(filePath => __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const content = yield fs_extra_1.default.readFile(filePath, 'utf8');
|
|
75
|
+
const targetFilePath = (0, utils_1.rebasePath)(filePath, path_1.default.dirname(filePath), modulePath);
|
|
76
|
+
result.memoryFiles.push(new MemoryFile(targetFilePath, content));
|
|
77
|
+
})));
|
|
78
|
+
return result;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ModuleManager = ModuleManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAA0B;AAC1B,gDAAsB;AACtB,8CAAsB;AACtB,0CAAiG;AAEjG,MAAM,YAAY,GAAG,IAAA,+BAAuB,EAAC,SAAS,CAAC,CAAC;AAExD,MAAa,UAAU;IAInB,YAAa,IAAY,EAAE,OAAe;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAEY,UAAU;;YACnB,MAAM,kBAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACzD,CAAC;KAAA;CACJ;AAZD,gCAYC;AAaD,MAAa,aAAa;IAA1B;QAEY,iBAAY,GAAG;YACnB,0BAA0B;YAC1B,8BAA8B;YAC9B,sBAAsB;SACzB,CAAC;QAEM,mBAAc,GAAG;YACrB,yBAAyB;YACzB,0BAA0B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AAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;gBAC9E,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;YACrE,CAAC,CAAA,CAAC,CAAC,CAAC;YACJ,OAAO,MAAM,CAAC;QAClB,CAAC;KAAA;CACJ;AA7BD,sCA6BC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export interface Config {
|
|
2
|
+
/**
|
|
3
|
+
* Engine features. Keys are feature IDs.
|
|
4
|
+
*/
|
|
5
|
+
features: Record<string, Feature>;
|
|
6
|
+
/**
|
|
7
|
+
* Describe how to generate the index module `'cc'`.
|
|
8
|
+
* Currently not used.
|
|
9
|
+
*/
|
|
10
|
+
index?: IndexConfig;
|
|
11
|
+
moduleOverrides?: Array<{
|
|
12
|
+
test: Test;
|
|
13
|
+
overrides: Record<string, string>;
|
|
14
|
+
isVirtualModule: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Included files for quick-compiler.
|
|
18
|
+
*/
|
|
19
|
+
includes: Array<string>;
|
|
20
|
+
/**
|
|
21
|
+
* The constants config for engine and user.
|
|
22
|
+
*/
|
|
23
|
+
constants: IConstantConfig;
|
|
24
|
+
/**
|
|
25
|
+
* The decorators to be optimize when build engine.
|
|
26
|
+
*/
|
|
27
|
+
optimizeDecorators: IOptimizeDecorators;
|
|
28
|
+
}
|
|
29
|
+
export interface IndexConfig {
|
|
30
|
+
modules?: Record<string, {
|
|
31
|
+
/**
|
|
32
|
+
* If specified, export contents of the module into a namespace specified by `ns`
|
|
33
|
+
* and then export that namespace into `'cc'`.
|
|
34
|
+
* If not specified, contents of the module will be directly exported into `'cc'`.
|
|
35
|
+
*/
|
|
36
|
+
ns?: string;
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, accesses the exports of this module from `'cc'` will be marked as deprecated.
|
|
39
|
+
*/
|
|
40
|
+
deprecated?: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export type Test = string;
|
|
44
|
+
/**
|
|
45
|
+
* An engine feature.
|
|
46
|
+
*/
|
|
47
|
+
export interface Feature {
|
|
48
|
+
/**
|
|
49
|
+
* Modules to be included in this feature in their IDs.
|
|
50
|
+
* The ID of a module is its relative path(no extension) under /exports/.
|
|
51
|
+
*/
|
|
52
|
+
modules: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Flags to set when this feature is enabled.
|
|
55
|
+
*/
|
|
56
|
+
intrinsicFlags?: Record<string, unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* List of uuid that the feature depend on.
|
|
59
|
+
*/
|
|
60
|
+
dependentAssets?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* List of module that the feature depend on.
|
|
63
|
+
*/
|
|
64
|
+
dependentModules?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* Whether it is a native only feature, default is false.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
isNativeOnly?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface Context {
|
|
72
|
+
mode?: string;
|
|
73
|
+
platform?: string;
|
|
74
|
+
buildTimeConstants?: Object;
|
|
75
|
+
}
|
|
76
|
+
export type ConstantTypeName = 'boolean' | 'number';
|
|
77
|
+
export interface IConstantInfo {
|
|
78
|
+
/**
|
|
79
|
+
* The comment of the constant.
|
|
80
|
+
* Which is used to generate the consts.d.ts file.
|
|
81
|
+
*/
|
|
82
|
+
readonly comment: string;
|
|
83
|
+
/**
|
|
84
|
+
* The type of the constant for generating consts.d.ts file.
|
|
85
|
+
*/
|
|
86
|
+
readonly type: ConstantTypeName;
|
|
87
|
+
/**
|
|
88
|
+
* The default value of the constant.
|
|
89
|
+
* It can be a boolean, number or string.
|
|
90
|
+
* When it's a string type, the value is the result of eval().
|
|
91
|
+
*/
|
|
92
|
+
value: boolean | string | number;
|
|
93
|
+
/**
|
|
94
|
+
* Whether exported to global as a `CC_XXXX` constant.
|
|
95
|
+
* eg. WECHAT is exported to global.CC_WECHAT
|
|
96
|
+
* NOTE: this is a feature of compatibility with Cocos 2.x engine.
|
|
97
|
+
* Default is false.
|
|
98
|
+
*
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
ccGlobal?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Whether exported to developer.
|
|
104
|
+
* If true, it's only exported to engine.
|
|
105
|
+
*/
|
|
106
|
+
readonly internal: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Some constant can't specify the value in the Editor, Preview or Test environment,
|
|
109
|
+
* so we need to dynamically judge them in runtime.
|
|
110
|
+
* These values are specified in a helper called `helper-dynamic-constants.ts`.
|
|
111
|
+
* Default is false.
|
|
112
|
+
*
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
dynamic?: boolean;
|
|
116
|
+
}
|
|
117
|
+
export interface IConstantConfig {
|
|
118
|
+
[ConstantName: string]: IConstantInfo;
|
|
119
|
+
}
|
|
120
|
+
export interface IOptimizeDecorators {
|
|
121
|
+
/**
|
|
122
|
+
* The decorators which should be optimized when they only decorate class fields.
|
|
123
|
+
*/
|
|
124
|
+
fieldDecorators: string[];
|
|
125
|
+
/**
|
|
126
|
+
* The decorators which should be removed directly when they only work in Cocos Creator editor.
|
|
127
|
+
*/
|
|
128
|
+
editorDecorators: string[];
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-interface.d.ts","sourceRoot":"","sources":["../src/config-interface.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,MAAM;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB,eAAe,CAAC,EAAE,KAAK,CAAC;QACpB,IAAI,EAAE,IAAI,CAAC;QACX,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACl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