@modern-js/server-utils 2.41.0 → 2.42.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.
@@ -1,21 +1,21 @@
1
1
  import type { SourceNormalizedConfig, ToolsNormalizedConfig } from '@modern-js/server-core';
2
2
  export interface Pattern {
3
- from: string;
4
- to: string;
5
- tsconfigPath?: string;
3
+ from: string;
4
+ to: string;
5
+ tsconfigPath?: string;
6
6
  }
7
7
  export interface IConfig {
8
- alias?: SourceNormalizedConfig['alias'];
9
- babelConfig?: ToolsNormalizedConfig['babel'];
10
- server: {
11
- compiler?: 'babel' | 'typescript';
12
- };
8
+ alias?: SourceNormalizedConfig['alias'];
9
+ babelConfig?: ToolsNormalizedConfig['babel'];
10
+ server: {
11
+ compiler?: 'babel' | 'typescript';
12
+ };
13
13
  }
14
14
  export interface CompileOptions {
15
- sourceDirs: string[];
16
- distDir: string;
17
- tsconfigPath?: string;
15
+ sourceDirs: string[];
16
+ distDir: string;
17
+ tsconfigPath?: string;
18
18
  }
19
19
  export type CompileFunc = (appDirectory: string, modernConfig: IConfig, compileOptions: CompileOptions) => Promise<void>;
20
20
  export declare const FILE_EXTENSIONS: string[];
21
- export declare const compile: CompileFunc;
21
+ export declare const compile: CompileFunc;
@@ -1,23 +1,23 @@
1
1
  import { CompileFunc } from '../../common';
2
2
  export * from '@babel/core';
3
3
  export interface ITsconfig {
4
- compilerOptions?: {
5
- rootDir?: string;
6
- baseUrl?: string;
7
- declaration?: boolean;
8
- emitDeclarationOnly?: boolean;
9
- isolatedModules?: boolean;
10
- allowJs?: boolean;
11
- outDir?: string;
12
- paths?: Record<string, string[]>;
13
- } | undefined;
14
- include?: string[];
15
- exclude?: string[];
4
+ compilerOptions?: {
5
+ rootDir?: string;
6
+ baseUrl?: string;
7
+ declaration?: boolean;
8
+ emitDeclarationOnly?: boolean;
9
+ isolatedModules?: boolean;
10
+ allowJs?: boolean;
11
+ outDir?: string;
12
+ paths?: Record<string, string[]>;
13
+ } | undefined;
14
+ include?: string[];
15
+ exclude?: string[];
16
16
  }
17
17
  export declare const readTsConfig: <T extends ITsconfig | null>(tsconfigPath: string, noExistReturn?: T) => ITsconfig | T;
18
18
  export declare const existTsConfigFile: (tsconfigAbsolutePath: string) => boolean;
19
19
  export interface IPackageModeValue {
20
- tsconfigPath: string;
20
+ tsconfigPath: string;
21
21
  }
22
22
  export declare const resolveBabelConfig: (appDirectory: string, config: Parameters<CompileFunc>[1], option: IPackageModeValue) => any;
23
- export declare const compileByBabel: CompileFunc;
23
+ export declare const compileByBabel: CompileFunc;
@@ -1,3 +1,3 @@
1
1
  import { PluginOptions } from '@babel/core';
2
2
  import type { AliasOption } from './types';
3
- export declare const aliasPlugin: (alias: AliasOption) => [string, PluginOptions];
3
+ export declare const aliasPlugin: (alias: AliasOption) => [string, PluginOptions];
@@ -1,4 +1,4 @@
1
1
  import { ILibPresetOption } from './types';
2
2
  export declare const getBabelConfig: (libPresetOption: ILibPresetOption) => import("@babel/core").TransformOptions;
3
3
  export * from './types';
4
- export { applyUserBabelConfig } from '@modern-js/utils';
4
+ export { applyUserBabelConfig } from '@modern-js/utils';
@@ -1,11 +1,11 @@
1
1
  export interface AliasOption {
2
- absoluteBaseUrl: string;
3
- paths?: Record<string, string | string[]>;
4
- isTsPath?: boolean;
5
- isTsProject?: boolean;
2
+ absoluteBaseUrl: string;
3
+ paths?: Record<string, string | string[]>;
4
+ isTsPath?: boolean;
5
+ isTsProject?: boolean;
6
6
  }
7
7
  export interface ILibPresetOption {
8
- appDirectory: string;
9
- alias?: AliasOption;
8
+ appDirectory: string;
9
+ alias?: AliasOption;
10
10
  }
11
- export type JsxTransformRuntimeType = 'automatic' | 'classic';
11
+ export type JsxTransformRuntimeType = 'automatic' | 'classic';
@@ -1,2 +1,2 @@
1
1
  import type { CompileFunc } from '../../common';
2
- export declare const compileByTs: CompileFunc;
2
+ export declare const compileByTs: CompileFunc;
@@ -1,2 +1,2 @@
1
1
  import * as ts from 'typescript';
2
- export declare function tsconfigPathsBeforeHookFactory(tsBinary: typeof ts, baseUrl: string, paths: Record<string, string[] | string>): ((ctx: ts.TransformationContext) => ts.Transformer<any>) | undefined;
2
+ export declare function tsconfigPathsBeforeHookFactory(tsBinary: typeof ts, baseUrl: string, paths: Record<string, string[] | string>): ((ctx: ts.TransformationContext) => ts.Transformer<any>) | undefined;
@@ -1,11 +1,9 @@
1
1
  import type ts from 'typescript';
2
2
  export declare class TypescriptLoader {
3
- private tsBinary?;
4
- private appDirectory?;
5
- constructor({
6
- appDirectory
7
- }: {
8
- appDirectory: string;
9
- });
10
- load(): typeof ts;
11
- }
3
+ private tsBinary?;
4
+ private appDirectory?;
5
+ constructor({ appDirectory }: {
6
+ appDirectory: string;
7
+ });
8
+ load(): typeof ts;
9
+ }
@@ -1,2 +1,2 @@
1
1
  export * from './compilers/babel';
2
- export { compile } from './common';
2
+ export { compile } from './common';
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.41.0",
18
+ "version": "2.42.1",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -39,9 +39,9 @@
39
39
  "@rsbuild/babel-preset": "0.0.7",
40
40
  "@swc/helpers": "0.5.3",
41
41
  "babel-plugin-transform-typescript-metadata": "^0.3.2",
42
- "@modern-js/babel-compiler": "2.41.0",
43
- "@modern-js/utils": "2.41.0",
44
- "@modern-js/babel-plugin-module-resolver": "2.41.0"
42
+ "@modern-js/babel-compiler": "2.42.1",
43
+ "@modern-js/babel-plugin-module-resolver": "2.42.1",
44
+ "@modern-js/utils": "2.42.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/babel__core": "^7.20.1",
@@ -50,9 +50,9 @@
50
50
  "jest": "^29",
51
51
  "ts-jest": "^29.1.0",
52
52
  "typescript": "^5",
53
- "@modern-js/server-core": "2.41.0",
54
- "@scripts/build": "2.41.0",
55
- "@scripts/jest-config": "2.41.0"
53
+ "@modern-js/server-core": "2.42.1",
54
+ "@scripts/build": "2.42.1",
55
+ "@scripts/jest-config": "2.42.1"
56
56
  },
57
57
  "sideEffects": false,
58
58
  "publishConfig": {