miniprogram-ci 2.1.29 → 2.1.31
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 +5 -0
- package/README.md +5 -0
- package/dist/@types/config/config.d.ts +1 -1
- package/dist/@types/modules/corecompiler/baseCompiler.d.ts +1 -0
- package/dist/@types/modules/corecompiler/originalCompiler.d.ts +1 -0
- package/dist/@types/modules/corecompiler/summer/graph/basegraph.d.ts +2 -0
- package/dist/@types/modules/corecompiler/summer/module.d.ts +8 -3
- package/dist/@types/modules/corecompiler/summer/pluginconfig.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/plugins/base/es6module.d.ts +0 -17
- package/dist/@types/modules/corecompiler/summer/plugins/filetask/script.d.ts +28 -0
- package/dist/@types/modules/corecompiler/summer/plugins/index.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/plugins/script_task/babel_script_task.d.ts +22 -0
- package/dist/@types/modules/corecompiler/summer/plugins/script_task/load_script_task.d.ts +7 -0
- package/dist/@types/modules/corecompiler/summer/plugins/script_task/minify_script_task.d.ts +5 -0
- package/dist/@types/modules/corecompiler/summer/plugins/script_task/swc_task.d.ts +22 -0
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +4 -0
- package/dist/@types/modules/nativecompiler/processHandler.d.ts +5 -0
- package/dist/@types/types/devtools.d.ts +9 -0
- package/dist/@types/types/summer.d.ts +7 -2
- package/dist/@types/utils/babel_plugin_worklet.d.ts +10 -1
- package/dist/@types/utils/env.d.ts +1 -0
- package/dist/@types/utils/helper_util.d.ts +1 -1
- package/dist/@types/utils/packOptionsHelper.d.ts +1 -0
- package/dist/@types/utils/subprocess/processManager.d.ts +2 -1
- package/dist/ci/android-miniapp-toolkit/dist/index.js +1 -1
- package/dist/ci/build-apk.js +1 -1
- package/dist/config/config.js +1 -1
- package/dist/modules/corecompiler/original/json/game.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/index.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -1
- package/dist/modules/corecompiler/originalCompiler.js +1 -1
- package/dist/modules/corecompiler/processHandler.js +1 -1
- package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
- package/dist/modules/corecompiler/summer/module.js +1 -1
- package/dist/modules/corecompiler/summer/pluginconfig.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/es6module.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/enhance.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/filetask/script.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/index.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/less.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/sass.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/script_task/babel_script_task.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/script_task/load_script_task.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/script_task/minify_script_task.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/script_task/swc_task.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/terser.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/typescript.js +1 -1
- package/dist/modules/corecompiler/summer/summer.js +1 -1
- package/dist/modules/corecompiler/summerCompiler.js +1 -1
- package/dist/modules/createSummer.js +1 -1
- package/dist/modules/nativecompiler/ios/buildCloud.js +1 -1
- package/dist/modules/nativecompiler/nativeEntryProcess.js +1 -1
- package/dist/modules/nativecompiler/processHandler.js +1 -0
- package/dist/utils/babel_plugin_worklet.js +1 -1
- package/dist/utils/cosUpload.js +1 -1
- package/dist/utils/debug.js +1 -1
- package/dist/utils/env.js +1 -1
- package/dist/utils/packOptionsHelper.js +1 -1
- package/dist/utils/subprocess/processManager.js +1 -1
- package/dist/utils/subprocess/processService.js +1 -1
- package/package.json +5 -54
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,6 +7,11 @@ miniprogram-ci 是从[微信开发者工具](https://developers.weixin.qq.com/mi
|
|
|
7
7
|
miniprogram-ci 从 1.0.28 开始支持第三方平台开发的上传和预览,调用方式与普通开发模式无异。[查看详情](#第三方平台开发)
|
|
8
8
|
|
|
9
9
|
## 最近变更
|
|
10
|
+
#### 2.1.31
|
|
11
|
+
- `fix` 修复 去除 package.json devDependencies
|
|
12
|
+
- `fix` 修复 锁定 less 版本为 4.5.1
|
|
13
|
+
#### 2.1.30
|
|
14
|
+
- `new` 新增 允许 CI 构建多端 APK 时使用 beta 版本 SDK
|
|
10
15
|
#### 2.1.29
|
|
11
16
|
- `fix` 修复 多端 iOS 构建专业版水印去除失败
|
|
12
17
|
#### 2.1.27
|
|
@@ -123,6 +123,7 @@ export declare abstract class BaseCoreCompiler {
|
|
|
123
123
|
componentFiles: string[];
|
|
124
124
|
otherFiles: string[];
|
|
125
125
|
}>;
|
|
126
|
+
abstract waitSubProcessReady(): Promise<void>;
|
|
126
127
|
abstract getAllPageAndComponent(): Promise<string[]>;
|
|
127
128
|
abstract getExtJSON(): Promise<ExtJSON.IExtJSON>;
|
|
128
129
|
abstract getAppJSON(): Promise<AppJSON.IAppJSON>;
|
|
@@ -3,6 +3,7 @@ import { BaseCoreCompiler } from './baseCompiler';
|
|
|
3
3
|
import { OriginalCompileManager } from './original';
|
|
4
4
|
import { FileInfo } from './summer/graph/basegraph';
|
|
5
5
|
export declare class OriginalCompiler extends BaseCoreCompiler {
|
|
6
|
+
waitSubProcessReady(): Promise<void>;
|
|
6
7
|
readonly isSummer = false;
|
|
7
8
|
compileManager: OriginalCompileManager | undefined;
|
|
8
9
|
constructor(project: MiniProgramCore.IPreCompileProject);
|
|
@@ -56,6 +56,7 @@ export declare abstract class BaseGraph {
|
|
|
56
56
|
private onFileChange;
|
|
57
57
|
private invalidateModules;
|
|
58
58
|
private loadModuleFromFile;
|
|
59
|
+
private loadSourceForModuleWithoutTransform;
|
|
59
60
|
private loadSourceForModule;
|
|
60
61
|
protected doCompileSingleCode(info: FileInfo, sourceCode?: string): Promise<MiniProgramDevtools.CodeFile>;
|
|
61
62
|
private getCodeFileTask;
|
|
@@ -66,6 +67,7 @@ export declare abstract class BaseGraph {
|
|
|
66
67
|
private readFile;
|
|
67
68
|
private tranform;
|
|
68
69
|
private generate;
|
|
70
|
+
private compileCode;
|
|
69
71
|
private optimize;
|
|
70
72
|
private compress;
|
|
71
73
|
compile(options: MiniProgramCore.ICompileOptions, recorder: Recorder): Promise<MiniProgramDevtools.ICompileResult>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MiniProgramSummer, MiniProgramDevtools, MiniProgramCore } from '../../../types';
|
|
2
2
|
import { CustomError } from '../../../utils/customError';
|
|
3
|
-
import {
|
|
3
|
+
import { FileType } from './graph/basegraph';
|
|
4
4
|
declare class JsTag {
|
|
5
5
|
isLargeFile: boolean;
|
|
6
6
|
isBabelIgnore: boolean;
|
|
@@ -17,7 +17,6 @@ declare class JsTag {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
export default class Module {
|
|
20
|
-
private readonly graph;
|
|
21
20
|
readonly path: string;
|
|
22
21
|
readonly sourcePath: string;
|
|
23
22
|
fileType: FileType;
|
|
@@ -25,24 +24,30 @@ export default class Module {
|
|
|
25
24
|
private _error;
|
|
26
25
|
private loadResult?;
|
|
27
26
|
private generateResultPromise;
|
|
27
|
+
private compileResultPromise;
|
|
28
28
|
depFiles: string[];
|
|
29
29
|
independentRoot: string;
|
|
30
30
|
isBabelIgnore: boolean;
|
|
31
31
|
private generatedTS;
|
|
32
|
-
constructor(
|
|
32
|
+
constructor(path: string, sourcePath: string, fileType: FileType);
|
|
33
33
|
private transResultType;
|
|
34
34
|
getGeneratedTS(resultType: MiniProgramCore.IResultType): number;
|
|
35
35
|
setError(resultType: MiniProgramCore.IResultType, error: CustomError | Error): void;
|
|
36
36
|
getError(resultType: MiniProgramCore.IResultType): Error | CustomError | undefined;
|
|
37
37
|
getJsTag(): Promise<JsTag | undefined>;
|
|
38
|
+
getJsTag2(): Promise<JsTag | undefined>;
|
|
38
39
|
getSource(): Promise<MiniProgramSummer.SourceDescription>;
|
|
39
40
|
getMd5(): Promise<string>;
|
|
40
41
|
setLoadingPromise(promise: Promise<MiniProgramSummer.ILoadResult>): void;
|
|
42
|
+
clearUselessCache(): Promise<void>;
|
|
41
43
|
getLoadingPromise(): Promise<MiniProgramSummer.ILoadResult> | undefined;
|
|
42
44
|
setGeneratingPromise(resultType: MiniProgramCore.IResultType, promise: Promise<MiniProgramSummer.IGenerateResult>): void;
|
|
43
45
|
getGeneratingPromise(resultType: MiniProgramCore.IResultType): Promise<MiniProgramSummer.IGenerateResult> | undefined;
|
|
46
|
+
getCompilePromise(resultType: MiniProgramCore.IResultType): Promise<MiniProgramSummer.IGenerateResult> | undefined;
|
|
47
|
+
setCompilePromise(resultType: MiniProgramCore.IResultType, promise: Promise<MiniProgramSummer.IGenerateResult>): void;
|
|
44
48
|
getProcessInfo(resultType: MiniProgramCore.IResultType): Promise<MiniProgramSummer.IPluginProcessInfo[] | undefined>;
|
|
45
49
|
toCodeFile(resultType: MiniProgramCore.IResultType): Promise<MiniProgramDevtools.CodeFile | MiniProgramDevtools.CodeError>;
|
|
50
|
+
toCodeFile2(resultType: MiniProgramCore.IResultType): Promise<MiniProgramDevtools.CodeFile | MiniProgramDevtools.CodeError>;
|
|
46
51
|
toGenerateResult(resultType: MiniProgramCore.IResultType): Promise<MiniProgramSummer.IGenerateResult | MiniProgramDevtools.CodeError>;
|
|
47
52
|
toJSON(): MiniProgramSummer.ModuleJSON;
|
|
48
53
|
addWatchFile(file: string): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MiniProgramDevtools } from '../../../types';
|
|
2
|
-
export type AvailableSummerPlugin = '
|
|
2
|
+
export type AvailableSummerPlugin = 'script' | 'wxss' | 'less' | 'sass' | 'minifywxml';
|
|
3
3
|
export declare function couldUseSWCMode(setting: MiniProgramDevtools.IProjectSetting): boolean;
|
|
4
4
|
export declare function getSummerPluginConfig(setting: MiniProgramDevtools.IProjectSetting): (AvailableSummerPlugin | [AvailableSummerPlugin, any])[];
|
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import { MiniProgramCore, MiniProgramSummer } from '../../../../../types';
|
|
2
|
-
export declare function getBabelRoot(independentRoot: string): string;
|
|
3
|
-
export declare function transformES6ModuleAndGenCode(id: string, source: MiniProgramSummer.SourceDescription, options: {
|
|
4
|
-
babelRoot: string;
|
|
5
|
-
disableUseStrict: boolean;
|
|
6
|
-
}): {
|
|
7
|
-
code: string;
|
|
8
|
-
map: {
|
|
9
|
-
version: number;
|
|
10
|
-
sources: string[];
|
|
11
|
-
names: string[];
|
|
12
|
-
sourceRoot?: string | undefined;
|
|
13
|
-
sourcesContent?: string[] | undefined;
|
|
14
|
-
mappings: string;
|
|
15
|
-
file: string;
|
|
16
|
-
};
|
|
17
|
-
helpers: string[];
|
|
18
|
-
};
|
|
19
2
|
export default function (project: MiniProgramCore.IPreCompileProject, options: {
|
|
20
3
|
disableUseStrict: boolean;
|
|
21
4
|
}): MiniProgramSummer.SummerPlugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MiniProgramCore, MiniProgramSummer } from '../../../../../types';
|
|
2
|
+
export { MAX_CODE_LENGTH, } from '../../../../../config/config';
|
|
3
|
+
export declare function getSWCRoot(project: MiniProgramCore.IPreCompileProject, independentRoot: string): string;
|
|
4
|
+
export interface IScriptCompileOptions {
|
|
5
|
+
disableUseStrict?: boolean;
|
|
6
|
+
minify?: boolean;
|
|
7
|
+
resultType: MiniProgramCore.IResultType;
|
|
8
|
+
swcRoot: string;
|
|
9
|
+
target: 'es5' | 'es2022';
|
|
10
|
+
rc?: {
|
|
11
|
+
parser?: Record<string, string>;
|
|
12
|
+
module?: Record<string, string>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface IScriptCompileResult {
|
|
16
|
+
code: string;
|
|
17
|
+
map?: MiniProgramSummer.SourceMap;
|
|
18
|
+
helpers: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface IScriptCompileOptions {
|
|
21
|
+
swc?: boolean;
|
|
22
|
+
independentRoot: string;
|
|
23
|
+
isBabelIgnore: boolean;
|
|
24
|
+
resultType: MiniProgramCore.IResultType;
|
|
25
|
+
}
|
|
26
|
+
export default function (project: MiniProgramCore.IPreCompileProject, options: {
|
|
27
|
+
disableUseStrict: boolean;
|
|
28
|
+
}): MiniProgramSummer.SummerPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
load(pluginName: string): typeof import("./
|
|
2
|
+
load(pluginName: string): typeof import("./filetask/script").default | typeof import("./base/wxss").default | typeof import("./less").default | null;
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MiniProgramSummer } from '../../../../../types';
|
|
2
|
+
export declare function getBabelRoot(independentRoot: string): string;
|
|
3
|
+
export declare function babelTransformJS(source: MiniProgramSummer.SourceDescription, sourcePath: string): Promise<MiniProgramSummer.SourceDescription>;
|
|
4
|
+
export declare function transformES6ModuleAndGenCode(id: string, source: MiniProgramSummer.SourceDescription, options: {
|
|
5
|
+
babelRoot: string;
|
|
6
|
+
disableUseStrict: boolean;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
code: string;
|
|
9
|
+
map: any;
|
|
10
|
+
helpers: string[];
|
|
11
|
+
}>;
|
|
12
|
+
export declare function babelTransformTS(source: MiniProgramSummer.SourceDescription, sourcePath: string): Promise<MiniProgramSummer.SourceDescription>;
|
|
13
|
+
export declare function bableCompile(sourcePath: string, source: MiniProgramSummer.SourceDescription, options: {
|
|
14
|
+
typescript?: boolean;
|
|
15
|
+
enhance?: boolean;
|
|
16
|
+
babelRoot: string;
|
|
17
|
+
disableUseStrict: boolean;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
code: string;
|
|
20
|
+
map: any;
|
|
21
|
+
helpers: string[];
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MiniProgramCore, MiniProgramSummer } from '../../../../../types';
|
|
2
|
+
export interface ILoadScriptResult {
|
|
3
|
+
targetPath: string;
|
|
4
|
+
source: MiniProgramSummer.SourceDescription;
|
|
5
|
+
process: MiniProgramSummer.IPluginProcessInfo[];
|
|
6
|
+
}
|
|
7
|
+
export declare function loadScriptFile(project: MiniProgramCore.IPreCompileProject, targetPath: string, sourcePath: string, pluginName: string): Promise<ILoadScriptResult>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MiniProgramSummer } from '../../../../../types';
|
|
2
|
+
export declare function doCompress(targetPath: string, target: Pick<MiniProgramSummer.GenerateDescription, 'code' | 'map'>): Promise<{
|
|
3
|
+
code: string;
|
|
4
|
+
map: string | import("source-map").RawSourceMap | undefined;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MiniProgramCore, MiniProgramSummer } from '../../../../../types';
|
|
2
|
+
export interface ISwcCompileOptions {
|
|
3
|
+
disableUseStrict?: boolean;
|
|
4
|
+
minify?: boolean;
|
|
5
|
+
resultType: MiniProgramCore.IResultType;
|
|
6
|
+
swcRoot: string;
|
|
7
|
+
target: 'es5' | 'es2022';
|
|
8
|
+
rc?: {
|
|
9
|
+
parser?: Record<string, any>;
|
|
10
|
+
module?: Record<string, any>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ISwcSourceInput {
|
|
14
|
+
sourceCode: string;
|
|
15
|
+
inputMap?: MiniProgramSummer.SourceMap;
|
|
16
|
+
}
|
|
17
|
+
export interface ISwcCompileResult {
|
|
18
|
+
code: string;
|
|
19
|
+
map?: MiniProgramSummer.SourceMap;
|
|
20
|
+
helpers: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function swcCompileTask(id: string, source: ISwcSourceInput, options: ISwcCompileOptions): Promise<ISwcCompileResult>;
|
|
@@ -31,7 +31,10 @@ export declare class SummerCompiler extends BaseCoreCompiler {
|
|
|
31
31
|
private loadStatus;
|
|
32
32
|
destroy(): void;
|
|
33
33
|
clearCache(): Promise<void>;
|
|
34
|
+
getProjectInfo(): MiniProgramDevtools.IDevtoolsProjectInfo;
|
|
34
35
|
updateOptions(options: MiniProgramDevtools.IDevtoolsProjectInfo): void;
|
|
36
|
+
updateOptionsWithoutJudge(options: MiniProgramDevtools.IDevtoolsProjectInfo): void;
|
|
37
|
+
updateOptionsWhenAttrNotChanged(options: MiniProgramDevtools.IDevtoolsProjectInfo): void;
|
|
35
38
|
private addProjectListener;
|
|
36
39
|
private removeProjectListener;
|
|
37
40
|
onFileChange: (type: 'unlink' | 'unlinkDir' | 'add' | 'addDir' | 'change', targetPath: string) => void;
|
|
@@ -39,6 +42,7 @@ export declare class SummerCompiler extends BaseCoreCompiler {
|
|
|
39
42
|
private invalidCodeCache;
|
|
40
43
|
private onProgressUpdate;
|
|
41
44
|
private getConf;
|
|
45
|
+
waitSubProcessReady(): Promise<void>;
|
|
42
46
|
getPackageFiles(graphId: MiniProgramDevtools.GraphId, root: string, resultType?: MiniProgramCore.IResultType, useCache?: boolean): Promise<FileInfo[]>;
|
|
43
47
|
_getPackageFiles: (graphId: import("../../types").MiniProgramCI.ProjectType, root: string, resultType?: MiniProgramCore.IResultType) => Promise<FileInfo[]>;
|
|
44
48
|
private isMiniappPlatformInclude;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MiniProgramDevtools } from '../../types';
|
|
2
|
+
export declare function initHandler(message: MiniProgramDevtools.InitMsg): Promise<void>;
|
|
3
|
+
export declare function destroy(): Promise<void>;
|
|
4
|
+
export declare const onMessage: (fn: (...args: any[]) => any) => void;
|
|
5
|
+
export declare function messageHandler(message: MiniProgramDevtools.SummerProcessMessage): Promise<void>;
|
|
@@ -37,6 +37,13 @@ export declare namespace MiniProgramDevtools {
|
|
|
37
37
|
outputPath?: string;
|
|
38
38
|
rc?: Record<string, any>;
|
|
39
39
|
};
|
|
40
|
+
type ISassSetting = {
|
|
41
|
+
scssCommonUseFilePath?: string;
|
|
42
|
+
sassCommonUseFilePath?: string;
|
|
43
|
+
};
|
|
44
|
+
type ILessSetting = {
|
|
45
|
+
commonUseFilePath?: string;
|
|
46
|
+
};
|
|
40
47
|
interface IDevtoolsProjectInfo {
|
|
41
48
|
appid: string;
|
|
42
49
|
attr: any;
|
|
@@ -189,6 +196,8 @@ export declare namespace MiniProgramDevtools {
|
|
|
189
196
|
enhance?: boolean;
|
|
190
197
|
swc?: boolean;
|
|
191
198
|
swcSetting?: ISWCSetting;
|
|
199
|
+
sassSetting?: ISassSetting;
|
|
200
|
+
lessSetting?: ILessSetting;
|
|
192
201
|
disableSWC?: boolean | null | undefined;
|
|
193
202
|
coverView?: boolean;
|
|
194
203
|
showShadowRootInWxmlPanel?: boolean;
|
|
@@ -69,14 +69,18 @@ export declare namespace MiniProgramSummer {
|
|
|
69
69
|
process: IPluginProcessInfo[];
|
|
70
70
|
}
|
|
71
71
|
type ITransformResult = ILoadResult;
|
|
72
|
-
type AsyncPluginHooks = 'load' | 'transform' | 'optimize' | 'generate' | 'compress' | 'sealed';
|
|
73
|
-
type FirstPluginHooks = 'load' | 'generate';
|
|
72
|
+
type AsyncPluginHooks = 'load' | 'transform' | 'optimize' | 'generate' | 'compress' | 'sealed' | 'compile';
|
|
73
|
+
type FirstPluginHooks = 'load' | 'generate' | 'compile';
|
|
74
74
|
type SequentialPluginHooks = 'transform' | 'optimize' | 'compress';
|
|
75
75
|
type ParallelPluginHooks = 'sealed';
|
|
76
76
|
type LoadHook = (this: PluginContext, targetPath: string, sourcePath: string, options: {
|
|
77
77
|
independentRoot: string;
|
|
78
78
|
isBabelIgnore: boolean;
|
|
79
79
|
}) => Promise<ILoadResult | undefined>;
|
|
80
|
+
type CompileHook = (this: PluginContext, targetPath: string, sourcePath: string, loadResult: ILoadResult, options: {
|
|
81
|
+
independentRoot: string;
|
|
82
|
+
isBabelIgnore: boolean;
|
|
83
|
+
} & ICompileOptions) => Promise<IGenerateResult | undefined>;
|
|
80
84
|
type TransformHook = (this: PluginContext, loadResult: ILoadResult, targetPath: string, sourcePath: string, options: {
|
|
81
85
|
independentRoot: string;
|
|
82
86
|
isBabelIgnore: boolean;
|
|
@@ -98,6 +102,7 @@ export declare namespace MiniProgramSummer {
|
|
|
98
102
|
optimize: OptimizeHook;
|
|
99
103
|
compress: CompressHook;
|
|
100
104
|
sealed: SealedHook;
|
|
105
|
+
compile: CompileHook;
|
|
101
106
|
}
|
|
102
107
|
interface ResolveExt {
|
|
103
108
|
json?: string | string[];
|
|
@@ -4,7 +4,7 @@ declare const hash: any;
|
|
|
4
4
|
declare const transformSync: any;
|
|
5
5
|
declare const traverse: any;
|
|
6
6
|
declare const parse: any;
|
|
7
|
-
declare const
|
|
7
|
+
declare const nodePath: any;
|
|
8
8
|
declare const buildBindFunc: (func: any) => any;
|
|
9
9
|
declare const buildWorkletFunc: (func: any) => any;
|
|
10
10
|
declare const globals: Set<string>;
|
|
@@ -23,7 +23,16 @@ declare function buildWorkletString(t: any, fun: any, closureVariables: any, nam
|
|
|
23
23
|
declare function generateWorkletFactory(t: any, fun: any): any;
|
|
24
24
|
declare function removeWorkletDirective(fun: any): undefined;
|
|
25
25
|
declare function makeWorkletName(t: any, fun: any): any;
|
|
26
|
+
declare function extractWorkletData(t: any, fun: any, fileName: any): {
|
|
27
|
+
variables: any[];
|
|
28
|
+
closure: Map<any, any>;
|
|
29
|
+
closureGenerator: ClosureGenerator;
|
|
30
|
+
funString: any;
|
|
31
|
+
workletHash: any;
|
|
32
|
+
locationFileName: any;
|
|
33
|
+
};
|
|
26
34
|
declare function makeWorklet(t: any, fun: any, fileName: any): any;
|
|
35
|
+
declare function buildWorkletProperties(t: any, fun: any, fileName: any): any;
|
|
27
36
|
declare function processWorkletFunction(t: any, fun: any, fileName: any): void;
|
|
28
37
|
declare function processIfWorkletNode(t: any, fun: any, fileName: any): void;
|
|
29
38
|
declare const FUNCTIONLESS_FLAG = 1;
|
|
@@ -6,6 +6,6 @@ export declare function getHelperOutputPath(setting: MiniProgramDevtools.IProjec
|
|
|
6
6
|
export declare function getHelperContent(setting: MiniProgramDevtools.IProjectSetting, mod: string): Promise<string>;
|
|
7
7
|
export declare function getHelperDeps(setting: MiniProgramDevtools.IProjectSetting, helpers: Set<string>): string[];
|
|
8
8
|
export declare function appendHelpers(project: IProjectLike, helperSet: Set<string>, root: string, resultMap: MiniProgramCore.IAnyObject): Promise<void[]>;
|
|
9
|
-
export declare function isValidHelperFunc(funcName: string): "
|
|
9
|
+
export declare function isValidHelperFunc(funcName: string): "babel" | "swc" | undefined;
|
|
10
10
|
export declare function getHelperName(setting: MiniProgramDevtools.IProjectSetting, mod: string): string;
|
|
11
11
|
export {};
|
|
@@ -27,6 +27,7 @@ declare class PackOptionsHelper {
|
|
|
27
27
|
isIgnoreByUnusedFiles(file: string, production?: boolean): boolean;
|
|
28
28
|
getUnusedFiles(): Set<string>;
|
|
29
29
|
isScssOnlyImportedByFile(module: IModule): boolean;
|
|
30
|
+
clearUnusedFiles(): void;
|
|
30
31
|
initUnusedFiles(project: MiniProgramCore.IPreCompileProject, analyzer: Analyzer | null, production?: boolean): Promise<void>;
|
|
31
32
|
}
|
|
32
33
|
declare const _default: PackOptionsHelper;
|
|
@@ -16,10 +16,11 @@ export declare class SubProcessProxy {
|
|
|
16
16
|
miniappDirPath?: string;
|
|
17
17
|
devtoolsVersion?: string;
|
|
18
18
|
}, initOptions: any, inspectPort?: number, progressUpdate?: MiniProgramDevtools.ProgressUpdate | undefined);
|
|
19
|
-
|
|
19
|
+
ready(): Promise<any>;
|
|
20
20
|
private sendProcessMessage;
|
|
21
21
|
private init;
|
|
22
22
|
destroy(): void;
|
|
23
|
+
private getInProcessHandler;
|
|
23
24
|
private forkProcess;
|
|
24
25
|
private onMessage;
|
|
25
26
|
private onResponse;
|