ttmg-pack 0.4.8 → 0.4.9
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 +4 -1
- package/__TEST__/tests/fixtures/game-preload/game.json +20 -0
- package/dist/index.js +30 -5
- package/dist/index.js.map +1 -1
- package/dist/libs/makePkgs/setup.d.ts +13 -0
- package/package.json +1 -1
- package/dist/libs/checkPkgs/checkPkgPath.d.ts +0 -1
- package/dist/libs/extractPkgs/hasAnyNodeModulesShallow.d.ts +0 -1
- package/dist/libs/extractPkgs/index.d.ts +0 -6
- package/dist/libs/makePkgs/extract/NodeModuleExtractor.d.ts +0 -39
- package/dist/libs/makePkgs/extract/hasAnyNodeModulesShallow.d.ts +0 -1
- package/dist/libs/makePkgs/extract/index.d.ts +0 -6
- package/dist/libs/makePkgs/extract.d.ts +0 -4
- package/dist/utils/NodeModuleExtractor.d.ts +0 -38
- package/dist/utils/overrideConfig.d.ts +0 -8
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { BuildConfig } from '../../typings';
|
|
2
|
+
/**
|
|
3
|
+
* 启动并行预下载子包条目。与线下 DevTool 写入源码 game.json 的
|
|
4
|
+
* `parallelPreloadSubpackages` 同构:`is_startup` 区分 FP / TTI 环节,
|
|
5
|
+
* `size` 为压缩前体积(线下采集写入时补齐)。
|
|
6
|
+
*/
|
|
7
|
+
interface ParallelPreloadSubpackage {
|
|
8
|
+
subPkgName: string;
|
|
9
|
+
is_startup: boolean;
|
|
10
|
+
size?: string;
|
|
11
|
+
}
|
|
2
12
|
export declare function setup(config: BuildConfig): Promise<{
|
|
3
13
|
packages: Record<string, {
|
|
4
14
|
url: string;
|
|
@@ -8,6 +18,8 @@ export declare function setup(config: BuildConfig): Promise<{
|
|
|
8
18
|
output: string;
|
|
9
19
|
type: string;
|
|
10
20
|
dependencies: string[];
|
|
21
|
+
independent?: boolean;
|
|
22
|
+
parallelPreloadSubpackages?: ParallelPreloadSubpackage[];
|
|
11
23
|
}>;
|
|
12
24
|
fyf_packages: Array<{
|
|
13
25
|
value: string;
|
|
@@ -15,3 +27,4 @@ export declare function setup(config: BuildConfig): Promise<{
|
|
|
15
27
|
type: any;
|
|
16
28
|
}>;
|
|
17
29
|
}>;
|
|
30
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function checkPkgPath(path: string): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function hasAnyNodeModulesShallow(root: string): boolean;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export declare class NodeModuleExtractor {
|
|
2
|
-
srcDir: string;
|
|
3
|
-
distDir: string;
|
|
4
|
-
miniprogramNpmDir: string;
|
|
5
|
-
addedFiles: Set<string>;
|
|
6
|
-
pendingTransforms: Array<{
|
|
7
|
-
srcRelativePath: string;
|
|
8
|
-
distRelativePath: string;
|
|
9
|
-
isNodeModuleFile: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
sourceMaps: Map<string, any>;
|
|
12
|
-
enableReport: boolean;
|
|
13
|
-
constructor(srcDir: any, distDir: any);
|
|
14
|
-
customRequireHook(modulePath: any, relativePath: any): Promise<boolean>;
|
|
15
|
-
findInNodeModules(moduleName: any, relativePath: any): string;
|
|
16
|
-
transformModulePath(originalPath: any): any;
|
|
17
|
-
transformRequirePath(moduleName: any, srcRelativePath: any, srcModuleRelativePath: any, distModuleRelativePath: any): string;
|
|
18
|
-
isCodeFile(filePath: any): boolean;
|
|
19
|
-
ensureDirForFile(filePath: any): void;
|
|
20
|
-
processCodeFile(srcRelativePath: any, distRelativePath: any, isNodeModuleFile: any): Promise<void>;
|
|
21
|
-
copyNonCodeFile(srcRelativePath: any, distRelativePath: any): void;
|
|
22
|
-
collectFiles(rootDir: any, relativeDir?: any): void;
|
|
23
|
-
addTransform(srcRelativePath: any, distRelativePath: any, isNodeModuleFile: any): void;
|
|
24
|
-
processTransforms(): Promise<void>;
|
|
25
|
-
generateReport(): {
|
|
26
|
-
srcDir: string;
|
|
27
|
-
distDir: string;
|
|
28
|
-
processedFiles: string[];
|
|
29
|
-
sourceMaps: [string, any][];
|
|
30
|
-
totalFiles: number;
|
|
31
|
-
totalSourceMaps: number;
|
|
32
|
-
timestamp: string;
|
|
33
|
-
};
|
|
34
|
-
extract(): Promise<void>;
|
|
35
|
-
}
|
|
36
|
-
export declare function extract(params: {
|
|
37
|
-
srcDir: string;
|
|
38
|
-
distDir: string;
|
|
39
|
-
}): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function hasAnyNodeModulesShallow(root: string): boolean;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare class NodeModuleExtractor {
|
|
2
|
-
srcDir: string;
|
|
3
|
-
distDir: string;
|
|
4
|
-
miniprogramNpmDir: string;
|
|
5
|
-
addedFiles: Set<string>;
|
|
6
|
-
pendingTransforms: Array<{
|
|
7
|
-
srcRelativePath: string;
|
|
8
|
-
distRelativePath: string;
|
|
9
|
-
isNodeModuleFile: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
sourceMaps: Map<string, any>;
|
|
12
|
-
constructor(srcDir: any, distDir: any);
|
|
13
|
-
customRequireHook(modulePath: any, relativePath: any): Promise<boolean>;
|
|
14
|
-
findInNodeModules(moduleName: any, relativePath: any): string;
|
|
15
|
-
transformModulePath(originalPath: any): any;
|
|
16
|
-
transformRequirePath(moduleName: any, srcRelativePath: any, srcModuleRelativePath: any, distModuleRelativePath: any): string;
|
|
17
|
-
isCodeFile(filePath: any): boolean;
|
|
18
|
-
ensureDirForFile(filePath: any): void;
|
|
19
|
-
processCodeFile(srcRelativePath: any, distRelativePath: any, isNodeModuleFile: any): Promise<void>;
|
|
20
|
-
copyNonCodeFile(srcRelativePath: any, distRelativePath: any): void;
|
|
21
|
-
collectFiles(rootDir: any, relativeDir?: any): void;
|
|
22
|
-
addTransform(srcRelativePath: any, distRelativePath: any, isNodeModuleFile: any): void;
|
|
23
|
-
processTransforms(): Promise<void>;
|
|
24
|
-
generateReport(): {
|
|
25
|
-
srcDir: string;
|
|
26
|
-
distDir: string;
|
|
27
|
-
processedFiles: string[];
|
|
28
|
-
sourceMaps: [string, any][];
|
|
29
|
-
totalFiles: number;
|
|
30
|
-
totalSourceMaps: number;
|
|
31
|
-
timestamp: string;
|
|
32
|
-
};
|
|
33
|
-
extract(): Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
export declare function extract(params: {
|
|
36
|
-
srcDir: string;
|
|
37
|
-
distDir: string;
|
|
38
|
-
}): Promise<void>;
|