@cocos/ccbuild 2.0.3-alpha.12 → 2.0.3-alpha.13
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 +6 -0
- package/README.md +16 -16
- package/modules/build-engine/lib/build-dts.d.ts +7 -0
- package/modules/build-engine/lib/build-dts.d.ts.map +1 -0
- package/modules/build-engine/lib/build-dts.js +297 -0
- package/modules/build-engine/lib/build-dts.js.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts +35 -35
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js +10 -10
- package/modules/build-engine/lib/engine-ts/engine-builder.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-ts/engine-builder.js +59 -3
- package/modules/build-engine/lib/engine-ts/engine-builder.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.d.ts +2 -2
- package/modules/build-engine/lib/engine-ts/plugins/interface.d.ts +14 -14
- package/modules/build-engine/lib/index.d.ts +94 -94
- package/modules/build-engine/lib/index.js +16 -16
- package/modules/dts-bundler/lib/index.js +5 -5
- package/modules/modularize/lib/module-config.d.ts +70 -70
- package/modules/modularize/lib/module-query.d.ts +25 -25
- package/modules/modularize/lib/module-query.js +13 -13
- package/modules/modularize/lib/platform-config.d.ts +8 -8
- package/modules/modularize/lib/platform-config.js +8 -8
- package/modules/stats-query/lib/config-interface.d.ts +61 -61
- package/modules/stats-query/lib/index.d.ts +61 -61
- package/modules/stats-query/lib/index.js +41 -41
- package/package.json +1 -1
- package/static/helper-dynamic-constants.txt +13 -13
- package/static/helper-file-decorator.ts +20 -20
- package/static/helper-global-exporter.txt +8 -8
- package/static/lib.dom.d.ts +2330 -2330
|
@@ -3,130 +3,130 @@ export type MinigamePlatformConfig = { [key in Lowercase<keyof typeof MinigamePl
|
|
|
3
3
|
export type NativePlatformConfig = { [key in Lowercase<keyof typeof NativePlatform>]?: string };
|
|
4
4
|
export type WebPlatformConfig = { [key in Lowercase<keyof typeof WebPlatform>]?: string };
|
|
5
5
|
export type PlatformType = Uppercase<keyof typeof WebPlatform | keyof typeof MinigamePlatform | keyof typeof NativePlatform> | 'HTML5' | 'NATIVE';
|
|
6
|
-
/**
|
|
7
|
-
* Abstract platform export, like `web`, `native` and `minigame`.
|
|
8
|
-
* Usually this is used for PAL modules.
|
|
9
|
-
* The build tools resolve the relative platform as entry according to the build platform config.
|
|
10
|
-
* - The value can be a `string` or a `object` which requires a default item.
|
|
11
|
-
* eg. { "web": "/path/to/index.ts" } is equals to { "web": { default: "/path/to/index.ts" } }.
|
|
12
|
-
* - We can also specify the exact platform like
|
|
13
|
-
* { "web": {default: "/path/to/index.ts", "web-desktop": "/path/to/index.ts" } }.
|
|
6
|
+
/**
|
|
7
|
+
* Abstract platform export, like `web`, `native` and `minigame`.
|
|
8
|
+
* Usually this is used for PAL modules.
|
|
9
|
+
* The build tools resolve the relative platform as entry according to the build platform config.
|
|
10
|
+
* - The value can be a `string` or a `object` which requires a default item.
|
|
11
|
+
* eg. { "web": "/path/to/index.ts" } is equals to { "web": { default: "/path/to/index.ts" } }.
|
|
12
|
+
* - We can also specify the exact platform like
|
|
13
|
+
* { "web": {default: "/path/to/index.ts", "web-desktop": "/path/to/index.ts" } }.
|
|
14
14
|
*/
|
|
15
15
|
type AbstractPlatformExport<T> = ({
|
|
16
|
-
/**
|
|
17
|
-
* Default platform export for unspecified platforms.
|
|
16
|
+
/**
|
|
17
|
+
* Default platform export for unspecified platforms.
|
|
18
18
|
*/
|
|
19
19
|
default: string;
|
|
20
20
|
} & T) | string;
|
|
21
|
-
/**
|
|
22
|
-
* The export condition. `types` fields are required.
|
|
21
|
+
/**
|
|
22
|
+
* The export condition. `types` fields are required.
|
|
23
23
|
*/
|
|
24
24
|
type ExportCondition<T> = {
|
|
25
|
-
/**
|
|
26
|
-
* This is the main module export condition.
|
|
27
|
-
* - The dts bundle tools resolve this condition as entry.
|
|
28
|
-
* - The API doc tools resolve this condition as entry.
|
|
29
|
-
* - If no platform export is specified, the build tools resolve this condition as entry.
|
|
25
|
+
/**
|
|
26
|
+
* This is the main module export condition.
|
|
27
|
+
* - The dts bundle tools resolve this condition as entry.
|
|
28
|
+
* - The API doc tools resolve this condition as entry.
|
|
29
|
+
* - If no platform export is specified, the build tools resolve this condition as entry.
|
|
30
30
|
*/
|
|
31
31
|
types: string;
|
|
32
|
-
/**
|
|
33
|
-
* The custom condition, for example:
|
|
34
|
-
* - For gfx module: {"webgl1": "/path/to/webgl1/index.ts", "webgl2": "/path/to/webgl2/index.ts"}
|
|
35
|
-
* - For physics module {"cannon": "/path/to/cannon/index.ts", "physX": "/path/to/physX/index.ts"}
|
|
32
|
+
/**
|
|
33
|
+
* The custom condition, for example:
|
|
34
|
+
* - For gfx module: {"webgl1": "/path/to/webgl1/index.ts", "webgl2": "/path/to/webgl2/index.ts"}
|
|
35
|
+
* - For physics module {"cannon": "/path/to/cannon/index.ts", "physX": "/path/to/physX/index.ts"}
|
|
36
36
|
*/
|
|
37
37
|
[customCondition: string]: string;
|
|
38
38
|
} & T;
|
|
39
39
|
interface ConditionalExports {
|
|
40
|
-
/**
|
|
41
|
-
* This is exported to the game runtime.
|
|
42
|
-
* Also we build the `cc.d.ts` with this export condition's `types` field.
|
|
43
|
-
* `node` field is required to resolve the path of package.json for build tools.
|
|
40
|
+
/**
|
|
41
|
+
* This is exported to the game runtime.
|
|
42
|
+
* Also we build the `cc.d.ts` with this export condition's `types` field.
|
|
43
|
+
* `node` field is required to resolve the path of package.json for build tools.
|
|
44
44
|
*/
|
|
45
45
|
'.': ExportCondition<{
|
|
46
|
-
/**
|
|
47
|
-
* `node` should be specified as './package.json' to resolve the path of package.json for build tools.
|
|
46
|
+
/**
|
|
47
|
+
* `node` should be specified as './package.json' to resolve the path of package.json for build tools.
|
|
48
48
|
*/
|
|
49
49
|
node: './package.json';
|
|
50
50
|
minigame?: AbstractPlatformExport<MinigamePlatformConfig>;
|
|
51
51
|
native?: AbstractPlatformExport<NativePlatformConfig>;
|
|
52
52
|
web?: AbstractPlatformExport<WebPlatformConfig>;
|
|
53
53
|
}>;
|
|
54
|
-
/**
|
|
55
|
-
* This is exported to the engine internal.
|
|
56
|
-
* It useful when we need to export some friend interfaces for internal engine modules.
|
|
54
|
+
/**
|
|
55
|
+
* This is exported to the engine internal.
|
|
56
|
+
* It useful when we need to export some friend interfaces for internal engine modules.
|
|
57
57
|
*/
|
|
58
58
|
'./internal'?: ExportCondition<{
|
|
59
59
|
minigame?: AbstractPlatformExport<MinigamePlatformConfig>;
|
|
60
60
|
native?: AbstractPlatformExport<NativePlatformConfig>;
|
|
61
61
|
web?: AbstractPlatformExport<WebPlatformConfig>;
|
|
62
62
|
}>;
|
|
63
|
-
/**
|
|
64
|
-
* This is exported to the editor, which is useful when we need to export some editor only interfaces.
|
|
65
|
-
* Also we build `cc.editor.d.ts` from this export condition's `types` field.
|
|
66
|
-
* If this is not specified, we use the '.' export condition by default for module editor export,
|
|
67
|
-
* otherwise, the build tools merges '.' and './editor' exports together for editor runtime environment.
|
|
68
|
-
* It is different with `web_editor` or `native_editor` platform export:
|
|
69
|
-
* - this condition exports some editor specific interfaces which is not cross-platform.
|
|
70
|
-
* - the `web_editor` or `native_editor` platform export is an editor version of implementation of interfaces defined in `types` field which should be cross-platform.
|
|
63
|
+
/**
|
|
64
|
+
* This is exported to the editor, which is useful when we need to export some editor only interfaces.
|
|
65
|
+
* Also we build `cc.editor.d.ts` from this export condition's `types` field.
|
|
66
|
+
* If this is not specified, we use the '.' export condition by default for module editor export,
|
|
67
|
+
* otherwise, the build tools merges '.' and './editor' exports together for editor runtime environment.
|
|
68
|
+
* It is different with `web_editor` or `native_editor` platform export:
|
|
69
|
+
* - this condition exports some editor specific interfaces which is not cross-platform.
|
|
70
|
+
* - the `web_editor` or `native_editor` platform export is an editor version of implementation of interfaces defined in `types` field which should be cross-platform.
|
|
71
71
|
*/
|
|
72
72
|
'./editor'?: ExportCondition<{}>;
|
|
73
73
|
}
|
|
74
74
|
interface ModuleOverride {
|
|
75
|
-
/**
|
|
76
|
-
* The test string to evaluate.
|
|
75
|
+
/**
|
|
76
|
+
* The test string to evaluate.
|
|
77
77
|
*/
|
|
78
78
|
test: string;
|
|
79
|
-
/**
|
|
80
|
-
* The override config, override mapping from key to value.
|
|
79
|
+
/**
|
|
80
|
+
* The override config, override mapping from key to value.
|
|
81
81
|
*/
|
|
82
82
|
overrides: Record<string, string>;
|
|
83
83
|
}
|
|
84
84
|
export interface ModuleConfig {
|
|
85
85
|
[key: string]: unknown;
|
|
86
|
-
/**
|
|
87
|
-
* The module name.
|
|
86
|
+
/**
|
|
87
|
+
* The module name.
|
|
88
88
|
*/
|
|
89
89
|
name: string;
|
|
90
|
-
/**
|
|
91
|
-
* The version of module.
|
|
92
|
-
* It is useful when we change the module config, then we need to make some migration.
|
|
93
|
-
* This usually comes with the `cc.migrations` field.
|
|
90
|
+
/**
|
|
91
|
+
* The version of module.
|
|
92
|
+
* It is useful when we change the module config, then we need to make some migration.
|
|
93
|
+
* This usually comes with the `cc.migrations` field.
|
|
94
94
|
*/
|
|
95
95
|
version: string;
|
|
96
|
-
/**
|
|
97
|
-
* The config for conditional exports.
|
|
96
|
+
/**
|
|
97
|
+
* The config for conditional exports.
|
|
98
98
|
*/
|
|
99
99
|
exports: ConditionalExports;
|
|
100
|
-
/**
|
|
101
|
-
* Specify the module dependencies is required if this module import another one.
|
|
102
|
-
* We need this field to generate the module dependency graph.
|
|
100
|
+
/**
|
|
101
|
+
* Specify the module dependencies is required if this module import another one.
|
|
102
|
+
* We need this field to generate the module dependency graph.
|
|
103
103
|
*/
|
|
104
104
|
dependencies?: Record<string, string>;
|
|
105
|
-
/**
|
|
106
|
-
* Specify the dev dependencies, these dependencies are always used in `scripts` folder.
|
|
105
|
+
/**
|
|
106
|
+
* Specify the dev dependencies, these dependencies are always used in `scripts` folder.
|
|
107
107
|
*/
|
|
108
108
|
devDependencies?: Record<string, string>;
|
|
109
|
-
/**
|
|
110
|
-
* The dependencies between modules form a tree-structured dependency graph.
|
|
111
|
-
* The correct dependency relationship should be that the upper module depends on the lower module one-way, and the reverse is wrong.
|
|
112
|
-
* However, it is normal for modules at the same layer to depend on each other, and such dependencies should be declared as `peerDependencies`.
|
|
113
|
-
* Otherwise the Turbo pipeline will report an error due to module circular dependencies.
|
|
114
|
-
* see: https://github.com/vercel/turbo/issues/1480
|
|
109
|
+
/**
|
|
110
|
+
* The dependencies between modules form a tree-structured dependency graph.
|
|
111
|
+
* The correct dependency relationship should be that the upper module depends on the lower module one-way, and the reverse is wrong.
|
|
112
|
+
* However, it is normal for modules at the same layer to depend on each other, and such dependencies should be declared as `peerDependencies`.
|
|
113
|
+
* Otherwise the Turbo pipeline will report an error due to module circular dependencies.
|
|
114
|
+
* see: https://github.com/vercel/turbo/issues/1480
|
|
115
115
|
*/
|
|
116
116
|
peerDependencies?: Record<string, string>;
|
|
117
|
-
/**
|
|
118
|
-
* This is a CC-specific item difference from the node package.json standard specification.
|
|
117
|
+
/**
|
|
118
|
+
* This is a CC-specific item difference from the node package.json standard specification.
|
|
119
119
|
*/
|
|
120
120
|
cc?: {
|
|
121
|
-
/**
|
|
122
|
-
* The module asset dependencies, which is an array of asset uuid.
|
|
121
|
+
/**
|
|
122
|
+
* The module asset dependencies, which is an array of asset uuid.
|
|
123
123
|
*/
|
|
124
124
|
assetDependencies?: string[];
|
|
125
|
-
/**
|
|
126
|
-
* This is different with conditional exports.
|
|
127
|
-
* Sometimes we just want to override a script file instead of the whole module.
|
|
128
|
-
* Module override could support to do this job.
|
|
129
|
-
* - eg. { "test": "context.mode === 'BUILD'", "overrides": { "/path/to/dev.ts": "/path/to/build.ts" } }
|
|
125
|
+
/**
|
|
126
|
+
* This is different with conditional exports.
|
|
127
|
+
* Sometimes we just want to override a script file instead of the whole module.
|
|
128
|
+
* Module override could support to do this job.
|
|
129
|
+
* - eg. { "test": "context.mode === 'BUILD'", "overrides": { "/path/to/dev.ts": "/path/to/build.ts" } }
|
|
130
130
|
*/
|
|
131
131
|
moduleOverrides?: ModuleOverride[];
|
|
132
132
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { ModuleConfig, PlatformType } from './module-config';
|
|
2
2
|
export interface ModuleQueryContext {
|
|
3
|
-
/**
|
|
4
|
-
* The engine root path.
|
|
3
|
+
/**
|
|
4
|
+
* The engine root path.
|
|
5
5
|
*/
|
|
6
6
|
engine: string;
|
|
7
|
-
/**
|
|
8
|
-
* The platform to resolve conditional export.
|
|
7
|
+
/**
|
|
8
|
+
* The platform to resolve conditional export.
|
|
9
9
|
*/
|
|
10
10
|
platform: PlatformType;
|
|
11
|
-
/**
|
|
12
|
-
* The custom export condition.
|
|
13
|
-
* The higher the array is sorted, the higher the priority is.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* [ 'webgl1', 'cannon' ] // the backend of 'gfx' and 'physics' modules.
|
|
18
|
-
* ```
|
|
11
|
+
/**
|
|
12
|
+
* The custom export condition.
|
|
13
|
+
* The higher the array is sorted, the higher the priority is.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* [ 'webgl1', 'cannon' ] // the backend of 'gfx' and 'physics' modules.
|
|
18
|
+
* ```
|
|
19
19
|
*/
|
|
20
20
|
customExportConditions?: string[];
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* The module info manager.
|
|
22
|
+
/**
|
|
23
|
+
* The module info manager.
|
|
24
24
|
*/
|
|
25
25
|
export declare class ModuleQuery {
|
|
26
26
|
private _context;
|
|
@@ -28,25 +28,25 @@ export declare class ModuleQuery {
|
|
|
28
28
|
private _resolvedCache;
|
|
29
29
|
private _cachedHasEditorSpecificExport;
|
|
30
30
|
constructor(context: ModuleQueryContext);
|
|
31
|
-
/**
|
|
32
|
-
* Get all modules' name defined in engine workspaces.
|
|
31
|
+
/**
|
|
32
|
+
* Get all modules' name defined in engine workspaces.
|
|
33
33
|
*/
|
|
34
34
|
getAllModules(): Promise<string[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Resolve module package.json path by module name.
|
|
35
|
+
/**
|
|
36
|
+
* Resolve module package.json path by module name.
|
|
37
37
|
*/
|
|
38
38
|
resolvePackageJson(moduleName: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Get module config by module name.
|
|
39
|
+
/**
|
|
40
|
+
* Get module config by module name.
|
|
41
41
|
*/
|
|
42
42
|
getConfig(moduleName: string): Promise<ModuleConfig>;
|
|
43
|
-
/**
|
|
44
|
-
* Resolve module entry path by import source.
|
|
43
|
+
/**
|
|
44
|
+
* Resolve module entry path by import source.
|
|
45
45
|
*/
|
|
46
46
|
resolveExport(source: string): Promise<string | void>;
|
|
47
|
-
/**
|
|
48
|
-
* To detect whether the module has a './editor' export.
|
|
49
|
-
* @param moduleName
|
|
47
|
+
/**
|
|
48
|
+
* To detect whether the module has a './editor' export.
|
|
49
|
+
* @param moduleName
|
|
50
50
|
*/
|
|
51
51
|
hasEditorSpecificExport(moduleName: string): Promise<boolean>;
|
|
52
52
|
private _isWebPlatform;
|
|
@@ -40,8 +40,8 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
40
40
|
const platform_config_1 = require("./platform-config");
|
|
41
41
|
const glob_1 = __importDefault(require("glob"));
|
|
42
42
|
const utils_1 = require("../../utils/lib/index.js");
|
|
43
|
-
/**
|
|
44
|
-
* The module info manager.
|
|
43
|
+
/**
|
|
44
|
+
* The module info manager.
|
|
45
45
|
*/
|
|
46
46
|
class ModuleQuery {
|
|
47
47
|
constructor(context) {
|
|
@@ -49,8 +49,8 @@ class ModuleQuery {
|
|
|
49
49
|
this._cachedHasEditorSpecificExport = {};
|
|
50
50
|
this._context = context;
|
|
51
51
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Get all modules' name defined in engine workspaces.
|
|
52
|
+
/**
|
|
53
|
+
* Get all modules' name defined in engine workspaces.
|
|
54
54
|
*/
|
|
55
55
|
getAllModules() {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -90,16 +90,16 @@ class ModuleQuery {
|
|
|
90
90
|
return this._cachedAllModules = moduleNames;
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Resolve module package.json path by module name.
|
|
93
|
+
/**
|
|
94
|
+
* Resolve module package.json path by module name.
|
|
95
95
|
*/
|
|
96
96
|
resolvePackageJson(moduleName) {
|
|
97
97
|
return require.resolve(moduleName, {
|
|
98
98
|
paths: [this._context.engine]
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Get module config by module name.
|
|
101
|
+
/**
|
|
102
|
+
* Get module config by module name.
|
|
103
103
|
*/
|
|
104
104
|
getConfig(moduleName) {
|
|
105
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -107,8 +107,8 @@ class ModuleQuery {
|
|
|
107
107
|
return yield fs_extra_1.default.readJson(modulePath);
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
/**
|
|
111
|
-
* Resolve module entry path by import source.
|
|
110
|
+
/**
|
|
111
|
+
* Resolve module entry path by import source.
|
|
112
112
|
*/
|
|
113
113
|
resolveExport(source) {
|
|
114
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -184,9 +184,9 @@ class ModuleQuery {
|
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
/**
|
|
188
|
-
* To detect whether the module has a './editor' export.
|
|
189
|
-
* @param moduleName
|
|
187
|
+
/**
|
|
188
|
+
* To detect whether the module has a './editor' export.
|
|
189
|
+
* @param moduleName
|
|
190
190
|
*/
|
|
191
191
|
hasEditorSpecificExport(moduleName) {
|
|
192
192
|
var _a;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare enum MinigamePlatform {
|
|
2
2
|
WECHAT = 0,
|
|
3
3
|
WECHAT_MINI_PROGRAM = 1,
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated this platform has been removed.
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated this platform has been removed.
|
|
6
6
|
*/
|
|
7
7
|
BAIDU = 2,
|
|
8
8
|
BYTEDANCE = 3,
|
|
@@ -13,16 +13,16 @@ export declare enum MinigamePlatform {
|
|
|
13
13
|
OPPO = 8,
|
|
14
14
|
VIVO = 9,
|
|
15
15
|
HUAWEI = 10,
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated this platform has been removed.
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated this platform has been removed.
|
|
18
18
|
*/
|
|
19
19
|
COCOSPLAY = 11,
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated this platform has been removed.
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated this platform has been removed.
|
|
22
22
|
*/
|
|
23
23
|
QTT = 12,
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated this platform has been removed.
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated this platform has been removed.
|
|
26
26
|
*/
|
|
27
27
|
LINKSURE = 13,
|
|
28
28
|
}
|
|
@@ -8,8 +8,8 @@ var MinigamePlatform;
|
|
|
8
8
|
(function (MinigamePlatform) {
|
|
9
9
|
MinigamePlatform[MinigamePlatform["WECHAT"] = 0] = "WECHAT";
|
|
10
10
|
MinigamePlatform[MinigamePlatform["WECHAT_MINI_PROGRAM"] = 1] = "WECHAT_MINI_PROGRAM";
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated this platform has been removed.
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated this platform has been removed.
|
|
13
13
|
*/
|
|
14
14
|
MinigamePlatform[MinigamePlatform["BAIDU"] = 2] = "BAIDU";
|
|
15
15
|
MinigamePlatform[MinigamePlatform["BYTEDANCE"] = 3] = "BYTEDANCE";
|
|
@@ -20,16 +20,16 @@ var MinigamePlatform;
|
|
|
20
20
|
MinigamePlatform[MinigamePlatform["OPPO"] = 8] = "OPPO";
|
|
21
21
|
MinigamePlatform[MinigamePlatform["VIVO"] = 9] = "VIVO";
|
|
22
22
|
MinigamePlatform[MinigamePlatform["HUAWEI"] = 10] = "HUAWEI";
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated this platform has been removed.
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated this platform has been removed.
|
|
25
25
|
*/
|
|
26
26
|
MinigamePlatform[MinigamePlatform["COCOSPLAY"] = 11] = "COCOSPLAY";
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated this platform has been removed.
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated this platform has been removed.
|
|
29
29
|
*/
|
|
30
30
|
MinigamePlatform[MinigamePlatform["QTT"] = 12] = "QTT";
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated this platform has been removed.
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated this platform has been removed.
|
|
33
33
|
*/
|
|
34
34
|
MinigamePlatform[MinigamePlatform["LINKSURE"] = 13] = "LINKSURE";
|
|
35
35
|
})(MinigamePlatform = exports.MinigamePlatform || (exports.MinigamePlatform = {}));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface Config {
|
|
2
|
-
/**
|
|
3
|
-
* Engine features. Keys are feature IDs.
|
|
2
|
+
/**
|
|
3
|
+
* Engine features. Keys are feature IDs.
|
|
4
4
|
*/
|
|
5
5
|
features: Record<string, Feature>;
|
|
6
|
-
/**
|
|
7
|
-
* Describe how to generate the index module `'cc'`.
|
|
8
|
-
* Currently not used.
|
|
6
|
+
/**
|
|
7
|
+
* Describe how to generate the index module `'cc'`.
|
|
8
|
+
* Currently not used.
|
|
9
9
|
*/
|
|
10
10
|
index?: IndexConfig;
|
|
11
11
|
moduleOverrides?: Array<{
|
|
@@ -13,58 +13,58 @@ export interface Config {
|
|
|
13
13
|
overrides: Record<string, string>;
|
|
14
14
|
isVirtualModule: boolean;
|
|
15
15
|
}>;
|
|
16
|
-
/**
|
|
17
|
-
* Included files for quick-compiler.
|
|
16
|
+
/**
|
|
17
|
+
* Included files for quick-compiler.
|
|
18
18
|
*/
|
|
19
19
|
includes: Array<string>;
|
|
20
|
-
/**
|
|
21
|
-
* The constants config for engine and user.
|
|
20
|
+
/**
|
|
21
|
+
* The constants config for engine and user.
|
|
22
22
|
*/
|
|
23
23
|
constants: IConstantConfig;
|
|
24
|
-
/**
|
|
25
|
-
* The decorators to be optimize when build engine.
|
|
24
|
+
/**
|
|
25
|
+
* The decorators to be optimize when build engine.
|
|
26
26
|
*/
|
|
27
27
|
optimizeDecorators: IOptimizeDecorators;
|
|
28
28
|
}
|
|
29
29
|
export interface IndexConfig {
|
|
30
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'`.
|
|
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
35
|
*/
|
|
36
36
|
ns?: string;
|
|
37
|
-
/**
|
|
38
|
-
* If `true`, accesses the exports of this module from `'cc'` will be marked as deprecated.
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, accesses the exports of this module from `'cc'` will be marked as deprecated.
|
|
39
39
|
*/
|
|
40
40
|
deprecated?: boolean;
|
|
41
41
|
}>;
|
|
42
42
|
}
|
|
43
43
|
export type Test = string;
|
|
44
|
-
/**
|
|
45
|
-
* An engine feature.
|
|
44
|
+
/**
|
|
45
|
+
* An engine feature.
|
|
46
46
|
*/
|
|
47
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/.
|
|
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
51
|
*/
|
|
52
52
|
modules: string[];
|
|
53
|
-
/**
|
|
54
|
-
* Flags to set when this feature is enabled.
|
|
53
|
+
/**
|
|
54
|
+
* Flags to set when this feature is enabled.
|
|
55
55
|
*/
|
|
56
56
|
intrinsicFlags?: Record<string, unknown>;
|
|
57
|
-
/**
|
|
58
|
-
* List of uuid that the feature depend on.
|
|
57
|
+
/**
|
|
58
|
+
* List of uuid that the feature depend on.
|
|
59
59
|
*/
|
|
60
60
|
dependentAssets?: string[];
|
|
61
|
-
/**
|
|
62
|
-
* List of module that the feature depend on.
|
|
61
|
+
/**
|
|
62
|
+
* List of module that the feature depend on.
|
|
63
63
|
*/
|
|
64
64
|
dependentModules?: string[];
|
|
65
|
-
/**
|
|
66
|
-
* Whether it is a native only feature, default is false.
|
|
67
|
-
* @default false
|
|
65
|
+
/**
|
|
66
|
+
* Whether it is a native only feature, default is false.
|
|
67
|
+
* @default false
|
|
68
68
|
*/
|
|
69
69
|
isNativeOnly?: boolean;
|
|
70
70
|
}
|
|
@@ -75,42 +75,42 @@ export interface Context {
|
|
|
75
75
|
}
|
|
76
76
|
export type ConstantTypeName = 'boolean' | 'number';
|
|
77
77
|
export interface IConstantInfo {
|
|
78
|
-
/**
|
|
79
|
-
* The comment of the constant.
|
|
80
|
-
* Which is used to generate the consts.d.ts file.
|
|
78
|
+
/**
|
|
79
|
+
* The comment of the constant.
|
|
80
|
+
* Which is used to generate the consts.d.ts file.
|
|
81
81
|
*/
|
|
82
82
|
readonly comment: string;
|
|
83
|
-
/**
|
|
84
|
-
* The type of the constant for generating consts.d.ts file.
|
|
83
|
+
/**
|
|
84
|
+
* The type of the constant for generating consts.d.ts file.
|
|
85
85
|
*/
|
|
86
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().
|
|
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
91
|
*/
|
|
92
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
|
|
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
100
|
*/
|
|
101
101
|
ccGlobal?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Whether exported to developer.
|
|
104
|
-
* If true, it's only exported to engine.
|
|
102
|
+
/**
|
|
103
|
+
* Whether exported to developer.
|
|
104
|
+
* If true, it's only exported to engine.
|
|
105
105
|
*/
|
|
106
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
|
|
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
114
|
*/
|
|
115
115
|
dynamic?: boolean;
|
|
116
116
|
}
|
|
@@ -118,12 +118,12 @@ export interface IConstantConfig {
|
|
|
118
118
|
[ConstantName: string]: IConstantInfo;
|
|
119
119
|
}
|
|
120
120
|
export interface IOptimizeDecorators {
|
|
121
|
-
/**
|
|
122
|
-
* The decorators which should be optimized when they only decorate class fields.
|
|
121
|
+
/**
|
|
122
|
+
* The decorators which should be optimized when they only decorate class fields.
|
|
123
123
|
*/
|
|
124
124
|
fieldDecorators: string[];
|
|
125
|
-
/**
|
|
126
|
-
* The decorators which should be removed directly when they only work in Cocos Creator editor.
|
|
125
|
+
/**
|
|
126
|
+
* The decorators which should be removed directly when they only work in Cocos Creator editor.
|
|
127
127
|
*/
|
|
128
128
|
editorDecorators: string[];
|
|
129
129
|
}
|