xhs-mp-compiler-cli 2.0.4-beta.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,95 +1 @@
1
- import { COMPILE_ENTRY } from './config/constant.config';
2
- import { Project } from 'xhs-mp-project';
3
- import EventEmitter from 'events';
4
- import { Logger } from 'xhs-mp-shared';
5
- import { prepareDevPool } from './compiler';
6
- export { COMPILE_ENTRY, prepareDevPool };
7
- interface ILibFeatures {
8
- supportV2?: boolean;
9
- supportVDom?: boolean;
10
- }
11
- export type IArchType = 'v0' | 'v1' | 'v2';
12
- export type IZipResult = {
13
- type: IArchType;
14
- zipPath: string;
15
- zipSize: number;
16
- root: string;
17
- originSize: number;
18
- };
19
- export type ICompileOpts = {
20
- logger?: any;
21
- report?: (key: string, data?: any) => void;
22
- compileDistDir?: string;
23
- compileCacheDir?: string;
24
- nodeJsPath?: string;
25
- getLibFeatures?: () => Promise<ILibFeatures>;
26
- };
27
- export type ICompilerProps = {
28
- projectPath?: string;
29
- project?: Project;
30
- } & ICompileOpts;
31
- interface ICompileBaseConfig {
32
- compressCss?: boolean;
33
- compressJs?: boolean;
34
- enableSourcemap?: boolean;
35
- appendSourcemapComment?: boolean;
36
- runInServiceSandbox?: boolean;
37
- enableV2?: boolean;
38
- enableV1?: boolean;
39
- enableVDom?: boolean;
40
- }
41
- type IMakePkgsReadyConfig = ICompileBaseConfig & {
42
- compilePkgs?: string[];
43
- };
44
- type ICompilePkgsConfig = ICompileBaseConfig & {
45
- compilePkgs?: string[];
46
- };
47
- type ICompileProjectConfig = ICompileBaseConfig & {
48
- entryType?: string;
49
- mpUploadOptions?: ICompileAndZipOptions | false;
50
- };
51
- export interface ICompileAndZipOptions {
52
- entryType?: string;
53
- can_upload_ext_json?: boolean;
54
- upload_app_id?: string;
55
- pkgInfo?: {
56
- version: string;
57
- };
58
- }
59
- export interface ISubPackages {
60
- root: string;
61
- pages: string;
62
- }
63
- export declare class ProjectCompilerManager extends EventEmitter {
64
- compilerProps: ICompilerProps;
65
- project: Project;
66
- compilerImplMap: {};
67
- logger: Logger;
68
- report?: (key: string, data?: any) => void;
69
- constructor(props: ICompilerProps);
70
- bindProject(props: any): void;
71
- private getCompilerType;
72
- getDistDir(entryType?: string): string;
73
- removeDistDir(entryType?: string): void;
74
- getCacheDir(entryType?: string): string;
75
- removeCacheDir(entryType?: string): void;
76
- removeAllCacheDir(): void;
77
- private createCompiler;
78
- private getCompiler;
79
- getUsingPackageType(entryType?: string): Promise<{
80
- enableV1: boolean;
81
- enableV2: boolean;
82
- enableVDom: boolean;
83
- }>;
84
- private initSimulatorCompiler;
85
- private initBuildCompiler;
86
- makePkgsReady(opts: IMakePkgsReadyConfig): Promise<void>;
87
- reCompilePkgs(opts: ICompilePkgsConfig): Promise<void>;
88
- compileProject(config: ICompileProjectConfig): Promise<void>;
89
- compileAndZip(opts: ICompileAndZipOptions): Promise<IZipResult[]>;
90
- closeCompiler(entryType?: string): void;
91
- killCompiler(entryType?: string): void;
92
- killAll(): void;
93
- private zipWithFullPackage;
94
- private zipWithSubPackage;
95
- }
1
+ export * from './compilerManager';