miniprogram-ci 2.0.7 → 2.0.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 -2
- package/README.md +6 -0
- package/dist/@types/ci/utils/tools.d.ts +1 -0
- package/dist/@types/common/code-analyse/index.d.ts +16 -1
- package/dist/@types/config/config.d.ts +8 -1
- package/dist/@types/index.d.ts +2 -1
- package/dist/@types/modules/corecompiler/baseCompiler.d.ts +6 -0
- package/dist/@types/modules/corecompiler/originalCompiler.d.ts +1 -0
- package/dist/@types/modules/corecompiler/processHandler.d.ts +24 -0
- package/dist/@types/modules/corecompiler/summer/graph/appconf.d.ts +4 -0
- package/dist/@types/modules/corecompiler/summer/graph/appgraph.d.ts +6 -0
- package/dist/@types/modules/corecompiler/summer/graph/basegraph.d.ts +14 -2
- package/dist/@types/modules/corecompiler/summer/graph/gamegraph.d.ts +6 -0
- package/dist/@types/modules/corecompiler/summer/graph/gameplugingraph.d.ts +5 -1
- package/dist/@types/modules/corecompiler/summer/graph/plugingraph.d.ts +5 -1
- package/dist/@types/modules/corecompiler/summer/plugins/base/javascript.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/plugins/base/swc.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/summer.d.ts +6 -1
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +30 -2
- package/dist/@types/modules/createSummer.d.ts +3 -2
- package/dist/@types/modules/index.d.ts +8 -2
- package/dist/@types/modules/nativecompiler/ios/buildCloud.d.ts +2 -2
- package/dist/@types/types/ci.d.ts +2 -1
- package/dist/@types/types/core.d.ts +21 -2
- package/dist/@types/types/devtools.d.ts +11 -5
- package/dist/@types/types/miniprogram-json/app.d.ts +16 -6
- package/dist/@types/utils/debug.d.ts +3 -0
- package/dist/@types/utils/locales/locales.d.ts +5 -0
- package/dist/@types/utils/locales/zh.d.ts +5 -0
- package/dist/@types/utils/messageHub.d.ts +1 -1
- package/dist/@types/utils/miniappJson.d.ts +1 -0
- package/dist/@types/utils/packOptionsHelper.d.ts +15 -2
- package/dist/@types/utils/progressRecorder.d.ts +1 -1
- package/dist/@types/utils/tools.d.ts +5 -0
- package/dist/ci/utils/filterUnusedFile.js +1 -1
- package/dist/ci/utils/tools.js +1 -1
- package/dist/common/code-analyse/index.js +1 -1
- package/dist/config/config.js +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/corecompiler/baseCompiler.js +1 -1
- package/dist/modules/corecompiler/original/compile/common.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/compilejs.js +1 -1
- package/dist/modules/corecompiler/originalCompiler.js +1 -1
- package/dist/modules/corecompiler/processHandler.js +1 -0
- package/dist/modules/corecompiler/summer/graph/appconf.js +1 -1
- package/dist/modules/corecompiler/summer/graph/appgraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/gamegraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/gameplugingraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/plugingraph.js +1 -1
- package/dist/modules/corecompiler/summer/pluginDriver.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/javascript.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/swc.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/sass.js +1 -1
- package/dist/modules/corecompiler/summer/summer.js +1 -1
- package/dist/modules/corecompiler/summerCompiler.js +1 -1
- package/dist/modules/corecompiler/summerEntryProcess.js +1 -1
- package/dist/modules/createSummer.js +1 -1
- package/dist/modules/index.js +1 -1
- package/dist/modules/nativecompiler/ios/buildCloud.js +1 -1
- package/dist/modules/nativecompiler/ios/index.js +1 -1
- package/dist/project/advance/precompileProject.js +1 -1
- package/dist/project/baseProject.js +1 -1
- package/dist/utils/codesign.js +1 -1
- package/dist/utils/debug.js +1 -0
- package/dist/utils/locales/en.js +1 -1
- package/dist/utils/locales/zh.js +1 -1
- package/dist/utils/miniapp-builder.js +1 -1
- package/dist/utils/miniappJson.js +1 -1
- package/dist/utils/packOptionsHelper.js +1 -1
- package/dist/utils/progressRecorder.js +1 -1
- package/dist/utils/subprocess/processManager.js +1 -1
- package/dist/utils/tools.js +1 -1
- package/package.json +101 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
#### 2.0.9
|
|
2
|
+
- `fix` 修复 ts,sass 等文件在某些情况无法编译的问题
|
|
3
|
+
#### 2.0.8
|
|
4
|
+
- `fix` 修复 babel 导致的 path.requeueComputedKeyAndDecorators 问题
|
|
1
5
|
#### 2.0.7
|
|
2
6
|
- `fix` 修复 Skyline disableScroll 不强制为 true
|
|
3
|
-
#### 2.0.6
|
|
4
|
-
- `fix` 修复 未设置 onProgressUpdate 输出日志为[object Object]的问题
|
|
5
7
|
#### 2.0.5
|
|
6
8
|
- `fix` 修复 命令行执行完不退出的问题
|
|
7
9
|
- `fix` 修复 输出日志为[object Object]的问题
|
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@ miniprogram-ci 从 1.0.28 开始支持第三方平台开发的上传和预览,
|
|
|
8
8
|
|
|
9
9
|
## 最近变更
|
|
10
10
|
|
|
11
|
+
#### 2.0.9
|
|
12
|
+
- `fix` 修复 ts,sass 等文件在某些情况无法编译的问题
|
|
13
|
+
#### 2.0.8
|
|
14
|
+
- `fix` 修复 babel 导致的 path.requeueComputedKeyAndDecorators 问题
|
|
15
|
+
#### 2.0.7
|
|
16
|
+
- `fix` 修复 Skyline disableScroll 不强制为 true
|
|
11
17
|
#### 2.0.6
|
|
12
18
|
- `fix` 修复 未设置 onProgressUpdate 输出日志为[object Object]的问题
|
|
13
19
|
#### 2.0.5
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MiniProgramCI, MiniProgramDevtools } from '../../types';
|
|
2
|
+
export declare const CompileSettingsKeysInProjectConfig: string[];
|
|
2
3
|
export declare function isGameApp(project: MiniProgramCI.IProject): boolean;
|
|
3
4
|
export declare const checkIsUseCompilerPlugins: (project: MiniProgramCI.IProject) => boolean | undefined;
|
|
4
5
|
export declare function isUndefined(value: any): boolean;
|
|
@@ -32,8 +32,17 @@ export declare class Analyzer {
|
|
|
32
32
|
/** 文件是否已经发生改变? */
|
|
33
33
|
invalid: boolean;
|
|
34
34
|
constructor(option: AnalyzerOption);
|
|
35
|
+
destroy(): void;
|
|
35
36
|
private getEntryDep;
|
|
36
|
-
analyse(): Promise<void>;
|
|
37
|
+
analyse(force?: boolean): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* 不管怎么样都会从新分析的
|
|
40
|
+
*/
|
|
41
|
+
private realAnalyse;
|
|
42
|
+
/**
|
|
43
|
+
* 只要 fileUtils 抛出 change 事件,就分析
|
|
44
|
+
* @param callback
|
|
45
|
+
*/
|
|
37
46
|
watch(callback: () => void): void;
|
|
38
47
|
serialize(): IAnalyseResult | undefined;
|
|
39
48
|
callPlugin<T extends Exclude<keyof AnalyzerPlugin, 'name'>>(event: T, ...args: any): void;
|
|
@@ -82,9 +91,11 @@ export declare class FileHelper implements IFileHelper {
|
|
|
82
91
|
root: string;
|
|
83
92
|
type: CompileType;
|
|
84
93
|
compilerPlugins: ICompilerPlugin[];
|
|
94
|
+
private _watcher;
|
|
85
95
|
dirSet: Set<string>;
|
|
86
96
|
fileSet: Set<string>;
|
|
87
97
|
constructor(root: string, type?: CompileType, compilerPlugins?: ICompilerPlugin[]);
|
|
98
|
+
destroy(): void;
|
|
88
99
|
private cacheDirName;
|
|
89
100
|
get pattern(): string;
|
|
90
101
|
init(): void;
|
|
@@ -203,6 +214,9 @@ declare interface IAppJSON {
|
|
|
203
214
|
tabBar?: {
|
|
204
215
|
custom?: boolean;
|
|
205
216
|
};
|
|
217
|
+
appBar?: {
|
|
218
|
+
custom?: boolean;
|
|
219
|
+
};
|
|
206
220
|
resolveAlias?: {
|
|
207
221
|
[key: string]: string;
|
|
208
222
|
};
|
|
@@ -260,6 +274,7 @@ export declare interface IFileHelper {
|
|
|
260
274
|
readdir(dirPath: string): Promise<string[]>;
|
|
261
275
|
watchFileChange(callback: () => void): void;
|
|
262
276
|
getLocalFileString?(filePath: string): Promise<string>;
|
|
277
|
+
destroy(): void;
|
|
263
278
|
}
|
|
264
279
|
|
|
265
280
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IProject } from '../types';
|
|
2
|
-
export declare const CI_VERSION = "2.0.
|
|
2
|
+
export declare const CI_VERSION = "2.0.9";
|
|
3
3
|
export declare const PARAM_ERROR = 10000;
|
|
4
4
|
export declare const WXML_NOT_FOUND = 10007;
|
|
5
5
|
export declare const JS_NOT_FOUND = 10008;
|
|
@@ -91,3 +91,10 @@ export declare enum AstType {
|
|
|
91
91
|
Babel = "babel",
|
|
92
92
|
Acorn = "acorn"
|
|
93
93
|
}
|
|
94
|
+
export declare enum EFilterCode {
|
|
95
|
+
Include = 0,
|
|
96
|
+
PackOptionsIgnore = 1,
|
|
97
|
+
AnalyseNoUse = 2,
|
|
98
|
+
PartialCompileNoUse = 3
|
|
99
|
+
}
|
|
100
|
+
export declare const MAX_CODE_LENGTH: number;
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -18,10 +18,11 @@ import { getHelperOutputPath, getHelperDeps, isValidHelperFunc, getHelperContent
|
|
|
18
18
|
import * as adroidDeviceUtils from './modules/nativecompiler/android/device';
|
|
19
19
|
import * as iosDeviceUtils from './modules/nativecompiler/ios/device';
|
|
20
20
|
import * as miniappBuilder from './utils/miniapp-builder';
|
|
21
|
+
import packOptionsHelper from './utils/packOptionsHelper';
|
|
21
22
|
export { BaseProject, CIProject as Project, CIProject, DevtoolsProject, WebProject, PreCompileProject, };
|
|
22
23
|
export { BaseCoreCompiler, OriginalCompiler, SummerCompiler, ICompilerStatus, ICompileOptions, Builder, };
|
|
23
24
|
export * from './modules/corecompiler/original';
|
|
24
25
|
export declare const workletVersion: any;
|
|
25
|
-
export { getWhiteExtList, proxy, locales, isHexColor, DefaultProjectAttr, JSON_CONTENT_ERR, compileTypeConfig, generateMD5, mkdirSync, normalizePath, checkIsInSubPackage, getHelperOutputPath, isValidHelperFunc, getHelperName, getHelperContent, getHelperDeps, getBabelHelperVersion, getBabelHelperDepMap, escapeQuot, escapeScript, getSummerPluginConfig, };
|
|
26
|
+
export { getWhiteExtList, proxy, locales, isHexColor, DefaultProjectAttr, JSON_CONTENT_ERR, compileTypeConfig, generateMD5, mkdirSync, normalizePath, checkIsInSubPackage, getHelperOutputPath, isValidHelperFunc, getHelperName, getHelperContent, getHelperDeps, getBabelHelperVersion, getBabelHelperDepMap, escapeQuot, escapeScript, getSummerPluginConfig, packOptionsHelper, };
|
|
26
27
|
export { adroidDeviceUtils, iosDeviceUtils, miniappBuilder, };
|
|
27
28
|
export * from './ci/index';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ExtJSON, AppJSON, IGameJSON, MiniProgramCore, PageJSON, PluginJSON, SiteMapJSON, ThemeJSON, MiniProgramDevtools } from '../../types';
|
|
3
3
|
import { SingletonTask } from '../../utils/singletontask';
|
|
4
|
+
import { EFilterCode } from '../../config/config';
|
|
4
5
|
import { FileInfo } from './summer/graph/basegraph';
|
|
5
6
|
export type ICompileOptions = MiniProgramCore.ICompileOptions;
|
|
6
7
|
export declare abstract class BaseCoreCompiler {
|
|
@@ -52,6 +53,10 @@ export declare abstract class BaseCoreCompiler {
|
|
|
52
53
|
getMPJSFileList(filter?: string): string[];
|
|
53
54
|
getMPWXSSFileList(filter?: string): string[];
|
|
54
55
|
getMPJSONFileList(filter?: string): string[];
|
|
56
|
+
getFiltedFileListReason(resultType: MiniProgramCore.IResultType): Promise<{
|
|
57
|
+
file: string;
|
|
58
|
+
code: EFilterCode;
|
|
59
|
+
}[]>;
|
|
55
60
|
getPluginFileList(prefix?: string, extName?: string): string[];
|
|
56
61
|
getPluginWXMLFileList(filter?: string): string[];
|
|
57
62
|
getPluginWXSFileList(filter?: string): string[];
|
|
@@ -61,6 +66,7 @@ export declare abstract class BaseCoreCompiler {
|
|
|
61
66
|
isValidComponent(prefix: string | undefined, filePath: string): boolean;
|
|
62
67
|
getAllFileInfo(prefix?: string): MiniProgramCore.IFileInfos;
|
|
63
68
|
abstract getMPFileInfo(): Promise<MiniProgramCore.IFileInfos>;
|
|
69
|
+
abstract getPackageWxssFileList(packagePath: string): Promise<string[]>;
|
|
64
70
|
abstract getPackageWxssFiles(packagePath: string): Promise<{
|
|
65
71
|
wxssFiles: string[];
|
|
66
72
|
content: Record<string, string>;
|
|
@@ -63,6 +63,7 @@ export declare class OriginalCompiler extends BaseCoreCompiler {
|
|
|
63
63
|
}>;
|
|
64
64
|
setLocale(locale: string): void;
|
|
65
65
|
clearCache(): void;
|
|
66
|
+
getPackageWxssFileList(_packagePath: string): Promise<never[]>;
|
|
66
67
|
getPackageWxssFiles(_packagePath: string): Promise<{
|
|
67
68
|
wxssFiles: string[];
|
|
68
69
|
content: Record<string, string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MiniProgramDevtools } from '../../types';
|
|
2
|
+
interface IProcessMsg {
|
|
3
|
+
type: 'progress';
|
|
4
|
+
id: number | string;
|
|
5
|
+
taskId: number;
|
|
6
|
+
status: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
interface IResponseMsg {
|
|
10
|
+
type: 'response';
|
|
11
|
+
id: number | string;
|
|
12
|
+
data: any;
|
|
13
|
+
error?: {
|
|
14
|
+
code: number;
|
|
15
|
+
message: string;
|
|
16
|
+
stack: string;
|
|
17
|
+
path: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type ICallbackMsg = IProcessMsg | IResponseMsg;
|
|
21
|
+
export declare function initHandler(message: MiniProgramDevtools.InitMsg): Promise<void>;
|
|
22
|
+
export declare function destroy(): Promise<void>;
|
|
23
|
+
export declare function messageHandler(message: MiniProgramDevtools.SummerProcessMessage, onProgressUpdate?: MiniProgramDevtools.ProgressUpdate): Promise<ICallbackMsg | undefined>;
|
|
24
|
+
export {};
|
|
@@ -26,6 +26,10 @@ export declare class AppConf extends MiniProgramBaseConf {
|
|
|
26
26
|
pageResults: Record<string, string>;
|
|
27
27
|
componentResults: Record<string, string>;
|
|
28
28
|
}>;
|
|
29
|
+
buildPagesAndCompsWithFileListForUpload(recorder: Recorder, fileList: string[], disabelSpreadingUsingComponent?: boolean): Promise<{
|
|
30
|
+
pageResults: Record<string, string>;
|
|
31
|
+
componentResults: Record<string, string>;
|
|
32
|
+
}>;
|
|
29
33
|
onFileChange: (type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string) => void;
|
|
30
34
|
protected resetState(): Promise<void>;
|
|
31
35
|
protected load(recorder: Recorder): Promise<void>;
|
|
@@ -21,4 +21,10 @@ export declare class AppGraph extends BaseGraph {
|
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
};
|
|
23
23
|
}>;
|
|
24
|
+
protected compileJSONWithFileList(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<{
|
|
25
|
+
conf: MiniProgramDevtools.IAppConf;
|
|
26
|
+
jsons: {
|
|
27
|
+
[x: string]: string;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
24
30
|
}
|
|
@@ -54,14 +54,14 @@ export declare abstract class BaseGraph {
|
|
|
54
54
|
protected abstract checkFilePackage(path: string): string;
|
|
55
55
|
protected abstract getIndependentRoot(targetPath: string): string;
|
|
56
56
|
private onFileChange;
|
|
57
|
-
private onFileAndDirChange;
|
|
58
57
|
private invalidateModules;
|
|
59
58
|
private loadModuleFromFile;
|
|
60
59
|
private loadSourceForModule;
|
|
61
60
|
protected doCompileSingleCode(info: FileInfo, sourceCode?: string): Promise<MiniProgramDevtools.CodeFile>;
|
|
62
61
|
private getCodeFileTask;
|
|
63
62
|
protected getCodeFiles(files: FileInfo[], recorder: Recorder, options?: MiniProgramCore.ICompileOptions & {
|
|
64
|
-
useCache
|
|
63
|
+
useCache?: boolean;
|
|
64
|
+
resultType?: MiniProgramCore.IResultType;
|
|
65
65
|
}): Promise<MiniProgramDevtools.CodeFiles>;
|
|
66
66
|
private readFile;
|
|
67
67
|
private tranform;
|
|
@@ -69,13 +69,21 @@ export declare abstract class BaseGraph {
|
|
|
69
69
|
private optimize;
|
|
70
70
|
private compress;
|
|
71
71
|
compile(options: MiniProgramCore.ICompileOptions, recorder: Recorder): Promise<MiniProgramDevtools.ICompileResult>;
|
|
72
|
+
compileWithFileList(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<MiniProgramDevtools.ICompileResult>;
|
|
72
73
|
protected abstract getWhiteListConfig(): Promise<Set<string>>;
|
|
73
74
|
getLocalFileList(): Promise<MiniProgramCore.IFileInfos>;
|
|
74
75
|
private compileOther;
|
|
75
76
|
private compileCodeWithoutJSON;
|
|
77
|
+
private compileCodeWithoutJSONWithFileList;
|
|
76
78
|
protected isBabelSettingIgnore(fileInfo: ResolveFileInfo): boolean;
|
|
77
79
|
protected abstract onFileChangeForGraph(type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string): void;
|
|
78
80
|
abstract getConf(recorder: Recorder): Promise<MiniProgramDevtools.IAppConf | MiniProgramDevtools.IPluginConf | MiniProgramDevtools.IGameConf | MiniProgramDevtools.IGamePluginConf>;
|
|
81
|
+
getDevCodeByFileList(recorder: Recorder, options: {
|
|
82
|
+
fileList: string[];
|
|
83
|
+
}): Promise<MiniProgramDevtools.CodeFiles>;
|
|
84
|
+
getProdCodeByFileList(recorder: Recorder, options: {
|
|
85
|
+
fileList: string[];
|
|
86
|
+
}): Promise<MiniProgramDevtools.CodeFiles>;
|
|
79
87
|
abstract getDevCode(recorder: Recorder, options?: MiniProgramDevtools.IPackageCodeOptions): Promise<MiniProgramDevtools.CodeFiles>;
|
|
80
88
|
abstract getProdCode(recorder: Recorder, options?: MiniProgramDevtools.IPackageCodeOptions & MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.CodeFiles>;
|
|
81
89
|
abstract compileSingleCode(filePath: string, sourceCode?: string): Promise<MiniProgramDevtools.CodeFile>;
|
|
@@ -83,6 +91,10 @@ export declare abstract class BaseGraph {
|
|
|
83
91
|
conf: any;
|
|
84
92
|
jsons: Record<string, string>;
|
|
85
93
|
}>;
|
|
94
|
+
protected abstract compileJSONWithFileList(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<{
|
|
95
|
+
conf: any;
|
|
96
|
+
jsons: Record<string, string>;
|
|
97
|
+
}>;
|
|
86
98
|
protected abstract getLocalCodeFileList(): string[];
|
|
87
99
|
}
|
|
88
100
|
export {};
|
|
@@ -21,4 +21,10 @@ export declare class GameGraph extends BaseGraph {
|
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
};
|
|
23
23
|
}>;
|
|
24
|
+
protected compileJSONWithFileList(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<{
|
|
25
|
+
conf: MiniProgramDevtools.IGameConf;
|
|
26
|
+
jsons: {
|
|
27
|
+
[x: string]: string;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
24
30
|
}
|
|
@@ -13,11 +13,15 @@ export declare class GamePluginGraph extends BaseGraph {
|
|
|
13
13
|
getProdCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions & MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.CodeFiles>;
|
|
14
14
|
protected getLocalCodeFileList(): string[];
|
|
15
15
|
protected onFileChangeForGraph(type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string): void;
|
|
16
|
-
getPackageFile(): Promise<FileInfo[]>;
|
|
16
|
+
getPackageFile(root?: string): Promise<FileInfo[]>;
|
|
17
17
|
protected checkFilePackage(path: string): string;
|
|
18
18
|
protected getIndependentRoot(targetPath: string): string;
|
|
19
19
|
protected compileJSON(): Promise<{
|
|
20
20
|
conf: MiniProgramDevtools.IGamePluginConf;
|
|
21
21
|
jsons: Record<string, string>;
|
|
22
22
|
}>;
|
|
23
|
+
protected compileJSONWithFileList(): Promise<{
|
|
24
|
+
conf: MiniProgramDevtools.IGamePluginConf;
|
|
25
|
+
jsons: Record<string, string>;
|
|
26
|
+
}>;
|
|
23
27
|
}
|
|
@@ -13,11 +13,15 @@ export declare class PluginGraph extends BaseGraph {
|
|
|
13
13
|
getProdCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions & MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.CodeFiles>;
|
|
14
14
|
protected getLocalCodeFileList(): string[];
|
|
15
15
|
protected onFileChangeForGraph(type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string): void;
|
|
16
|
-
getPackageFile(): Promise<FileInfo[]>;
|
|
16
|
+
getPackageFile(root?: string): Promise<FileInfo[]>;
|
|
17
17
|
protected getIndependentRoot(targetPath: string): string;
|
|
18
18
|
protected checkFilePackage(path: string): string;
|
|
19
19
|
protected compileJSON(): Promise<{
|
|
20
20
|
conf: MiniProgramDevtools.IPluginConf;
|
|
21
21
|
jsons: Record<string, string>;
|
|
22
22
|
}>;
|
|
23
|
+
protected compileJSONWithFileList(): Promise<{
|
|
24
|
+
conf: MiniProgramDevtools.IPluginConf;
|
|
25
|
+
jsons: Record<string, string>;
|
|
26
|
+
}>;
|
|
23
27
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MiniProgramCore, MiniProgramSummer } from '../../../../../types';
|
|
2
|
-
export
|
|
2
|
+
export { MAX_CODE_LENGTH, } from '../../../../../config/config';
|
|
3
3
|
export default function (project: MiniProgramCore.IPreCompileProject): MiniProgramSummer.SummerPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MiniProgramCore, MiniProgramSummer } from '../../../../../types';
|
|
2
|
-
export
|
|
2
|
+
export { MAX_CODE_LENGTH, } from '../../../../../config/config';
|
|
3
3
|
export declare function getSWCRoot(project: MiniProgramCore.IPreCompileProject, independentRoot: string): string;
|
|
4
4
|
export default function (project: MiniProgramCore.IPreCompileProject, options: {
|
|
5
5
|
disableUseStrict: boolean;
|
|
@@ -31,10 +31,15 @@ export declare class SummerCompiler {
|
|
|
31
31
|
destroy(): void;
|
|
32
32
|
getStatus(): MiniProgramDevtools.ICompilerStatus;
|
|
33
33
|
clearCache(): void;
|
|
34
|
-
getPackageFiles({ graphId, root, }:
|
|
34
|
+
getPackageFiles({ graphId, root, }: MiniProgramCore.IGetPackageFilesOptions, recorder: Recorder): Promise<import("./graph/basegraph").FileInfo[] | undefined>;
|
|
35
35
|
getConf({ graphId }: MiniProgramDevtools.IGetConfOptions, recorder: Recorder): Promise<MiniProgramDevtools.IAppConf | MiniProgramDevtools.IPluginConf | MiniProgramDevtools.IGameConf | MiniProgramDevtools.IGamePluginConf>;
|
|
36
36
|
getCode(options: MiniProgramDevtools.IGetCodeOptions, recorder: Recorder): Promise<MiniProgramDevtools.CodeFiles>;
|
|
37
|
+
getDevCodeByFileList(options: MiniProgramDevtools.IGetCodeByFileListOptions, recorder: Recorder): Promise<MiniProgramDevtools.CodeFiles>;
|
|
37
38
|
getLocalFileList(graphId: MiniProgramDevtools.GraphId): Promise<MiniProgramCore.IFileInfos>;
|
|
38
39
|
compileSingleCode(options: MiniProgramDevtools.ICompileSingleCodeOptions, recorder: Recorder): Promise<MiniProgramDevtools.CodeFile>;
|
|
40
|
+
compileNewLogic(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<{
|
|
41
|
+
app: MiniProgramDevtools.ICompileResult;
|
|
42
|
+
plugin?: MiniProgramDevtools.ICompileResult;
|
|
43
|
+
}>;
|
|
39
44
|
compile(options: MiniProgramCore.ICompileOptions, recorder: Recorder): Promise<MiniProgramDevtools.ICompileResult>;
|
|
40
45
|
}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { MiniProgramDevtools, MiniProgramCore, ExtJSON } from '../../types';
|
|
3
|
+
import { FileInfo } from './summer/graph/basegraph';
|
|
3
4
|
import { SubProcessProxy } from '../../utils/subprocess/processManager';
|
|
4
5
|
import { IMessageHub } from '../../utils/messageHub';
|
|
5
6
|
import { BaseCoreCompiler } from './baseCompiler';
|
|
7
|
+
import { Analyzer } from '../../common/code-analyse';
|
|
6
8
|
export { ICompilerStatus } from './summer/summer';
|
|
7
9
|
export declare class SummerCompiler extends BaseCoreCompiler {
|
|
8
10
|
project: MiniProgramCore.IPreCompileProject;
|
|
9
11
|
private cachePath;
|
|
10
12
|
private projectInfo;
|
|
11
13
|
private devtoolMessagehub;
|
|
14
|
+
private analyzer;
|
|
15
|
+
private _filterFactory?;
|
|
12
16
|
readonly isSummer = true;
|
|
13
17
|
subProcessManager: SubProcessProxy | undefined;
|
|
14
18
|
private codeCache;
|
|
15
19
|
private promiseCache;
|
|
20
|
+
private _taskCache;
|
|
16
21
|
private messageHub;
|
|
17
22
|
_status: MiniProgramDevtools.ICompilerStatus | undefined;
|
|
18
23
|
private _eventAdded;
|
|
19
24
|
private _locale;
|
|
20
|
-
|
|
25
|
+
private codeCacheByPath;
|
|
26
|
+
constructor(project: MiniProgramCore.IPreCompileProject, cachePath: string, projectInfo: MiniProgramDevtools.IDevtoolsProjectInfo, devtoolMessagehub: IMessageHub, analyzer: Analyzer, _filterFactory?: MiniProgramDevtools.IFilterFactory | undefined);
|
|
21
27
|
get status(): MiniProgramDevtools.ICompilerStatus | undefined;
|
|
22
28
|
protected init(): Promise<void>;
|
|
23
29
|
private loadStatus;
|
|
@@ -31,7 +37,10 @@ export declare class SummerCompiler extends BaseCoreCompiler {
|
|
|
31
37
|
private invalidCodeCache;
|
|
32
38
|
private onProgressUpdate;
|
|
33
39
|
private getConf;
|
|
34
|
-
getPackageFiles(graphId: MiniProgramDevtools.GraphId, root: string): Promise<
|
|
40
|
+
getPackageFiles(graphId: MiniProgramDevtools.GraphId, root: string, resultType?: MiniProgramCore.IResultType, useCache?: boolean): Promise<FileInfo[]>;
|
|
41
|
+
_getPackageFiles: (graphId: import("../../types").MiniProgramCI.ProjectType, root: string, resultType?: MiniProgramCore.IResultType) => Promise<FileInfo[]>;
|
|
42
|
+
private filterFactory;
|
|
43
|
+
private getCodeByFileList;
|
|
35
44
|
private getCode;
|
|
36
45
|
getExtJSON(): Promise<ExtJSON.IExtJSON>;
|
|
37
46
|
getAppJSON(): Promise<any>;
|
|
@@ -54,6 +63,7 @@ export declare class SummerCompiler extends BaseCoreCompiler {
|
|
|
54
63
|
wxsFiles: string[];
|
|
55
64
|
content: Record<string, string>;
|
|
56
65
|
}>;
|
|
66
|
+
getPackageWxssFileList(packagePath: string): Promise<any[]>;
|
|
57
67
|
getPackageWxssFiles(packagePath: string): Promise<{
|
|
58
68
|
wxssFiles: string[];
|
|
59
69
|
content: Record<string, string>;
|
|
@@ -75,6 +85,18 @@ export declare class SummerCompiler extends BaseCoreCompiler {
|
|
|
75
85
|
componentFiles: string[];
|
|
76
86
|
otherFiles: string[];
|
|
77
87
|
}>;
|
|
88
|
+
compileJSList(options: {
|
|
89
|
+
root: string;
|
|
90
|
+
fileList: string[];
|
|
91
|
+
babelRoot: string;
|
|
92
|
+
}): Promise<{
|
|
93
|
+
isLargeFile?: boolean | undefined;
|
|
94
|
+
isBabelIgnore?: boolean | undefined;
|
|
95
|
+
helpers?: string[] | undefined;
|
|
96
|
+
filePath: string;
|
|
97
|
+
code: string;
|
|
98
|
+
map: string | import("../../types").MiniProgramSummer.SourceMap | undefined;
|
|
99
|
+
}[]>;
|
|
78
100
|
compileJS(options: {
|
|
79
101
|
root: string;
|
|
80
102
|
filePath: string;
|
|
@@ -90,6 +112,8 @@ export declare class SummerCompiler extends BaseCoreCompiler {
|
|
|
90
112
|
map: string | import("../../types").MiniProgramSummer.SourceMap | undefined;
|
|
91
113
|
}>;
|
|
92
114
|
compile(options: MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.ICompileResult>;
|
|
115
|
+
private compileOther;
|
|
116
|
+
compile2(options: MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.ICompileResult>;
|
|
93
117
|
getPluginJSON(localPath?: string): Promise<any>;
|
|
94
118
|
getPluginPageJSON(pagePath: string): Promise<any>;
|
|
95
119
|
getPluginComponents(): Promise<string[]>;
|
|
@@ -119,4 +143,8 @@ export declare class SummerCompiler extends BaseCoreCompiler {
|
|
|
119
143
|
pages: Record<string, any>;
|
|
120
144
|
comps: Record<string, any>;
|
|
121
145
|
}>;
|
|
146
|
+
getFiltedFileListReason(resultType: MiniProgramCore.IResultType): Promise<{
|
|
147
|
+
file: string;
|
|
148
|
+
code: number;
|
|
149
|
+
}[]>;
|
|
122
150
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { MiniProgramCore } from '../types';
|
|
2
2
|
import { SummerCompiler, ICompilerStatus } from './corecompiler/summerCompiler';
|
|
3
|
+
import { Analyzer } from '../common/code-analyse';
|
|
3
4
|
export declare class SummerCompilerFactory {
|
|
4
5
|
summerCompiler: SummerCompiler | null;
|
|
5
6
|
private project;
|
|
6
7
|
private createPromise;
|
|
7
8
|
summerCompilerStatus: ICompilerStatus | undefined;
|
|
8
9
|
private releaseCbs;
|
|
9
|
-
getSummerCompiler(project: MiniProgramCore.IPreCompileProject): Promise<SummerCompiler>;
|
|
10
|
+
getSummerCompiler(project: MiniProgramCore.IPreCompileProject, analyzer: Analyzer): Promise<SummerCompiler>;
|
|
10
11
|
private shouldCreate;
|
|
11
12
|
private releaseLastCompiler;
|
|
12
13
|
private ensureCacheDir;
|
|
@@ -15,4 +16,4 @@ export declare class SummerCompilerFactory {
|
|
|
15
16
|
private getSummerOptions;
|
|
16
17
|
}
|
|
17
18
|
export declare const summerCompilerFactory: SummerCompilerFactory;
|
|
18
|
-
export declare const getSummerCompiler: (project: MiniProgramCore.IPreCompileProject) => Promise<SummerCompiler>;
|
|
19
|
+
export declare const getSummerCompiler: (project: MiniProgramCore.IPreCompileProject, analyzer: Analyzer) => Promise<SummerCompiler>;
|
|
@@ -4,6 +4,7 @@ import { IMessageHub, IConsoleDisplay } from '../utils/messageHub';
|
|
|
4
4
|
import { PreCompiler } from './precompiler/index';
|
|
5
5
|
import { SummerCompiler } from './corecompiler/summerCompiler';
|
|
6
6
|
import { NativeCompiler } from './nativecompiler';
|
|
7
|
+
import { Analyzer } from '../common/code-analyse';
|
|
7
8
|
interface IBuilderOptions {
|
|
8
9
|
summerCompilerClass?: typeof SummerCompiler;
|
|
9
10
|
cachePath?: string;
|
|
@@ -15,6 +16,7 @@ interface IBuilderOptions {
|
|
|
15
16
|
targetPlatform?: MiniProgramCore.ITargetPlatform;
|
|
16
17
|
targetPlatformDefines?: MiniProgramCore.ITargetPlatformDefine;
|
|
17
18
|
outputDir?: string;
|
|
19
|
+
filterFactory?: MiniProgramDevtools.IFilterFactory;
|
|
18
20
|
}
|
|
19
21
|
export declare class Builder {
|
|
20
22
|
originProject: MiniProgramCI.IProject;
|
|
@@ -24,12 +26,16 @@ export declare class Builder {
|
|
|
24
26
|
private _nativeCompiler;
|
|
25
27
|
private _options;
|
|
26
28
|
private _checkReadyTask?;
|
|
29
|
+
private _getSummerCompilerTask?;
|
|
27
30
|
private _originalCompiler;
|
|
31
|
+
private _analyzer?;
|
|
28
32
|
constructor(project: MiniProgramCI.IProject, opts: IBuilderOptions);
|
|
29
|
-
getCompiler(): Promise<
|
|
33
|
+
getCompiler(): Promise<any>;
|
|
34
|
+
getAnalyzer(): Promise<Analyzer>;
|
|
30
35
|
getPreCompileProject(): Promise<PreCompileProject>;
|
|
31
36
|
getPreCompiler(): Promise<PreCompiler>;
|
|
32
|
-
getSummerCompiler(): Promise<
|
|
37
|
+
getSummerCompiler(): Promise<any>;
|
|
38
|
+
private _getSummerCompiler;
|
|
33
39
|
ready(): Promise<any>;
|
|
34
40
|
init(): Promise<void>;
|
|
35
41
|
getNativeCompiler(): Promise<NativeCompiler>;
|
|
@@ -4,7 +4,6 @@ import { IEntitlements } from '../../../utils/codesign';
|
|
|
4
4
|
import II18NInfo = IMiniApp.II18NInfo;
|
|
5
5
|
type ITheme = 'Light' | 'LightSpecial' | 'Dark' | 'DarkSpecial' | 'Default';
|
|
6
6
|
export declare const remoteBuildProjectMaterialAbsoluteCacheDir = "__absoluteFile";
|
|
7
|
-
export declare const privateDescriptions: string[];
|
|
8
7
|
export interface IBuildCloudResult {
|
|
9
8
|
projectPath: string;
|
|
10
9
|
demoIpaPath: string;
|
|
@@ -27,7 +26,8 @@ declare class buildCloudManager {
|
|
|
27
26
|
updateIOSAppexInfoPlistInfo(bindAppInfo: MiniProgramCore.IStringKeyMap, demoIpaPath: string, iosMiniappJson: MiniProgramCore.IStringKeyMap, CFBundleVersion: number, recorder: Recorder): Promise<void>;
|
|
28
27
|
private updateBundleIcons;
|
|
29
28
|
updateIOSIcons(projectPath: string, demoIpaPath: string, miniappCacheDirPath: string, iosMiniappJson: MiniProgramCore.IStringKeyMap, isPublish: boolean, recorder: Recorder): Promise<void>;
|
|
30
|
-
|
|
29
|
+
replaceLaunchScreenImage(storyboardPath: string, newScreenImagePath: string, oldScreenImageName: string, recorder: Recorder, projectPath: string, demoIpaPath: string): string | undefined;
|
|
30
|
+
updateSplashScreen(projectPath: string, demoIpaPath: string, iosMiniappJson: MiniProgramCore.IStringKeyMap, recorder: Recorder, theme: ITheme | undefined, i18nInfo: II18NInfo): Promise<void>;
|
|
31
31
|
genUseExtendedSdk(iosMiniappJson: MiniProgramCore.IStringKeyMap): MiniProgramCore.IStringKeyMap<any>;
|
|
32
32
|
updateExtendedSdk(bindAppInfo: MiniProgramCore.IStringKeyMap, demoIpaPath: string, sdkPath: string, arch: string, iosMiniappJson: MiniProgramCore.IStringKeyMap, recorder: Recorder): Promise<void>;
|
|
33
33
|
updatePrivacyInfo(demoIpaPath: string, iosMiniappJson: MiniProgramCore.IStringKeyMap, recorder: Recorder): Promise<void>;
|
|
@@ -67,6 +67,7 @@ export declare namespace MiniProgramCI {
|
|
|
67
67
|
ignore: MiniProgramDevtools.IProjectConfigPackOption[];
|
|
68
68
|
include: MiniProgramDevtools.IProjectConfigPackOption[];
|
|
69
69
|
};
|
|
70
|
+
destroy?: () => void;
|
|
70
71
|
}
|
|
71
72
|
interface IStringKeyMap<T = any> {
|
|
72
73
|
[propName: string]: T;
|
|
@@ -104,7 +105,7 @@ export declare namespace MiniProgramCI {
|
|
|
104
105
|
interface ITaskStatus {
|
|
105
106
|
id: string;
|
|
106
107
|
message: string;
|
|
107
|
-
status: 'doing' | 'done' | 'fail';
|
|
108
|
+
status: 'doing' | 'done' | 'fail' | 'warn';
|
|
108
109
|
}
|
|
109
110
|
interface IDevToolsCompileCache {
|
|
110
111
|
init: (project: IProject) => Promise<void>;
|
|
@@ -45,11 +45,16 @@ export declare namespace MiniProgramCore {
|
|
|
45
45
|
getAllFileInfo: (prefix?: string) => IFileInfos;
|
|
46
46
|
onFileChange?: any;
|
|
47
47
|
}
|
|
48
|
+
type IGetPackageFilesOptions = {
|
|
49
|
+
graphId: ProjectType;
|
|
50
|
+
root: string;
|
|
51
|
+
};
|
|
48
52
|
interface IPreCompileProject extends IProject {
|
|
49
53
|
project: MiniProgramCI.IProject;
|
|
50
54
|
targetPlatform?: ITargetPlatform;
|
|
51
55
|
targetPlatformDefines?: ITargetPlatformDefine;
|
|
52
56
|
conditionCompiler?: any;
|
|
57
|
+
updateOptions(options: MiniProgramDevtools.IDevtoolsProjectInfo): void;
|
|
53
58
|
getSrcFile(prefix: string, filePath: string): Buffer;
|
|
54
59
|
}
|
|
55
60
|
interface IStringKeyMap<T = any> {
|
|
@@ -73,11 +78,11 @@ export declare namespace MiniProgramCore {
|
|
|
73
78
|
[key: string]: any;
|
|
74
79
|
}
|
|
75
80
|
type ICompileSettings = MiniProgramCI.ICompileSettings;
|
|
76
|
-
type IResultType = 'prod' | 'dev';
|
|
81
|
+
type IResultType = 'prod' | 'dev' | 'preview';
|
|
77
82
|
interface ITaskStatus {
|
|
78
83
|
id: string;
|
|
79
84
|
message: string;
|
|
80
|
-
status: 'doing' | 'fail' | 'done';
|
|
85
|
+
status: 'doing' | 'fail' | 'done' | 'warn';
|
|
81
86
|
}
|
|
82
87
|
interface IDevToolsCompileCache {
|
|
83
88
|
init: (project: IProject) => Promise<void>;
|
|
@@ -107,6 +112,20 @@ export declare namespace MiniProgramCore {
|
|
|
107
112
|
analyzer?: Analyzer;
|
|
108
113
|
disableSpreadingUsingComponents?: boolean;
|
|
109
114
|
resultType?: IResultType;
|
|
115
|
+
useCache?: boolean;
|
|
116
|
+
targetPlatform?: 'mini-ios' | 'mini-android' | 'miniprogram';
|
|
117
|
+
}
|
|
118
|
+
interface ICompileOptionsWithFileList {
|
|
119
|
+
nameMapping?: IStringKeyMap<string>;
|
|
120
|
+
setting?: MiniProgramDevtools.IProjectSetting;
|
|
121
|
+
fileList: string[];
|
|
122
|
+
onProgressUpdate?: (task: ITaskStatus) => void;
|
|
123
|
+
devToolsCompileCache?: IDevToolsCompileCache;
|
|
124
|
+
__compileDebugInfo__?: IDevtoolsDebugInfo;
|
|
125
|
+
compilePages?: string[];
|
|
126
|
+
analyzer?: Analyzer;
|
|
127
|
+
disableSpreadingUsingComponents?: boolean;
|
|
128
|
+
resultType?: IResultType;
|
|
110
129
|
}
|
|
111
130
|
type IProjectAttr = MiniProgramCI.IProjectAttr;
|
|
112
131
|
interface IWarnItem {
|
|
@@ -11,6 +11,7 @@ export declare namespace MiniProgramDevtools {
|
|
|
11
11
|
sitemap: any;
|
|
12
12
|
theme: any;
|
|
13
13
|
}
|
|
14
|
+
type IFilterFactory = (resultType: MiniProgramCore.IResultType) => Promise<(graph: GraphId, abFilePath: string) => number>;
|
|
14
15
|
interface IGameConf {
|
|
15
16
|
app: any;
|
|
16
17
|
packages: Record<string, any>;
|
|
@@ -24,7 +25,7 @@ export declare namespace MiniProgramDevtools {
|
|
|
24
25
|
plugin: any;
|
|
25
26
|
}
|
|
26
27
|
type IShowBuildLog = (msgId: string, type: IBuildLogType, text: string) => void;
|
|
27
|
-
type ProgressUpdate = (id: number, status: 'doing' | 'fail' | 'done', message: string) => void;
|
|
28
|
+
type ProgressUpdate = (id: number | string, status: 'doing' | 'fail' | 'done' | 'warn', message: string) => void;
|
|
28
29
|
type ISummerPluginConfig = Array<string | [string, MiniProgramSummer.SummerPluginOptions]>;
|
|
29
30
|
type IBabelSetting = {
|
|
30
31
|
outputPath?: string;
|
|
@@ -44,15 +45,15 @@ export declare namespace MiniProgramDevtools {
|
|
|
44
45
|
pluginRoot: string;
|
|
45
46
|
summerPlugins: ISummerPluginConfig;
|
|
46
47
|
setting: MiniProgramDevtools.IProjectSetting;
|
|
48
|
+
packOptions?: {
|
|
49
|
+
ignore: MiniProgramDevtools.IProjectConfigPackOption[];
|
|
50
|
+
include: MiniProgramDevtools.IProjectConfigPackOption[];
|
|
51
|
+
};
|
|
47
52
|
}
|
|
48
53
|
type GraphId = MiniProgramCore.ProjectType;
|
|
49
54
|
type IGetConfOptions = {
|
|
50
55
|
graphId: GraphId;
|
|
51
56
|
};
|
|
52
|
-
type IGetPackageFilesOptions = {
|
|
53
|
-
graphId: GraphId;
|
|
54
|
-
root: string;
|
|
55
|
-
};
|
|
56
57
|
type ICompileSingleCodeOptions = {
|
|
57
58
|
graphId: GraphId;
|
|
58
59
|
filePath: string;
|
|
@@ -63,6 +64,11 @@ export declare namespace MiniProgramDevtools {
|
|
|
63
64
|
cacheMd5: Record<string, string>;
|
|
64
65
|
package?: string;
|
|
65
66
|
};
|
|
67
|
+
type IGetCodeByFileListOptions = {
|
|
68
|
+
graphId: GraphId;
|
|
69
|
+
cacheMd5: Record<string, string>;
|
|
70
|
+
fileList: string[];
|
|
71
|
+
};
|
|
66
72
|
interface IDevtoolsProject {
|
|
67
73
|
id: string;
|
|
68
74
|
appid: string;
|