@modern-js/core 1.9.2 → 1.10.0

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 (130) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/compiled/ajv-keywords/index.d.ts +1 -0
  3. package/compiled/ajv-keywords/package.json +1 -1
  4. package/compiled/better-ajv-errors/index.d.ts +1 -0
  5. package/compiled/better-ajv-errors/package.json +1 -1
  6. package/compiled/v8-compile-cache/index.d.ts +1 -0
  7. package/compiled/v8-compile-cache/package.json +1 -1
  8. package/dist/config/index.d.ts +1 -1
  9. package/dist/config/index.js +19 -28
  10. package/dist/config/types/index.d.ts +36 -36
  11. package/dist/index.js +55 -60
  12. package/dist/initWatcher.js +3 -12
  13. package/package.json +7 -8
  14. package/tsconfig.json +1 -0
  15. package/compiled/ajv-keywords/ajv/dist/ajv.d.ts +0 -16
  16. package/compiled/ajv-keywords/ajv/dist/compile/codegen/code.d.ts +0 -40
  17. package/compiled/ajv-keywords/ajv/dist/compile/codegen/index.d.ts +0 -79
  18. package/compiled/ajv-keywords/ajv/dist/compile/codegen/scope.d.ts +0 -79
  19. package/compiled/ajv-keywords/ajv/dist/compile/errors.d.ts +0 -13
  20. package/compiled/ajv-keywords/ajv/dist/compile/index.d.ts +0 -80
  21. package/compiled/ajv-keywords/ajv/dist/compile/ref_error.d.ts +0 -6
  22. package/compiled/ajv-keywords/ajv/dist/compile/resolve.d.ts +0 -12
  23. package/compiled/ajv-keywords/ajv/dist/compile/rules.d.ts +0 -28
  24. package/compiled/ajv-keywords/ajv/dist/compile/util.d.ts +0 -40
  25. package/compiled/ajv-keywords/ajv/dist/compile/validate/index.d.ts +0 -42
  26. package/compiled/ajv-keywords/ajv/dist/compile/validate/subschema.d.ts +0 -47
  27. package/compiled/ajv-keywords/ajv/dist/core.d.ts +0 -173
  28. package/compiled/ajv-keywords/ajv/dist/runtime/validation_error.d.ts +0 -7
  29. package/compiled/ajv-keywords/ajv/dist/types/index.d.ts +0 -183
  30. package/compiled/ajv-keywords/ajv/dist/types/json-schema.d.ts +0 -124
  31. package/compiled/ajv-keywords/ajv/dist/types/jtd-schema.d.ts +0 -169
  32. package/compiled/ajv-keywords/dist/index.d.ts +0 -4
  33. package/compiled/ajv-keywords/uri-js/dist/es5/uri.all.d.ts +0 -59
  34. package/compiled/better-ajv-errors/ajv/dist/ajv.d.ts +0 -16
  35. package/compiled/better-ajv-errors/ajv/dist/compile/codegen/code.d.ts +0 -40
  36. package/compiled/better-ajv-errors/ajv/dist/compile/codegen/index.d.ts +0 -79
  37. package/compiled/better-ajv-errors/ajv/dist/compile/codegen/scope.d.ts +0 -79
  38. package/compiled/better-ajv-errors/ajv/dist/compile/errors.d.ts +0 -13
  39. package/compiled/better-ajv-errors/ajv/dist/compile/index.d.ts +0 -80
  40. package/compiled/better-ajv-errors/ajv/dist/compile/ref_error.d.ts +0 -6
  41. package/compiled/better-ajv-errors/ajv/dist/compile/resolve.d.ts +0 -12
  42. package/compiled/better-ajv-errors/ajv/dist/compile/rules.d.ts +0 -28
  43. package/compiled/better-ajv-errors/ajv/dist/compile/util.d.ts +0 -40
  44. package/compiled/better-ajv-errors/ajv/dist/compile/validate/index.d.ts +0 -42
  45. package/compiled/better-ajv-errors/ajv/dist/compile/validate/subschema.d.ts +0 -47
  46. package/compiled/better-ajv-errors/ajv/dist/core.d.ts +0 -173
  47. package/compiled/better-ajv-errors/ajv/dist/runtime/validation_error.d.ts +0 -7
  48. package/compiled/better-ajv-errors/ajv/dist/types/index.d.ts +0 -183
  49. package/compiled/better-ajv-errors/ajv/dist/types/json-schema.d.ts +0 -124
  50. package/compiled/better-ajv-errors/ajv/dist/types/jtd-schema.d.ts +0 -169
  51. package/compiled/better-ajv-errors/typings.d.ts +0 -24
  52. package/compiled/better-ajv-errors/uri-js/dist/es5/uri.all.d.ts +0 -59
  53. package/dist/js/modern/cli.js +0 -29
  54. package/dist/js/modern/config/defaults.js +0 -103
  55. package/dist/js/modern/config/index.js +0 -115
  56. package/dist/js/modern/config/mergeConfig.js +0 -22
  57. package/dist/js/modern/config/schema/deploy.js +0 -17
  58. package/dist/js/modern/config/schema/index.js +0 -107
  59. package/dist/js/modern/config/schema/output.js +0 -147
  60. package/dist/js/modern/config/schema/server.js +0 -170
  61. package/dist/js/modern/config/schema/source.js +0 -59
  62. package/dist/js/modern/config/schema/tools.js +0 -36
  63. package/dist/js/modern/config/types/electron.js +0 -1
  64. package/dist/js/modern/config/types/index.js +0 -1
  65. package/dist/js/modern/config/types/less.js +0 -0
  66. package/dist/js/modern/config/types/sass.js +0 -0
  67. package/dist/js/modern/config/types/ssg.js +0 -0
  68. package/dist/js/modern/config/types/test.js +0 -0
  69. package/dist/js/modern/config/types/unbundle.js +0 -0
  70. package/dist/js/modern/context.js +0 -63
  71. package/dist/js/modern/index.js +0 -169
  72. package/dist/js/modern/initWatcher.js +0 -62
  73. package/dist/js/modern/loadEnv.js +0 -14
  74. package/dist/js/modern/loadPlugins.js +0 -122
  75. package/dist/js/modern/manager.js +0 -28
  76. package/dist/js/modern/pluginAPI.js +0 -11
  77. package/dist/js/modern/utils/commander.js +0 -19
  78. package/dist/js/modern/utils/repeatKeyWarning.js +0 -18
  79. package/dist/js/node/cli.js +0 -35
  80. package/dist/js/node/config/defaults.js +0 -110
  81. package/dist/js/node/config/index.js +0 -182
  82. package/dist/js/node/config/mergeConfig.js +0 -32
  83. package/dist/js/node/config/schema/deploy.js +0 -26
  84. package/dist/js/node/config/schema/index.js +0 -127
  85. package/dist/js/node/config/schema/output.js +0 -156
  86. package/dist/js/node/config/schema/server.js +0 -179
  87. package/dist/js/node/config/schema/source.js +0 -68
  88. package/dist/js/node/config/schema/tools.js +0 -43
  89. package/dist/js/node/config/types/electron.js +0 -5
  90. package/dist/js/node/config/types/index.js +0 -5
  91. package/dist/js/node/config/types/less.js +0 -0
  92. package/dist/js/node/config/types/sass.js +0 -0
  93. package/dist/js/node/config/types/ssg.js +0 -0
  94. package/dist/js/node/config/types/test.js +0 -0
  95. package/dist/js/node/config/types/unbundle.js +0 -0
  96. package/dist/js/node/context.js +0 -93
  97. package/dist/js/node/index.js +0 -329
  98. package/dist/js/node/initWatcher.js +0 -82
  99. package/dist/js/node/loadEnv.js +0 -30
  100. package/dist/js/node/loadPlugins.js +0 -134
  101. package/dist/js/node/manager.js +0 -45
  102. package/dist/js/node/pluginAPI.js +0 -54
  103. package/dist/js/node/utils/commander.js +0 -32
  104. package/dist/js/node/utils/repeatKeyWarning.js +0 -31
  105. package/dist/types/cli.d.ts +0 -1
  106. package/dist/types/config/defaults.d.ts +0 -28
  107. package/dist/types/config/index.d.ts +0 -12
  108. package/dist/types/config/mergeConfig.d.ts +0 -31
  109. package/dist/types/config/schema/deploy.d.ts +0 -16
  110. package/dist/types/config/schema/index.d.ts +0 -466
  111. package/dist/types/config/schema/output.d.ts +0 -146
  112. package/dist/types/config/schema/server.d.ts +0 -182
  113. package/dist/types/config/schema/source.d.ts +0 -58
  114. package/dist/types/config/schema/tools.d.ts +0 -36
  115. package/dist/types/config/types/electron.d.ts +0 -13
  116. package/dist/types/config/types/index.d.ts +0 -252
  117. package/dist/types/config/types/less.d.ts +0 -10
  118. package/dist/types/config/types/sass.d.ts +0 -8
  119. package/dist/types/config/types/ssg.d.ts +0 -13
  120. package/dist/types/config/types/test.d.ts +0 -15
  121. package/dist/types/config/types/unbundle.d.ts +0 -28
  122. package/dist/types/context.d.ts +0 -47
  123. package/dist/types/index.d.ts +0 -64
  124. package/dist/types/initWatcher.d.ts +0 -3
  125. package/dist/types/loadEnv.d.ts +0 -1
  126. package/dist/types/loadPlugins.d.ts +0 -44
  127. package/dist/types/manager.d.ts +0 -75
  128. package/dist/types/pluginAPI.d.ts +0 -13
  129. package/dist/types/utils/commander.d.ts +0 -4
  130. package/dist/types/utils/repeatKeyWarning.d.ts +0 -3
@@ -1,182 +0,0 @@
1
- export declare const server: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- port: {
6
- type: string;
7
- };
8
- ssr: {
9
- if: {
10
- type: string;
11
- };
12
- then: {
13
- properties: {
14
- disableLoadable: {
15
- type: string;
16
- };
17
- disableHelmet: {
18
- type: string;
19
- };
20
- disableRedirect: {
21
- type: string;
22
- };
23
- enableAsyncData: {
24
- type: string;
25
- };
26
- enableProductWarning: {
27
- type: string;
28
- };
29
- timeout: {
30
- type: string;
31
- };
32
- asyncDataTimeout: {
33
- type: string;
34
- };
35
- };
36
- };
37
- else: {
38
- type: string;
39
- };
40
- };
41
- ssrByEntries: {
42
- type: string;
43
- patternProperties: {
44
- "^[a-zA-Z0-9_-]+$": {
45
- if: {
46
- type: string;
47
- };
48
- then: {
49
- properties: {
50
- disableLoadable: {
51
- type: string;
52
- };
53
- disableHelmet: {
54
- type: string;
55
- };
56
- disableRedirect: {
57
- type: string;
58
- };
59
- enableProductWarning: {
60
- type: string;
61
- };
62
- enableAsyncData: {
63
- type: string;
64
- };
65
- timeout: {
66
- type: string;
67
- };
68
- asyncDataTimeout: {
69
- type: string;
70
- };
71
- };
72
- additionalProperties: boolean;
73
- };
74
- else: {
75
- type: string;
76
- };
77
- };
78
- };
79
- };
80
- routes: {
81
- type: string;
82
- patternProperties: {
83
- "^[a-zA-Z0-9_-]+$": {
84
- if: {
85
- type: string;
86
- };
87
- then: {
88
- properties: {
89
- route: {
90
- oneOf: ({
91
- type: string;
92
- properties: {
93
- path: {
94
- type: string;
95
- };
96
- headers: {
97
- type: string;
98
- };
99
- };
100
- additionalProperties: boolean;
101
- } | {
102
- type: string;
103
- items?: undefined;
104
- } | {
105
- type: string;
106
- items: {
107
- oneOf: ({
108
- type: string;
109
- properties: {
110
- path: {
111
- type: string;
112
- };
113
- headers: {
114
- type: string;
115
- };
116
- };
117
- additionalProperties: boolean;
118
- } | {
119
- type: string;
120
- })[];
121
- };
122
- })[];
123
- };
124
- disableSpa: {
125
- type: string;
126
- };
127
- };
128
- additionalProperties: boolean;
129
- };
130
- else: {
131
- oneOf: ({
132
- type: string;
133
- items?: undefined;
134
- } | {
135
- type: string;
136
- items: {
137
- type: string;
138
- };
139
- })[];
140
- };
141
- };
142
- };
143
- };
144
- publicRoutes: {
145
- type: string;
146
- patternProperties: {
147
- "^[a-zA-Z0-9_-]+$": {
148
- type: string[];
149
- };
150
- };
151
- };
152
- baseUrl: {
153
- oneOf: ({
154
- type: string;
155
- items?: undefined;
156
- } | {
157
- type: string;
158
- items: {
159
- type: string;
160
- }[];
161
- })[];
162
- };
163
- middleware: {
164
- instanceof: string[];
165
- };
166
- renderHook: {
167
- instanceof: string;
168
- };
169
- logger: {
170
- type: string[];
171
- };
172
- metrics: {
173
- type: string[];
174
- };
175
- proxy: {
176
- type: string;
177
- };
178
- enableMicroFrontendDebug: {
179
- type: string;
180
- };
181
- };
182
- };
@@ -1,58 +0,0 @@
1
- export declare const source: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- entries: {
6
- type: string;
7
- patternProperties: {
8
- "^[a-zA-Z0-9_-]+$": {
9
- if: {
10
- type: string;
11
- };
12
- then: {
13
- required: string[];
14
- properties: {
15
- entry: {
16
- type: string[];
17
- };
18
- disableMount: {
19
- type: string;
20
- };
21
- enableFileSystemRoutes: {
22
- type: string;
23
- };
24
- };
25
- additionalProperties: boolean;
26
- };
27
- else: {
28
- type: string[];
29
- };
30
- };
31
- };
32
- };
33
- alias: {
34
- typeof: string[];
35
- };
36
- disableDefaultEntries: {
37
- type: string;
38
- };
39
- envVars: {
40
- type: string;
41
- };
42
- globalVars: {
43
- type: string;
44
- };
45
- moduleScopes: {
46
- instanceof: string[];
47
- };
48
- entriesDir: {
49
- type: string;
50
- };
51
- configDir: {
52
- type: string;
53
- };
54
- include: {
55
- type: string[];
56
- };
57
- };
58
- };
@@ -1,36 +0,0 @@
1
- export declare const tools: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- webpack: {
6
- typeof: string[];
7
- };
8
- babel: {
9
- typeof: string[];
10
- };
11
- postcss: {
12
- typeof: string[];
13
- };
14
- lodash: {
15
- typeof: string[];
16
- };
17
- devServer: {
18
- type: string;
19
- };
20
- tsLoader: {
21
- typeof: string[];
22
- };
23
- autoprefixer: {
24
- typeof: string[];
25
- };
26
- terser: {
27
- typeof: string[];
28
- };
29
- minifyCss: {
30
- typeof: string[];
31
- };
32
- styledComponents: {
33
- typeof: string[];
34
- };
35
- };
36
- };
@@ -1,13 +0,0 @@
1
- import { TransformOptions } from '@babel/core';
2
- import { Configuration } from 'electron-builder';
3
- export declare type BuildConfig = {
4
- baseConfig: Configuration;
5
- macConfig?: Configuration;
6
- winConfig?: Configuration;
7
- win64Config?: Configuration;
8
- linuxConfig?: Configuration;
9
- };
10
- export declare type ElectronConfig = {
11
- builder?: BuildConfig;
12
- babel?: TransformOptions | ((defaultBabelConfig: TransformOptions) => TransformOptions);
13
- };
@@ -1,252 +0,0 @@
1
- /// <reference types="node" />
2
- import type { IncomingMessage, ServerResponse } from 'http';
3
- import type { NextFunction, BffProxyOptions } from '@modern-js/types';
4
- import type { MetaOptions } from '@modern-js/utils';
5
- import type { TransformOptions } from '@babel/core';
6
- import type webpack from 'webpack';
7
- import type { Configuration as WebpackConfiguration } from 'webpack';
8
- import autoprefixer from 'autoprefixer';
9
- import type { BasePluginOptions, TerserOptions as RawTerserOptions } from 'terser-webpack-plugin';
10
- import type { PluginConfig } from '../../loadPlugins';
11
- import type { TestConfig, JestConfig } from './test';
12
- import type { SassConfig, SassLoaderOptions } from './sass';
13
- import type { LessConfig, LessLoaderOptions } from './less';
14
- import type { UnbundleConfig } from './unbundle';
15
- import type { SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions } from './ssg';
16
- import { ElectronConfig } from './electron';
17
- declare type AutoprefixerOptions = autoprefixer.Options;
18
- declare type TerserOptions = BasePluginOptions & RawTerserOptions;
19
- export type { TestConfig, JestConfig, UnbundleConfig, SassConfig, SassLoaderOptions, LessConfig, LessLoaderOptions, SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions, TransformOptions, AutoprefixerOptions, TerserOptions };
20
- export interface SourceConfig {
21
- entries?: Record<string, string | {
22
- entry: string;
23
- enableFileSystemRoutes?: boolean;
24
- disableMount?: boolean;
25
- }>;
26
- disableDefaultEntries?: boolean;
27
- entriesDir?: string;
28
- configDir?: string;
29
- apiDir?: string;
30
- envVars?: Array<string>;
31
- globalVars?: Record<string, string>;
32
- alias?: Record<string, string> | ((aliases: Record<string, string>) => Record<string, unknown>);
33
- moduleScopes?: Array<string | RegExp> | ((scopes: Array<string | RegExp>) => void) | ((scopes: Array<string | RegExp>) => Array<string | RegExp>);
34
- include?: Array<string | RegExp>;
35
- /**
36
- * The configuration of `source.designSystem` is provided by plugin `@modern-js/plugin-tailwindcss`.
37
- * Please use `yarn new` to enable the corresponding capability.
38
- * @requires `@modern-js/plugin-tailwindcss`
39
- */
40
-
41
- designSystem?: Record<string, any>;
42
- }
43
- export interface OutputConfig {
44
- assetPrefix?: string;
45
- htmlPath?: string;
46
- jsPath?: string;
47
- cssPath?: string;
48
- mediaPath?: string;
49
- path?: string;
50
- title?: string;
51
- titleByEntries?: Record<string, string>;
52
- meta?: MetaOptions;
53
- metaByEntries?: Record<string, MetaOptions>;
54
- inject?: 'body' | 'head' | boolean;
55
- injectByEntries?: Record<string, 'body' | 'head' | boolean>;
56
- mountId?: string;
57
- favicon?: string;
58
- faviconByEntries?: Record<string, string | undefined>;
59
- copy?: Array<Record<string, unknown> & {
60
- from: string;
61
- }>;
62
- scriptExt?: Record<string, unknown>;
63
- disableTsChecker?: boolean;
64
- disableHtmlFolder?: boolean;
65
- disableCssModuleExtension?: boolean;
66
- disableCssExtract?: boolean;
67
- enableCssModuleTSDeclaration?: boolean;
68
- disableMinimize?: boolean;
69
- enableInlineStyles?: boolean;
70
- enableInlineScripts?: boolean;
71
- disableSourceMap?: boolean;
72
- disableInlineRuntimeChunk?: boolean;
73
- disableAssetsCache?: boolean;
74
- enableLatestDecorators?: boolean;
75
- polyfill?: 'off' | 'usage' | 'entry' | 'ua';
76
- dataUriLimit?: number;
77
- templateParameters?: Record<string, unknown>;
78
- templateParametersByEntries?: Record<string, Record<string, unknown> | undefined>;
79
- cssModuleLocalIdentName?: string;
80
- enableModernMode?: boolean;
81
- federation?: boolean;
82
- disableNodePolyfill?: boolean;
83
- enableTsLoader?: boolean;
84
- /**
85
- * Disables lazy import support for styles, currently supports antd and arco-design.
86
- * The configuration of `output.disableAutoImportStyle` is provided by plugin `@modern-js/plugin-unbundle`.
87
- * Please use `yarn new` to enable the corresponding capability.
88
- * @requires `@modern-js/plugin-unbundle`
89
- */
90
-
91
- disableAutoImportStyle?: boolean;
92
- /**
93
- * The configuration of `output.ssg` is provided by plugin `@modern-js/plugin-ssg`.
94
- * Please use `yarn new` to enable the corresponding capability.
95
- * @requires `@modern-js/plugin-ssg`
96
- */
97
-
98
- ssg?: SSGConfig;
99
- }
100
- export interface ServerConfig {
101
- routes?: Record<string, string | string[] | {
102
- route: string | string[];
103
- disableSpa?: boolean;
104
- }>;
105
- publicRoutes?: {
106
- [filepath: string]: string;
107
- };
108
- ssr?: boolean | Record<string, unknown>;
109
- ssrByEntries?: Record<string, boolean | Record<string, unknown>>;
110
- baseUrl?: string | Array<string>;
111
- port?: number;
112
- logger?: boolean | Record<string, any>;
113
- metrics?: boolean | Record<string, any>;
114
- enableMicroFrontendDebug?: boolean;
115
- }
116
- export declare type DevProxyOptions = string | Record<string, string>;
117
- export interface DevConfig {
118
- assetPrefix?: string | boolean;
119
- https?: boolean;
120
- /**
121
- * The configuration of `dev.proxy` is provided by plugin `@modern-js/plugin-proxy`.
122
- * Please use `yarn new` to enable the corresponding capability.
123
- * @requires `@modern-js/plugin-proxy`
124
- */
125
-
126
- proxy?: DevProxyOptions;
127
- /**
128
- * The configuration of `dev.unbundle` is provided by plugin `@modern-js/plugin-unbundle`.
129
- * Please use `yarn new` to enable the corresponding capability.
130
- * @requires `@modern-js/plugin-unbundle`
131
- */
132
-
133
- unbundle?: UnbundleConfig;
134
- }
135
- export interface MicroFrontend {
136
- enableHtmlEntry?: boolean;
137
- externalBasicLibrary?: boolean;
138
- moduleApp?: string;
139
- }
140
- export interface DeployConfig {
141
- microFrontend?: false | MicroFrontend;
142
- domain?: string | Array<string>;
143
- domainByEntries?: Record<string, string | Array<string>>;
144
- }
145
- declare type ConfigFunction = Record<string, unknown> | ((config: Record<string, unknown>, utils?: any) => Record<string, unknown> | void);
146
- export declare type RequestHandler = (req: IncomingMessage, res: ServerResponse, next: NextFunction) => void;
147
- export declare type DevServerConfig = {
148
- proxy?: BffProxyOptions;
149
- headers?: Record<string, string>;
150
- before?: RequestHandler[];
151
- after?: RequestHandler[];
152
- [propsName: string]: any;
153
- };
154
- export declare type WebpackConfig = WebpackConfiguration | ((config: WebpackConfiguration, utils: {
155
- env: string;
156
- webpack: typeof webpack;
157
- [key: string]: any;
158
- }) => WebpackConfiguration | void);
159
- export declare type BabelConfig = TransformOptions | ((config: TransformOptions, utils?: any) => TransformOptions | void);
160
- export declare type AutoprefixerConfig = AutoprefixerOptions | ((config: AutoprefixerOptions) => AutoprefixerOptions | void);
161
- export declare type TerserConfig = TerserOptions | ((config: TerserOptions) => TerserOptions | void);
162
- export interface ToolsConfig {
163
- webpack?: WebpackConfig;
164
- babel?: BabelConfig;
165
- autoprefixer?: AutoprefixerConfig;
166
- postcss?: ConfigFunction;
167
- styledComponents?: ConfigFunction;
168
- lodash?: ConfigFunction;
169
- devServer?: DevServerConfig;
170
- tsLoader?: ConfigFunction;
171
- terser?: TerserConfig;
172
- minifyCss?: ConfigFunction;
173
- esbuild?: Record<string, unknown>;
174
- /**
175
- * The configuration of `tools.tailwindcss` is provided by plugin `@modern-js/plugin-tailwindcss`.
176
- * Please use `yarn new` to enable the corresponding capability.
177
- * @requires `@modern-js/plugin-tailwindcss`
178
- */
179
-
180
- tailwindcss?: Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
181
- /**
182
- * The configuration of `tools.jest` is provided by plugin `@modern-js/plugin-testing`.
183
- * Please use `yarn new` to enable the corresponding capability.
184
- * @requires `@modern-js/plugin-testing`
185
- */
186
-
187
- jest?: TestConfig['jest'];
188
- /**
189
- * The configuration of `tools.sass` is provided by plugin `@modern-js/plugin-sass`.
190
- * Please use `yarn new` to enable the corresponding capability.
191
- * @requires `@modern-js/plugin-sass`
192
- */
193
-
194
- sass?: SassConfig;
195
- /**
196
- * The configuration of `tools.less` is provided by plugin `@modern-js/plugin-less`.
197
- * Please use `yarn new` to enable the corresponding capability.
198
- * @requires `@modern-js/plugin-less`
199
- */
200
-
201
- less?: LessConfig;
202
- }
203
- export declare type RuntimeConfig = Record<string, any>;
204
- export interface RuntimeByEntriesConfig {
205
- [name: string]: RuntimeConfig;
206
- }
207
- export declare type BffConfig = Partial<{
208
- prefix: string;
209
- requestCreator: string;
210
- fetcher: string;
211
- proxy: Record<string, any>;
212
- }>;
213
- export interface UserConfig {
214
- source?: SourceConfig;
215
- output?: OutputConfig;
216
- server?: ServerConfig;
217
- dev?: DevConfig;
218
- deploy?: DeployConfig;
219
- tools?: ToolsConfig;
220
- plugins?: PluginConfig;
221
- runtime?: RuntimeConfig;
222
- runtimeByEntries?: RuntimeByEntriesConfig;
223
- /**
224
- * The configuration of `bff` is provided by plugin `@modern-js/plugin-bff`.
225
- * Please use `yarn new` to enable the corresponding capability.
226
- * @requires `@modern-js/plugin-bff`
227
- */
228
-
229
- bff?: BffConfig;
230
- /**
231
- * The configuration of `testing` is provided by plugin `@modern-js/plugin-testing`.
232
- * Please use `yarn new` to enable the corresponding capability.
233
- * @requires `@modern-js/plugin-testing`
234
- */
235
-
236
- testing?: TestConfig;
237
- /**
238
- * The configuration of `electron` is provided by plugin `@modern-js/plugin-electron`.
239
- * Please use `yarn new` to enable the corresponding capability.
240
- * @requires `@modern-js/plugin-electron`
241
- */
242
-
243
- electron?: ElectronConfig;
244
- }
245
- export declare type ConfigParam = UserConfig | Promise<UserConfig> | ((env: any) => UserConfig | Promise<UserConfig>);
246
- export interface LoadedConfig {
247
- config: UserConfig;
248
- filePath: string | false;
249
- dependencies: string[];
250
- pkgConfig: UserConfig;
251
- jsConfig: UserConfig;
252
- }
@@ -1,10 +0,0 @@
1
- /// <reference types="less" />
2
- import type { LoaderContext } from 'webpack';
3
- export declare type LessLoaderOptions = {
4
- lessOptions?: Less.Options;
5
- additionalData?: string | ((content: string, loaderContext: LoaderContext<LessLoaderOptions>) => string);
6
- sourceMap?: boolean;
7
- webpackImporter?: boolean;
8
- implementation?: boolean;
9
- };
10
- export declare type LessConfig = LessLoaderOptions | ((options: LessLoaderOptions, utils?: any) => LessLoaderOptions | void);
@@ -1,8 +0,0 @@
1
- import type { LegacyFileOptions } from 'sass';
2
- export interface SassLoaderOptions {
3
- sassOptions?: LegacyFileOptions<'sync'>;
4
- sourceMap?: boolean;
5
- implementation?: string;
6
- additionalData?: string | ((content: string, filename: string) => string);
7
- }
8
- export declare type SassConfig = SassLoaderOptions | ((options: SassLoaderOptions, utils?: any) => SassLoaderOptions | void);
@@ -1,13 +0,0 @@
1
- export declare type SSGRouteOptions = string | {
2
- url: string;
3
- output?: string;
4
- params?: Record<string, any>[];
5
- headers?: Record<string, any>;
6
- };
7
- export declare type SSGSingleEntryOptions = boolean | {
8
- preventDefault?: string[];
9
- headers?: Record<string, any>;
10
- routes?: SSGRouteOptions[];
11
- };
12
- export declare type SSGMultiEntryOptions = Record<string, SSGSingleEntryOptions>;
13
- export declare type SSGConfig = boolean | SSGSingleEntryOptions | SSGMultiEntryOptions | ((entryName: string) => SSGSingleEntryOptions);
@@ -1,15 +0,0 @@
1
- import type { Config as JestConfigTypes } from '@jest/types';
2
- export declare type JestConfig = JestConfigTypes.InitialOptions;
3
- export interface TestConfig {
4
- /**
5
- * Decide which transformer will be used to compile file
6
- * Default: babel-jest
7
- */
8
- transformer?: 'babel-jest' | 'ts-jest';
9
- /**
10
- * Original jest config
11
- * Doc: https://jestjs.io/docs/configuration
12
- */
13
-
14
- jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
15
- }
@@ -1,28 +0,0 @@
1
- export declare type UnbundleConfig = {
2
- /**
3
- * Some package A may require another package B that is intended for Node.js
4
- * use only. In such a case, if package B cannot be converted to ESM, it will
5
- * cause package A to fail during unbundle development, even though package B
6
- * is not really required. Package B can thus be safely ignored via this option
7
- * to ensure transpilation of package A to ESM
8
- */
9
- ignore?: string | string[];
10
- /**
11
- * ignores cached esm modules and recompiles dependencies not available
12
- * from PDN host on dev start.
13
- * default: false
14
- */
15
-
16
- ignoreModuleCache?: boolean;
17
- /**
18
- * clears cache of downloaded esm modules (from PDN) on dev start.
19
- * default: false
20
- */
21
-
22
- clearPdnCache?: boolean;
23
- /**
24
- * modifies host to attempt to download esm modules from
25
- */
26
-
27
- pdnHost?: string;
28
- };
@@ -1,47 +0,0 @@
1
- import type { IAppContext } from '@modern-js/types';
2
- import { UserConfig } from './config';
3
- import { NormalizedConfig } from './config/mergeConfig';
4
- import type { LoadedPlugin } from './loadPlugins';
5
- export type { IAppContext };
6
- export declare const AppContext: import("@modern-js/plugin").Context<IAppContext>;
7
- export declare const ConfigContext: import("@modern-js/plugin").Context<UserConfig>;
8
- export declare const ResolvedConfigContext: import("@modern-js/plugin").Context<NormalizedConfig>;
9
- /**
10
- * Set app context.
11
- * @param value new app context. It will override previous app context.
12
- */
13
-
14
- export declare const setAppContext: (value: IAppContext) => void;
15
- /**
16
- * Get app context, including directories, plugins and some static infos.
17
- */
18
-
19
- export declare const useAppContext: () => IAppContext;
20
- /**
21
- * Get original content of user config.
22
- */
23
-
24
- export declare const useConfigContext: () => UserConfig;
25
- /**
26
- * Get normalized content of user config.
27
- */
28
-
29
- export declare const useResolvedConfigContext: () => NormalizedConfig;
30
- export declare const initAppContext: ({
31
- appDirectory,
32
- plugins,
33
- configFile,
34
- options,
35
- serverConfigFile
36
- }: {
37
- appDirectory: string;
38
- plugins: LoadedPlugin[];
39
- configFile: string | false;
40
- options?: {
41
- metaName?: string | undefined;
42
- srcDir?: string | undefined;
43
- distDir?: string | undefined;
44
- sharedDir?: string | undefined;
45
- } | undefined;
46
- serverConfigFile: string;
47
- }) => IAppContext;