@lcap/nasl-unified-frontend-generator 4.1.0-beta.2 → 4.1.0-beta.20
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.mts +107 -17
- package/dist/index.d.ts +107 -17
- package/dist/index.js +325 -205
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +321 -200
- package/dist/index.mjs.map +1 -1
- package/dist/playground.js +129551 -223
- package/dist/playground.js.map +1 -1
- package/dist/playground.mjs +129547 -218
- package/dist/playground.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -28,6 +28,7 @@ interface CommonAppConfig {
|
|
|
28
28
|
isExport?: boolean;
|
|
29
29
|
needCompileViews?: string[];
|
|
30
30
|
cacheChunksMapCode?: string;
|
|
31
|
+
feLoadDependenciesOnDemand?: boolean;
|
|
31
32
|
/**
|
|
32
33
|
* 插件用的配置项
|
|
33
34
|
*/
|
|
@@ -172,6 +173,10 @@ type Package = {
|
|
|
172
173
|
name: string;
|
|
173
174
|
version: string;
|
|
174
175
|
hasCss?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* 是否被应用使用
|
|
178
|
+
*/
|
|
179
|
+
used?: boolean;
|
|
175
180
|
};
|
|
176
181
|
type IdentifierString = string & {
|
|
177
182
|
readonly __tag?: unique symbol;
|
|
@@ -582,7 +587,7 @@ declare function bindAttrToIR(b: BindAttribute | (Omit<BindAttribute, 'type' | '
|
|
|
582
587
|
scopeVariable: string | undefined;
|
|
583
588
|
name: string;
|
|
584
589
|
}): BindAttributeIR | undefined;
|
|
585
|
-
declare function logicToLogicIR(logic:
|
|
590
|
+
declare function logicToLogicIR(logic: any): LogicIR;
|
|
586
591
|
declare function inferChangeEventNameFromAttrName(attrName: string): string;
|
|
587
592
|
declare function bindViewElementEventToIR(b: BindEvent): BindEventIR;
|
|
588
593
|
declare function bindEventToAction(b: BindEventIR): StateActionIR;
|
|
@@ -691,16 +696,18 @@ declare class FileSystemPlugin implements GeneratorInfrastructureDomain.FileSyst
|
|
|
691
696
|
|
|
692
697
|
type AnalyzerOptions = {
|
|
693
698
|
asyncAnalysis?: boolean;
|
|
699
|
+
depAnalysis?: boolean;
|
|
694
700
|
};
|
|
695
701
|
type AnalyzerManager = {
|
|
696
702
|
setOptions(options: AnalyzerOptions): void;
|
|
697
703
|
};
|
|
698
|
-
declare class AnalyzerManagerPlugin implements AnalyzerManager, NASLDomain.IRPreProcesser {
|
|
704
|
+
declare class AnalyzerManagerPlugin implements AnalyzerManager, NASLDomain.IRPreProcesser, NASLDomain.IRPostProcesser {
|
|
699
705
|
preProcess(app: App, frontend: Frontend, config: CommonAppConfig): {
|
|
700
706
|
app: App;
|
|
701
707
|
frontend: Frontend;
|
|
702
708
|
config: CommonAppConfig;
|
|
703
709
|
};
|
|
710
|
+
postProcess(ir: NASLAppIR, config: CommonAppConfig): NASLAppIR;
|
|
704
711
|
private options;
|
|
705
712
|
/**
|
|
706
713
|
* 设置完整的分析选项
|
|
@@ -712,7 +719,7 @@ declare class AnalyzerManagerPlugin implements AnalyzerManager, NASLDomain.IRPre
|
|
|
712
719
|
* @returns 分析选项
|
|
713
720
|
*/
|
|
714
721
|
getOptions(): AnalyzerOptions;
|
|
715
|
-
static install(c: Container):
|
|
722
|
+
static install(c: Container): Container;
|
|
716
723
|
}
|
|
717
724
|
|
|
718
725
|
declare class NameManglerManagerPlugin implements NASLDomain.IRPreProcesser {
|
|
@@ -754,6 +761,7 @@ declare class ReactPresetPlugin implements Generator.NASLTranspiler {
|
|
|
754
761
|
frontend: Frontend;
|
|
755
762
|
config: CommonAppConfig;
|
|
756
763
|
baseDir: string;
|
|
764
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
757
765
|
}): Promise<OrganizedFile[]>;
|
|
758
766
|
static install(container: Container): Container;
|
|
759
767
|
}
|
|
@@ -793,6 +801,85 @@ type Folder = {
|
|
|
793
801
|
};
|
|
794
802
|
type FolderPath = [Folder] | [Folder, ...Folder[]];
|
|
795
803
|
|
|
804
|
+
type CompilerConfigOptions = Partial<{
|
|
805
|
+
backendUrl: string;
|
|
806
|
+
publicPath: string;
|
|
807
|
+
aliasMapStr: string;
|
|
808
|
+
}>;
|
|
809
|
+
/**
|
|
810
|
+
* 前端打包器配置插件
|
|
811
|
+
* 将 backendUrl aliasMapStr publicPath 等动态信息保存到 FrontendBundlerConfigPlugin 插件中
|
|
812
|
+
*/
|
|
813
|
+
declare class FrontendBundlerConfigPlugin {
|
|
814
|
+
private compilerConfig;
|
|
815
|
+
setCompilerConfig(config: CompilerConfigOptions): void;
|
|
816
|
+
getCompilerConfig(): {
|
|
817
|
+
backendUrl: string;
|
|
818
|
+
publicPath: string;
|
|
819
|
+
aliasMapStr: string;
|
|
820
|
+
};
|
|
821
|
+
static install(c: Container): Container;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
type FS$2 = GeneratorInfrastructureDomain.FileSystemProvider;
|
|
825
|
+
declare class BundlerConfigDataPlugin {
|
|
826
|
+
private frontendBundlerConfigPlugin;
|
|
827
|
+
constructor(frontendBundlerConfigPlugin: FrontendBundlerConfigPlugin);
|
|
828
|
+
getBundlerConfigData(app: App, frontend: Frontend, config: CommonAppConfig, fs: FS$2, frameworkKind: 'vue3' | 'react' | 'vue2'): Promise<{
|
|
829
|
+
backendUrl: string;
|
|
830
|
+
publicPath: string;
|
|
831
|
+
aliasMapStr: string;
|
|
832
|
+
dependenciesStr: string | undefined;
|
|
833
|
+
}>;
|
|
834
|
+
static install(c: Container): Container;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
type PerformanceOptions = Partial<{
|
|
838
|
+
lazy: boolean;
|
|
839
|
+
chunks: 'initial' | 'all' | 'async';
|
|
840
|
+
}>;
|
|
841
|
+
/**
|
|
842
|
+
* 前端制品调优插件
|
|
843
|
+
* 用于外部调用来设置前端页面打包器的性能优化参数,例如页面懒加载 lazy,以及分包策略 chunks 等
|
|
844
|
+
*/
|
|
845
|
+
declare class FrontendPerformancePlugin {
|
|
846
|
+
performanceOptions: {
|
|
847
|
+
lazy: boolean;
|
|
848
|
+
chunks: string;
|
|
849
|
+
};
|
|
850
|
+
setOptions(options: PerformanceOptions): void;
|
|
851
|
+
static install(c: Container): Container;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
type FS$1 = GeneratorInfrastructureDomain.FileSystemProvider;
|
|
855
|
+
declare class RspackConfigPlugin {
|
|
856
|
+
private bundlerConfigDataPlugin;
|
|
857
|
+
private frontendPerformancePlugin;
|
|
858
|
+
constructor(bundlerConfigDataPlugin: BundlerConfigDataPlugin, frontendPerformancePlugin: FrontendPerformancePlugin);
|
|
859
|
+
configBundlerConfig(instruction: {
|
|
860
|
+
app: App;
|
|
861
|
+
frontend: Frontend;
|
|
862
|
+
config: CommonAppConfig;
|
|
863
|
+
fs: FS$1;
|
|
864
|
+
frameworkKind: 'vue3' | 'react' | 'vue2';
|
|
865
|
+
}): Promise<ReactFileDescription>;
|
|
866
|
+
/**
|
|
867
|
+
* 处理按需加载
|
|
868
|
+
* 注意:此功能仅在非dev环境下的vue3框架中可以启用。
|
|
869
|
+
* @param source 源代码
|
|
870
|
+
* @param options 选项
|
|
871
|
+
* @returns 处理后的代码
|
|
872
|
+
*/
|
|
873
|
+
processLoadOnDemand(source: string, options: {
|
|
874
|
+
app: App;
|
|
875
|
+
frontend: Frontend;
|
|
876
|
+
config: CommonAppConfig;
|
|
877
|
+
fs: FS$1;
|
|
878
|
+
frameworkKind: 'vue3' | 'react' | 'vue2';
|
|
879
|
+
}): Promise<string>;
|
|
880
|
+
static install(c: Container): Container;
|
|
881
|
+
}
|
|
882
|
+
|
|
796
883
|
/**
|
|
797
884
|
* 各类React Hooks
|
|
798
885
|
*/
|
|
@@ -1123,8 +1210,9 @@ declare class ReactCodegenPlugin implements JavaScriptDomain.FrontendApplication
|
|
|
1123
1210
|
frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance;
|
|
1124
1211
|
private projectOrganizer;
|
|
1125
1212
|
private entrypointManager;
|
|
1213
|
+
private rspackConfigPlugin;
|
|
1126
1214
|
private reactHookProviders?;
|
|
1127
|
-
constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, entrypointManager: JavaScriptDomain.FrontendApplicationDomain.EntrypointManager, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
|
|
1215
|
+
constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, entrypointManager: JavaScriptDomain.FrontendApplicationDomain.EntrypointManager, rspackConfigPlugin: RspackConfigPlugin, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
|
|
1128
1216
|
genReactFragment(c: ComponentInstanceIR, ctx: StateContextIR): ReactFragment;
|
|
1129
1217
|
/**
|
|
1130
1218
|
* 根据组件声明信息和文件夹信息生成React组件
|
|
@@ -1165,7 +1253,13 @@ declare class ReactCodegenPlugin implements JavaScriptDomain.FrontendApplication
|
|
|
1165
1253
|
* @param baseDir - 基目录
|
|
1166
1254
|
* @returns 组织后的文件列表
|
|
1167
1255
|
*/
|
|
1168
|
-
genFiles(ir: NASLAppIR,
|
|
1256
|
+
genFiles(ir: NASLAppIR, instruction: {
|
|
1257
|
+
app: App;
|
|
1258
|
+
frontend: Frontend;
|
|
1259
|
+
config: CommonAppConfig;
|
|
1260
|
+
baseDir: string;
|
|
1261
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
1262
|
+
}): Promise<OrganizedFile[]>;
|
|
1169
1263
|
}
|
|
1170
1264
|
|
|
1171
1265
|
declare const reactComponentLibHackPlugin: {
|
|
@@ -1262,17 +1356,6 @@ declare class ReactStateManagerMobxPlugin implements JavaScriptDomain.FrontendAp
|
|
|
1262
1356
|
static install(container: Container): Container;
|
|
1263
1357
|
}
|
|
1264
1358
|
|
|
1265
|
-
type PerformanceOptions = Partial<{
|
|
1266
|
-
lazy: boolean;
|
|
1267
|
-
chunks: 'initial' | 'all' | 'async';
|
|
1268
|
-
}>;
|
|
1269
|
-
|
|
1270
|
-
type CompilerConfigOptions = Partial<{
|
|
1271
|
-
backendUrl: string;
|
|
1272
|
-
publicPath: string;
|
|
1273
|
-
aliasMapStr: string;
|
|
1274
|
-
}>;
|
|
1275
|
-
|
|
1276
1359
|
/**
|
|
1277
1360
|
*
|
|
1278
1361
|
*/
|
|
@@ -1291,6 +1374,7 @@ declare namespace Generator {
|
|
|
1291
1374
|
frontend: Frontend;
|
|
1292
1375
|
config: CommonAppConfig;
|
|
1293
1376
|
baseDir: string;
|
|
1377
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
1294
1378
|
}): Promise<OrganizedFile[]>;
|
|
1295
1379
|
}
|
|
1296
1380
|
}
|
|
@@ -1599,7 +1683,13 @@ declare namespace JavaScriptDomain {
|
|
|
1599
1683
|
* @param ir - NASL应用IR
|
|
1600
1684
|
* @param baseDir - 项目根目录
|
|
1601
1685
|
*/
|
|
1602
|
-
genFiles(ir: NASLAppIR,
|
|
1686
|
+
genFiles(ir: NASLAppIR, instruction: {
|
|
1687
|
+
app: App;
|
|
1688
|
+
frontend: Frontend;
|
|
1689
|
+
config: CommonAppConfig;
|
|
1690
|
+
baseDir: string;
|
|
1691
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
1692
|
+
}): Promise<OrganizedFile[]>;
|
|
1603
1693
|
}
|
|
1604
1694
|
/**
|
|
1605
1695
|
* React路由接口
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ interface CommonAppConfig {
|
|
|
28
28
|
isExport?: boolean;
|
|
29
29
|
needCompileViews?: string[];
|
|
30
30
|
cacheChunksMapCode?: string;
|
|
31
|
+
feLoadDependenciesOnDemand?: boolean;
|
|
31
32
|
/**
|
|
32
33
|
* 插件用的配置项
|
|
33
34
|
*/
|
|
@@ -172,6 +173,10 @@ type Package = {
|
|
|
172
173
|
name: string;
|
|
173
174
|
version: string;
|
|
174
175
|
hasCss?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* 是否被应用使用
|
|
178
|
+
*/
|
|
179
|
+
used?: boolean;
|
|
175
180
|
};
|
|
176
181
|
type IdentifierString = string & {
|
|
177
182
|
readonly __tag?: unique symbol;
|
|
@@ -582,7 +587,7 @@ declare function bindAttrToIR(b: BindAttribute | (Omit<BindAttribute, 'type' | '
|
|
|
582
587
|
scopeVariable: string | undefined;
|
|
583
588
|
name: string;
|
|
584
589
|
}): BindAttributeIR | undefined;
|
|
585
|
-
declare function logicToLogicIR(logic:
|
|
590
|
+
declare function logicToLogicIR(logic: any): LogicIR;
|
|
586
591
|
declare function inferChangeEventNameFromAttrName(attrName: string): string;
|
|
587
592
|
declare function bindViewElementEventToIR(b: BindEvent): BindEventIR;
|
|
588
593
|
declare function bindEventToAction(b: BindEventIR): StateActionIR;
|
|
@@ -691,16 +696,18 @@ declare class FileSystemPlugin implements GeneratorInfrastructureDomain.FileSyst
|
|
|
691
696
|
|
|
692
697
|
type AnalyzerOptions = {
|
|
693
698
|
asyncAnalysis?: boolean;
|
|
699
|
+
depAnalysis?: boolean;
|
|
694
700
|
};
|
|
695
701
|
type AnalyzerManager = {
|
|
696
702
|
setOptions(options: AnalyzerOptions): void;
|
|
697
703
|
};
|
|
698
|
-
declare class AnalyzerManagerPlugin implements AnalyzerManager, NASLDomain.IRPreProcesser {
|
|
704
|
+
declare class AnalyzerManagerPlugin implements AnalyzerManager, NASLDomain.IRPreProcesser, NASLDomain.IRPostProcesser {
|
|
699
705
|
preProcess(app: App, frontend: Frontend, config: CommonAppConfig): {
|
|
700
706
|
app: App;
|
|
701
707
|
frontend: Frontend;
|
|
702
708
|
config: CommonAppConfig;
|
|
703
709
|
};
|
|
710
|
+
postProcess(ir: NASLAppIR, config: CommonAppConfig): NASLAppIR;
|
|
704
711
|
private options;
|
|
705
712
|
/**
|
|
706
713
|
* 设置完整的分析选项
|
|
@@ -712,7 +719,7 @@ declare class AnalyzerManagerPlugin implements AnalyzerManager, NASLDomain.IRPre
|
|
|
712
719
|
* @returns 分析选项
|
|
713
720
|
*/
|
|
714
721
|
getOptions(): AnalyzerOptions;
|
|
715
|
-
static install(c: Container):
|
|
722
|
+
static install(c: Container): Container;
|
|
716
723
|
}
|
|
717
724
|
|
|
718
725
|
declare class NameManglerManagerPlugin implements NASLDomain.IRPreProcesser {
|
|
@@ -754,6 +761,7 @@ declare class ReactPresetPlugin implements Generator.NASLTranspiler {
|
|
|
754
761
|
frontend: Frontend;
|
|
755
762
|
config: CommonAppConfig;
|
|
756
763
|
baseDir: string;
|
|
764
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
757
765
|
}): Promise<OrganizedFile[]>;
|
|
758
766
|
static install(container: Container): Container;
|
|
759
767
|
}
|
|
@@ -793,6 +801,85 @@ type Folder = {
|
|
|
793
801
|
};
|
|
794
802
|
type FolderPath = [Folder] | [Folder, ...Folder[]];
|
|
795
803
|
|
|
804
|
+
type CompilerConfigOptions = Partial<{
|
|
805
|
+
backendUrl: string;
|
|
806
|
+
publicPath: string;
|
|
807
|
+
aliasMapStr: string;
|
|
808
|
+
}>;
|
|
809
|
+
/**
|
|
810
|
+
* 前端打包器配置插件
|
|
811
|
+
* 将 backendUrl aliasMapStr publicPath 等动态信息保存到 FrontendBundlerConfigPlugin 插件中
|
|
812
|
+
*/
|
|
813
|
+
declare class FrontendBundlerConfigPlugin {
|
|
814
|
+
private compilerConfig;
|
|
815
|
+
setCompilerConfig(config: CompilerConfigOptions): void;
|
|
816
|
+
getCompilerConfig(): {
|
|
817
|
+
backendUrl: string;
|
|
818
|
+
publicPath: string;
|
|
819
|
+
aliasMapStr: string;
|
|
820
|
+
};
|
|
821
|
+
static install(c: Container): Container;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
type FS$2 = GeneratorInfrastructureDomain.FileSystemProvider;
|
|
825
|
+
declare class BundlerConfigDataPlugin {
|
|
826
|
+
private frontendBundlerConfigPlugin;
|
|
827
|
+
constructor(frontendBundlerConfigPlugin: FrontendBundlerConfigPlugin);
|
|
828
|
+
getBundlerConfigData(app: App, frontend: Frontend, config: CommonAppConfig, fs: FS$2, frameworkKind: 'vue3' | 'react' | 'vue2'): Promise<{
|
|
829
|
+
backendUrl: string;
|
|
830
|
+
publicPath: string;
|
|
831
|
+
aliasMapStr: string;
|
|
832
|
+
dependenciesStr: string | undefined;
|
|
833
|
+
}>;
|
|
834
|
+
static install(c: Container): Container;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
type PerformanceOptions = Partial<{
|
|
838
|
+
lazy: boolean;
|
|
839
|
+
chunks: 'initial' | 'all' | 'async';
|
|
840
|
+
}>;
|
|
841
|
+
/**
|
|
842
|
+
* 前端制品调优插件
|
|
843
|
+
* 用于外部调用来设置前端页面打包器的性能优化参数,例如页面懒加载 lazy,以及分包策略 chunks 等
|
|
844
|
+
*/
|
|
845
|
+
declare class FrontendPerformancePlugin {
|
|
846
|
+
performanceOptions: {
|
|
847
|
+
lazy: boolean;
|
|
848
|
+
chunks: string;
|
|
849
|
+
};
|
|
850
|
+
setOptions(options: PerformanceOptions): void;
|
|
851
|
+
static install(c: Container): Container;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
type FS$1 = GeneratorInfrastructureDomain.FileSystemProvider;
|
|
855
|
+
declare class RspackConfigPlugin {
|
|
856
|
+
private bundlerConfigDataPlugin;
|
|
857
|
+
private frontendPerformancePlugin;
|
|
858
|
+
constructor(bundlerConfigDataPlugin: BundlerConfigDataPlugin, frontendPerformancePlugin: FrontendPerformancePlugin);
|
|
859
|
+
configBundlerConfig(instruction: {
|
|
860
|
+
app: App;
|
|
861
|
+
frontend: Frontend;
|
|
862
|
+
config: CommonAppConfig;
|
|
863
|
+
fs: FS$1;
|
|
864
|
+
frameworkKind: 'vue3' | 'react' | 'vue2';
|
|
865
|
+
}): Promise<ReactFileDescription>;
|
|
866
|
+
/**
|
|
867
|
+
* 处理按需加载
|
|
868
|
+
* 注意:此功能仅在非dev环境下的vue3框架中可以启用。
|
|
869
|
+
* @param source 源代码
|
|
870
|
+
* @param options 选项
|
|
871
|
+
* @returns 处理后的代码
|
|
872
|
+
*/
|
|
873
|
+
processLoadOnDemand(source: string, options: {
|
|
874
|
+
app: App;
|
|
875
|
+
frontend: Frontend;
|
|
876
|
+
config: CommonAppConfig;
|
|
877
|
+
fs: FS$1;
|
|
878
|
+
frameworkKind: 'vue3' | 'react' | 'vue2';
|
|
879
|
+
}): Promise<string>;
|
|
880
|
+
static install(c: Container): Container;
|
|
881
|
+
}
|
|
882
|
+
|
|
796
883
|
/**
|
|
797
884
|
* 各类React Hooks
|
|
798
885
|
*/
|
|
@@ -1123,8 +1210,9 @@ declare class ReactCodegenPlugin implements JavaScriptDomain.FrontendApplication
|
|
|
1123
1210
|
frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance;
|
|
1124
1211
|
private projectOrganizer;
|
|
1125
1212
|
private entrypointManager;
|
|
1213
|
+
private rspackConfigPlugin;
|
|
1126
1214
|
private reactHookProviders?;
|
|
1127
|
-
constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, entrypointManager: JavaScriptDomain.FrontendApplicationDomain.EntrypointManager, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
|
|
1215
|
+
constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, entrypointManager: JavaScriptDomain.FrontendApplicationDomain.EntrypointManager, rspackConfigPlugin: RspackConfigPlugin, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
|
|
1128
1216
|
genReactFragment(c: ComponentInstanceIR, ctx: StateContextIR): ReactFragment;
|
|
1129
1217
|
/**
|
|
1130
1218
|
* 根据组件声明信息和文件夹信息生成React组件
|
|
@@ -1165,7 +1253,13 @@ declare class ReactCodegenPlugin implements JavaScriptDomain.FrontendApplication
|
|
|
1165
1253
|
* @param baseDir - 基目录
|
|
1166
1254
|
* @returns 组织后的文件列表
|
|
1167
1255
|
*/
|
|
1168
|
-
genFiles(ir: NASLAppIR,
|
|
1256
|
+
genFiles(ir: NASLAppIR, instruction: {
|
|
1257
|
+
app: App;
|
|
1258
|
+
frontend: Frontend;
|
|
1259
|
+
config: CommonAppConfig;
|
|
1260
|
+
baseDir: string;
|
|
1261
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
1262
|
+
}): Promise<OrganizedFile[]>;
|
|
1169
1263
|
}
|
|
1170
1264
|
|
|
1171
1265
|
declare const reactComponentLibHackPlugin: {
|
|
@@ -1262,17 +1356,6 @@ declare class ReactStateManagerMobxPlugin implements JavaScriptDomain.FrontendAp
|
|
|
1262
1356
|
static install(container: Container): Container;
|
|
1263
1357
|
}
|
|
1264
1358
|
|
|
1265
|
-
type PerformanceOptions = Partial<{
|
|
1266
|
-
lazy: boolean;
|
|
1267
|
-
chunks: 'initial' | 'all' | 'async';
|
|
1268
|
-
}>;
|
|
1269
|
-
|
|
1270
|
-
type CompilerConfigOptions = Partial<{
|
|
1271
|
-
backendUrl: string;
|
|
1272
|
-
publicPath: string;
|
|
1273
|
-
aliasMapStr: string;
|
|
1274
|
-
}>;
|
|
1275
|
-
|
|
1276
1359
|
/**
|
|
1277
1360
|
*
|
|
1278
1361
|
*/
|
|
@@ -1291,6 +1374,7 @@ declare namespace Generator {
|
|
|
1291
1374
|
frontend: Frontend;
|
|
1292
1375
|
config: CommonAppConfig;
|
|
1293
1376
|
baseDir: string;
|
|
1377
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
1294
1378
|
}): Promise<OrganizedFile[]>;
|
|
1295
1379
|
}
|
|
1296
1380
|
}
|
|
@@ -1599,7 +1683,13 @@ declare namespace JavaScriptDomain {
|
|
|
1599
1683
|
* @param ir - NASL应用IR
|
|
1600
1684
|
* @param baseDir - 项目根目录
|
|
1601
1685
|
*/
|
|
1602
|
-
genFiles(ir: NASLAppIR,
|
|
1686
|
+
genFiles(ir: NASLAppIR, instruction: {
|
|
1687
|
+
app: App;
|
|
1688
|
+
frontend: Frontend;
|
|
1689
|
+
config: CommonAppConfig;
|
|
1690
|
+
baseDir: string;
|
|
1691
|
+
fs: GeneratorInfrastructureDomain.FileSystemProvider;
|
|
1692
|
+
}): Promise<OrganizedFile[]>;
|
|
1603
1693
|
}
|
|
1604
1694
|
/**
|
|
1605
1695
|
* React路由接口
|