@cocos/ccbuild 1.1.19 → 1.1.20
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 +37 -37
- package/lib/api-builder.js +1 -1
- package/lib/build-engine/engine-js/index.d.ts +2 -2
- package/lib/build-engine/engine-js/index.js +406 -406
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.d.ts +57 -57
- package/lib/build-engine/engine-js/rollup-plugins/external-wasm-loader.js +326 -326
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.d.ts +2 -2
- package/lib/build-engine/engine-js/rollup-plugins/remove-deprecated-features.js +37 -37
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.d.ts +4 -4
- package/lib/build-engine/engine-js/rollup-plugins/ts-paths.js +42 -42
- package/lib/build-engine/engine-ts/engine-builder.d.ts +57 -57
- package/lib/build-engine/engine-ts/engine-builder.js +631 -631
- package/lib/build-engine/engine-ts/field-decorator-helper.d.ts +9 -9
- package/lib/build-engine/engine-ts/field-decorator-helper.js +54 -54
- package/lib/build-engine/engine-ts/index.d.ts +2 -2
- package/lib/build-engine/engine-ts/index.js +36 -36
- package/lib/build-engine/engine-ts/plugins/external-wasm-loader.d.ts +6 -6
- package/lib/build-engine/engine-ts/plugins/external-wasm-loader.js +65 -65
- package/lib/build-engine/engine-ts/plugins/interface.d.ts +20 -20
- package/lib/build-engine/engine-ts/plugins/interface.js +1 -1
- package/lib/build-engine/index.d.ts +147 -145
- package/lib/build-engine/index.d.ts.map +1 -1
- package/lib/build-engine/index.js +168 -167
- package/lib/build-engine/index.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +33 -33
- package/lib/module-resolver.d.ts +7 -7
- package/lib/module-resolver.js +28 -28
- package/lib/stats-query/config-interface.d.ts +129 -129
- package/lib/stats-query/config-interface.js +3 -3
- package/lib/stats-query/index.d.ts +183 -183
- package/lib/stats-query/index.js +531 -531
- package/lib/stats-query/path-utils.d.ts +2 -2
- package/lib/stats-query/path-utils.js +35 -35
- package/lib/transformer/babel.d.ts +5 -5
- package/lib/transformer/babel.js +34 -34
- package/lib/transformer/index.d.ts +2 -2
- package/lib/transformer/index.js +28 -28
- package/lib/utils.d.ts +4 -4
- package/lib/utils.js +23 -23
- 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 +20227 -20227
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const semver_1 = __importDefault(require("semver"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
function removeDeprecatedFeatures(range) {
|
|
9
|
-
const versionRange = range ? new semver_1.default.Range(range) : undefined;
|
|
10
|
-
return {
|
|
11
|
-
name: '@cocos/ccbuild|remove-deprecated-features',
|
|
12
|
-
load(id) {
|
|
13
|
-
if (!path_1.default.isAbsolute(id)) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
const stem = path_1.default.basename(id, path_1.default.extname(id));
|
|
17
|
-
const match = /^deprecated(-)?(.*)/.exec(stem);
|
|
18
|
-
if (!match) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
const versionString = match[2];
|
|
22
|
-
if (versionString.length !== 0) {
|
|
23
|
-
const parsedVersion = semver_1.default.parse(versionString);
|
|
24
|
-
if (!parsedVersion) {
|
|
25
|
-
console.debug(`${id} looks like a deprecated module, but it contains an invalid version.`);
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
if (versionRange && !semver_1.default.satisfies(parsedVersion, versionRange)) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
console.debug(`Exclude deprecated module ${id}`);
|
|
33
|
-
return `export {}`;
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
exports.default = removeDeprecatedFeatures;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const semver_1 = __importDefault(require("semver"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
function removeDeprecatedFeatures(range) {
|
|
9
|
+
const versionRange = range ? new semver_1.default.Range(range) : undefined;
|
|
10
|
+
return {
|
|
11
|
+
name: '@cocos/ccbuild|remove-deprecated-features',
|
|
12
|
+
load(id) {
|
|
13
|
+
if (!path_1.default.isAbsolute(id)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const stem = path_1.default.basename(id, path_1.default.extname(id));
|
|
17
|
+
const match = /^deprecated(-)?(.*)/.exec(stem);
|
|
18
|
+
if (!match) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const versionString = match[2];
|
|
22
|
+
if (versionString.length !== 0) {
|
|
23
|
+
const parsedVersion = semver_1.default.parse(versionString);
|
|
24
|
+
if (!parsedVersion) {
|
|
25
|
+
console.debug(`${id} looks like a deprecated module, but it contains an invalid version.`);
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (versionRange && !semver_1.default.satisfies(parsedVersion, versionRange)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
console.debug(`Exclude deprecated module ${id}`);
|
|
33
|
+
return `export {}`;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.default = removeDeprecatedFeatures;
|
|
38
38
|
//# sourceMappingURL=remove-deprecated-features.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as rollup from 'rollup';
|
|
2
|
-
export default function ({ configFileName, }: {
|
|
3
|
-
configFileName: string;
|
|
4
|
-
}): rollup.Plugin;
|
|
1
|
+
import * as rollup from 'rollup';
|
|
2
|
+
export default function ({ configFileName, }: {
|
|
3
|
+
configFileName: string;
|
|
4
|
+
}): rollup.Plugin;
|
|
5
5
|
//# sourceMappingURL=ts-paths.d.ts.map
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
function default_1({ configFileName, }) {
|
|
9
|
-
const parsedCommandLine = typescript_1.default.getParsedCommandLineOfConfigFile(configFileName, {}, {
|
|
10
|
-
onUnRecoverableConfigFileDiagnostic: () => { },
|
|
11
|
-
useCaseSensitiveFileNames: typescript_1.default.sys.useCaseSensitiveFileNames,
|
|
12
|
-
readDirectory: typescript_1.default.sys.readDirectory,
|
|
13
|
-
getCurrentDirectory: typescript_1.default.sys.getCurrentDirectory,
|
|
14
|
-
fileExists: typescript_1.default.sys.fileExists,
|
|
15
|
-
readFile: typescript_1.default.sys.readFile,
|
|
16
|
-
});
|
|
17
|
-
if (!parsedCommandLine) {
|
|
18
|
-
throw new Error(`Failed to read tsconfig`);
|
|
19
|
-
}
|
|
20
|
-
const { baseUrl, paths } = parsedCommandLine.options;
|
|
21
|
-
let resolveId;
|
|
22
|
-
if (paths) {
|
|
23
|
-
const baseUrlNormalized = path_1.default.resolve(configFileName, baseUrl !== null && baseUrl !== void 0 ? baseUrl : '.');
|
|
24
|
-
const simpleMap = {};
|
|
25
|
-
for (const [key, mapped] of Object.entries(paths)) {
|
|
26
|
-
simpleMap[key] = path_1.default.resolve(baseUrlNormalized, mapped[0]);
|
|
27
|
-
}
|
|
28
|
-
resolveId = function (source, importer) {
|
|
29
|
-
if (!(source in simpleMap)) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return simpleMap[source];
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
name: 'ts-paths',
|
|
39
|
-
resolveId,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
exports.default = default_1;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
function default_1({ configFileName, }) {
|
|
9
|
+
const parsedCommandLine = typescript_1.default.getParsedCommandLineOfConfigFile(configFileName, {}, {
|
|
10
|
+
onUnRecoverableConfigFileDiagnostic: () => { },
|
|
11
|
+
useCaseSensitiveFileNames: typescript_1.default.sys.useCaseSensitiveFileNames,
|
|
12
|
+
readDirectory: typescript_1.default.sys.readDirectory,
|
|
13
|
+
getCurrentDirectory: typescript_1.default.sys.getCurrentDirectory,
|
|
14
|
+
fileExists: typescript_1.default.sys.fileExists,
|
|
15
|
+
readFile: typescript_1.default.sys.readFile,
|
|
16
|
+
});
|
|
17
|
+
if (!parsedCommandLine) {
|
|
18
|
+
throw new Error(`Failed to read tsconfig`);
|
|
19
|
+
}
|
|
20
|
+
const { baseUrl, paths } = parsedCommandLine.options;
|
|
21
|
+
let resolveId;
|
|
22
|
+
if (paths) {
|
|
23
|
+
const baseUrlNormalized = path_1.default.resolve(configFileName, baseUrl !== null && baseUrl !== void 0 ? baseUrl : '.');
|
|
24
|
+
const simpleMap = {};
|
|
25
|
+
for (const [key, mapped] of Object.entries(paths)) {
|
|
26
|
+
simpleMap[key] = path_1.default.resolve(baseUrlNormalized, mapped[0]);
|
|
27
|
+
}
|
|
28
|
+
resolveId = function (source, importer) {
|
|
29
|
+
if (!(source in simpleMap)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return simpleMap[source];
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
name: 'ts-paths',
|
|
39
|
+
resolveId,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.default = default_1;
|
|
43
43
|
//# sourceMappingURL=ts-paths.js.map
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { StatsQuery } from "../../stats-query";
|
|
2
|
-
import ConstantManager = StatsQuery.ConstantManager;
|
|
3
|
-
export declare namespace EngineBuilder {
|
|
4
|
-
interface IBuildOptions {
|
|
5
|
-
root: string;
|
|
6
|
-
features?: string[];
|
|
7
|
-
platform: ConstantManager.PlatformType;
|
|
8
|
-
mode: ConstantManager.ModeType;
|
|
9
|
-
flagConfig: Partial<ConstantManager.IFlagConfig>;
|
|
10
|
-
outDir?: string;
|
|
11
|
-
}
|
|
12
|
-
interface IBuildResult {
|
|
13
|
-
[outputFile: string]: IHandleResult;
|
|
14
|
-
}
|
|
15
|
-
interface IHandleResult {
|
|
16
|
-
code: string;
|
|
17
|
-
file: string;
|
|
18
|
-
originalId: string;
|
|
19
|
-
resolvedId: string;
|
|
20
|
-
map: any;
|
|
21
|
-
}
|
|
22
|
-
interface ITransformResult {
|
|
23
|
-
code: string;
|
|
24
|
-
map?: any;
|
|
25
|
-
depIdList: string[];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export declare class EngineBuilder {
|
|
29
|
-
private _options;
|
|
30
|
-
private _entries;
|
|
31
|
-
private _entriesForPass2;
|
|
32
|
-
private _virtual2code;
|
|
33
|
-
private _feature2NodeModule;
|
|
34
|
-
private _nodeModules;
|
|
35
|
-
private _virtualOverrides;
|
|
36
|
-
private _buildTimeConstants;
|
|
37
|
-
private _moduleOverrides;
|
|
38
|
-
private _buildResult;
|
|
39
|
-
private _resolveExtension;
|
|
40
|
-
private _renameMap;
|
|
41
|
-
private _filedDecoratorHelper;
|
|
42
|
-
private _plugins;
|
|
43
|
-
private _excludeTransform;
|
|
44
|
-
build(options: EngineBuilder.IBuildOptions): Promise<EngineBuilder.IBuildResult>;
|
|
45
|
-
private _initPlugins;
|
|
46
|
-
private _initOptions;
|
|
47
|
-
private _handleId;
|
|
48
|
-
private _getOverrideId;
|
|
49
|
-
private _resolve;
|
|
50
|
-
private _resolveRelative;
|
|
51
|
-
private _load;
|
|
52
|
-
private _transform;
|
|
53
|
-
private _lintImport;
|
|
54
|
-
private _buildIndex;
|
|
55
|
-
private _copyTypes;
|
|
56
|
-
private _addNodeModulesDeps;
|
|
57
|
-
}
|
|
1
|
+
import { StatsQuery } from "../../stats-query";
|
|
2
|
+
import ConstantManager = StatsQuery.ConstantManager;
|
|
3
|
+
export declare namespace EngineBuilder {
|
|
4
|
+
interface IBuildOptions {
|
|
5
|
+
root: string;
|
|
6
|
+
features?: string[];
|
|
7
|
+
platform: ConstantManager.PlatformType;
|
|
8
|
+
mode: ConstantManager.ModeType;
|
|
9
|
+
flagConfig: Partial<ConstantManager.IFlagConfig>;
|
|
10
|
+
outDir?: string;
|
|
11
|
+
}
|
|
12
|
+
interface IBuildResult {
|
|
13
|
+
[outputFile: string]: IHandleResult;
|
|
14
|
+
}
|
|
15
|
+
interface IHandleResult {
|
|
16
|
+
code: string;
|
|
17
|
+
file: string;
|
|
18
|
+
originalId: string;
|
|
19
|
+
resolvedId: string;
|
|
20
|
+
map: any;
|
|
21
|
+
}
|
|
22
|
+
interface ITransformResult {
|
|
23
|
+
code: string;
|
|
24
|
+
map?: any;
|
|
25
|
+
depIdList: string[];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export declare class EngineBuilder {
|
|
29
|
+
private _options;
|
|
30
|
+
private _entries;
|
|
31
|
+
private _entriesForPass2;
|
|
32
|
+
private _virtual2code;
|
|
33
|
+
private _feature2NodeModule;
|
|
34
|
+
private _nodeModules;
|
|
35
|
+
private _virtualOverrides;
|
|
36
|
+
private _buildTimeConstants;
|
|
37
|
+
private _moduleOverrides;
|
|
38
|
+
private _buildResult;
|
|
39
|
+
private _resolveExtension;
|
|
40
|
+
private _renameMap;
|
|
41
|
+
private _filedDecoratorHelper;
|
|
42
|
+
private _plugins;
|
|
43
|
+
private _excludeTransform;
|
|
44
|
+
build(options: EngineBuilder.IBuildOptions): Promise<EngineBuilder.IBuildResult>;
|
|
45
|
+
private _initPlugins;
|
|
46
|
+
private _initOptions;
|
|
47
|
+
private _handleId;
|
|
48
|
+
private _getOverrideId;
|
|
49
|
+
private _resolve;
|
|
50
|
+
private _resolveRelative;
|
|
51
|
+
private _load;
|
|
52
|
+
private _transform;
|
|
53
|
+
private _lintImport;
|
|
54
|
+
private _buildIndex;
|
|
55
|
+
private _copyTypes;
|
|
56
|
+
private _addNodeModulesDeps;
|
|
57
|
+
}
|
|
58
58
|
//# sourceMappingURL=engine-builder.d.ts.map
|