ttmg-pack 0.3.5 → 0.3.7
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/dist/index.js +212 -303
- package/dist/index.js.map +1 -1
- package/dist/libs/buildPkgs/index.d.ts +0 -1
- package/dist/libs/buildPlugins/index.d.ts +1 -1
- package/dist/libs/checkPkgs/checkAPI.d.ts +1 -4
- package/dist/libs/checkPkgs/checkIndependentPackages.d.ts +3 -2
- package/dist/libs/checkPkgs/checkMainpackage.d.ts +3 -9
- package/dist/libs/checkPkgs/checkPkgPath.d.ts +1 -0
- package/dist/libs/checkPkgs/checkProject.d.ts +3 -4
- package/dist/libs/checkPkgs/checkSubpackages.d.ts +1 -1
- package/dist/libs/checkPkgs/index.d.ts +1 -4
- package/dist/libs/clearPkgs/index.d.ts +2 -1
- package/dist/libs/extractPkgs/hasAnyNodeModulesShallow.d.ts +1 -0
- package/dist/libs/extractPkgs/index.d.ts +6 -0
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/makePkgs/collectDeps.d.ts +3 -2
- package/dist/libs/makePkgs/collectMaps.d.ts +2 -2
- 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/libs/makePkgs/index.d.ts +1 -10
- package/dist/libs/makePkgs/setup.d.ts +14 -5
- package/dist/libs/makePlugins/collectPluginMaps.d.ts +2 -0
- package/dist/libs/makePlugins/index.d.ts +6 -0
- package/dist/libs/makePlugins/packPlugin.d.ts +13 -0
- package/dist/typings/index.d.ts +3 -0
- package/dist/utils/NodeModuleExtractor.d.ts +38 -0
- package/dist/utils/overrideConfig.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BuildConfig } from '../../typings';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function buildPlugin(originConfig: BuildConfig): Promise<void>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { CheckAPIResult, BuildConfig } from '../../typings';
|
|
2
2
|
type CheckResult = Array<CheckAPIResult>;
|
|
3
|
-
export declare function checkAPI(
|
|
4
|
-
entryDir: string;
|
|
5
|
-
config: BuildConfig;
|
|
6
|
-
}): CheckResult;
|
|
3
|
+
export declare function checkAPI(config: BuildConfig): CheckResult;
|
|
7
4
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BuildConfig, CheckConfigResult, CheckSizeResult } from '../../typings';
|
|
2
|
-
export declare function checkIndependentPackages(
|
|
3
|
-
export declare function checkPkgSize({ entryDir, limit, pkgName, dimension, }: {
|
|
2
|
+
export declare function checkIndependentPackages(config: BuildConfig): (CheckConfigResult | CheckSizeResult)[];
|
|
3
|
+
export declare function checkPkgSize({ entryDir, limit, pkgName, dimension, level, }: {
|
|
4
4
|
entryDir: string;
|
|
5
5
|
limit: number;
|
|
6
6
|
pkgName: string;
|
|
7
7
|
dimension: CheckSizeResult['dimension'];
|
|
8
|
+
level: CheckSizeResult['level'];
|
|
8
9
|
}): CheckSizeResult;
|
|
@@ -4,12 +4,6 @@ import { BuildConfig, CheckConfigResult, CheckSizeResult } from '../../typings';
|
|
|
4
4
|
* @param param0
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
|
-
export declare function checkMainPackageSize(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}): CheckSizeResult;
|
|
11
|
-
export declare function checkMainPackageEntry({ entryDir, config, }: {
|
|
12
|
-
entryDir: string;
|
|
13
|
-
config: BuildConfig;
|
|
14
|
-
}): CheckConfigResult;
|
|
15
|
-
export declare function checkMainPackage(entryDir: string, config: BuildConfig): (CheckConfigResult | CheckSizeResult)[];
|
|
7
|
+
export declare function checkMainPackageSize(config: BuildConfig): CheckSizeResult;
|
|
8
|
+
export declare function checkMainPackageEntry(config: BuildConfig): CheckConfigResult;
|
|
9
|
+
export declare function checkMainPackage(config: BuildConfig): (CheckConfigResult | CheckSizeResult)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkPkgPath(path: string): boolean;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BuildConfig, CheckConfigResult, CheckSizeResult } from '../../typings';
|
|
2
|
-
export declare function checkProject(
|
|
3
|
-
export declare function checkGameJson(
|
|
2
|
+
export declare function checkProject(config: BuildConfig): (CheckConfigResult | CheckSizeResult)[];
|
|
3
|
+
export declare function checkGameJson(config: BuildConfig): CheckConfigResult;
|
|
4
4
|
/**
|
|
5
5
|
* 检查游戏大小是否超出限制
|
|
6
6
|
* @param param0
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export declare function checkProjectSize(
|
|
10
|
-
export declare function checkProjectConfig(entryDir: string, config: BuildConfig): CheckConfigResult;
|
|
9
|
+
export declare function checkProjectSize(config: BuildConfig): CheckSizeResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CheckConfigResult, CheckSizeResult, BuildConfig } from '../../typings';
|
|
2
|
-
export declare function checkSubpackages(
|
|
2
|
+
export declare function checkSubpackages(config: BuildConfig): (CheckConfigResult | CheckSizeResult)[];
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import { BuildConfig, CheckResult } from '../../typings';
|
|
2
|
-
export declare function checkPkgs(
|
|
3
|
-
entryDir: string;
|
|
4
|
-
config: BuildConfig;
|
|
5
|
-
}): Promise<CheckResult[]>;
|
|
2
|
+
export declare function checkPkgs(config: BuildConfig): Promise<CheckResult[]>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { BuildConfig } from '../../typings';
|
|
2
|
+
export declare function clearPkgs(config: BuildConfig, uselessDirs?: string[]): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasAnyNodeModulesShallow(root: string): boolean;
|
package/dist/libs/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { BuildConfig } from '../../typings';
|
|
2
|
+
export declare function collectDeps(config: BuildConfig, packages: any): Promise<{
|
|
2
3
|
packageDeps: Record<string, Record<string, string>>;
|
|
3
4
|
pluginDeps: Record<string, string[]>;
|
|
4
|
-
}
|
|
5
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { BuildConfig } from '../../typings';
|
|
1
2
|
export declare function flattenMaps(allMaps: any): any[];
|
|
2
|
-
export declare function collectMaps(
|
|
3
|
+
export declare function collectMaps(config: BuildConfig, packages: Record<string, {
|
|
3
4
|
root: string;
|
|
4
5
|
}>): {};
|
|
5
|
-
export declare function collectPluginMaps(gameDir: any, entryDir: any, name: string): {};
|
|
@@ -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;
|
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import { BuildConfig } from '../../typings';
|
|
2
|
-
export declare function makePkgs(
|
|
3
|
-
gameEntry: string;
|
|
4
|
-
gameOutput: string;
|
|
5
|
-
config: BuildConfig;
|
|
6
|
-
}): Promise<{}>;
|
|
7
|
-
export declare function makePlugin({ gameEntry, gameOutput, config, }: {
|
|
8
|
-
gameEntry: string;
|
|
9
|
-
gameOutput: string;
|
|
10
|
-
config: BuildConfig;
|
|
11
|
-
}): Promise<void>;
|
|
2
|
+
export declare function makePkgs(config: BuildConfig): Promise<{}>;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { BuildConfig } from '../../typings';
|
|
2
|
+
export declare function setup(config: BuildConfig): Promise<{
|
|
3
|
+
packages: Record<string, {
|
|
4
|
+
url: string;
|
|
5
|
+
md5: string;
|
|
6
|
+
root: string;
|
|
7
|
+
main: string;
|
|
8
|
+
output: string;
|
|
9
|
+
type: string;
|
|
10
|
+
dependencies: string[];
|
|
11
|
+
}>;
|
|
12
|
+
fyf_packages: Array<{
|
|
4
13
|
value: string;
|
|
5
14
|
label: string;
|
|
6
|
-
type:
|
|
7
|
-
}
|
|
15
|
+
type: any;
|
|
16
|
+
}>;
|
|
8
17
|
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BuildConfig } from '../../typings';
|
|
2
|
+
export declare function packPlugin({ gameEntry, pkgName, allDeps, allMaps, pkgConfig, destRoot, config, }: {
|
|
3
|
+
gameEntry: string;
|
|
4
|
+
pkgName: string;
|
|
5
|
+
allDeps: any;
|
|
6
|
+
allMaps: Record<string, Record<string, string[]>>;
|
|
7
|
+
pkgConfig: {
|
|
8
|
+
main: string;
|
|
9
|
+
root: string;
|
|
10
|
+
};
|
|
11
|
+
destRoot: string;
|
|
12
|
+
config: BuildConfig;
|
|
13
|
+
}): Promise<void>;
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export interface CheckSizeResult {
|
|
|
40
40
|
passed: boolean;
|
|
41
41
|
msg: string;
|
|
42
42
|
type: 'size';
|
|
43
|
+
level?: 'error' | 'warning' | 'info';
|
|
43
44
|
size: number;
|
|
44
45
|
name: string;
|
|
45
46
|
dimension: CheckDimension;
|
|
@@ -48,6 +49,7 @@ export interface CheckConfigResult {
|
|
|
48
49
|
passed: boolean;
|
|
49
50
|
msg: string;
|
|
50
51
|
type: 'config';
|
|
52
|
+
level?: 'error' | 'warning' | 'info';
|
|
51
53
|
file: string;
|
|
52
54
|
name: string;
|
|
53
55
|
dimension: CheckDimension;
|
|
@@ -58,6 +60,7 @@ export interface CheckAPIResult {
|
|
|
58
60
|
passed: boolean;
|
|
59
61
|
msg: string;
|
|
60
62
|
type: 'api';
|
|
63
|
+
level?: 'error' | 'warning' | 'info';
|
|
61
64
|
name: string;
|
|
62
65
|
required: boolean;
|
|
63
66
|
dimension: CheckDimension;
|
|
@@ -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>;
|