@modern-js/app-tools 3.9.0 → 3.9.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.
Files changed (70) hide show
  1. package/dist/cjs/builder/generator/createCopyPattern.js +2 -1
  2. package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +2 -1
  3. package/dist/esm/builder/generator/createCopyPattern.mjs +2 -1
  4. package/dist/esm/builder/shared/builderPlugins/adapterHtml.mjs +2 -1
  5. package/dist/esm-node/builder/generator/createCopyPattern.mjs +2 -1
  6. package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.mjs +2 -1
  7. package/dist/types/builder/builder-rspack/index.d.ts +1 -1
  8. package/dist/types/builder/generator/adapterCopy.d.ts +1 -1
  9. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +2 -2
  10. package/dist/types/builder/generator/createCopyPattern.d.ts +2 -2
  11. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +2 -2
  12. package/dist/types/builder/generator/index.d.ts +1 -1
  13. package/dist/types/builder/index.d.ts +1 -1
  14. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +1 -1
  15. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +1 -1
  16. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +1 -1
  17. package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +1 -1
  18. package/dist/types/builder/shared/builderPlugins/index.d.ts +4 -4
  19. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +3 -3
  20. package/dist/types/builder/shared/createCopyInfo.d.ts +2 -2
  21. package/dist/types/builder/shared/index.d.ts +3 -3
  22. package/dist/types/builder/shared/types.d.ts +2 -2
  23. package/dist/types/commands/build.d.ts +2 -2
  24. package/dist/types/commands/deploy.d.ts +2 -2
  25. package/dist/types/commands/dev.d.ts +2 -2
  26. package/dist/types/commands/index.d.ts +1 -1
  27. package/dist/types/commands/info.d.ts +2 -2
  28. package/dist/types/commands/inspect.d.ts +2 -2
  29. package/dist/types/commands/serve.d.ts +1 -1
  30. package/dist/types/compat/hooks.d.ts +1 -1
  31. package/dist/types/compat/index.d.ts +1 -1
  32. package/dist/types/config/default.d.ts +2 -2
  33. package/dist/types/config/index.d.ts +2 -2
  34. package/dist/types/config/initialize/index.d.ts +2 -2
  35. package/dist/types/config/initialize/inits.d.ts +2 -2
  36. package/dist/types/defineConfig.d.ts +2 -2
  37. package/dist/types/index.d.ts +13 -13
  38. package/dist/types/plugins/analyze/getBundleEntry.d.ts +2 -2
  39. package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +2 -2
  40. package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +2 -2
  41. package/dist/types/plugins/analyze/getServerRoutes.d.ts +2 -2
  42. package/dist/types/plugins/analyze/index.d.ts +1 -1
  43. package/dist/types/plugins/deploy/index.d.ts +1 -1
  44. package/dist/types/plugins/deploy/platforms/gh-pages.d.ts +1 -1
  45. package/dist/types/plugins/deploy/platforms/netlify.d.ts +1 -1
  46. package/dist/types/plugins/deploy/platforms/node.d.ts +1 -1
  47. package/dist/types/plugins/deploy/platforms/platform.d.ts +3 -3
  48. package/dist/types/plugins/deploy/platforms/vercel.d.ts +1 -1
  49. package/dist/types/plugins/deploy/types.d.ts +1 -1
  50. package/dist/types/plugins/deploy/utils/generator.d.ts +2 -2
  51. package/dist/types/plugins/initialize/index.d.ts +1 -1
  52. package/dist/types/plugins/serverBuild.d.ts +1 -1
  53. package/dist/types/plugins/serverRuntime.d.ts +1 -1
  54. package/dist/types/rsbuild.d.ts +1 -1
  55. package/dist/types/run/index.d.ts +1 -1
  56. package/dist/types/types/config/html.d.ts +1 -1
  57. package/dist/types/types/config/index.d.ts +13 -13
  58. package/dist/types/types/config/output.d.ts +1 -1
  59. package/dist/types/types/config/performance.d.ts +1 -1
  60. package/dist/types/types/config/tools.d.ts +1 -1
  61. package/dist/types/types/index.d.ts +3 -3
  62. package/dist/types/types/plugin.d.ts +3 -3
  63. package/dist/types/utils/config.d.ts +1 -1
  64. package/dist/types/utils/env.d.ts +1 -1
  65. package/dist/types/utils/generateWatchFiles.d.ts +1 -1
  66. package/dist/types/utils/loadPlugins.d.ts +1 -1
  67. package/dist/types/utils/printInstructions.d.ts +2 -2
  68. package/dist/types/utils/restart.d.ts +1 -1
  69. package/dist/types/utils/routes.d.ts +1 -1
  70. package/package.json +13 -13
@@ -47,7 +47,8 @@ function createPublicPattern(appContext, config, chain) {
47
47
  noErrorOnMissing: true,
48
48
  transform: (content, absoluteFrom)=>{
49
49
  if (!/\.html?$/.test(absoluteFrom)) return content;
50
- return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, (0, utils_namespaceObject.removeTailSlash)(chain.output.get('publicPath')));
50
+ const publicPath = chain.output.get('publicPath');
51
+ return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, (0, utils_namespaceObject.removeTailSlash)('string' == typeof publicPath ? publicPath : ''));
51
52
  }
52
53
  };
53
54
  }
@@ -58,7 +58,8 @@ const builderPluginAdapterHtml = (options)=>({
58
58
  async function injectAssetPrefix({ chain }) {
59
59
  const entries = chain.entryPoints.entries() || {};
60
60
  const entryNames = Object.keys(entries);
61
- const assetPrefix = (0, utils_namespaceObject.removeTailSlash)(chain.output.get('publicPath') || '');
61
+ const publicPath = chain.output.get('publicPath');
62
+ const assetPrefix = (0, utils_namespaceObject.removeTailSlash)('string' == typeof publicPath ? publicPath : '');
62
63
  const code = `window.__assetPrefix__ = '${assetPrefix}';`;
63
64
  entryNames.forEach((entryName)=>{
64
65
  entries[entryName].prepend(createVirtualModule(code));
@@ -14,7 +14,8 @@ function createPublicPattern(appContext, config, chain) {
14
14
  noErrorOnMissing: true,
15
15
  transform: (content, absoluteFrom)=>{
16
16
  if (!/\.html?$/.test(absoluteFrom)) return content;
17
- return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash(chain.output.get('publicPath')));
17
+ const publicPath = chain.output.get('publicPath');
18
+ return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash('string' == typeof publicPath ? publicPath : ''));
18
19
  }
19
20
  };
20
21
  }
@@ -26,7 +26,8 @@ const builderPluginAdapterHtml = (options)=>({
26
26
  async function injectAssetPrefix({ chain }) {
27
27
  const entries = chain.entryPoints.entries() || {};
28
28
  const entryNames = Object.keys(entries);
29
- const assetPrefix = removeTailSlash(chain.output.get('publicPath') || '');
29
+ const publicPath = chain.output.get('publicPath');
30
+ const assetPrefix = removeTailSlash('string' == typeof publicPath ? publicPath : '');
30
31
  const code = `window.__assetPrefix__ = '${assetPrefix}';`;
31
32
  entryNames.forEach((entryName)=>{
32
33
  entries[entryName].prepend(createVirtualModule(code));
@@ -15,7 +15,8 @@ function createPublicPattern(appContext, config, chain) {
15
15
  noErrorOnMissing: true,
16
16
  transform: (content, absoluteFrom)=>{
17
17
  if (!/\.html?$/.test(absoluteFrom)) return content;
18
- return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash(chain.output.get('publicPath')));
18
+ const publicPath = chain.output.get('publicPath');
19
+ return content.toString('utf8').replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash('string' == typeof publicPath ? publicPath : ''));
19
20
  }
20
21
  };
21
22
  }
@@ -27,7 +27,8 @@ const builderPluginAdapterHtml = (options)=>({
27
27
  async function injectAssetPrefix({ chain }) {
28
28
  const entries = chain.entryPoints.entries() || {};
29
29
  const entryNames = Object.keys(entries);
30
- const assetPrefix = removeTailSlash(chain.output.get('publicPath') || '');
30
+ const publicPath = chain.output.get('publicPath');
31
+ const assetPrefix = removeTailSlash('string' == typeof publicPath ? publicPath : '');
31
32
  const code = `window.__assetPrefix__ = '${assetPrefix}';`;
32
33
  entryNames.forEach((entryName)=>{
33
34
  entries[entryName].prepend(createVirtualModule(code));
@@ -1,2 +1,2 @@
1
- import type { BuilderOptions } from '../shared';
1
+ import type { BuilderOptions } from '../shared/index.js';
2
2
  export declare function createRspackBuilderForModern(options: BuilderOptions): Promise<import("@rsbuild/core").RsbuildInstance>;
@@ -1,3 +1,3 @@
1
1
  import type { RsbuildPlugin } from '@modern-js/builder';
2
- import type { BuilderOptions } from '../shared';
2
+ import type { BuilderOptions } from '../shared/index.js';
3
3
  export declare const builderPluginAdapterCopy: (options: BuilderOptions) => RsbuildPlugin;
@@ -1,3 +1,3 @@
1
- import type { AppNormalizedConfig } from '../../types';
2
- import type { AppToolsContext } from '../../types/plugin';
1
+ import type { AppNormalizedConfig } from '../../types/index.js';
2
+ import type { AppToolsContext } from '../../types/plugin.js';
3
3
  export declare function createBuilderProviderConfig(resolveConfig: AppNormalizedConfig, appContext: AppToolsContext): Omit<AppNormalizedConfig, 'plugins'>;
@@ -1,6 +1,6 @@
1
1
  import type { Rspack, RspackChain } from '@rsbuild/core';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext } from '../../types/plugin';
2
+ import type { AppNormalizedConfig } from '../../types/index.js';
3
+ import type { AppToolsContext } from '../../types/plugin.js';
4
4
  export declare function createPublicPattern(appContext: AppToolsContext, config: AppNormalizedConfig, chain: RspackChain): {
5
5
  info: (file: {
6
6
  sourceFilename: string;
@@ -1,5 +1,5 @@
1
- import type { AppNormalizedConfig } from '../../types';
2
- import type { AppToolsContext } from '../../types/plugin';
1
+ import type { AppNormalizedConfig } from '../../types/index.js';
2
+ import type { AppToolsContext } from '../../types/plugin.js';
3
3
  export declare function getBuilderEnvironments(normalizedConfig: AppNormalizedConfig, appContext: AppToolsContext, tempBuilderConfig: Omit<AppNormalizedConfig, 'plugins'>): {
4
4
  environments: Record<string, import("@rsbuild/core").EnvironmentConfig>;
5
5
  builderConfig: Omit<AppNormalizedConfig, "plugins">;
@@ -1,5 +1,5 @@
1
1
  import { type BundlerType } from '@modern-js/builder';
2
- import type { BuilderOptions } from '../shared';
2
+ import type { BuilderOptions } from '../shared/index.js';
3
3
  /**
4
4
  * @param options BuilderOptions
5
5
  * @param bundlerType BundlerType
@@ -1,3 +1,3 @@
1
1
  export declare function createBuilderGenerator(): Promise<typeof import("./builder-rspack/index.js").createRspackBuilderForModern>;
2
2
  export { parseRspackConfig } from '@modern-js/builder';
3
- export { builderPluginAdapterBasic, builderPluginAdapterHooks, } from './shared/builderPlugins';
3
+ export { builderPluginAdapterBasic, builderPluginAdapterHooks, } from './shared/builderPlugins/index.js';
@@ -1,3 +1,3 @@
1
1
  import type { RsbuildPlugin } from '@rsbuild/core';
2
- import type { BuilderOptions } from '../types';
2
+ import type { BuilderOptions } from '../types.js';
3
3
  export declare const builderPluginAdapterBasic: (options: BuilderOptions) => RsbuildPlugin;
@@ -1,3 +1,3 @@
1
1
  import type { RsbuildPlugin } from '@rsbuild/core';
2
- import type { BuilderOptions } from '../types';
2
+ import type { BuilderOptions } from '../types.js';
3
3
  export declare const builderPluginAdapterHtml: (options: BuilderOptions) => RsbuildPlugin;
@@ -1,3 +1,3 @@
1
1
  import { type RsbuildPlugin } from '@rsbuild/core';
2
- import type { BuilderOptions } from '../types';
2
+ import type { BuilderOptions } from '../types.js';
3
3
  export declare const builderPluginAdapterSSR: (options: BuilderOptions) => RsbuildPlugin;
@@ -1,3 +1,3 @@
1
1
  import type { RsbuildPlugin } from '@rsbuild/core';
2
- import type { BuilderOptions } from '../types';
2
+ import type { BuilderOptions } from '../types.js';
3
3
  export declare const builderPluginAdapterHooks: (options: BuilderOptions) => RsbuildPlugin;
@@ -1,4 +1,4 @@
1
- export * from './adapterBasic';
2
- export * from './adapterHtml';
3
- export * from './adapterSSR';
4
- export * from './builderHooks';
1
+ export * from './adapterBasic.js';
2
+ export * from './adapterHtml.js';
3
+ export * from './adapterSSR.js';
4
+ export * from './builderHooks.js';
@@ -1,3 +1,3 @@
1
- export * from './HtmlAsyncChunkPlugin';
2
- export * from './HtmlBottomTemplate';
3
- export * from './RouterPlugin';
1
+ export * from './HtmlAsyncChunkPlugin.js';
2
+ export * from './HtmlBottomTemplate.js';
3
+ export * from './RouterPlugin.js';
@@ -1,5 +1,5 @@
1
- import type { AppNormalizedConfig } from '../../types';
2
- import type { AppToolsContext } from '../../types/plugin';
1
+ import type { AppNormalizedConfig } from '../../types/index.js';
2
+ import type { AppToolsContext } from '../../types/plugin.js';
3
3
  export declare function createCopyInfo(appContext: AppToolsContext, config: AppNormalizedConfig): {
4
4
  configDir: string;
5
5
  uploadDir: string;
@@ -1,3 +1,3 @@
1
- export * from './types';
2
- export * from './builderPlugins';
3
- export * from './createCopyInfo';
1
+ export * from './types.js';
2
+ export * from './builderPlugins/index.js';
3
+ export * from './createCopyInfo.js';
@@ -1,6 +1,6 @@
1
1
  import type { EagerRouteComponentFilesByEntry } from '@modern-js/utils';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext } from '../../types/plugin';
2
+ import type { AppNormalizedConfig } from '../../types/index.js';
3
+ import type { AppToolsContext } from '../../types/plugin.js';
4
4
  export type BuilderOptions = {
5
5
  normalizedConfig: AppNormalizedConfig;
6
6
  appContext: AppToolsContext;
@@ -1,4 +1,4 @@
1
1
  import type { CLIPluginAPI } from '@modern-js/plugin';
2
- import type { AppTools } from '../types';
3
- import type { BuildOptions } from '../utils/types';
2
+ import type { AppTools } from '../types/index.js';
3
+ import type { BuildOptions } from '../utils/types.js';
4
4
  export declare const build: (api: CLIPluginAPI<AppTools>, options?: BuildOptions) => Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import type { CLIPluginAPI } from '@modern-js/plugin';
2
- import type { AppTools } from '../types';
3
- import type { DeployOptions } from '../utils/types';
2
+ import type { AppTools } from '../types/index.js';
3
+ import type { DeployOptions } from '../utils/types.js';
4
4
  export declare const deploy: (api: CLIPluginAPI<AppTools>, options?: DeployOptions) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import type { CLIPluginAPI } from '@modern-js/plugin';
2
2
  import { type ApplyPlugins } from '@modern-js/server';
3
- import type { AppTools } from '../types';
4
- import type { DevOptions } from '../utils/types';
3
+ import type { AppTools } from '../types/index.js';
4
+ import type { DevOptions } from '../utils/types.js';
5
5
  interface ExtraServerOptions {
6
6
  applyPlugins?: ApplyPlugins;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type { CLIPluginAPI } from '@modern-js/plugin';
2
2
  import type { Command } from '@modern-js/utils';
3
- import type { AppTools } from '../types';
3
+ import type { AppTools } from '../types/index.js';
4
4
  export declare const devCommand: (program: Command, api: CLIPluginAPI<AppTools>) => Promise<void>;
5
5
  export declare const buildCommand: (program: Command, api: CLIPluginAPI<AppTools>) => Promise<void>;
6
6
  export declare const serverCommand: (program: Command, api: CLIPluginAPI<AppTools>) => void;
@@ -1,6 +1,6 @@
1
1
  import type { CLIPluginAPI } from '@modern-js/plugin';
2
- import type { AppTools } from '../types';
3
- import type { InfoOptions } from '../utils/types';
2
+ import type { AppTools } from '../types/index.js';
3
+ import type { InfoOptions } from '../utils/types.js';
4
4
  export interface EntryInfo {
5
5
  entryName: string;
6
6
  isMainEntry: boolean;
@@ -1,4 +1,4 @@
1
1
  import type { CLIPluginAPI } from '@modern-js/plugin';
2
- import type { AppTools } from '../types';
3
- import type { InspectOptions } from '../utils/types';
2
+ import type { AppTools } from '../types/index.js';
3
+ import type { InspectOptions } from '../utils/types.js';
4
4
  export declare const inspect: (api: CLIPluginAPI<AppTools>, options: InspectOptions) => Promise<import("@rsbuild/core").InspectConfigResult>;
@@ -1,6 +1,6 @@
1
1
  import type { CLIPluginAPI } from '@modern-js/plugin';
2
2
  import { createProdServer } from '@modern-js/prod-server';
3
- import type { AppTools } from '../types';
3
+ import type { AppTools } from '../types/index.js';
4
4
  type ExtraServerOptions = {
5
5
  launcher?: typeof createProdServer;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import type { InternalContext } from '@modern-js/plugin';
2
- import type { AppTools } from '../types';
2
+ import type { AppTools } from '../types/index.js';
3
3
  /**
4
4
  * old plugin useHookRunners function result
5
5
  */
@@ -1,2 +1,2 @@
1
- import type { AppTools, CliPlugin } from '../types';
1
+ import type { AppTools, CliPlugin } from '../types/index.js';
2
2
  export declare const compatPlugin: () => CliPlugin<AppTools>;
@@ -1,5 +1,5 @@
1
- import type { AppUserConfig } from '../types';
2
- import type { AppToolsContext } from '../types/plugin';
1
+ import type { AppUserConfig } from '../types/index.js';
2
+ import type { AppToolsContext } from '../types/plugin.js';
3
3
  export declare function createDefaultConfig(appContext: AppToolsContext): AppUserConfig;
4
4
  /**
5
5
  * Default-enable lazy compilation for pure CSR and stream SSR. Stream SSR keeps
@@ -1,2 +1,2 @@
1
- export * from './initialize';
2
- export * from './default';
1
+ export * from './initialize/index.js';
2
+ export * from './default.js';
@@ -1,3 +1,3 @@
1
- import type { AppNormalizedConfig } from '../../types';
2
- import type { AppToolsContext } from '../../types/plugin';
1
+ import type { AppNormalizedConfig } from '../../types/index.js';
2
+ import type { AppToolsContext } from '../../types/plugin.js';
3
3
  export declare function initialNormalizedConfig(config: AppNormalizedConfig, appContext: AppToolsContext): AppNormalizedConfig;
@@ -1,4 +1,4 @@
1
- import type { AppNormalizedConfig } from '../../types';
2
- import type { AppToolsContext } from '../../types/plugin';
1
+ import type { AppNormalizedConfig } from '../../types/index.js';
2
+ import type { AppToolsContext } from '../../types/plugin.js';
3
3
  export declare function initHtmlConfig(config: AppNormalizedConfig, appContext: AppToolsContext): AppNormalizedConfig['html'];
4
4
  export declare function initSourceConfig(config: AppNormalizedConfig, appContext: AppToolsContext): void;
@@ -1,4 +1,4 @@
1
- import type { AppUserConfig } from './types';
1
+ import type { AppUserConfig } from './types/index.js';
2
2
  export type ConfigParams = {
3
3
  env: string;
4
4
  command: string;
@@ -8,4 +8,4 @@ export type UserConfigExport<Config> = Config | ((env: ConfigParams) => Config |
8
8
  * This function helps you to autocomplete configuration types.
9
9
  * It accepts a direct config object, or a function that returns a config.
10
10
  */
11
- export declare const defineConfig: (config: UserConfigExport<AppUserConfig>) => UserConfigExport<import("./types").AppToolsUserConfig>;
11
+ export declare const defineConfig: (config: UserConfigExport<AppUserConfig>) => UserConfigExport<import("./types/index.js").AppToolsUserConfig>;
@@ -1,17 +1,17 @@
1
- import type { AppTools, CliPlugin } from './types';
2
- import { initAppContext } from './utils/initAppContext';
3
- export * from './defineConfig';
1
+ import type { AppTools, CliPlugin } from './types/index.js';
2
+ import { initAppContext } from './utils/initAppContext.js';
3
+ export * from './defineConfig.js';
4
4
  export declare const appTools: () => CliPlugin<AppTools>;
5
- export { defineConfig } from './defineConfig';
6
- export { build } from './commands/build';
7
- export { deploy } from './commands/deploy';
8
- export { dev } from './commands/dev';
9
- export { serve } from './commands/serve';
10
- export { closeServer } from './utils/createServer';
11
- export type { BuildOptions, DeployOptions, DevOptions } from './utils/types';
12
- export { generateWatchFiles } from './utils/generateWatchFiles';
13
- export { resolveModernRsbuildConfig, type ResolveModernRsbuildConfigOptions, } from './rsbuild';
14
- export * from './types';
5
+ export { defineConfig } from './defineConfig.js';
6
+ export { build } from './commands/build.js';
7
+ export { deploy } from './commands/deploy.js';
8
+ export { dev } from './commands/dev.js';
9
+ export { serve } from './commands/serve.js';
10
+ export { closeServer } from './utils/createServer.js';
11
+ export type { BuildOptions, DeployOptions, DevOptions } from './utils/types.js';
12
+ export { generateWatchFiles } from './utils/generateWatchFiles.js';
13
+ export { resolveModernRsbuildConfig, type ResolveModernRsbuildConfigOptions, } from './rsbuild.js';
14
+ export * from './types/index.js';
15
15
  export { initAppContext };
16
16
  export default appTools;
17
17
  export { mergeConfig } from '@modern-js/plugin/cli';
@@ -1,4 +1,4 @@
1
1
  import type { Entrypoint } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext, AppToolsHooks } from '../../types/plugin';
2
+ import type { AppNormalizedConfig } from '../../types/index.js';
3
+ import type { AppToolsContext, AppToolsHooks } from '../../types/plugin.js';
4
4
  export declare const getBundleEntry: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<Entrypoint[]>;
@@ -1,6 +1,6 @@
1
1
  import type { Entrypoint } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext, AppToolsHooks } from '../../types/plugin';
2
+ import type { AppNormalizedConfig } from '../../types/index.js';
3
+ import type { AppToolsContext, AppToolsHooks } from '../../types/plugin.js';
4
4
  export type { Entrypoint };
5
5
  export declare const hasEntry: (dir: string) => string | false;
6
6
  export declare const hasServerEntry: (dir: string) => string | false;
@@ -1,6 +1,6 @@
1
1
  import type { Entrypoint, HtmlPartials, HtmlTemplates } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext, AppToolsHooks } from '../../types/plugin';
2
+ import type { AppNormalizedConfig } from '../../types/index.js';
3
+ import type { AppToolsContext, AppToolsHooks } from '../../types/plugin.js';
4
4
  export declare const getModifyHtmlPartials: (partials: Record<keyof HtmlPartials, string[]>) => {
5
5
  top: {
6
6
  append: (...script: string[]) => void;
@@ -1,6 +1,6 @@
1
1
  import type { Entrypoint, ServerRoute } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext } from '../../types/plugin';
2
+ import type { AppNormalizedConfig } from '../../types/index.js';
3
+ import type { AppToolsContext } from '../../types/plugin.js';
4
4
  export declare const getServerRoutes: (entrypoints: Entrypoint[], { appContext, config, }: {
5
5
  appContext: AppToolsContext;
6
6
  config: AppNormalizedConfig;
@@ -1,3 +1,3 @@
1
- import type { AppTools, CliPlugin } from '../../types';
1
+ import type { AppTools, CliPlugin } from '../../types/index.js';
2
2
  declare const _default: () => CliPlugin<AppTools>;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { AppTools, CliPlugin } from '../../types';
1
+ import type { AppTools, CliPlugin } from '../../types/index.js';
2
2
  declare const _default: () => CliPlugin<AppTools>;
3
3
  export default _default;
@@ -1,2 +1,2 @@
1
- import type { CreatePreset } from './platform';
1
+ import type { CreatePreset } from './platform.js';
2
2
  export declare const createGhPagesPreset: CreatePreset;
@@ -1,2 +1,2 @@
1
- import type { CreatePreset } from './platform';
1
+ import type { CreatePreset } from './platform.js';
2
2
  export declare const createNetlifyPreset: CreatePreset;
@@ -1,2 +1,2 @@
1
- import type { CreatePreset } from './platform';
1
+ import type { CreatePreset } from './platform.js';
2
2
  export declare const createNodePreset: CreatePreset;
@@ -1,6 +1,6 @@
1
- import type { AppToolsNormalizedConfig } from '../../../types';
2
- import type { AppToolsContext } from '../../../types/plugin';
3
- import type { PluginAPI } from '../types';
1
+ import type { AppToolsNormalizedConfig } from '../../../types/index.js';
2
+ import type { AppToolsContext } from '../../../types/plugin.js';
3
+ import type { PluginAPI } from '../types.js';
4
4
  interface CreatePresetParams {
5
5
  appContext: AppToolsContext;
6
6
  modernConfig: AppToolsNormalizedConfig;
@@ -1,2 +1,2 @@
1
- import type { CreatePreset } from './platform';
1
+ import type { CreatePreset } from './platform.js';
2
2
  export declare const createVercelPreset: CreatePreset;
@@ -1,3 +1,3 @@
1
- import type { AppTools, CliPlugin } from '../../types';
1
+ import type { AppTools, CliPlugin } from '../../types/index.js';
2
2
  export type Setup = NonNullable<CliPlugin<AppTools>['setup']>;
3
3
  export type PluginAPI = Parameters<Setup>[0];
@@ -1,6 +1,6 @@
1
1
  import type { ProdServerOptions } from '@modern-js/prod-server';
2
- import type { AppToolsNormalizedConfig } from '../../../types';
3
- import type { AppToolsContext } from '../../../types/plugin';
2
+ import type { AppToolsNormalizedConfig } from '../../../types/index.js';
3
+ import type { AppToolsContext } from '../../../types/plugin.js';
4
4
  export declare const serverAppContextTemplate: (appContext: AppToolsContext) => {
5
5
  sharedDirectory: string;
6
6
  apiDirectory: string;
@@ -1,3 +1,3 @@
1
- import type { AppTools, CliPlugin } from '../../types';
1
+ import type { AppTools, CliPlugin } from '../../types/index.js';
2
2
  declare const _default: () => CliPlugin<AppTools>;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { AppTools, CliPlugin } from '../types';
1
+ import type { AppTools, CliPlugin } from '../types/index.js';
2
2
  declare const _default: () => CliPlugin<AppTools>;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { AppTools, CliPlugin } from '../types';
1
+ import type { AppTools, CliPlugin } from '../types/index.js';
2
2
  declare const _default: () => CliPlugin<AppTools>;
3
3
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { AppUserConfig } from './types';
1
+ import type { AppUserConfig } from './types/index.js';
2
2
  type ResolveModernRsbuildConfigOptions = {
3
3
  command: string;
4
4
  configPath?: string;
@@ -1,5 +1,5 @@
1
1
  import type { InternalPlugins } from '@modern-js/types';
2
- import { handleSetupResult } from '../compat/hooks';
2
+ import { handleSetupResult } from '../compat/hooks.js';
3
3
  export interface RunOptions {
4
4
  cwd?: string;
5
5
  configFile?: string;
@@ -1,3 +1,3 @@
1
1
  import type { BuilderConfig } from '@modern-js/builder';
2
- import type { UnwrapBuilderConfig } from '../utils';
2
+ import type { UnwrapBuilderConfig } from '../utils.js';
3
3
  export type HtmlUserConfig = UnwrapBuilderConfig<BuilderConfig, 'html'>;
@@ -2,19 +2,19 @@ import type { RsbuildPlugins } from '@modern-js/builder';
2
2
  import type { CLIPlugin, CLIPluginExtends } from '@modern-js/plugin';
3
3
  import type { BffUserConfig, ServerUserConfig } from '@modern-js/server-core';
4
4
  import type { RsbuildConfig } from '@rsbuild/core';
5
- import type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks } from '../plugin';
6
- import type { DeployUserConfig } from './deploy';
7
- import type { DevUserConfig } from './dev';
8
- import type { ExperimentsUserConfig } from './experiments';
9
- import type { HtmlUserConfig } from './html';
10
- import type { OutputUserConfig } from './output';
11
- import type { PerformanceUserConfig } from './performance';
12
- import type { ResolveUserConfig } from './resolve';
13
- import type { SecurityUserConfig } from './security';
14
- import type { SourceUserConfig } from './source';
15
- import type { TestingUserConfig } from './testing';
16
- import type { ToolsUserConfig } from './tools';
17
- export * from './output';
5
+ import type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks } from '../plugin.js';
6
+ import type { DeployUserConfig } from './deploy.js';
7
+ import type { DevUserConfig } from './dev.js';
8
+ import type { ExperimentsUserConfig } from './experiments.js';
9
+ import type { HtmlUserConfig } from './html.js';
10
+ import type { OutputUserConfig } from './output.js';
11
+ import type { PerformanceUserConfig } from './performance.js';
12
+ import type { ResolveUserConfig } from './resolve.js';
13
+ import type { SecurityUserConfig } from './security.js';
14
+ import type { SourceUserConfig } from './source.js';
15
+ import type { TestingUserConfig } from './testing.js';
16
+ import type { ToolsUserConfig } from './tools.js';
17
+ export * from './output.js';
18
18
  export interface AppToolsUserConfig {
19
19
  resolve?: ResolveUserConfig;
20
20
  server?: ServerUserConfig;
@@ -1,6 +1,6 @@
1
1
  import type { BuilderConfig } from '@modern-js/builder';
2
2
  import type { SSGConfig, SSGMultiEntryOptions } from '@modern-js/types';
3
- import type { UnwrapBuilderConfig } from '../utils';
3
+ import type { UnwrapBuilderConfig } from '../utils.js';
4
4
  export interface OutputUserConfig extends UnwrapBuilderConfig<BuilderConfig, 'output'> {
5
5
  /**
6
6
  * Enable SSG for self-controlled routing or conventional routing.
@@ -1,3 +1,3 @@
1
1
  import type { BuilderConfig } from '@modern-js/builder';
2
- import type { UnwrapBuilderConfig } from '../utils';
2
+ import type { UnwrapBuilderConfig } from '../utils.js';
3
3
  export type PerformanceUserConfig = UnwrapBuilderConfig<BuilderConfig, 'performance'>;
@@ -1,6 +1,6 @@
1
1
  import type { BuilderConfig } from '@modern-js/builder';
2
2
  import type { JestConfig } from '@modern-js/types';
3
- import type { UnwrapBuilderConfig } from '../utils';
3
+ import type { UnwrapBuilderConfig } from '../utils.js';
4
4
  type BuilderToolsConfig = UnwrapBuilderConfig<BuilderConfig, 'tools'>;
5
5
  export interface ToolsUserConfig extends Omit<BuilderToolsConfig, 'swc'> {
6
6
  /**
@@ -1,10 +1,10 @@
1
1
  import type { CLIPluginAPI, CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig } from '@modern-js/plugin';
2
- import type { AppTools, AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
2
+ import type { AppTools, AppToolsNormalizedConfig, AppToolsUserConfig } from './config/index.js';
3
3
  export type { CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig };
4
- export * from './config';
4
+ export * from './config/index.js';
5
5
  export type { Rspack } from '@modern-js/builder';
6
6
  export type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig, SSR, SSRByEntries, Resource, Params, RequestHandlerConfig, LoaderContext, OnError, OnTiming, RequestHandlerOptions, RequestHandler, } from '@modern-js/server-core';
7
7
  export type AppUserConfig = AppToolsUserConfig;
8
8
  export type AppNormalizedConfig = AppToolsNormalizedConfig;
9
9
  export type AppToolsAPI = CLIPluginAPI<AppTools>;
10
- export type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks, AppToolsContext, AppToolsHooks as AppToolsFeatureHooks, } from './plugin';
10
+ export type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks, AppToolsContext, AppToolsHooks as AppToolsFeatureHooks, } from './plugin.js';
@@ -3,9 +3,9 @@ import type { Hooks } from '@modern-js/plugin/cli';
3
3
  import type { Entrypoint, HtmlPartials, HtmlTemplates, NestedRouteForCli, PageRoute, RouteLegacy, ServerPlugin, ServerRoute } from '@modern-js/types';
4
4
  import type { EagerRouteComponentFilesByEntry } from '@modern-js/utils';
5
5
  import type { EnvironmentConfig } from '@rsbuild/core';
6
- import type { AppTools } from '.';
7
- import type { getHookRunners } from '../compat/hooks';
8
- import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
6
+ import type { AppTools } from './index.js';
7
+ import type { getHookRunners } from '../compat/hooks.js';
8
+ import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config/index.js';
9
9
  export type AfterPrepareFn = () => Promise<void> | void;
10
10
  export type CheckEntryPointFn = TransformFunction<{
11
11
  path: string;
@@ -1,2 +1,2 @@
1
- import type { AppNormalizedConfig } from '../types';
1
+ import type { AppNormalizedConfig } from '../types/index.js';
2
2
  export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig: AppNormalizedConfig) => Promise<void>;
@@ -1,2 +1,2 @@
1
- import type { AppToolsContext } from '../types/plugin';
1
+ import type { AppToolsContext } from '../types/plugin.js';
2
2
  export declare function getAutoInjectEnv(appContext: AppToolsContext): Record<string, string>;
@@ -1,2 +1,2 @@
1
- import type { AppToolsContext } from '../types/plugin';
1
+ import type { AppToolsContext } from '../types/plugin.js';
2
2
  export declare function generateWatchFiles(appContext: AppToolsContext, configDir?: string): Promise<string[]>;
@@ -3,7 +3,7 @@ import type { Plugin } from '@modern-js/plugin';
3
3
  import type { ServerPlugin as ServerPluginInstance } from '@modern-js/server-core';
4
4
  import type { ServerPlugin } from '@modern-js/types';
5
5
  import type { InternalPlugins } from '@modern-js/types';
6
- import type { AppTools } from '../types';
6
+ import type { AppTools } from '../types/index.js';
7
7
  export declare function getServerPlugins(api: CLIPluginAPI<AppTools>, metaName?: string): Promise<ServerPlugin[]>;
8
8
  export declare function loadServerPlugins(api: CLIPluginAPI<AppTools>, appDirectory: string, metaName: string): Promise<ServerPluginInstance[]>;
9
9
  /**
@@ -1,3 +1,3 @@
1
- import type { AppNormalizedConfig } from '../types';
2
- import type { AppToolsContext, AppToolsHooks } from '../types/plugin';
1
+ import type { AppNormalizedConfig } from '../types/index.js';
2
+ import type { AppToolsContext, AppToolsHooks } from '../types/plugin.js';
3
3
  export declare const printInstructions: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<void>;
@@ -1,2 +1,2 @@
1
- import type { AppToolsHooks } from '../types/plugin';
1
+ import type { AppToolsHooks } from '../types/plugin.js';
2
2
  export declare function restart(hooks: AppToolsHooks, filename: string): Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { AppToolsContext } from '../types/plugin';
1
+ import type { AppToolsContext } from '../types/plugin.js';
2
2
  export declare const generateRoutes: (appContext: AppToolsContext) => Promise<void>;
3
3
  export declare const getPathWithoutExt: (filename: string) => string;
4
4
  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": "3.9.0",
18
+ "version": "3.9.1",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "main": "./dist/cjs/index.js",
21
21
  "exports": {
@@ -116,7 +116,7 @@
116
116
  "@babel/parser": "^7.29.7",
117
117
  "@babel/traverse": "^7.29.7",
118
118
  "@babel/types": "^7.29.7",
119
- "@rsbuild/core": "2.2.0-rc.0",
119
+ "@rsbuild/core": "2.2.4",
120
120
  "@swc/core": "1.15.41",
121
121
  "@swc/helpers": "^0.5.17",
122
122
  "es-module-lexer": "^1.7.0",
@@ -126,19 +126,19 @@
126
126
  "ndepe": "^0.1.13",
127
127
  "pkg-types": "^1.3.1",
128
128
  "std-env": "^3.10.0",
129
- "@modern-js/builder": "3.9.0",
130
- "@modern-js/i18n-utils": "3.9.0",
131
- "@modern-js/plugin-data-loader": "3.9.0",
132
- "@modern-js/plugin": "3.9.0",
133
- "@modern-js/prod-server": "3.9.0",
134
- "@modern-js/server": "3.9.0",
135
- "@modern-js/server-core": "3.9.0",
136
- "@modern-js/server-utils": "3.9.0",
137
- "@modern-js/types": "3.9.0",
138
- "@modern-js/utils": "3.9.0"
129
+ "@modern-js/builder": "3.9.1",
130
+ "@modern-js/i18n-utils": "3.9.1",
131
+ "@modern-js/plugin": "3.9.1",
132
+ "@modern-js/plugin-data-loader": "3.9.1",
133
+ "@modern-js/prod-server": "3.9.1",
134
+ "@modern-js/server": "3.9.1",
135
+ "@modern-js/server-core": "3.9.1",
136
+ "@modern-js/server-utils": "3.9.1",
137
+ "@modern-js/types": "3.9.1",
138
+ "@modern-js/utils": "3.9.1"
139
139
  },
140
140
  "devDependencies": {
141
- "@rslib/core": "0.23.2",
141
+ "@rslib/core": "1.0.0",
142
142
  "@types/babel__traverse": "7.28.0",
143
143
  "@types/node": "^20",
144
144
  "ts-node": "^10.9.2",