@cocos/ccbuild 2.0.3-alpha.1 → 2.0.3-alpha.11
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 +269 -0
- package/README.md +16 -37
- package/lib/src/index.d.ts +5 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +5 -1
- package/lib/src/index.js.map +1 -1
- 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/index.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/index.js +11 -2
- package/modules/build-engine/lib/engine-js/index.js.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts +33 -33
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js +72 -43
- package/modules/build-engine/lib/engine-js/rollup-plugins/external-wasm-loader.js.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.d.ts +4 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.js +43 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/module-query-plugin.js.map +1 -0
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.js +8 -7
- package/modules/build-engine/lib/engine-js/rollup-plugins/ts-paths.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/engine-builder.d.ts +0 -1
- package/modules/build-engine/lib/engine-ts/engine-builder.d.ts.map +1 -1
- package/modules/build-engine/lib/engine-ts/engine-builder.js +28 -47
- 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.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js +20 -3
- package/modules/build-engine/lib/engine-ts/plugins/external-wasm-loader.js.map +1 -1
- package/modules/build-engine/lib/engine-ts/plugins/interface.d.ts +14 -14
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.d.ts +3 -0
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.d.ts.map +1 -0
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.js +52 -0
- package/modules/build-engine/lib/engine-ts/plugins/module-query-plugin.js.map +1 -0
- package/modules/build-engine/lib/index.d.ts +98 -86
- package/modules/build-engine/lib/index.d.ts.map +1 -1
- package/modules/build-engine/lib/index.js +69 -38
- package/modules/build-engine/lib/index.js.map +1 -1
- package/modules/dts-bundler/lib/index.d.ts +5 -0
- package/modules/dts-bundler/lib/index.d.ts.map +1 -0
- package/modules/dts-bundler/lib/index.js +344 -0
- package/modules/dts-bundler/lib/index.js.map +1 -0
- package/modules/modularize/lib/index.d.ts +3 -20
- package/modules/modularize/lib/index.d.ts.map +1 -1
- package/modules/modularize/lib/index.js +20 -75
- package/modules/modularize/lib/index.js.map +1 -1
- package/modules/modularize/lib/module-config.d.ts +134 -0
- package/modules/modularize/lib/module-config.d.ts.map +1 -0
- package/modules/modularize/lib/module-config.js +6 -0
- package/modules/modularize/lib/module-config.js.map +1 -0
- package/modules/modularize/lib/module-config.schema.json +425 -0
- package/modules/modularize/lib/module-query.d.ts +55 -0
- package/modules/modularize/lib/module-query.d.ts.map +1 -0
- package/modules/modularize/lib/module-query.js +212 -0
- package/modules/modularize/lib/module-query.js.map +1 -0
- package/modules/modularize/lib/platform-config.d.ts +43 -0
- package/modules/modularize/lib/platform-config.d.ts.map +1 -0
- package/modules/modularize/lib/platform-config.js +52 -0
- package/modules/modularize/lib/platform-config.js.map +1 -0
- package/modules/stats-query/lib/cc.config.schema.json +216 -0
- package/modules/stats-query/lib/config-interface.d.ts +61 -61
- package/modules/stats-query/lib/config-interface.js +1 -1
- package/modules/stats-query/lib/config-interface.js.map +1 -1
- package/modules/stats-query/lib/index.d.ts +62 -73
- package/modules/stats-query/lib/index.d.ts.map +1 -1
- package/modules/stats-query/lib/index.js +43 -38
- package/modules/stats-query/lib/index.js.map +1 -1
- package/modules/transformer/lib/babel/plugins.d.ts +1 -0
- package/modules/transformer/lib/babel/plugins.d.ts.map +1 -1
- package/modules/transformer/lib/babel/plugins.js +2 -4
- package/modules/transformer/lib/babel/plugins.js.map +1 -1
- package/modules/transformer/lib/index.d.ts +2 -1
- package/modules/transformer/lib/index.d.ts.map +1 -1
- package/modules/transformer/lib/index.js +4 -2
- package/modules/transformer/lib/index.js.map +1 -1
- package/modules/transformer/lib/typescript/index.d.ts +2 -0
- package/modules/transformer/lib/typescript/index.d.ts.map +1 -0
- package/modules/transformer/lib/typescript/index.js +39 -0
- package/modules/transformer/lib/typescript/index.js.map +1 -0
- package/modules/transformer/static/types-polyfill.d.ts +18 -0
- package/modules/utils/lib/index.d.ts +3 -1
- package/modules/utils/lib/index.d.ts.map +1 -1
- package/modules/utils/lib/index.js +61 -4
- package/modules/utils/lib/index.js.map +1 -1
- package/modules/utils/lib/path.d.ts +5 -0
- package/modules/utils/lib/path.d.ts.map +1 -1
- package/modules/utils/lib/path.js +21 -4
- package/modules/utils/lib/path.js.map +1 -1
- package/package.json +26 -20
- 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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
4
|
+
/// <reference path="../../static/types-polyfill.d.ts"/>
|
|
3
5
|
var __importDefault = this && this.__importDefault || function (mod) {
|
|
4
6
|
return mod && mod.__esModule ? mod : {
|
|
5
7
|
"default": mod
|
|
@@ -9,17 +11,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
11
|
value: true
|
|
10
12
|
});
|
|
11
13
|
exports.transformModulesSystemjs = exports.cocosDynamicImportVars = exports.transformForOf = exports.syntaxDecorators = exports.syntaxTS = void 0;
|
|
12
|
-
// @ts-expect-error no type
|
|
13
14
|
const plugin_syntax_typescript_1 = __importDefault(require("@babel/plugin-syntax-typescript"));
|
|
14
15
|
exports.syntaxTS = plugin_syntax_typescript_1.default;
|
|
15
|
-
// @ts-expect-error no type
|
|
16
16
|
const plugin_syntax_decorators_1 = __importDefault(require("@babel/plugin-syntax-decorators"));
|
|
17
17
|
exports.syntaxDecorators = plugin_syntax_decorators_1.default;
|
|
18
|
-
// @ts-expect-error no type
|
|
19
18
|
const plugin_transform_for_of_1 = __importDefault(require("@babel/plugin-transform-for-of"));
|
|
20
19
|
exports.transformForOf = plugin_transform_for_of_1.default;
|
|
21
20
|
const babel_plugin_dynamic_import_vars_1 = __importDefault(require("@cocos/babel-plugin-dynamic-import-vars"));
|
|
22
21
|
exports.cocosDynamicImportVars = babel_plugin_dynamic_import_vars_1.default;
|
|
23
|
-
// @ts-expect-error no type
|
|
24
22
|
const plugin_transform_modules_systemjs_1 = __importDefault(require("@babel/plugin-transform-modules-systemjs"));
|
|
25
23
|
exports.transformModulesSystemjs = plugin_transform_modules_systemjs_1.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/babel/plugins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/babel/plugins.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,wDAAwD;;;;;;AAExD,+FAAuD;AAOnD,mBAPG,kCAAQ,CAOH;AANZ,+FAA+D;AAO3D,2BAPG,kCAAgB,CAOH;AANpB,6FAA4D;AAOxD,yBAPG,iCAAc,CAOH;AANlB,+GAA6E;AAOzE,iCAPG,0CAAsB,CAOH;AAN1B,iHAAgF;AAO5E,mCAPG,2CAAwB,CAOH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,OAAO,EACH,KAAK,EACL,UAAU,GACb,CAAC"}
|
|
@@ -34,6 +34,8 @@ var __importStar = this && this.__importStar || function (mod) {
|
|
|
34
34
|
Object.defineProperty(exports, "__esModule", {
|
|
35
35
|
value: true
|
|
36
36
|
});
|
|
37
|
-
exports.babel = void 0;
|
|
37
|
+
exports.typescript = exports.babel = void 0;
|
|
38
38
|
const babel = __importStar(require("./babel"));
|
|
39
|
-
exports.babel = babel;
|
|
39
|
+
exports.babel = babel;
|
|
40
|
+
const typescript = __importStar(require("./typescript"));
|
|
41
|
+
exports.typescript = typescript;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAI7B,sBAAK;AAHT,yDAA2C;AAIvC,gCAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,OAAO,EACH,IAAI,GACP,CAAC"}
|
|
@@ -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.core = void 0;
|
|
38
|
+
const core = __importStar(require("typescript"));
|
|
39
|
+
exports.core = core;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAG/B,oBAAI"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// add module declaration for some babel plugins
|
|
2
|
+
|
|
3
|
+
declare module '@babel/plugin-syntax-typescript' {
|
|
4
|
+
const $: any;
|
|
5
|
+
export default $;
|
|
6
|
+
}
|
|
7
|
+
declare module '@babel/plugin-syntax-decorators' {
|
|
8
|
+
const $: any;
|
|
9
|
+
export default $;
|
|
10
|
+
}
|
|
11
|
+
declare module '@babel/plugin-transform-for-of' {
|
|
12
|
+
const $: any;
|
|
13
|
+
export default $;
|
|
14
|
+
}
|
|
15
|
+
declare module '@babel/plugin-transform-modules-systemjs' {
|
|
16
|
+
const $: any;
|
|
17
|
+
export default $;
|
|
18
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as ps from './path';
|
|
2
|
+
export { ps };
|
|
3
|
+
export { formatPath, absolutePathFuncFactory, replaceExtname, rebasePath, filePathToModuleRequest, toExtensionLess, readdirR } from './path';
|
|
2
4
|
export declare function asserts(expr: boolean, message?: string): boolean;
|
|
3
5
|
export declare function isThenable(value: any): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,EAAE,EAAE,CAAC;AAGd,OAAO,EACH,UAAU,EACV,uBAAuB,EACvB,cAAc,EACd,UAAU,EACV,uBAAuB,EACvB,eAAe,EACf,QAAQ,GACX,MAAM,QAAQ,CAAC;AAEhB,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED,wBAAgB,UAAU,CAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAG/C"}
|
|
@@ -16,14 +16,71 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
16
16
|
if (k2 === undefined) k2 = k;
|
|
17
17
|
o[k2] = m[k];
|
|
18
18
|
});
|
|
19
|
-
var
|
|
20
|
-
|
|
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;
|
|
21
33
|
};
|
|
22
34
|
Object.defineProperty(exports, "__esModule", {
|
|
23
35
|
value: true
|
|
24
36
|
});
|
|
25
|
-
exports.isThenable = exports.asserts = void 0;
|
|
26
|
-
|
|
37
|
+
exports.isThenable = exports.asserts = exports.readdirR = exports.toExtensionLess = exports.filePathToModuleRequest = exports.rebasePath = exports.replaceExtname = exports.absolutePathFuncFactory = exports.formatPath = exports.ps = void 0;
|
|
38
|
+
const ps = __importStar(require("./path"));
|
|
39
|
+
exports.ps = ps;
|
|
40
|
+
// TODO: for module compatibility, to be removed.
|
|
41
|
+
var path_1 = require("./path");
|
|
42
|
+
Object.defineProperty(exports, "formatPath", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return path_1.formatPath;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "absolutePathFuncFactory", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return path_1.absolutePathFuncFactory;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "replaceExtname", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return path_1.replaceExtname;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "rebasePath", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return path_1.rebasePath;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "filePathToModuleRequest", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return path_1.filePathToModuleRequest;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "toExtensionLess", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return path_1.toExtensionLess;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "readdirR", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return path_1.readdirR;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
27
84
|
function asserts(expr, message) {
|
|
28
85
|
if (!expr) {
|
|
29
86
|
throw new Error(message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAEpB,gBAAE;AAEX,iDAAiD;AACjD,+BAQgB;AAPZ,kGAAA,UAAU,OAAA;AACV,+GAAA,uBAAuB,OAAA;AACvB,sGAAA,cAAc,OAAA;AACd,kGAAA,UAAU,OAAA;AACV,+GAAA,uBAAuB,OAAA;AACvB,uGAAA,eAAe,OAAA;AACf,gGAAA,QAAQ,OAAA;AAGZ,SAAgB,OAAO,CAAC,IAAa,EAAE,OAAgB;IACnD,IAAI,CAAC,IAAI,EAAE;QACP,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KAC5B;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AALD,0BAKC;AAED,SAAgB,UAAU,CAAE,KAAU;IAClC,gDAAgD;IAChD,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AAC9D,CAAC;AAHD,gCAGC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export declare const isAbsolute: (path: string) => boolean;
|
|
2
|
+
export declare function resolve(...args: string[]): string;
|
|
3
|
+
export declare function dirname(path: string): string;
|
|
4
|
+
export declare function join(...args: string[]): string;
|
|
5
|
+
export declare function relative(from: string, to: string): string;
|
|
1
6
|
export declare function formatPath(path: string): string;
|
|
2
7
|
export declare function absolutePathFuncFactory(dirname: string): (relativePath: string) => string;
|
|
3
8
|
export declare function replaceExtname(path: string, extname: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,uBAAuB,CAAE,OAAO,EAAE,MAAM,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAI1F;AAED,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtF;AAED,wBAAgB,uBAAuB,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,eAAe,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAsB,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CASnF"}
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAuB,CAAC;AAEnE,wBAAgB,OAAO,CAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAElD;AAED,wBAAgB,OAAO,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,IAAI,CAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED,wBAAgB,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,uBAAuB,CAAE,OAAO,EAAE,MAAM,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAI1F;AAED,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtF;AAED,wBAAgB,uBAAuB,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,eAAe,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAsB,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CASnF"}
|
|
@@ -61,16 +61,33 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
61
61
|
Object.defineProperty(exports, "__esModule", {
|
|
62
62
|
value: true
|
|
63
63
|
});
|
|
64
|
-
exports.readdirR = exports.toExtensionLess = exports.filePathToModuleRequest = exports.rebasePath = exports.replaceExtname = exports.absolutePathFuncFactory = exports.formatPath = void 0;
|
|
64
|
+
exports.readdirR = exports.toExtensionLess = exports.filePathToModuleRequest = exports.rebasePath = exports.replaceExtname = exports.absolutePathFuncFactory = exports.formatPath = exports.relative = exports.join = exports.dirname = exports.resolve = exports.isAbsolute = void 0;
|
|
65
65
|
const ps = __importStar(require("path"));
|
|
66
66
|
const fs = __importStar(require("fs-extra"));
|
|
67
|
+
exports.isAbsolute = ps.isAbsolute;
|
|
68
|
+
function resolve(...args) {
|
|
69
|
+
return formatPath(ps.resolve(...args));
|
|
70
|
+
}
|
|
71
|
+
exports.resolve = resolve;
|
|
72
|
+
function dirname(path) {
|
|
73
|
+
return formatPath(ps.dirname(path));
|
|
74
|
+
}
|
|
75
|
+
exports.dirname = dirname;
|
|
76
|
+
function join(...args) {
|
|
77
|
+
return formatPath(ps.join(...args));
|
|
78
|
+
}
|
|
79
|
+
exports.join = join;
|
|
80
|
+
function relative(from, to) {
|
|
81
|
+
return formatPath(ps.relative(from, to));
|
|
82
|
+
}
|
|
83
|
+
exports.relative = relative;
|
|
67
84
|
function formatPath(path) {
|
|
68
85
|
return path.replace(/\\/g, '/');
|
|
69
86
|
}
|
|
70
87
|
exports.formatPath = formatPath;
|
|
71
88
|
function absolutePathFuncFactory(dirname) {
|
|
72
89
|
return function absolutePath(relativePath) {
|
|
73
|
-
return
|
|
90
|
+
return join(dirname, relativePath);
|
|
74
91
|
};
|
|
75
92
|
}
|
|
76
93
|
exports.absolutePathFuncFactory = absolutePathFuncFactory;
|
|
@@ -79,7 +96,7 @@ function replaceExtname(path, extname) {
|
|
|
79
96
|
}
|
|
80
97
|
exports.replaceExtname = replaceExtname;
|
|
81
98
|
function rebasePath(path, originDir, rebaseDir) {
|
|
82
|
-
return
|
|
99
|
+
return join(rebaseDir, ps.relative(originDir, path));
|
|
83
100
|
}
|
|
84
101
|
exports.rebasePath = rebasePath;
|
|
85
102
|
function filePathToModuleRequest(path) {
|
|
@@ -95,7 +112,7 @@ function readdirR(item, reduceOutput) {
|
|
|
95
112
|
if ((yield fs.stat(item)).isDirectory()) {
|
|
96
113
|
const dirItems = yield fs.readdir(item);
|
|
97
114
|
for (const subItem of dirItems) {
|
|
98
|
-
yield readdirR(
|
|
115
|
+
yield readdirR(join(item, subItem), reduceOutput);
|
|
99
116
|
}
|
|
100
117
|
} else {
|
|
101
118
|
reduceOutput.push(item);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA+B;
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA+B;AAElB,QAAA,UAAU,GAA8B,EAAE,CAAC,UAAU,CAAC;AAEnE,SAAgB,OAAO,CAAE,GAAG,IAAc;IACtC,OAAO,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,0BAEC;AAED,SAAgB,OAAO,CAAE,IAAY;IACjC,OAAO,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,0BAEC;AAED,SAAgB,IAAI,CAAE,GAAG,IAAc;IACnC,OAAO,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,oBAEC;AAED,SAAgB,QAAQ,CAAE,IAAY,EAAE,EAAU;IAC9C,OAAO,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,4BAEC;AAED,SAAgB,UAAU,CAAE,IAAY;IACpC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAFD,gCAEC;AAED,SAAgB,uBAAuB,CAAE,OAAe;IACpD,OAAO,SAAS,YAAY,CAAE,YAAoB;QAC9C,OAAO,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvC,CAAC,CAAC;AACN,CAAC;AAJD,0DAIC;AAED,SAAgB,cAAc,CAAE,IAAY,EAAE,OAAe;IACzD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;AAC7D,CAAC;AAFD,wCAEC;AAED,SAAgB,UAAU,CAAE,IAAY,EAAE,SAAiB,EAAE,SAAiB;IAC1E,OAAO,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;AACzD,CAAC;AAFD,gCAEC;AAED,SAAgB,uBAAuB,CAAE,IAAY;IACjD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC;AAFD,0DAEC;AAED,SAAgB,eAAe,CAAE,IAAY;IACzC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAFD,0CAEC;AAED,SAAsB,QAAQ,CAAE,IAAY,EAAE,YAAsB;;QAChE,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE;YACrC,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;gBAC5B,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC;aACrD;SACJ;aAAM;YACH,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC3B;IACL,CAAC;CAAA;AATD,4BASC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocos/ccbuild",
|
|
3
|
-
"version": "2.0.3-alpha.
|
|
3
|
+
"version": "2.0.3-alpha.11",
|
|
4
4
|
"description": "The next generation of build tool for Cocos engine.",
|
|
5
5
|
"main": "./lib/src/index.js",
|
|
6
6
|
"types": "./lib/src/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"lib/src
|
|
8
|
+
"lib/src/**/*",
|
|
9
9
|
"static/**/*",
|
|
10
10
|
"CHANGELOG.md",
|
|
11
11
|
"README.md",
|
|
@@ -21,43 +21,49 @@
|
|
|
21
21
|
"build",
|
|
22
22
|
"compile"
|
|
23
23
|
],
|
|
24
|
+
"workspaces": [
|
|
25
|
+
"./modules/*"
|
|
26
|
+
],
|
|
24
27
|
"author": "PP_Pro",
|
|
25
28
|
"license": "MIT",
|
|
26
29
|
"dependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@typescript-eslint/parser": "^5.52.0",
|
|
30
|
+
"@types/resolve": "^1.20.2",
|
|
29
31
|
"dedent": "^0.7.0",
|
|
30
|
-
"eslint": "^8.34.0",
|
|
31
|
-
"eslint-plugin-unused-imports": "^2.0.0",
|
|
32
32
|
"fs-extra": "~11.1.1",
|
|
33
33
|
"glob": "~7.2.0",
|
|
34
34
|
"json5": "^2.2.3",
|
|
35
35
|
"resolve": "^1.22.1",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"semver": "~7.5.3",
|
|
37
|
+
"rollup": "^2.79.1",
|
|
38
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
39
|
+
"@rollup/plugin-commonjs": "^11.1.0",
|
|
40
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
41
|
+
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
42
|
+
"@rollup/plugin-virtual": "^3.0.1",
|
|
43
|
+
"@rollup/plugin-typescript": "~11.1.2",
|
|
44
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
45
|
+
"tfig": "^3.3.1",
|
|
38
46
|
"commander": "~11.0.0",
|
|
39
47
|
"ejs": "~3.1.9",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
48
|
+
"path": "~0.12.7",
|
|
49
|
+
"@types/babel__core": "7.1.20",
|
|
50
|
+
"@types/babel__generator": "7.6.4",
|
|
51
|
+
"@types/babel__helper-module-imports": "7.18.0",
|
|
52
|
+
"@types/babel__preset-env": "7.9.2",
|
|
53
|
+
"@types/babel__template": "7.4.1",
|
|
54
|
+
"@types/babel__traverse": "7.18.2",
|
|
42
55
|
"@babel/core": "^7.20.12",
|
|
56
|
+
"@babel/helper-module-imports": "7.18.6",
|
|
43
57
|
"@babel/parser": "^7.20.13",
|
|
44
58
|
"@babel/plugin-syntax-decorators": "^7.19.0",
|
|
45
59
|
"@babel/plugin-syntax-typescript": "^7.20.0",
|
|
46
60
|
"@babel/plugin-transform-for-of": "^7.21.0",
|
|
61
|
+
"@babel/plugin-transform-modules-systemjs": "~7.22.5",
|
|
47
62
|
"@babel/preset-env": "^7.20.2",
|
|
48
63
|
"@babel/traverse": "^7.20.13",
|
|
49
64
|
"@cocos/babel-plugin-dynamic-import-vars": "^1.0.2",
|
|
50
65
|
"@cocos/creator-programming-babel-preset-cc": "1.0.1-alpha.4",
|
|
51
|
-
"
|
|
52
|
-
"@babel/helper-module-imports": "7.18.6",
|
|
53
|
-
"rollup": "^2.79.1",
|
|
54
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
55
|
-
"@rollup/plugin-commonjs": "^11.1.0",
|
|
56
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
57
|
-
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
58
|
-
"@rollup/plugin-virtual": "^3.0.1",
|
|
59
|
-
"@rollup/plugin-typescript": "~11.1.2",
|
|
60
|
-
"rollup-plugin-terser": "^7.0.2"
|
|
66
|
+
"typescript": "^4.9.5"
|
|
61
67
|
},
|
|
62
68
|
"exports": {
|
|
63
69
|
".": {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function defined (name) {
|
|
2
|
-
const _global = typeof window === 'undefined' ? global : window;
|
|
3
|
-
return typeof _global[name] === 'object';
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const TEST = tryDefineGlobal('CC_TEST', defined('tap') || defined('QUnit'));
|
|
7
|
-
export const EDITOR = tryDefineGlobal('CC_EDITOR', defined('Editor') && defined('process') && ('electron' in process.versions));
|
|
8
|
-
export const PREVIEW = tryDefineGlobal('CC_PREVIEW', !EDITOR);
|
|
9
|
-
export const JSB = tryDefineGlobal('CC_JSB', defined('jsb'));
|
|
10
|
-
export const NATIVE = JSB;
|
|
11
|
-
export const HTML5 = !(EDITOR && NATIVE);
|
|
12
|
-
export const DEV = tryDefineGlobal('CC_DEV', true);
|
|
13
|
-
export const EDITOR_NOT_IN_PREVIEW = EDITOR && !tryDefineGlobal('isPreviewProcess',false);
|
|
1
|
+
function defined (name) {
|
|
2
|
+
const _global = typeof window === 'undefined' ? global : window;
|
|
3
|
+
return typeof _global[name] === 'object';
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const TEST = tryDefineGlobal('CC_TEST', defined('tap') || defined('QUnit'));
|
|
7
|
+
export const EDITOR = tryDefineGlobal('CC_EDITOR', defined('Editor') && defined('process') && ('electron' in process.versions));
|
|
8
|
+
export const PREVIEW = tryDefineGlobal('CC_PREVIEW', !EDITOR);
|
|
9
|
+
export const JSB = tryDefineGlobal('CC_JSB', defined('jsb'));
|
|
10
|
+
export const NATIVE = JSB;
|
|
11
|
+
export const HTML5 = !(EDITOR && NATIVE);
|
|
12
|
+
export const DEV = tryDefineGlobal('CC_DEV', true);
|
|
13
|
+
export const EDITOR_NOT_IN_PREVIEW = EDITOR && !tryDefineGlobal('isPreviewProcess',false);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* TsPropertyDecorator cannot access the property descriptor, sometimes we need to access the initializer in property descriptor.
|
|
4
|
-
* This helper helps receive the initializer from EngineCompiler, and generate a BabelPropertyDecorator in runtime.
|
|
5
|
-
* @param decoratorOrFactory A TsPropertyDecorator or a decorator factory
|
|
6
|
-
* @param initializer the property initializer generate from engine compiler
|
|
7
|
-
* @param factoryArgs if `decoratorOrFactory` is a factory, then we may need some arguments for this factory method.
|
|
8
|
-
* @returns BabelPropertyDecorator
|
|
9
|
-
*/
|
|
10
|
-
export function CCBuildTsFieldDecoratorHelper (decoratorOrFactory: Function, initializer: Function, ...factoryArgs: any[]): PropertyDecorator {
|
|
11
|
-
if (factoryArgs.length > 0) {
|
|
12
|
-
const decorator = decoratorOrFactory(...factoryArgs);
|
|
13
|
-
return (target, propertyKey) => {
|
|
14
|
-
decorator(target, propertyKey, initializer);
|
|
15
|
-
};
|
|
16
|
-
} else {
|
|
17
|
-
return (target, propertyKey) => {
|
|
18
|
-
decoratorOrFactory(target, propertyKey, initializer);
|
|
19
|
-
};
|
|
20
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* TsPropertyDecorator cannot access the property descriptor, sometimes we need to access the initializer in property descriptor.
|
|
4
|
+
* This helper helps receive the initializer from EngineCompiler, and generate a BabelPropertyDecorator in runtime.
|
|
5
|
+
* @param decoratorOrFactory A TsPropertyDecorator or a decorator factory
|
|
6
|
+
* @param initializer the property initializer generate from engine compiler
|
|
7
|
+
* @param factoryArgs if `decoratorOrFactory` is a factory, then we may need some arguments for this factory method.
|
|
8
|
+
* @returns BabelPropertyDecorator
|
|
9
|
+
*/
|
|
10
|
+
export function CCBuildTsFieldDecoratorHelper (decoratorOrFactory: Function, initializer: Function | null, ...factoryArgs: any[]): PropertyDecorator {
|
|
11
|
+
if (factoryArgs.length > 0) {
|
|
12
|
+
const decorator = decoratorOrFactory(...factoryArgs);
|
|
13
|
+
return (target, propertyKey) => {
|
|
14
|
+
decorator(target, propertyKey, initializer);
|
|
15
|
+
};
|
|
16
|
+
} else {
|
|
17
|
+
return (target, propertyKey) => {
|
|
18
|
+
decoratorOrFactory(target, propertyKey, initializer);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
21
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function tryDefineGlobal (name, value) {
|
|
2
|
-
const _global = typeof window === 'undefined' ? global : window;
|
|
3
|
-
if (typeof _global[name] === 'undefined') {
|
|
4
|
-
return (_global[name] = value);
|
|
5
|
-
} else {
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
7
|
-
return _global[name];
|
|
8
|
-
}
|
|
1
|
+
function tryDefineGlobal (name, value) {
|
|
2
|
+
const _global = typeof window === 'undefined' ? global : window;
|
|
3
|
+
if (typeof _global[name] === 'undefined') {
|
|
4
|
+
return (_global[name] = value);
|
|
5
|
+
} else {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
7
|
+
return _global[name];
|
|
8
|
+
}
|
|
9
9
|
}
|