@modern-js/app-tools 2.63.0 → 2.63.1
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/commands/dev.js +1 -1
- package/dist/cjs/commands/serve.js +1 -1
- package/dist/cjs/new/compat/hooks.js +11 -4
- package/dist/cjs/new/compat/utils.js +10 -1
- package/dist/cjs/new/context.js +0 -1
- package/dist/cjs/plugins/analyze/getBundleEntry.js +2 -2
- package/dist/cjs/plugins/analyze/getFileSystemEntry.js +9 -9
- package/dist/cjs/plugins/analyze/getHtmlTemplate.js +51 -25
- package/dist/cjs/plugins/analyze/index.js +128 -130
- package/dist/cjs/plugins/deploy/index.js +12 -14
- package/dist/cjs/plugins/initialize/index.js +1 -1
- package/dist/cjs/utils/printInstructions.js +12 -3
- package/dist/cjs/utils/restart.js +2 -1
- package/dist/esm/commands/dev.js +2 -2
- package/dist/esm/commands/serve.js +2 -2
- package/dist/esm/new/compat/hooks.js +27 -17
- package/dist/esm/new/compat/utils.js +10 -1
- package/dist/esm/new/context.js +0 -1
- package/dist/esm/plugins/analyze/getBundleEntry.js +3 -3
- package/dist/esm/plugins/analyze/getFileSystemEntry.js +12 -12
- package/dist/esm/plugins/analyze/getHtmlTemplate.js +101 -28
- package/dist/esm/plugins/analyze/index.js +328 -331
- package/dist/esm/plugins/deploy/index.js +84 -88
- package/dist/esm/plugins/initialize/index.js +1 -1
- package/dist/esm/utils/printInstructions.js +29 -2
- package/dist/esm/utils/restart.js +2 -1
- package/dist/esm-node/commands/dev.js +2 -2
- package/dist/esm-node/commands/serve.js +2 -2
- package/dist/esm-node/new/compat/hooks.js +11 -4
- package/dist/esm-node/new/compat/utils.js +10 -1
- package/dist/esm-node/new/context.js +0 -1
- package/dist/esm-node/plugins/analyze/getBundleEntry.js +2 -2
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.js +9 -9
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.js +49 -24
- package/dist/esm-node/plugins/analyze/index.js +128 -130
- package/dist/esm-node/plugins/deploy/index.js +12 -14
- package/dist/esm-node/plugins/initialize/index.js +1 -1
- package/dist/esm-node/utils/printInstructions.js +10 -2
- package/dist/esm-node/utils/restart.js +2 -1
- package/dist/types/builder/generator/adapterCopy.d.ts +2 -1
- package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -2
- package/dist/types/builder/generator/createCopyPattern.d.ts +4 -3
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +2 -2
- package/dist/types/builder/index.d.ts +1 -1
- package/dist/types/builder/shared/createCopyInfo.d.ts +3 -2
- package/dist/types/builder/shared/types.d.ts +3 -2
- package/dist/types/config/initialize/index.d.ts +3 -2
- package/dist/types/config/initialize/inits.d.ts +4 -3
- package/dist/types/new/context.d.ts +0 -1
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +3 -3
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +3 -3
- package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +26 -5
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +2 -2
- package/dist/types/plugins/analyze/index.d.ts +2 -3
- package/dist/types/plugins/deploy/index.d.ts +2 -3
- package/dist/types/plugins/deploy/platforms/platform.d.ts +3 -3
- package/dist/types/plugins/deploy/utils.d.ts +2 -2
- package/dist/types/types/new.d.ts +38 -21
- package/dist/types/utils/printInstructions.d.ts +3 -1
- package/dist/types/utils/routes.d.ts +2 -1
- package/package.json +20 -20
@@ -1,6 +1,7 @@
|
|
1
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 {
|
2
|
+
import type { AppContext, AsyncHook, InternalContext, PluginHook, PluginHookTap, TransformFunction } from '@modern-js/plugin-v2';
|
3
|
+
import type { Hooks } from '@modern-js/plugin-v2/cli';
|
4
|
+
import type { Entrypoint, HtmlPartials, HtmlTemplates, NestedRouteForCli, PageRoute, RouteLegacy, ServerPlugin, ServerRoute } from '@modern-js/types';
|
4
5
|
import type { AppTools } from '.';
|
5
6
|
import type { getHookRunners } from '../new/compat/hooks';
|
6
7
|
import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
|
@@ -52,10 +53,7 @@ export type RegisterBuildPlatformFn = (params: {
|
|
52
53
|
type: string;
|
53
54
|
config: any;
|
54
55
|
}) => Promise<RegisterBuildPlatformResult> | RegisterBuildPlatformResult;
|
55
|
-
export type AddRuntimeExportsFn = (
|
56
|
-
entrypoint: Entrypoint;
|
57
|
-
exports: string[];
|
58
|
-
}) => Promise<void> | void;
|
56
|
+
export type AddRuntimeExportsFn = () => Promise<void> | void;
|
59
57
|
export interface AppToolsExtendAPI<B extends Bundler = 'webpack'> {
|
60
58
|
onBeforeConfig: PluginHookTap<BeforeConfigFn>;
|
61
59
|
onAfterPrepare: PluginHookTap<AfterPrepareFn>;
|
@@ -102,33 +100,33 @@ export interface AppToolsExtendAPI<B extends Bundler = 'webpack'> {
|
|
102
100
|
useHookRunners: () => ReturnType<typeof getHookRunners>;
|
103
101
|
}
|
104
102
|
export interface AppToolsExtendHooks extends Record<string, PluginHook<(...args: any[]) => any>> {
|
105
|
-
onBeforeConfig:
|
106
|
-
onAfterPrepare:
|
107
|
-
deploy:
|
108
|
-
_internalRuntimePlugins:
|
109
|
-
_internalServerPlugins:
|
110
|
-
checkEntryPoint:
|
111
|
-
modifyEntrypoints:
|
112
|
-
modifyFileSystemRoutes:
|
113
|
-
modifyServerRoutes:
|
114
|
-
generateEntryCode:
|
115
|
-
onBeforeGenerateRoutes:
|
103
|
+
onBeforeConfig: AsyncHook<BeforeConfigFn>;
|
104
|
+
onAfterPrepare: AsyncHook<AfterPrepareFn>;
|
105
|
+
deploy: AsyncHook<DeplpoyFn>;
|
106
|
+
_internalRuntimePlugins: AsyncHook<InternalRuntimePluginsFn>;
|
107
|
+
_internalServerPlugins: AsyncHook<InternalServerPluginsFn>;
|
108
|
+
checkEntryPoint: AsyncHook<CheckEntryPointFn>;
|
109
|
+
modifyEntrypoints: AsyncHook<ModifyEntrypointsFn>;
|
110
|
+
modifyFileSystemRoutes: AsyncHook<ModifyFileSystemRoutesFn>;
|
111
|
+
modifyServerRoutes: AsyncHook<ModifyServerRoutesFn>;
|
112
|
+
generateEntryCode: AsyncHook<GenerateEntryCodeFn>;
|
113
|
+
onBeforeGenerateRoutes: AsyncHook<BeforeGenerateRoutesFn>;
|
116
114
|
/**
|
117
115
|
* @deprecated
|
118
116
|
*/
|
119
|
-
onBeforePrintInstructions:
|
117
|
+
onBeforePrintInstructions: AsyncHook<BeforePrintInstructionsFn>;
|
120
118
|
/**
|
121
119
|
* @deprecated
|
122
120
|
*/
|
123
|
-
registerDev:
|
121
|
+
registerDev: AsyncHook<RegisterDevFn>;
|
124
122
|
/**
|
125
123
|
* @deprecated
|
126
124
|
*/
|
127
|
-
registerBuildPlatform:
|
125
|
+
registerBuildPlatform: AsyncHook<RegisterBuildPlatformFn>;
|
128
126
|
/**
|
129
127
|
* @deprecated
|
130
128
|
*/
|
131
|
-
addRuntimeExports:
|
129
|
+
addRuntimeExports: AsyncHook<AddRuntimeExportsFn>;
|
132
130
|
}
|
133
131
|
export type AppToolsExtendContext<B extends Bundler = 'webpack'> = {
|
134
132
|
metaName: string;
|
@@ -140,6 +138,25 @@ export type AppToolsExtendContext<B extends Bundler = 'webpack'> = {
|
|
140
138
|
lambdaDirectory: string;
|
141
139
|
serverPlugins: ServerPlugin[];
|
142
140
|
moduleType: 'module' | 'commonjs';
|
141
|
+
/** Information for entry points */
|
142
|
+
entrypoints: Entrypoint[];
|
143
|
+
/** Selected entry points */
|
144
|
+
checkedEntries: string[];
|
145
|
+
/** Information for server routes */
|
146
|
+
serverRoutes: ServerRoute[];
|
147
|
+
/** Whether to use api only mode */
|
148
|
+
apiOnly: boolean;
|
143
149
|
_internalContext: InternalContext<AppTools<B>>;
|
150
|
+
/**
|
151
|
+
* Information for HTML templates by entry
|
152
|
+
* @private
|
153
|
+
*/
|
154
|
+
partialsByEntrypoint?: Record<string, HtmlPartials>;
|
155
|
+
/**
|
156
|
+
* Information for HTML templates
|
157
|
+
* @private
|
158
|
+
*/
|
159
|
+
htmlTemplates: HtmlTemplates;
|
144
160
|
};
|
145
161
|
export type AppToolsContext<B extends Bundler = 'webpack'> = AppContext<AppTools<B>> & AppToolsExtendContext<B>;
|
162
|
+
export type AppToolsHooks<B extends Bundler = 'webpack'> = Hooks<AppToolsUserConfig<B>, AppToolsNormalizedConfig> & AppToolsExtendHooks;
|
@@ -1,3 +1,5 @@
|
|
1
1
|
import type { CliHooksRunner, IAppContext } from '@modern-js/core';
|
2
2
|
import type { AppNormalizedConfig, AppTools } from '../types';
|
3
|
-
|
3
|
+
import type { AppToolsContext, AppToolsHooks } from '../types/new';
|
4
|
+
export declare const printInstructions: (hooks: AppToolsHooks<'shared'>, appContext: AppToolsContext<'shared'>, config: AppNormalizedConfig<'shared'>) => Promise<void>;
|
5
|
+
export declare const printInstructionsCompat: (hookRunners: CliHooksRunner<AppTools<'shared'>>, appContext: IAppContext, config: AppNormalizedConfig<'shared'>) => Promise<void>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { IAppContext } from '@modern-js/core';
|
2
|
-
|
2
|
+
import type { AppToolsContext } from '../types/new';
|
3
|
+
export declare const generateRoutes: (appContext: AppToolsContext<'shared'> | IAppContext) => Promise<void>;
|
3
4
|
export declare const getPathWithoutExt: (filename: string) => string;
|
4
5
|
export declare const isMainEntry: (entryName: string, mainEntryName?: string) => boolean;
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.63.
|
18
|
+
"version": "2.63.1",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -85,8 +85,8 @@
|
|
85
85
|
"@babel/parser": "^7.22.15",
|
86
86
|
"@babel/traverse": "^7.23.2",
|
87
87
|
"@babel/types": "^7.26.0",
|
88
|
-
"@rsbuild/core": "
|
89
|
-
"@rsbuild/plugin-node-polyfill": "
|
88
|
+
"@rsbuild/core": "1.1.8",
|
89
|
+
"@rsbuild/plugin-node-polyfill": "1.2.0",
|
90
90
|
"@swc/helpers": "0.5.13",
|
91
91
|
"@vercel/nft": "^0.26.4",
|
92
92
|
"es-module-lexer": "^1.1.0",
|
@@ -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/
|
100
|
-
"@modern-js/
|
101
|
-
"@modern-js/
|
102
|
-
"@modern-js/plugin": "2.63.
|
103
|
-
"@modern-js/
|
104
|
-
"@modern-js/plugin-
|
105
|
-
"@modern-js/
|
106
|
-
"@modern-js/
|
107
|
-
"@modern-js/server": "2.63.
|
108
|
-
"@modern-js/server-core": "2.63.
|
109
|
-
"@modern-js/
|
110
|
-
"@modern-js/
|
111
|
-
"@modern-js/
|
112
|
-
"@modern-js/utils": "2.63.
|
99
|
+
"@modern-js/node-bundle-require": "2.63.1",
|
100
|
+
"@modern-js/core": "2.63.1",
|
101
|
+
"@modern-js/plugin": "2.63.1",
|
102
|
+
"@modern-js/plugin-data-loader": "2.63.1",
|
103
|
+
"@modern-js/prod-server": "2.63.1",
|
104
|
+
"@modern-js/plugin-v2": "2.63.1",
|
105
|
+
"@modern-js/plugin-i18n": "2.63.1",
|
106
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.63.1",
|
107
|
+
"@modern-js/server": "2.63.1",
|
108
|
+
"@modern-js/server-core": "2.63.1",
|
109
|
+
"@modern-js/types": "2.63.1",
|
110
|
+
"@modern-js/uni-builder": "2.63.1",
|
111
|
+
"@modern-js/server-utils": "2.63.1",
|
112
|
+
"@modern-js/utils": "2.63.1"
|
113
113
|
},
|
114
114
|
"devDependencies": {
|
115
|
-
"@rsbuild/plugin-webpack-swc": "
|
115
|
+
"@rsbuild/plugin-webpack-swc": "1.0.9",
|
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/
|
125
|
-
"@scripts/
|
124
|
+
"@scripts/jest-config": "2.63.1",
|
125
|
+
"@scripts/build": "2.63.1"
|
126
126
|
},
|
127
127
|
"peerDependencies": {
|
128
128
|
"ts-node": "^10.7.0",
|