@modern-js/module-tools 2.65.5 → 2.66.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.
@@ -1,4 +1,3 @@
1
- import { watch } from '@modern-js/utils';
2
1
  import type { BaseBuildConfig } from '../types/config';
3
2
  import type { CopyOptions, CopyPattern } from '../types/config/copy';
4
3
  export declare const runPatterns: (pattern: CopyPattern, options: {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ICompiler } from '../../types';
3
2
  export declare const asset: {
4
3
  name: string;
@@ -14,5 +13,5 @@ export declare const asset: {
14
13
  */
15
14
  export declare function getAssetContents(this: ICompiler, assetPath: string, rebaseFrom: string, calledOnLoad?: boolean): Promise<{
16
15
  contents: string | Buffer;
17
- loader: "text" | "copy" | "jsx";
16
+ loader: "copy" | "jsx" | "text";
18
17
  }>;
@@ -2,5 +2,5 @@ import type { ICompiler } from '../../../types';
2
2
  export declare const isCssModule: (filePath: string, autoModules: boolean | RegExp) => boolean;
3
3
  export declare const postcssTransformer: (css: string, entryPath: string, compilation: ICompiler) => Promise<{
4
4
  code: string;
5
- loader: 'js' | 'css';
5
+ loader: "js" | "css";
6
6
  }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { PartialMessage } from 'esbuild';
3
2
  import type { ICompiler, Source } from '../../../types';
4
3
  export type PreprocessRender = (content: string, stdinPath: string, stdinDir: string, preprocessOptions: any, resolvePathMap: Map<string, string>, implementation?: object | string) => Promise<{
package/dist/error.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { ExecaError } from '@modern-js/utils';
2
2
  import type { BuildType, Format, Target } from './types';
3
3
  export declare const padSpaceWith: (str: string, targetL: number, opts?: {
4
- endStr?: string | undefined;
5
- style?: ((s: string) => string) | undefined;
4
+ endStr?: string;
5
+ style?: (s: string) => string;
6
6
  }) => string;
7
7
  export declare class InternalBuildError extends Error {
8
8
  buildType: BuildType;
@@ -28,5 +28,5 @@ export declare class InternalDTSError extends Error {
28
28
  export declare class ModuleBuildError extends Error {
29
29
  constructor(e: InternalBuildError | InternalDTSError);
30
30
  }
31
- export declare const isInternalError: (e: unknown) => e is InternalBuildError | InternalDTSError;
32
- export declare const isExecaError: (e: any) => e is ExecaError<string>;
31
+ export declare const isInternalError: (e: unknown) => e is InternalDTSError | InternalBuildError;
32
+ export declare const isExecaError: (e: any) => e is ExecaError;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { FSWatcher } from '@modern-js/utils';
3
2
  import type { BuildContext, BuildOptions, BuildResult, ImportKind, OnLoadArgs, OnLoadResult } from 'esbuild';
4
3
  import type { AsyncSeriesBailHook, AsyncSeriesWaterfallHook } from 'tapable';
@@ -1,5 +1,5 @@
1
1
  export declare function isStyleExt(path: string): boolean;
2
2
  export declare function isJsExt(path: string): boolean;
3
- export declare function isJsLoader(loader?: string): boolean;
3
+ export declare function isJsLoader(loader?: string): loader is "js" | "jsx" | "ts" | "tsx";
4
4
  export declare function isTsExt(path: string): boolean;
5
- export declare function isTsLoader(loader?: string): boolean;
5
+ export declare function isTsLoader(loader?: string): loader is "ts" | "tsx";
@@ -7,4 +7,4 @@ export declare const printOrThrowDtsErrors: (error: unknown, options: {
7
7
  abortOnError?: boolean;
8
8
  buildType: BuildType;
9
9
  }) => Promise<void>;
10
- export declare const tsTargetAtOrAboveES2022: (target: TsTarget) => boolean;
10
+ export declare const tsTargetAtOrAboveES2022: (target: TsTarget) => target is "esnext" | "es2022";
@@ -1,2 +1 @@
1
- /// <reference types="node" />
2
1
  export declare function getHash(content: Buffer | string, encoding: any, type?: string): string;
@@ -2,12 +2,12 @@ import type { LessOptions, PartialBaseBuildConfig, PostcssOptions, SassOptions }
2
2
  export declare const getLessConfig: (config: PartialBaseBuildConfig) => Promise<LessOptions>;
3
3
  export declare const getSassConfig: (config: PartialBaseBuildConfig) => Promise<SassOptions>;
4
4
  export declare const getPostcssConfig: (config: PartialBaseBuildConfig) => Promise<PostcssOptions & {
5
- $$tools?: string | undefined;
5
+ $$tools?: string;
6
6
  }>;
7
7
  export declare const getStyleConfig: (config: PartialBaseBuildConfig) => Promise<{
8
8
  less: LessOptions;
9
9
  sass: SassOptions;
10
10
  postcss: PostcssOptions & {
11
- $$tools?: string | undefined;
11
+ $$tools?: string;
12
12
  };
13
13
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/module-tools",
3
- "version": "2.65.5",
3
+ "version": "2.66.0",
4
4
  "description": "Simple, powerful, high-performance modern npm package development solution.",
5
5
  "keywords": [
6
6
  "modern",
@@ -70,21 +70,21 @@
70
70
  "tapable": "2.2.1",
71
71
  "terser": "^5.31.1",
72
72
  "tsconfig-paths-webpack-plugin": "4.1.0",
73
- "@modern-js/core": "2.65.5",
74
- "@modern-js/plugin-changeset": "2.65.5",
75
- "@modern-js/utils": "2.65.5",
76
- "@modern-js/plugin": "2.65.5",
77
- "@modern-js/plugin-i18n": "2.65.5",
78
- "@modern-js/types": "2.65.5"
73
+ "@modern-js/core": "2.66.0",
74
+ "@modern-js/plugin": "2.66.0",
75
+ "@modern-js/plugin-changeset": "2.66.0",
76
+ "@modern-js/types": "2.66.0",
77
+ "@modern-js/plugin-i18n": "2.66.0",
78
+ "@modern-js/utils": "2.66.0"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@rsbuild/core": "1.2.19",
82
82
  "@types/convert-source-map": "1.5.2",
83
83
  "@types/node": "^14",
84
84
  "typescript": "^5",
85
- "@scripts/build": "2.65.5",
86
- "@modern-js/self": "npm:@modern-js/module-tools@2.65.5",
87
- "@scripts/vitest-config": "2.65.5"
85
+ "@modern-js/self": "npm:@modern-js/module-tools@2.66.0",
86
+ "@scripts/build": "2.66.0",
87
+ "@scripts/vitest-config": "2.66.0"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "typescript": "^4 || ^5"