ttmg-pack 0.4.4 → 0.4.5
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 +400 -0
- package/__TEST__/tests/fixtures/check-project/non-unity/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/non-unity/src/game.json +3 -0
- package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/webgl-wasm-split.json +3 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/webgl-wasm-split.json +3 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-small/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-small/src/game.json +4 -0
- package/__TEST__/tests/fixtures/game-cocos/game.json +3 -0
- package/__TEST__/tests/fixtures/game-invalid-json/game.json +1 -0
- package/__TEST__/tests/fixtures/game-no-config/game.js +1 -0
- package/__TEST__/tests/fixtures/game-no-engine/game.json +3 -0
- package/__TEST__/tests/fixtures/game-unity/game.json +15 -0
- package/__TEST__/tests/libs/checkProject.test.js +68 -0
- package/__TEST__/tests/runner-simple.js +120 -0
- package/__TEST__/tests/runner.js +102 -0
- package/__TEST__/tests/utils/Deferred.test.js +69 -0
- package/__TEST__/tests/utils/asyncPool.test.js +48 -0
- package/__TEST__/tests/utils/getCheckConfig.test.js +24 -0
- package/__TEST__/tests/utils/getGameEngine.test.js +32 -0
- package/__TEST__/tests/utils/getIndependentPackagesConfig.test.js +27 -0
- package/__TEST__/tests/utils/getMd5.test.js +31 -0
- package/__TEST__/tests/utils/getSubpackagesConfig.test.js +26 -0
- package/__TEST__/tests/utils/unity.test.js +30 -0
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/libs/checkPkgs/checkPkgPath.d.ts +1 -0
- package/dist/libs/extractPkgs/hasAnyNodeModulesShallow.d.ts +1 -0
- package/dist/libs/extractPkgs/index.d.ts +6 -0
- package/dist/libs/makePkgs/extract/NodeModuleExtractor.d.ts +39 -0
- package/dist/libs/makePkgs/extract/hasAnyNodeModulesShallow.d.ts +1 -0
- package/dist/libs/makePkgs/extract/index.d.ts +6 -0
- package/dist/libs/makePkgs/extract.d.ts +4 -0
- package/dist/utils/NodeModuleExtractor.d.ts +38 -0
- package/dist/utils/overrideConfig.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkPkgPath(path: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasAnyNodeModulesShallow(root: string): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
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>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasAnyNodeModulesShallow(root: string): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
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>;
|