@modern-js/app-tools 2.62.2-alpha.0 → 2.63.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.
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/new/compat/hooks.js +5 -0
- package/dist/cjs/new/compat/index.js +6 -1
- package/dist/cjs/new/context.js +2 -1
- package/dist/cjs/plugins/initialize/index.js +44 -50
- package/dist/cjs/{new/types/index.js → types/new.js} +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/new/compat/hooks.js +24 -0
- package/dist/esm/new/compat/index.js +9 -1
- package/dist/esm/new/context.js +3 -2
- package/dist/esm/plugins/initialize/index.js +61 -64
- package/dist/esm-node/index.js +4 -4
- package/dist/esm-node/new/compat/hooks.js +5 -0
- package/dist/esm-node/new/compat/index.js +6 -1
- package/dist/esm-node/new/context.js +3 -2
- package/dist/esm-node/plugins/initialize/index.js +44 -50
- package/dist/types/config/default.d.ts +4 -3
- package/dist/types/index.d.ts +5 -4
- package/dist/types/new/compat/hooks.d.ts +3 -4
- package/dist/types/new/compat/index.d.ts +2 -4
- package/dist/types/new/index.d.ts +2 -5
- package/dist/types/new/loadPlugins.d.ts +1 -1
- package/dist/types/plugins/initialize/index.d.ts +2 -2
- package/dist/types/types/index.d.ts +5 -3
- package/dist/types/types/new.d.ts +145 -0
- package/dist/types/utils/env.d.ts +2 -2
- package/lib/types.d.ts +82 -61
- package/package.json +21 -20
- package/dist/types/new/types/index.d.ts +0 -90
- /package/dist/esm/{new/types/index.js → types/new.js} +0 -0
- /package/dist/esm-node/{new/types/index.js → types/new.js} +0 -0
@@ -1,8 +1,7 @@
|
|
1
|
-
import type { InternalContext } from '@modern-js/plugin-v2
|
2
|
-
import type {
|
3
|
-
import type { AppToolsExtendAPIName } from '../types';
|
1
|
+
import type { InternalContext } from '@modern-js/plugin-v2';
|
2
|
+
import type { AppTools } from '../../types';
|
4
3
|
/**
|
5
4
|
* old plugin useHookRunners function result
|
6
5
|
*/
|
7
|
-
export declare function getHookRunners(context: InternalContext<
|
6
|
+
export declare function getHookRunners(context: InternalContext<AppTools>): Record<string, any>;
|
8
7
|
export declare function handleSetupResult(setupResult: Record<string, (...args: any) => any>, api: Record<string, any>): void;
|
@@ -1,4 +1,2 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
import type { AppTools, AppToolsExtendAPIName } from '../types';
|
4
|
-
export declare const compatPlugin: () => Plugin<AppTools<'shared'>, InternalContext<AppToolsUserConfig<'shared'>, AppToolsNormalizedConfig, AppToolsExtendAPIName<'shared'>>>;
|
1
|
+
import type { AppTools, CliPluginFuture } from '../../types';
|
2
|
+
export declare const compatPlugin: () => CliPluginFuture<AppTools>;
|
@@ -1,9 +1,6 @@
|
|
1
|
-
import type { InternalContext, Plugin } from '@modern-js/plugin-v2/types';
|
2
1
|
import { type AppToolsOptions } from '../old';
|
3
|
-
import type {
|
2
|
+
import type { AppTools, CliPluginFuture } from '../types';
|
4
3
|
import { initAppContext } from './context';
|
5
|
-
import type { AppTools, AppToolsExtendAPIName } from './types';
|
6
4
|
export * from '../defineConfig';
|
7
5
|
export { initAppContext };
|
8
|
-
export
|
9
|
-
export declare const appTools: (options?: AppToolsOptions) => AppToolsPlugin;
|
6
|
+
export declare const appTools: (options?: AppToolsOptions) => CliPluginFuture<AppTools<'shared'>>;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { AppTools,
|
1
|
+
import type { AppTools, CliPluginFuture } from '../../types';
|
2
2
|
declare const _default: ({ bundler, }: {
|
3
3
|
bundler: 'rspack' | 'webpack';
|
4
|
-
}) =>
|
4
|
+
}) => CliPluginFuture<AppTools<'shared'>>;
|
5
5
|
export default _default;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import type { NormalizedConfig, UserConfig } from '@modern-js/core';
|
2
|
+
import type { CLIPlugin, CLIPluginExtends } from '@modern-js/plugin-v2';
|
2
3
|
import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
|
3
4
|
import type { AppToolsHooks } from './hooks';
|
4
5
|
import type { AppToolsLegacyNormalizedConfig, AppToolsLegacyUserConfig } from './legacyConfig';
|
6
|
+
import type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks } from './new';
|
5
7
|
import type { Bundler } from './utils';
|
6
8
|
export * from './hooks';
|
7
9
|
export * from './config';
|
@@ -10,16 +12,16 @@ export type { webpack, Rspack } from '@modern-js/uni-builder';
|
|
10
12
|
export type { Bundler } from './utils';
|
11
13
|
export type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig, SSR, SSRByEntries, Resource, Params, RequestHandlerConfig, LoaderContext, OnError, OnTiming, RequestHandlerOptions, RequestHandler, } from '@modern-js/server-core';
|
12
14
|
export type { IAppContext, PluginAPI, CliPlugin, NormalizedConfig, UserConfig, } from '@modern-js/core';
|
13
|
-
export type AppTools<B extends Bundler = 'webpack'> = {
|
14
|
-
hooks: AppToolsHooks<B>;
|
15
|
+
export type AppTools<B extends Bundler = 'webpack'> = Required<CLIPluginExtends<AppToolsUserConfig<B>, AppToolsNormalizedConfig, AppToolsExtendContext<B>, AppToolsExtendAPI<B>, AppToolsExtendHooks>> & {
|
15
16
|
userConfig: AppToolsUserConfig<B>;
|
16
|
-
|
17
|
+
hooks: AppToolsHooks<B>;
|
17
18
|
};
|
18
19
|
export type LegacyAppTools = {
|
19
20
|
hooks: AppToolsHooks;
|
20
21
|
userConfig: AppToolsLegacyUserConfig;
|
21
22
|
normalizedConfig: AppToolsLegacyNormalizedConfig;
|
22
23
|
};
|
24
|
+
export type CliPluginFuture<Extends extends CLIPluginExtends> = CLIPlugin<Extends>;
|
23
25
|
export type AppNormalizedConfig<B extends Bundler = 'webpack'> = NormalizedConfig<AppTools<B>>;
|
24
26
|
export type AppLegacyNormalizedConfig = NormalizedConfig<LegacyAppTools>;
|
25
27
|
export type AppUserConfig<B extends Bundler = 'webpack'> = UserConfig<AppTools<B>>;
|
@@ -0,0 +1,145 @@
|
|
1
|
+
import type { DevToolData, RegisterBuildPlatformResult } from '@modern-js/core';
|
2
|
+
import type { AppContext, InternalContext, PluginHook, PluginHookTap, TransformFunction } from '@modern-js/plugin-v2';
|
3
|
+
import type { Entrypoint, NestedRouteForCli, PageRoute, RouteLegacy, ServerPlugin, ServerRoute } from '@modern-js/types';
|
4
|
+
import type { AppTools } from '.';
|
5
|
+
import type { getHookRunners } from '../new/compat/hooks';
|
6
|
+
import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
|
7
|
+
import type { RuntimePlugin } from './hooks';
|
8
|
+
import type { Bundler } from './utils';
|
9
|
+
export type BeforeConfigFn = () => Promise<void> | void;
|
10
|
+
export type AfterPrepareFn = () => Promise<void> | void;
|
11
|
+
export type InternalRuntimePluginsFn = TransformFunction<{
|
12
|
+
entrypoint: Entrypoint;
|
13
|
+
plugins: RuntimePlugin[];
|
14
|
+
}>;
|
15
|
+
export type InternalServerPluginsFn = TransformFunction<{
|
16
|
+
plugins: ServerPlugin[];
|
17
|
+
}>;
|
18
|
+
export type CheckEntryPointFn = TransformFunction<{
|
19
|
+
path: string;
|
20
|
+
entry: false | string;
|
21
|
+
}>;
|
22
|
+
export type ModifyEntrypointsFn = TransformFunction<{
|
23
|
+
entrypoints: Entrypoint[];
|
24
|
+
}>;
|
25
|
+
export type ModifyFileSystemRoutesFn = TransformFunction<{
|
26
|
+
entrypoint: Entrypoint;
|
27
|
+
routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
|
28
|
+
}>;
|
29
|
+
export type ModifyServerRoutesFn = TransformFunction<{
|
30
|
+
routes: ServerRoute[];
|
31
|
+
}>;
|
32
|
+
export type DeplpoyFn = () => Promise<void> | void;
|
33
|
+
export type GenerateEntryCodeFn = (params: {
|
34
|
+
entrypoints: Entrypoint[];
|
35
|
+
}) => Promise<void> | void;
|
36
|
+
export type BeforeGenerateRoutesFn = TransformFunction<{
|
37
|
+
entrypoint: Entrypoint;
|
38
|
+
code: string;
|
39
|
+
}>;
|
40
|
+
export type BeforePrintInstructionsFn = TransformFunction<{
|
41
|
+
instructions: string;
|
42
|
+
}>;
|
43
|
+
export type RegisterDevFn = (params: {
|
44
|
+
name: string;
|
45
|
+
entry: string;
|
46
|
+
type: string;
|
47
|
+
config: any;
|
48
|
+
}) => Promise<DevToolData> | DevToolData;
|
49
|
+
export type RegisterBuildPlatformFn = (params: {
|
50
|
+
name: string;
|
51
|
+
entry: string;
|
52
|
+
type: string;
|
53
|
+
config: any;
|
54
|
+
}) => Promise<RegisterBuildPlatformResult> | RegisterBuildPlatformResult;
|
55
|
+
export type AddRuntimeExportsFn = (params: {
|
56
|
+
entrypoint: Entrypoint;
|
57
|
+
exports: string[];
|
58
|
+
}) => Promise<void> | void;
|
59
|
+
export interface AppToolsExtendAPI<B extends Bundler = 'webpack'> {
|
60
|
+
onBeforeConfig: PluginHookTap<BeforeConfigFn>;
|
61
|
+
onAfterPrepare: PluginHookTap<AfterPrepareFn>;
|
62
|
+
deploy: PluginHookTap<DeplpoyFn>;
|
63
|
+
_internalRuntimePlugins: PluginHookTap<InternalRuntimePluginsFn>;
|
64
|
+
_internalServerPlugins: PluginHookTap<InternalServerPluginsFn>;
|
65
|
+
checkEntryPoint: PluginHookTap<CheckEntryPointFn>;
|
66
|
+
modifyEntrypoints: PluginHookTap<ModifyEntrypointsFn>;
|
67
|
+
modifyFileSystemRoutes: PluginHookTap<ModifyFileSystemRoutesFn>;
|
68
|
+
modifyServerRoutes: PluginHookTap<ModifyServerRoutesFn>;
|
69
|
+
generateEntryCode: PluginHookTap<GenerateEntryCodeFn>;
|
70
|
+
onBeforeGenerateRoutes: PluginHookTap<BeforeGenerateRoutesFn>;
|
71
|
+
/**
|
72
|
+
* @deprecated
|
73
|
+
*/
|
74
|
+
onBeforePrintInstructions: PluginHookTap<BeforePrintInstructionsFn>;
|
75
|
+
/**
|
76
|
+
* @deprecated
|
77
|
+
*/
|
78
|
+
registerDev: PluginHookTap<RegisterDevFn>;
|
79
|
+
/**
|
80
|
+
* @deprecated
|
81
|
+
*/
|
82
|
+
registerBuildPlatform: PluginHookTap<RegisterBuildPlatformFn>;
|
83
|
+
/**
|
84
|
+
* @deprecated
|
85
|
+
*/
|
86
|
+
addRuntimeExports: PluginHookTap<AddRuntimeExportsFn>;
|
87
|
+
/**
|
88
|
+
* @deprecated use getAppContext instead
|
89
|
+
*/
|
90
|
+
useAppContext: () => AppToolsContext<B>;
|
91
|
+
/**
|
92
|
+
* @deprecated use getConfig instead
|
93
|
+
*/
|
94
|
+
useConfigContext: () => AppToolsUserConfig<B>;
|
95
|
+
/**
|
96
|
+
* @deprecated use getNormalizedConfig instead
|
97
|
+
*/
|
98
|
+
useResolvedConfigContext: () => AppToolsNormalizedConfig<AppToolsUserConfig<B>>;
|
99
|
+
/**
|
100
|
+
* @deprecated use api.xx instead
|
101
|
+
*/
|
102
|
+
useHookRunners: () => ReturnType<typeof getHookRunners>;
|
103
|
+
}
|
104
|
+
export interface AppToolsExtendHooks extends Record<string, PluginHook<(...args: any[]) => any>> {
|
105
|
+
onBeforeConfig: PluginHook<BeforeConfigFn>;
|
106
|
+
onAfterPrepare: PluginHook<AfterPrepareFn>;
|
107
|
+
deploy: PluginHook<DeplpoyFn>;
|
108
|
+
_internalRuntimePlugins: PluginHook<InternalRuntimePluginsFn>;
|
109
|
+
_internalServerPlugins: PluginHook<InternalServerPluginsFn>;
|
110
|
+
checkEntryPoint: PluginHook<CheckEntryPointFn>;
|
111
|
+
modifyEntrypoints: PluginHook<ModifyEntrypointsFn>;
|
112
|
+
modifyFileSystemRoutes: PluginHook<ModifyFileSystemRoutesFn>;
|
113
|
+
modifyServerRoutes: PluginHook<ModifyServerRoutesFn>;
|
114
|
+
generateEntryCode: PluginHook<GenerateEntryCodeFn>;
|
115
|
+
onBeforeGenerateRoutes: PluginHook<BeforeGenerateRoutesFn>;
|
116
|
+
/**
|
117
|
+
* @deprecated
|
118
|
+
*/
|
119
|
+
onBeforePrintInstructions: PluginHook<BeforePrintInstructionsFn>;
|
120
|
+
/**
|
121
|
+
* @deprecated
|
122
|
+
*/
|
123
|
+
registerDev: PluginHook<RegisterDevFn>;
|
124
|
+
/**
|
125
|
+
* @deprecated
|
126
|
+
*/
|
127
|
+
registerBuildPlatform: PluginHook<RegisterBuildPlatformFn>;
|
128
|
+
/**
|
129
|
+
* @deprecated
|
130
|
+
*/
|
131
|
+
addRuntimeExports: PluginHook<AddRuntimeExportsFn>;
|
132
|
+
}
|
133
|
+
export type AppToolsExtendContext<B extends Bundler = 'webpack'> = {
|
134
|
+
metaName: string;
|
135
|
+
internalDirectory: string;
|
136
|
+
sharedDirectory: string;
|
137
|
+
internalDirAlias: string;
|
138
|
+
internalSrcAlias: string;
|
139
|
+
apiDirectory: string;
|
140
|
+
lambdaDirectory: string;
|
141
|
+
serverPlugins: ServerPlugin[];
|
142
|
+
moduleType: 'module' | 'commonjs';
|
143
|
+
_internalContext: InternalContext<AppTools<B>>;
|
144
|
+
};
|
145
|
+
export type AppToolsContext<B extends Bundler = 'webpack'> = AppContext<AppTools<B>> & AppToolsExtendContext<B>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type {
|
2
|
-
export declare function getAutoInjectEnv(appContext:
|
1
|
+
import type { AppToolsContext } from '../types/new';
|
2
|
+
export declare function getAutoInjectEnv(appContext: AppToolsContext<'shared'>): Record<string, string>;
|
package/lib/types.d.ts
CHANGED
@@ -11,6 +11,10 @@ declare namespace NodeJS {
|
|
11
11
|
}
|
12
12
|
}
|
13
13
|
|
14
|
+
// reference @rsbuild/core/types, but there are some differences, such as svg
|
15
|
+
/**
|
16
|
+
* Image assets
|
17
|
+
*/
|
14
18
|
declare module '*.bmp' {
|
15
19
|
const src: string;
|
16
20
|
export default src;
|
@@ -36,143 +40,152 @@ declare module '*.png' {
|
|
36
40
|
export default src;
|
37
41
|
}
|
38
42
|
|
39
|
-
declare module '*.
|
43
|
+
declare module '*.pjpeg' {
|
40
44
|
const src: string;
|
41
45
|
export default src;
|
42
46
|
}
|
43
|
-
|
44
|
-
declare module '*.ico' {
|
47
|
+
declare module '*.pjp' {
|
45
48
|
const src: string;
|
46
49
|
export default src;
|
47
50
|
}
|
48
|
-
|
49
|
-
declare module '*.webp' {
|
51
|
+
declare module '*.apng' {
|
50
52
|
const src: string;
|
51
53
|
export default src;
|
52
54
|
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
export const ReactComponent: React.FunctionComponent<
|
58
|
-
React.SVGProps<SVGSVGElement>
|
59
|
-
>;
|
60
|
-
|
61
|
-
/**
|
62
|
-
* The default export type depends on the svgDefaultExport config,
|
63
|
-
* it can be a string or a ReactComponent
|
64
|
-
* */
|
65
|
-
const content: any;
|
66
|
-
export default content;
|
55
|
+
declare module '*.tif' {
|
56
|
+
const src: string;
|
57
|
+
export default src;
|
67
58
|
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
export default ReactComponent;
|
59
|
+
declare module '*.tiff' {
|
60
|
+
const src: string;
|
61
|
+
export default src;
|
72
62
|
}
|
73
|
-
|
74
|
-
declare module '*.bmp?inline' {
|
63
|
+
declare module '*.jfif' {
|
75
64
|
const src: string;
|
76
65
|
export default src;
|
77
66
|
}
|
78
67
|
|
79
|
-
declare module '*.
|
68
|
+
declare module '*.avif' {
|
80
69
|
const src: string;
|
81
70
|
export default src;
|
82
71
|
}
|
83
72
|
|
84
|
-
declare module '*.
|
73
|
+
declare module '*.ico' {
|
85
74
|
const src: string;
|
86
75
|
export default src;
|
87
76
|
}
|
88
77
|
|
89
|
-
declare module '*.
|
78
|
+
declare module '*.webp' {
|
90
79
|
const src: string;
|
91
80
|
export default src;
|
92
81
|
}
|
93
82
|
|
94
|
-
|
83
|
+
/**
|
84
|
+
* Font assets
|
85
|
+
*/
|
86
|
+
declare module '*.woff' {
|
95
87
|
const src: string;
|
96
88
|
export default src;
|
97
89
|
}
|
98
|
-
|
99
|
-
declare module '*.avif?inline' {
|
90
|
+
declare module '*.woff2' {
|
100
91
|
const src: string;
|
101
92
|
export default src;
|
102
93
|
}
|
103
|
-
|
104
|
-
declare module '*.ico?inline' {
|
94
|
+
declare module '*.eot' {
|
105
95
|
const src: string;
|
106
96
|
export default src;
|
107
97
|
}
|
108
|
-
|
109
|
-
declare module '*.webp?inline' {
|
98
|
+
declare module '*.ttf' {
|
110
99
|
const src: string;
|
111
100
|
export default src;
|
112
101
|
}
|
113
|
-
|
114
|
-
declare module '*.svg?inline' {
|
115
|
-
import * as React from 'react';
|
116
|
-
|
117
|
-
export const ReactComponent: React.FunctionComponent<
|
118
|
-
React.SVGProps<SVGSVGElement>
|
119
|
-
>;
|
120
|
-
|
102
|
+
declare module '*.otf' {
|
121
103
|
const src: string;
|
122
104
|
export default src;
|
123
105
|
}
|
124
|
-
|
125
|
-
declare module '*.bmp?url' {
|
106
|
+
declare module '*.ttc' {
|
126
107
|
const src: string;
|
127
108
|
export default src;
|
128
109
|
}
|
129
110
|
|
130
|
-
|
111
|
+
/**
|
112
|
+
* Media assets
|
113
|
+
*/
|
114
|
+
declare module '*.mp4' {
|
131
115
|
const src: string;
|
132
116
|
export default src;
|
133
117
|
}
|
134
|
-
|
135
|
-
declare module '*.jpg?url' {
|
118
|
+
declare module '*.webm' {
|
136
119
|
const src: string;
|
137
120
|
export default src;
|
138
121
|
}
|
139
|
-
|
140
|
-
declare module '*.jpeg?url' {
|
122
|
+
declare module '*.ogg' {
|
141
123
|
const src: string;
|
142
124
|
export default src;
|
143
125
|
}
|
144
|
-
|
145
|
-
declare module '*.png?url' {
|
126
|
+
declare module '*.mp3' {
|
146
127
|
const src: string;
|
147
128
|
export default src;
|
148
129
|
}
|
149
|
-
|
150
|
-
declare module '*.avif?url' {
|
130
|
+
declare module '*.wav' {
|
151
131
|
const src: string;
|
152
132
|
export default src;
|
153
133
|
}
|
154
|
-
|
155
|
-
declare module '*.ico?url' {
|
134
|
+
declare module '*.flac' {
|
156
135
|
const src: string;
|
157
136
|
export default src;
|
158
137
|
}
|
159
|
-
|
160
|
-
|
138
|
+
declare module '*.aac' {
|
139
|
+
const src: string;
|
140
|
+
export default src;
|
141
|
+
}
|
142
|
+
declare module '*.mov' {
|
143
|
+
const src: string;
|
144
|
+
export default src;
|
145
|
+
}
|
146
|
+
declare module '*.m4a' {
|
147
|
+
const src: string;
|
148
|
+
export default src;
|
149
|
+
}
|
150
|
+
declare module '*.opus' {
|
161
151
|
const src: string;
|
162
152
|
export default src;
|
163
153
|
}
|
164
154
|
|
165
|
-
declare module '*.svg
|
155
|
+
declare module '*.svg' {
|
166
156
|
import * as React from 'react';
|
167
157
|
|
168
158
|
export const ReactComponent: React.FunctionComponent<
|
169
159
|
React.SVGProps<SVGSVGElement>
|
170
160
|
>;
|
171
161
|
|
162
|
+
/**
|
163
|
+
* The default export type depends on the svgDefaultExport config,
|
164
|
+
* it can be a string or a ReactComponent
|
165
|
+
* */
|
166
|
+
const content: any;
|
167
|
+
export default content;
|
168
|
+
}
|
169
|
+
|
170
|
+
declare module '*.svg?react' {
|
171
|
+
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
172
|
+
export default ReactComponent;
|
173
|
+
}
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Queries
|
177
|
+
*/
|
178
|
+
declare module '*?inline' {
|
179
|
+
const content: string;
|
180
|
+
export default content;
|
181
|
+
}
|
182
|
+
|
183
|
+
declare module '*?url' {
|
172
184
|
const src: string;
|
173
185
|
export default src;
|
174
186
|
}
|
175
187
|
|
188
|
+
|
176
189
|
declare module '*.css' {
|
177
190
|
const classes: { readonly [key: string]: string };
|
178
191
|
export default classes;
|
@@ -193,6 +206,9 @@ declare module '*.sass' {
|
|
193
206
|
export default classes;
|
194
207
|
}
|
195
208
|
|
209
|
+
/**
|
210
|
+
* CSS Modules
|
211
|
+
*/
|
196
212
|
declare module '*.module.css' {
|
197
213
|
const classes: { readonly [key: string]: string };
|
198
214
|
export default classes;
|
@@ -224,12 +240,17 @@ declare module '*.hbs' {
|
|
224
240
|
}
|
225
241
|
|
226
242
|
declare module '*.yaml' {
|
227
|
-
const src: string
|
243
|
+
const src: Record<string, any>;
|
228
244
|
export default src;
|
229
245
|
}
|
230
246
|
|
247
|
+
declare module '*.yml' {
|
248
|
+
const content: Record<string, any>;
|
249
|
+
export default content;
|
250
|
+
}
|
251
|
+
|
231
252
|
declare module '*.toml' {
|
232
|
-
const src: string
|
253
|
+
const src: Record<string, any>;
|
233
254
|
export default src;
|
234
255
|
}
|
235
256
|
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.63.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -85,7 +85,7 @@
|
|
85
85
|
"@babel/parser": "^7.22.15",
|
86
86
|
"@babel/traverse": "^7.23.2",
|
87
87
|
"@babel/types": "^7.26.0",
|
88
|
-
"@rsbuild/core": "~1.1.
|
88
|
+
"@rsbuild/core": "~1.1.5",
|
89
89
|
"@rsbuild/plugin-node-polyfill": "~1.2.0",
|
90
90
|
"@swc/helpers": "0.5.13",
|
91
91
|
"@vercel/nft": "^0.26.4",
|
@@ -96,23 +96,23 @@
|
|
96
96
|
"mlly": "^1.6.1",
|
97
97
|
"pkg-types": "^1.1.0",
|
98
98
|
"std-env": "^3.7.0",
|
99
|
-
"@modern-js/plugin-v2": "2.
|
100
|
-
"@modern-js/
|
101
|
-
"@modern-js/
|
102
|
-
"@modern-js/plugin
|
103
|
-
"@modern-js/plugin-
|
104
|
-
"@modern-js/
|
105
|
-
"@modern-js/rsbuild-plugin-esbuild": "2.
|
106
|
-
"@modern-js/
|
107
|
-
"@modern-js/server": "2.
|
108
|
-
"@modern-js/
|
109
|
-
"@modern-js/server-utils": "2.
|
110
|
-
"@modern-js/
|
111
|
-
"@modern-js/
|
112
|
-
"@modern-js/
|
99
|
+
"@modern-js/plugin-v2": "2.63.0",
|
100
|
+
"@modern-js/node-bundle-require": "2.63.0",
|
101
|
+
"@modern-js/core": "2.63.0",
|
102
|
+
"@modern-js/plugin": "2.63.0",
|
103
|
+
"@modern-js/plugin-i18n": "2.63.0",
|
104
|
+
"@modern-js/plugin-data-loader": "2.63.0",
|
105
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.63.0",
|
106
|
+
"@modern-js/prod-server": "2.63.0",
|
107
|
+
"@modern-js/server": "2.63.0",
|
108
|
+
"@modern-js/server-core": "2.63.0",
|
109
|
+
"@modern-js/server-utils": "2.63.0",
|
110
|
+
"@modern-js/types": "2.63.0",
|
111
|
+
"@modern-js/uni-builder": "2.63.0",
|
112
|
+
"@modern-js/utils": "2.63.0"
|
113
113
|
},
|
114
114
|
"devDependencies": {
|
115
|
-
"@rsbuild/plugin-webpack-swc": "~1.0.
|
115
|
+
"@rsbuild/plugin-webpack-swc": "~1.0.8",
|
116
116
|
"@types/babel__traverse": "7.20.6",
|
117
117
|
"@types/jest": "^29",
|
118
118
|
"@types/node": "^16",
|
@@ -121,8 +121,8 @@
|
|
121
121
|
"tsconfig-paths": "^4.2.0",
|
122
122
|
"typescript": "^5",
|
123
123
|
"webpack": "^5.96.1",
|
124
|
-
"@scripts/build": "2.
|
125
|
-
"@scripts/jest-config": "2.
|
124
|
+
"@scripts/build": "2.63.0",
|
125
|
+
"@scripts/jest-config": "2.63.0"
|
126
126
|
},
|
127
127
|
"peerDependencies": {
|
128
128
|
"ts-node": "^10.7.0",
|
@@ -139,7 +139,8 @@
|
|
139
139
|
"sideEffects": false,
|
140
140
|
"publishConfig": {
|
141
141
|
"registry": "https://registry.npmjs.org/",
|
142
|
-
"access": "public"
|
142
|
+
"access": "public",
|
143
|
+
"provenance": true
|
143
144
|
},
|
144
145
|
"scripts": {
|
145
146
|
"new": "modern-lib new",
|
@@ -1,90 +0,0 @@
|
|
1
|
-
import type { DevToolData, RegisterBuildPlatformResult } from '@modern-js/core';
|
2
|
-
import type { AppContext } from '@modern-js/plugin-v2/types';
|
3
|
-
import type { CLIPluginAPI, PluginHookTap, TransformFunction } from '@modern-js/plugin-v2/types';
|
4
|
-
import type { Entrypoint, NestedRouteForCli, PageRoute, RouteLegacy, ServerPlugin, ServerRoute } from '@modern-js/types';
|
5
|
-
import type { AppToolsNormalizedConfig, AppToolsUserConfig } from '../../types/config';
|
6
|
-
import type { RuntimePlugin } from '../../types/hooks';
|
7
|
-
import type { Bundler } from '../../types/utils';
|
8
|
-
import type { getHookRunners } from '../compat/hooks';
|
9
|
-
export type BeforeConfigFn = () => Promise<void> | void;
|
10
|
-
export type AfterPrepareFn = () => Promise<void> | void;
|
11
|
-
export type InternalRuntimePluginsFn = TransformFunction<{
|
12
|
-
entrypoint: Entrypoint;
|
13
|
-
plugins: RuntimePlugin[];
|
14
|
-
}>;
|
15
|
-
export type InternalServerPluginsFn = TransformFunction<{
|
16
|
-
plugins: ServerPlugin[];
|
17
|
-
}>;
|
18
|
-
export type CheckEntryPointFn = TransformFunction<{
|
19
|
-
path: string;
|
20
|
-
entry: false | string;
|
21
|
-
}>;
|
22
|
-
export type ModifyEntrypointsFn = TransformFunction<Entrypoint[]>;
|
23
|
-
export type ModifyFileSystemRoutesFn = TransformFunction<{
|
24
|
-
entrypoint: Entrypoint;
|
25
|
-
routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
|
26
|
-
}>;
|
27
|
-
export type ModifyServerRoutesFn = TransformFunction<{
|
28
|
-
routes: ServerRoute[];
|
29
|
-
}>;
|
30
|
-
export type DeplpoyFn = () => Promise<void> | void;
|
31
|
-
export type GenerateEntryCodeFn = (entrypoints: Entrypoint[]) => Promise<void> | void;
|
32
|
-
export type BeforeGenerateRoutesFn = TransformFunction<{
|
33
|
-
entrypoint: Entrypoint;
|
34
|
-
code: string;
|
35
|
-
}>;
|
36
|
-
export type BeforePrintInstructionsFn = TransformFunction<{
|
37
|
-
instructions: string;
|
38
|
-
}>;
|
39
|
-
export type RegisterDevFn = () => Promise<DevToolData> | DevToolData;
|
40
|
-
export type RegisterBuildPlatformFn = () => Promise<RegisterBuildPlatformResult> | RegisterBuildPlatformResult;
|
41
|
-
export type AddRuntimeExportsFn = () => Promise<void> | void;
|
42
|
-
interface AppToolsExtendAPI<B extends Bundler = 'webpack'> {
|
43
|
-
onBeforeConfig: PluginHookTap<BeforeConfigFn>;
|
44
|
-
onAfterPrepare: PluginHookTap<AfterPrepareFn>;
|
45
|
-
deploy: PluginHookTap<DeplpoyFn>;
|
46
|
-
_internalRuntimePlugins: PluginHookTap<InternalRuntimePluginsFn>;
|
47
|
-
_internalServerPlugins: PluginHookTap<InternalServerPluginsFn>;
|
48
|
-
checkEntryPoint: PluginHookTap<CheckEntryPointFn>;
|
49
|
-
modifyEntrypoints: PluginHookTap<ModifyEntrypointsFn>;
|
50
|
-
modifyFileSystemRoutes: PluginHookTap<ModifyFileSystemRoutesFn>;
|
51
|
-
modifyServerRoutes: PluginHookTap<ModifyServerRoutesFn>;
|
52
|
-
generateEntryCode: PluginHookTap<GenerateEntryCodeFn>;
|
53
|
-
onBeforeGenerateRoutes: PluginHookTap<BeforeGenerateRoutesFn>;
|
54
|
-
/**
|
55
|
-
* @deprecated
|
56
|
-
*/
|
57
|
-
onBeforePrintInstructions: PluginHookTap<BeforePrintInstructionsFn>;
|
58
|
-
/**
|
59
|
-
* @deprecated
|
60
|
-
*/
|
61
|
-
registerDev: PluginHookTap<RegisterDevFn>;
|
62
|
-
/**
|
63
|
-
* @deprecated
|
64
|
-
*/
|
65
|
-
registerBuildPlatform: PluginHookTap<RegisterBuildPlatformFn>;
|
66
|
-
/**
|
67
|
-
* @deprecated
|
68
|
-
*/
|
69
|
-
addRuntimeExports: PluginHookTap<AddRuntimeExportsFn>;
|
70
|
-
/**
|
71
|
-
* @deprecated use getAppContext instead
|
72
|
-
*/
|
73
|
-
useAppContext: () => AppContext<AppToolsUserConfig<B>, AppToolsNormalizedConfig<AppToolsUserConfig<B>>>;
|
74
|
-
/**
|
75
|
-
* @deprecated use getConfig instead
|
76
|
-
*/
|
77
|
-
useConfigContext: () => AppToolsUserConfig<B>;
|
78
|
-
/**
|
79
|
-
* @deprecated use getNormalizedConfig instead
|
80
|
-
*/
|
81
|
-
useResolvedConfigContext: () => AppToolsNormalizedConfig<AppToolsUserConfig<B>>;
|
82
|
-
/**
|
83
|
-
* @deprecated use api.xx instead
|
84
|
-
*/
|
85
|
-
useHookRunners: () => ReturnType<typeof getHookRunners>;
|
86
|
-
}
|
87
|
-
export interface AppTools<B extends Bundler = 'webpack'> extends CLIPluginAPI<AppToolsUserConfig<B>, AppToolsNormalizedConfig<AppToolsUserConfig<B>>>, AppToolsExtendAPI<B> {
|
88
|
-
}
|
89
|
-
export type AppToolsExtendAPIName<B extends Bundler = 'webpack'> = keyof AppToolsExtendAPI<B> & string;
|
90
|
-
export {};
|
File without changes
|
File without changes
|