miniprogram-ci 2.0.8 → 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.
Files changed (62) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +2 -0
  3. package/dist/@types/ci/utils/tools.d.ts +1 -0
  4. package/dist/@types/common/code-analyse/index.d.ts +16 -1
  5. package/dist/@types/config/config.d.ts +8 -1
  6. package/dist/@types/index.d.ts +2 -1
  7. package/dist/@types/modules/corecompiler/baseCompiler.d.ts +6 -0
  8. package/dist/@types/modules/corecompiler/originalCompiler.d.ts +1 -0
  9. package/dist/@types/modules/corecompiler/processHandler.d.ts +4 -3
  10. package/dist/@types/modules/corecompiler/summer/graph/appconf.d.ts +4 -0
  11. package/dist/@types/modules/corecompiler/summer/graph/appgraph.d.ts +6 -3
  12. package/dist/@types/modules/corecompiler/summer/graph/basegraph.d.ts +12 -3
  13. package/dist/@types/modules/corecompiler/summer/graph/gamegraph.d.ts +6 -3
  14. package/dist/@types/modules/corecompiler/summer/graph/gameplugingraph.d.ts +5 -4
  15. package/dist/@types/modules/corecompiler/summer/graph/plugingraph.d.ts +5 -4
  16. package/dist/@types/modules/corecompiler/summer/plugins/base/javascript.d.ts +1 -1
  17. package/dist/@types/modules/corecompiler/summer/plugins/base/swc.d.ts +1 -1
  18. package/dist/@types/modules/corecompiler/summer/summer.d.ts +5 -1
  19. package/dist/@types/modules/corecompiler/summerCompiler.d.ts +15 -2
  20. package/dist/@types/modules/createSummer.d.ts +3 -2
  21. package/dist/@types/modules/index.d.ts +4 -0
  22. package/dist/@types/types/ci.d.ts +2 -1
  23. package/dist/@types/types/core.d.ts +21 -2
  24. package/dist/@types/types/devtools.d.ts +6 -6
  25. package/dist/@types/types/miniprogram-json/app.d.ts +16 -6
  26. package/dist/@types/utils/locales/locales.d.ts +5 -0
  27. package/dist/@types/utils/locales/zh.d.ts +5 -0
  28. package/dist/@types/utils/messageHub.d.ts +1 -1
  29. package/dist/@types/utils/packOptionsHelper.d.ts +15 -2
  30. package/dist/@types/utils/progressRecorder.d.ts +1 -1
  31. package/dist/@types/utils/tools.d.ts +4 -0
  32. package/dist/ci/utils/filterUnusedFile.js +1 -1
  33. package/dist/ci/utils/tools.js +1 -1
  34. package/dist/common/code-analyse/index.js +1 -1
  35. package/dist/config/config.js +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/modules/corecompiler/baseCompiler.js +1 -1
  38. package/dist/modules/corecompiler/original/compile/common.js +1 -1
  39. package/dist/modules/corecompiler/original/workerThread/task/compilejs.js +1 -1
  40. package/dist/modules/corecompiler/originalCompiler.js +1 -1
  41. package/dist/modules/corecompiler/processHandler.js +1 -1
  42. package/dist/modules/corecompiler/summer/graph/appconf.js +1 -1
  43. package/dist/modules/corecompiler/summer/graph/appgraph.js +1 -1
  44. package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
  45. package/dist/modules/corecompiler/summer/graph/gamegraph.js +1 -1
  46. package/dist/modules/corecompiler/summer/graph/gameplugingraph.js +1 -1
  47. package/dist/modules/corecompiler/summer/graph/plugingraph.js +1 -1
  48. package/dist/modules/corecompiler/summer/plugins/base/javascript.js +1 -1
  49. package/dist/modules/corecompiler/summer/plugins/base/swc.js +1 -1
  50. package/dist/modules/corecompiler/summer/summer.js +1 -1
  51. package/dist/modules/corecompiler/summerCompiler.js +1 -1
  52. package/dist/modules/createSummer.js +1 -1
  53. package/dist/modules/index.js +1 -1
  54. package/dist/project/advance/precompileProject.js +1 -1
  55. package/dist/project/baseProject.js +1 -1
  56. package/dist/utils/locales/en.js +1 -1
  57. package/dist/utils/locales/zh.js +1 -1
  58. package/dist/utils/packOptionsHelper.js +1 -1
  59. package/dist/utils/progressRecorder.js +1 -1
  60. package/dist/utils/subprocess/processManager.js +1 -1
  61. package/dist/utils/tools.js +1 -1
  62. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ #### 2.0.9
2
+ - `fix` 修复 ts,sass 等文件在某些情况无法编译的问题
1
3
  #### 2.0.8
2
4
  - `fix` 修复 babel 导致的 path.requeueComputedKeyAndDecorators 问题
3
5
  #### 2.0.7
package/README.md CHANGED
@@ -8,6 +8,8 @@ miniprogram-ci 从 1.0.28 开始支持第三方平台开发的上传和预览,
8
8
 
9
9
  ## 最近变更
10
10
 
11
+ #### 2.0.9
12
+ - `fix` 修复 ts,sass 等文件在某些情况无法编译的问题
11
13
  #### 2.0.8
12
14
  - `fix` 修复 babel 导致的 path.requeueComputedKeyAndDecorators 问题
13
15
  #### 2.0.7
@@ -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.8";
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;
@@ -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>;
@@ -1,14 +1,14 @@
1
1
  import { MiniProgramDevtools } from '../../types';
2
2
  interface IProcessMsg {
3
3
  type: 'progress';
4
- id: number;
4
+ id: number | string;
5
5
  taskId: number;
6
6
  status: string;
7
7
  message: string;
8
8
  }
9
9
  interface IResponseMsg {
10
10
  type: 'response';
11
- id: number;
11
+ id: number | string;
12
12
  data: any;
13
13
  error?: {
14
14
  code: number;
@@ -19,5 +19,6 @@ interface IResponseMsg {
19
19
  }
20
20
  type ICallbackMsg = IProcessMsg | IResponseMsg;
21
21
  export declare function initHandler(message: MiniProgramDevtools.InitMsg): Promise<void>;
22
- export declare function messageHandler(message: MiniProgramDevtools.SummerProcessMessage): Promise<ICallbackMsg | undefined>;
22
+ export declare function destroy(): Promise<void>;
23
+ export declare function messageHandler(message: MiniProgramDevtools.SummerProcessMessage, onProgressUpdate?: MiniProgramDevtools.ProgressUpdate): Promise<ICallbackMsg | undefined>;
23
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>;
@@ -10,9 +10,6 @@ export declare class AppGraph extends BaseGraph {
10
10
  getConf(recorder: Recorder): Promise<MiniProgramDevtools.IAppConf>;
11
11
  compileSingleCode(filePath: string, sourceCode?: string): Promise<MiniProgramDevtools.CodeFile>;
12
12
  getDevCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions): Promise<MiniProgramDevtools.CodeFiles>;
13
- getDevCodeByFileList(recorder: Recorder, options: {
14
- fileList: string[];
15
- }): Promise<MiniProgramDevtools.CodeFiles>;
16
13
  getProdCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions & MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.CodeFiles>;
17
14
  protected getLocalCodeFileList(): string[];
18
15
  protected onFileChangeForGraph(type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string): void;
@@ -24,4 +21,10 @@ export declare class AppGraph extends BaseGraph {
24
21
  [x: string]: string;
25
22
  };
26
23
  }>;
24
+ protected compileJSONWithFileList(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<{
25
+ conf: MiniProgramDevtools.IAppConf;
26
+ jsons: {
27
+ [x: string]: string;
28
+ };
29
+ }>;
27
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: boolean;
63
+ useCache?: boolean;
64
+ resultType?: MiniProgramCore.IResultType;
65
65
  }): Promise<MiniProgramDevtools.CodeFiles>;
66
66
  private readFile;
67
67
  private tranform;
@@ -69,14 +69,19 @@ 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>;
79
- abstract getDevCodeByFileList(recorder: Recorder, options: {
81
+ getDevCodeByFileList(recorder: Recorder, options: {
82
+ fileList: string[];
83
+ }): Promise<MiniProgramDevtools.CodeFiles>;
84
+ getProdCodeByFileList(recorder: Recorder, options: {
80
85
  fileList: string[];
81
86
  }): Promise<MiniProgramDevtools.CodeFiles>;
82
87
  abstract getDevCode(recorder: Recorder, options?: MiniProgramDevtools.IPackageCodeOptions): Promise<MiniProgramDevtools.CodeFiles>;
@@ -86,6 +91,10 @@ export declare abstract class BaseGraph {
86
91
  conf: any;
87
92
  jsons: Record<string, string>;
88
93
  }>;
94
+ protected abstract compileJSONWithFileList(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<{
95
+ conf: any;
96
+ jsons: Record<string, string>;
97
+ }>;
89
98
  protected abstract getLocalCodeFileList(): string[];
90
99
  }
91
100
  export {};
@@ -10,9 +10,6 @@ export declare class GameGraph extends BaseGraph {
10
10
  getConf(recorder: Recorder): Promise<MiniProgramDevtools.IGameConf>;
11
11
  compileSingleCode(filePath: string, sourceCode?: string): Promise<MiniProgramDevtools.CodeFile>;
12
12
  getDevCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions): Promise<MiniProgramDevtools.CodeFiles>;
13
- getDevCodeByFileList(recorder: Recorder, options: {
14
- fileList: string[];
15
- }): Promise<MiniProgramDevtools.CodeFiles>;
16
13
  getProdCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions & MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.CodeFiles>;
17
14
  protected getLocalCodeFileList(): string[];
18
15
  protected onFileChangeForGraph(type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string): void;
@@ -24,4 +21,10 @@ export declare class GameGraph extends BaseGraph {
24
21
  [x: string]: string;
25
22
  };
26
23
  }>;
24
+ protected compileJSONWithFileList(options: MiniProgramCore.ICompileOptionsWithFileList, recorder: Recorder): Promise<{
25
+ conf: MiniProgramDevtools.IGameConf;
26
+ jsons: {
27
+ [x: string]: string;
28
+ };
29
+ }>;
27
30
  }
@@ -10,17 +10,18 @@ export declare class GamePluginGraph extends BaseGraph {
10
10
  getConf(recorder: Recorder): Promise<MiniProgramDevtools.IGamePluginConf>;
11
11
  compileSingleCode(filePath: string, sourceCode?: string): Promise<MiniProgramDevtools.CodeFile>;
12
12
  getDevCode(recorder: Recorder): Promise<MiniProgramDevtools.CodeFiles>;
13
- getDevCodeByFileList(recorder: Recorder, options: {
14
- fileList: string[];
15
- }): Promise<MiniProgramDevtools.CodeFiles>;
16
13
  getProdCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions & MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.CodeFiles>;
17
14
  protected getLocalCodeFileList(): string[];
18
15
  protected onFileChangeForGraph(type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string): void;
19
- getPackageFile(): Promise<FileInfo[]>;
16
+ getPackageFile(root?: string): Promise<FileInfo[]>;
20
17
  protected checkFilePackage(path: string): string;
21
18
  protected getIndependentRoot(targetPath: string): string;
22
19
  protected compileJSON(): Promise<{
23
20
  conf: MiniProgramDevtools.IGamePluginConf;
24
21
  jsons: Record<string, string>;
25
22
  }>;
23
+ protected compileJSONWithFileList(): Promise<{
24
+ conf: MiniProgramDevtools.IGamePluginConf;
25
+ jsons: Record<string, string>;
26
+ }>;
26
27
  }
@@ -10,17 +10,18 @@ export declare class PluginGraph extends BaseGraph {
10
10
  getConf(recorder: Recorder): Promise<MiniProgramDevtools.IPluginConf>;
11
11
  compileSingleCode(filePath: string, sourceCode?: string): Promise<MiniProgramDevtools.CodeFile>;
12
12
  getDevCode(recorder: Recorder): Promise<MiniProgramDevtools.CodeFiles>;
13
- getDevCodeByFileList(recorder: Recorder, options: {
14
- fileList: string[];
15
- }): Promise<MiniProgramDevtools.CodeFiles>;
16
13
  getProdCode(recorder: Recorder, options: MiniProgramDevtools.IPackageCodeOptions & MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.CodeFiles>;
17
14
  protected getLocalCodeFileList(): string[];
18
15
  protected onFileChangeForGraph(type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', path: string): void;
19
- getPackageFile(): Promise<FileInfo[]>;
16
+ getPackageFile(root?: string): Promise<FileInfo[]>;
20
17
  protected getIndependentRoot(targetPath: string): string;
21
18
  protected checkFilePackage(path: string): string;
22
19
  protected compileJSON(): Promise<{
23
20
  conf: MiniProgramDevtools.IPluginConf;
24
21
  jsons: Record<string, string>;
25
22
  }>;
23
+ protected compileJSONWithFileList(): Promise<{
24
+ conf: MiniProgramDevtools.IPluginConf;
25
+ jsons: Record<string, string>;
26
+ }>;
26
27
  }
@@ -1,3 +1,3 @@
1
1
  import { MiniProgramCore, MiniProgramSummer } from '../../../../../types';
2
- export declare const MAX_CODE_LENGTH: number;
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 declare const MAX_CODE_LENGTH: number;
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,11 +31,15 @@ export declare class SummerCompiler {
31
31
  destroy(): void;
32
32
  getStatus(): MiniProgramDevtools.ICompilerStatus;
33
33
  clearCache(): void;
34
- getPackageFiles({ graphId, root, }: MiniProgramDevtools.IGetPackageFilesOptions): Promise<import("./graph/basegraph").FileInfo[] | undefined>;
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
37
  getDevCodeByFileList(options: MiniProgramDevtools.IGetCodeByFileListOptions, recorder: Recorder): Promise<MiniProgramDevtools.CodeFiles>;
38
38
  getLocalFileList(graphId: MiniProgramDevtools.GraphId): Promise<MiniProgramCore.IFileInfos>;
39
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
+ }>;
40
44
  compile(options: MiniProgramCore.ICompileOptions, recorder: Recorder): Promise<MiniProgramDevtools.ICompileResult>;
41
45
  }
@@ -4,22 +4,26 @@ import { FileInfo } from './summer/graph/basegraph';
4
4
  import { SubProcessProxy } from '../../utils/subprocess/processManager';
5
5
  import { IMessageHub } from '../../utils/messageHub';
6
6
  import { BaseCoreCompiler } from './baseCompiler';
7
+ import { Analyzer } from '../../common/code-analyse';
7
8
  export { ICompilerStatus } from './summer/summer';
8
9
  export declare class SummerCompiler extends BaseCoreCompiler {
9
10
  project: MiniProgramCore.IPreCompileProject;
10
11
  private cachePath;
11
12
  private projectInfo;
12
13
  private devtoolMessagehub;
14
+ private analyzer;
15
+ private _filterFactory?;
13
16
  readonly isSummer = true;
14
17
  subProcessManager: SubProcessProxy | undefined;
15
18
  private codeCache;
16
19
  private promiseCache;
20
+ private _taskCache;
17
21
  private messageHub;
18
22
  _status: MiniProgramDevtools.ICompilerStatus | undefined;
19
23
  private _eventAdded;
20
24
  private _locale;
21
25
  private codeCacheByPath;
22
- constructor(project: MiniProgramCore.IPreCompileProject, cachePath: string, projectInfo: MiniProgramDevtools.IDevtoolsProjectInfo, devtoolMessagehub: IMessageHub);
26
+ constructor(project: MiniProgramCore.IPreCompileProject, cachePath: string, projectInfo: MiniProgramDevtools.IDevtoolsProjectInfo, devtoolMessagehub: IMessageHub, analyzer: Analyzer, _filterFactory?: MiniProgramDevtools.IFilterFactory | undefined);
23
27
  get status(): MiniProgramDevtools.ICompilerStatus | undefined;
24
28
  protected init(): Promise<void>;
25
29
  private loadStatus;
@@ -33,7 +37,9 @@ export declare class SummerCompiler extends BaseCoreCompiler {
33
37
  private invalidCodeCache;
34
38
  private onProgressUpdate;
35
39
  private getConf;
36
- getPackageFiles(graphId: MiniProgramDevtools.GraphId, root: string): Promise<FileInfo[]>;
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;
37
43
  private getCodeByFileList;
38
44
  private getCode;
39
45
  getExtJSON(): Promise<ExtJSON.IExtJSON>;
@@ -57,6 +63,7 @@ export declare class SummerCompiler extends BaseCoreCompiler {
57
63
  wxsFiles: string[];
58
64
  content: Record<string, string>;
59
65
  }>;
66
+ getPackageWxssFileList(packagePath: string): Promise<any[]>;
60
67
  getPackageWxssFiles(packagePath: string): Promise<{
61
68
  wxssFiles: string[];
62
69
  content: Record<string, string>;
@@ -105,6 +112,8 @@ export declare class SummerCompiler extends BaseCoreCompiler {
105
112
  map: string | import("../../types").MiniProgramSummer.SourceMap | undefined;
106
113
  }>;
107
114
  compile(options: MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.ICompileResult>;
115
+ private compileOther;
116
+ compile2(options: MiniProgramCore.ICompileOptions): Promise<MiniProgramDevtools.ICompileResult>;
108
117
  getPluginJSON(localPath?: string): Promise<any>;
109
118
  getPluginPageJSON(pagePath: string): Promise<any>;
110
119
  getPluginComponents(): Promise<string[]>;
@@ -134,4 +143,8 @@ export declare class SummerCompiler extends BaseCoreCompiler {
134
143
  pages: Record<string, any>;
135
144
  comps: Record<string, any>;
136
145
  }>;
146
+ getFiltedFileListReason(resultType: MiniProgramCore.IResultType): Promise<{
147
+ file: string;
148
+ code: number;
149
+ }[]>;
137
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;
@@ -26,8 +28,10 @@ export declare class Builder {
26
28
  private _checkReadyTask?;
27
29
  private _getSummerCompilerTask?;
28
30
  private _originalCompiler;
31
+ private _analyzer?;
29
32
  constructor(project: MiniProgramCI.IProject, opts: IBuilderOptions);
30
33
  getCompiler(): Promise<any>;
34
+ getAnalyzer(): Promise<Analyzer>;
31
35
  getPreCompileProject(): Promise<PreCompileProject>;
32
36
  getPreCompiler(): Promise<PreCompiler>;
33
37
  getSummerCompiler(): Promise<any>;
@@ -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;
@@ -67,7 +68,6 @@ export declare namespace MiniProgramDevtools {
67
68
  graphId: GraphId;
68
69
  cacheMd5: Record<string, string>;
69
70
  fileList: string[];
70
- package?: string;
71
71
  };
72
72
  interface IDevtoolsProject {
73
73
  id: string;
@@ -17,12 +17,7 @@ export declare namespace AppJSON {
17
17
  }
18
18
  interface ITabBar {
19
19
  custom?: boolean;
20
- list: Array<{
21
- pagePath: string;
22
- text?: string;
23
- iconPath?: string;
24
- selectedIconPath?: string;
25
- }>;
20
+ list: Array<ITabbarItem>;
26
21
  borderStyle?: 'black' | 'white';
27
22
  position?: 'bottom' | 'top';
28
23
  color?: string;
@@ -120,6 +115,16 @@ export declare namespace AppJSON {
120
115
  }>;
121
116
  };
122
117
  componentFramework?: 'glass-easel' | 'exparser';
118
+ supportedMaterials?: ISupportMaterial[];
119
+ miniApp?: {
120
+ useAuthorizePage: boolean;
121
+ };
122
+ }
123
+ interface ISupportMaterial {
124
+ materialType: string;
125
+ name: string;
126
+ desc: string;
127
+ path: string;
123
128
  }
124
129
  interface IPluginConfig {
125
130
  provider: string;
@@ -140,6 +145,10 @@ export declare namespace AppJSON {
140
145
  useExtendedLib?: {
141
146
  [key: string]: boolean | string;
142
147
  };
148
+ meta?: {
149
+ type?: string;
150
+ };
151
+ renderer?: Renderer;
143
152
  }
144
153
  type requiredPrivateInfosValues = 'getFuzzyLocation' | 'getLocation' | 'onLocationChange' | 'startLocationUpdate' | 'startLocationUpdateBackground' | 'chooseLocation' | 'choosePoi' | 'chooseAddress';
145
154
  interface IWindowConfig {
@@ -173,6 +182,7 @@ export declare namespace AppJSON {
173
182
  text?: string;
174
183
  iconPath?: string;
175
184
  selectedIconPath?: string;
185
+ renderer?: 'skyline' | 'webview' | 'cover-view';
176
186
  badge?: {};
177
187
  }
178
188
  interface INetworkTimeoutConfig {
@@ -106,6 +106,11 @@ declare const _default: {
106
106
  RELATED_NODE_MODULES_NOT_FOUND: import("./fomatable_string").FormatableString;
107
107
  PACKAGE_JSON_PATH_IN_VALID: import("./fomatable_string").FormatableString;
108
108
  ACCOUNT_CARD_PACKAPGE_IN_VALID: import("./fomatable_string").FormatableString;
109
+ UNUSE_FILE_LIST: import("./fomatable_string").FormatableString;
110
+ PACK_OPTIONS_IGNORE_LIST: import("./fomatable_string").FormatableString;
111
+ PARTIAL_COMPILE_IGNORE_LIST: import("./fomatable_string").FormatableString;
112
+ UNKNOWN_REASON_INGORE_LIST: import("./fomatable_string").FormatableString;
113
+ LARGEFILE_WARNING: import("./fomatable_string").FormatableString;
109
114
  };
110
115
  setLocale: (tag: string) => void;
111
116
  getLocale: () => string;