@modern-js/module-tools 0.0.0-nightly-20231218170633 → 0.0.0-nightly-20231219170633

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 (91) hide show
  1. package/dist/builder/clear.js +21 -14
  2. package/dist/builder/esbuild/adapter.js +1 -1
  3. package/dist/utils/dts.js +9 -2
  4. package/package.json +14 -14
  5. package/dist/build.d.ts +0 -3
  6. package/dist/builder/build.d.ts +0 -13
  7. package/dist/builder/clear.d.ts +0 -2
  8. package/dist/builder/copy.d.ts +0 -17
  9. package/dist/builder/dts/index.d.ts +0 -2
  10. package/dist/builder/dts/rollup.d.ts +0 -4
  11. package/dist/builder/dts/tsc.d.ts +0 -3
  12. package/dist/builder/esbuild/adapter.d.ts +0 -3
  13. package/dist/builder/esbuild/hook.d.ts +0 -4
  14. package/dist/builder/esbuild/index.d.ts +0 -35
  15. package/dist/builder/esbuild/resolve.d.ts +0 -18
  16. package/dist/builder/esbuild/sourcemap.d.ts +0 -16
  17. package/dist/builder/esbuild/transform.d.ts +0 -7
  18. package/dist/builder/esbuild/watch.d.ts +0 -2
  19. package/dist/builder/esbuild/write-file.d.ts +0 -2
  20. package/dist/builder/feature/asset.d.ts +0 -19
  21. package/dist/builder/feature/format-cjs.d.ts +0 -5
  22. package/dist/builder/feature/index.d.ts +0 -2
  23. package/dist/builder/feature/json.d.ts +0 -5
  24. package/dist/builder/feature/redirect.d.ts +0 -5
  25. package/dist/builder/feature/style/index.d.ts +0 -5
  26. package/dist/builder/feature/style/lessAliasPlugin.d.ts +0 -12
  27. package/dist/builder/feature/style/lessRender.d.ts +0 -2
  28. package/dist/builder/feature/style/postcssTransformer.d.ts +0 -6
  29. package/dist/builder/feature/style/postcssUrlPlugin.d.ts +0 -6
  30. package/dist/builder/feature/style/sassRender.d.ts +0 -2
  31. package/dist/builder/feature/style/transformStyle.d.ts +0 -13
  32. package/dist/builder/feature/style/utils.d.ts +0 -18
  33. package/dist/builder/feature/swc.d.ts +0 -9
  34. package/dist/builder/feature/terser.d.ts +0 -5
  35. package/dist/builder/index.d.ts +0 -8
  36. package/dist/builder/platform.d.ts +0 -4
  37. package/dist/cli.d.ts +0 -3
  38. package/dist/command.d.ts +0 -7
  39. package/dist/config/defineConfig.d.ts +0 -8
  40. package/dist/config/merge.d.ts +0 -9
  41. package/dist/config/normalize.d.ts +0 -8
  42. package/dist/config/transformLegacyConfig.d.ts +0 -25
  43. package/dist/config/valid.d.ts +0 -3
  44. package/dist/constants/build.d.ts +0 -6
  45. package/dist/constants/color.d.ts +0 -4
  46. package/dist/constants/dts.d.ts +0 -2
  47. package/dist/constants/file.d.ts +0 -3
  48. package/dist/constants/legacy-preset.d.ts +0 -18
  49. package/dist/constants/loader.d.ts +0 -2
  50. package/dist/constants/log.d.ts +0 -3
  51. package/dist/constants/preset.d.ts +0 -26
  52. package/dist/debug.d.ts +0 -4
  53. package/dist/dev.d.ts +0 -6
  54. package/dist/error.d.ts +0 -33
  55. package/dist/hooks/build.d.ts +0 -22
  56. package/dist/hooks/dev.d.ts +0 -13
  57. package/dist/hooks/index.d.ts +0 -30
  58. package/dist/hooks/misc.d.ts +0 -13
  59. package/dist/index.d.ts +0 -7
  60. package/dist/locale/en.d.ts +0 -45
  61. package/dist/locale/index.d.ts +0 -92
  62. package/dist/locale/zh.d.ts +0 -45
  63. package/dist/plugins.d.ts +0 -2
  64. package/dist/types/color.d.ts +0 -1
  65. package/dist/types/command.d.ts +0 -12
  66. package/dist/types/config/copy.d.ts +0 -15
  67. package/dist/types/config/dev.d.ts +0 -8
  68. package/dist/types/config/index.d.ts +0 -166
  69. package/dist/types/config/style.d.ts +0 -64
  70. package/dist/types/context.d.ts +0 -5
  71. package/dist/types/dts.d.ts +0 -46
  72. package/dist/types/esbuild.d.ts +0 -107
  73. package/dist/types/hooks.d.ts +0 -31
  74. package/dist/types/index.d.ts +0 -27
  75. package/dist/types/legacyConfig/index.d.ts +0 -20
  76. package/dist/types/legacyConfig/output.d.ts +0 -61
  77. package/dist/types/legacyConfig/source.d.ts +0 -12
  78. package/dist/types/legacyConfig/tools.d.ts +0 -53
  79. package/dist/utils/assert.d.ts +0 -5
  80. package/dist/utils/builder.d.ts +0 -19
  81. package/dist/utils/common.d.ts +0 -5
  82. package/dist/utils/dts.d.ts +0 -10
  83. package/dist/utils/hash.d.ts +0 -2
  84. package/dist/utils/index.d.ts +0 -11
  85. package/dist/utils/input.d.ts +0 -8
  86. package/dist/utils/log.d.ts +0 -1
  87. package/dist/utils/map.d.ts +0 -13
  88. package/dist/utils/onExit.d.ts +0 -1
  89. package/dist/utils/outExtension.d.ts +0 -9
  90. package/dist/utils/print.d.ts +0 -14
  91. package/dist/utils/style.d.ts +0 -13
package/dist/dev.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import type { PluginAPI } from '@modern-js/core';
2
- import type { DevCommandOptions } from './types/command';
3
- import type { ModuleContext } from './types/context';
4
- import type { DevToolData, ModuleTools } from './types';
5
- export declare const showMenu: (metas: DevToolData[], devCmdOptions: DevCommandOptions, api: PluginAPI<ModuleTools>, context: ModuleContext) => Promise<void>;
6
- export declare const dev: (options: DevCommandOptions, metas: DevToolData[], api: PluginAPI<ModuleTools>, context: ModuleContext) => Promise<void>;
package/dist/error.d.ts DELETED
@@ -1,33 +0,0 @@
1
- import type { ExecaError } from '@modern-js/utils';
2
- import type { BuildType, Format, Target } from './types';
3
- export declare const padSpaceWith: (str: string, targetL: number, opts?: {
4
- endStr?: string | undefined;
5
- style?: ((s: string) => string) | undefined;
6
- }) => string;
7
- export declare class InternalBuildError extends Error {
8
- buildType: BuildType;
9
- target: Target;
10
- format: Format;
11
- private e;
12
- constructor(e: Error, opts: {
13
- buildType: BuildType;
14
- format: Format;
15
- target: Target;
16
- });
17
- toString(): string;
18
- formatError(): string[];
19
- }
20
- export declare class InternalDTSError extends Error {
21
- buildType: BuildType;
22
- private e;
23
- constructor(e: Error | ExecaError, opts: {
24
- buildType: BuildType;
25
- });
26
- toString(): string;
27
- formatError(): string[];
28
- }
29
- export declare class ModuleBuildError extends Error {
30
- constructor(e: InternalBuildError | InternalDTSError);
31
- }
32
- export declare const isInternalError: (e: unknown) => e is InternalBuildError | InternalDTSError;
33
- export declare const isExecaError: (e: any) => e is ExecaError<string>;
@@ -1,22 +0,0 @@
1
- import type { RegisterBuildPlatformResult } from '@modern-js/core';
2
- import { BuildCommandOptions } from '../types';
3
- import type { BuildTaskResult, BuildResult, BuildPlatformResult, WatchDtsHookContext, WatchJsHookContext, BaseBuildConfig } from '../types';
4
- export declare const buildHooks: {
5
- beforeBuild: import("@modern-js/plugin").ParallelWorkflow<{
6
- config: BaseBuildConfig[];
7
- cliOptions: BuildCommandOptions;
8
- }, void>;
9
- beforeBuildTask: import("@modern-js/plugin").AsyncWaterfall<BaseBuildConfig>;
10
- afterBuildTask: import("@modern-js/plugin").ParallelWorkflow<BuildTaskResult, void>;
11
- afterBuild: import("@modern-js/plugin").ParallelWorkflow<BuildResult, void>;
12
- registerBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<void, RegisterBuildPlatformResult>;
13
- beforeBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<RegisterBuildPlatformResult[], void>;
14
- buildPlatform: import("@modern-js/plugin").ParallelWorkflow<{
15
- platform: string;
16
- }, void>;
17
- afterBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<BuildPlatformResult, void>;
18
- };
19
- export declare const buildWatchHooks: {
20
- buildWatchJs: import("@modern-js/plugin").ParallelWorkflow<WatchJsHookContext, void>;
21
- buildWatchDts: import("@modern-js/plugin").ParallelWorkflow<WatchDtsHookContext, void>;
22
- };
@@ -1,13 +0,0 @@
1
- import type { DevToolData, PromptResult } from '../types/hooks';
2
- export declare const devHooks: {
3
- registerDev: import("@modern-js/plugin").ParallelWorkflow<void, DevToolData>;
4
- beforeDev: import("@modern-js/plugin").ParallelWorkflow<DevToolData[], void>;
5
- beforeDevMenu: import("@modern-js/plugin").AsyncWaterfall<any>;
6
- afterDevMenu: import("@modern-js/plugin").ParallelWorkflow<{
7
- result: PromptResult;
8
- devTools: DevToolData[];
9
- }, void>;
10
- beforeDevTask: import("@modern-js/plugin").ParallelWorkflow<DevToolData, void>;
11
- afterDev: import("@modern-js/plugin").ParallelWorkflow<void, void>;
12
- noDevTools: import("@modern-js/plugin").AsyncWaterfall<string>;
13
- };
@@ -1,30 +0,0 @@
1
- export declare const registerHook: {
2
- buildWatchJs: import("@modern-js/plugin").ParallelWorkflow<import("..").WatchJsHookContext, void>;
3
- buildWatchDts: import("@modern-js/plugin").ParallelWorkflow<import("..").WatchDtsHookContext, void>;
4
- addRuntimeExports: import("@modern-js/plugin").AsyncWaterfall<void>;
5
- resolveModuleUserConfig: import("@modern-js/plugin").AsyncWaterfall<import("..").ModuleUserConfig>;
6
- modifyLibuild: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
7
- registerDev: import("@modern-js/plugin").ParallelWorkflow<void, import("..").DevToolData>;
8
- beforeDev: import("@modern-js/plugin").ParallelWorkflow<import("..").DevToolData[], void>;
9
- beforeDevMenu: import("@modern-js/plugin").AsyncWaterfall<any>;
10
- afterDevMenu: import("@modern-js/plugin").ParallelWorkflow<{
11
- result: import("..").PromptResult;
12
- devTools: import("..").DevToolData[];
13
- }, void>;
14
- beforeDevTask: import("@modern-js/plugin").ParallelWorkflow<import("..").DevToolData, void>;
15
- afterDev: import("@modern-js/plugin").ParallelWorkflow<void, void>;
16
- noDevTools: import("@modern-js/plugin").AsyncWaterfall<string>;
17
- beforeBuild: import("@modern-js/plugin").ParallelWorkflow<{
18
- config: import("..").BaseBuildConfig[];
19
- cliOptions: import("..").BuildCommandOptions;
20
- }, void>;
21
- beforeBuildTask: import("@modern-js/plugin").AsyncWaterfall<import("..").BaseBuildConfig>;
22
- afterBuildTask: import("@modern-js/plugin").ParallelWorkflow<import("..").BuildTaskResult, void>;
23
- afterBuild: import("@modern-js/plugin").ParallelWorkflow<import("..").BuildResult, void>;
24
- registerBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<void, import("@modern-js/core").RegisterBuildPlatformResult>;
25
- beforeBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<import("@modern-js/core").RegisterBuildPlatformResult[], void>;
26
- buildPlatform: import("@modern-js/plugin").ParallelWorkflow<{
27
- platform: string;
28
- }, void>;
29
- afterBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<import("..").BuildPlatformResult, void>;
30
- };
@@ -1,13 +0,0 @@
1
- import { ModuleUserConfig } from '../types';
2
- export declare const miscHooks: {
3
- addRuntimeExports: import("@modern-js/plugin").AsyncWaterfall<void>;
4
- /**
5
- * Change user configuration
6
- */
7
- resolveModuleUserConfig: import("@modern-js/plugin").AsyncWaterfall<ModuleUserConfig>;
8
- /**
9
- * @deprecated
10
- * use buildConfig.hooks and buildConfig.esbuildOptions instead.
11
- */
12
- modifyLibuild: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
13
- };
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { moduleTools } from './cli';
2
- export { defineConfig, defineLegacyConfig } from './config/defineConfig';
3
- export { legacyPresets } from './constants/legacy-preset';
4
- export * from './types';
5
- export { moduleTools };
6
- export default moduleTools;
7
- export * from './utils/assert';
@@ -1,45 +0,0 @@
1
- export declare const EN_LOCALE: {
2
- command: {
3
- shared: {
4
- config: string;
5
- noNeedInstall: string;
6
- };
7
- build: {
8
- describe: string;
9
- watch: string;
10
- tsconfig: string;
11
- styleOnly: string;
12
- platform: string;
13
- noTsc: string;
14
- dts: string;
15
- noClear: string;
16
- };
17
- dev: {
18
- describe: string;
19
- tsconfig: string;
20
- };
21
- new: {
22
- describe: string;
23
- debug: string;
24
- config: string;
25
- distTag: string;
26
- registry: string;
27
- lang: string;
28
- };
29
- };
30
- log: {
31
- dev: {
32
- noDevtools: string;
33
- };
34
- buildConfigTip: string;
35
- };
36
- errors: {
37
- externalHelpers: string;
38
- };
39
- warns: {
40
- dts: {
41
- abortOnError: string;
42
- };
43
- clearRootPath: string;
44
- };
45
- };
@@ -1,92 +0,0 @@
1
- import { I18n } from '@modern-js/plugin-i18n';
2
- declare const i18n: I18n;
3
- declare const localeKeys: {
4
- command: {
5
- shared: {
6
- config: string;
7
- noNeedInstall: string;
8
- };
9
- build: {
10
- describe: string;
11
- watch: string;
12
- tsconfig: string;
13
- styleOnly: string;
14
- platform: string;
15
- noTsc: string;
16
- dts: string;
17
- noClear: string;
18
- };
19
- dev: {
20
- describe: string;
21
- tsconfig: string;
22
- };
23
- new: {
24
- describe: string;
25
- debug: string;
26
- config: string;
27
- distTag: string;
28
- registry: string;
29
- lang: string;
30
- };
31
- };
32
- log: {
33
- dev: {
34
- noDevtools: string;
35
- };
36
- buildConfigTip: string;
37
- };
38
- errors: {
39
- externalHelpers: string;
40
- };
41
- warns: {
42
- dts: {
43
- abortOnError: string;
44
- };
45
- clearRootPath: string;
46
- };
47
- } | {
48
- command: {
49
- shared: {
50
- config: string;
51
- noNeedInstall: string;
52
- };
53
- build: {
54
- describe: string;
55
- watch: string;
56
- tsconfig: string;
57
- styleOnly: string;
58
- platform: string;
59
- noTsc: string;
60
- dts: string;
61
- noClear: string;
62
- };
63
- dev: {
64
- describe: string;
65
- tsconfig: string;
66
- };
67
- new: {
68
- describe: string;
69
- debug: string;
70
- config: string;
71
- distTag: string;
72
- registry: string;
73
- lang: string;
74
- };
75
- };
76
- log: {
77
- dev: {
78
- noDevtools: string;
79
- };
80
- buildConfigTip: string;
81
- };
82
- errors: {
83
- externalHelpers: string;
84
- };
85
- warns: {
86
- dts: {
87
- abortOnError: string;
88
- };
89
- clearRootPath: string;
90
- };
91
- };
92
- export { i18n, localeKeys };
@@ -1,45 +0,0 @@
1
- export declare const ZH_LOCALE: {
2
- command: {
3
- shared: {
4
- config: string;
5
- noNeedInstall: string;
6
- };
7
- build: {
8
- describe: string;
9
- watch: string;
10
- tsconfig: string;
11
- styleOnly: string;
12
- platform: string;
13
- noTsc: string;
14
- dts: string;
15
- noClear: string;
16
- };
17
- dev: {
18
- describe: string;
19
- tsconfig: string;
20
- };
21
- new: {
22
- describe: string;
23
- debug: string;
24
- config: string;
25
- distTag: string;
26
- registry: string;
27
- lang: string;
28
- };
29
- };
30
- log: {
31
- dev: {
32
- noDevtools: string;
33
- };
34
- buildConfigTip: string;
35
- };
36
- errors: {
37
- externalHelpers: string;
38
- };
39
- warns: {
40
- dts: {
41
- abortOnError: string;
42
- };
43
- clearRootPath: string;
44
- };
45
- };
package/dist/plugins.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { CliPlugin } from '@modern-js/core';
2
- export declare const getPlugins: (runningCmd: string) => CliPlugin[];
@@ -1 +0,0 @@
1
- export type RGB = [number, number, number];
@@ -1,12 +0,0 @@
1
- export interface DevCommandOptions {
2
- port?: string;
3
- tsconfig?: string;
4
- }
5
- export interface BuildCommandOptions {
6
- clear: boolean;
7
- dts: boolean;
8
- watch: boolean;
9
- config?: string;
10
- platform?: boolean | string[];
11
- tsconfig?: string;
12
- }
@@ -1,15 +0,0 @@
1
- import type { globby } from '@modern-js/utils';
2
- export interface CopyPattern {
3
- from: string;
4
- to?: string;
5
- context?: string;
6
- globOptions?: globby.GlobbyOptions;
7
- }
8
- export interface CopyOptions {
9
- patterns?: CopyPattern[];
10
- options?: {
11
- concurrency?: number;
12
- enableCopySync?: boolean;
13
- };
14
- }
15
- export type CopyConfig = CopyOptions;
@@ -1,8 +0,0 @@
1
- import type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';
2
- export interface StorybookBuildConfig {
3
- webpack?: WebpackBuilderToolsConfig['webpack'];
4
- webpackChain?: WebpackBuilderToolsConfig['webpackChain'];
5
- }
6
- export interface Dev {
7
- storybook?: StorybookBuildConfig;
8
- }
@@ -1,166 +0,0 @@
1
- import type { BuildOptions } from 'esbuild';
2
- import type { ImportItem } from '@modern-js/swc-plugins';
3
- import type { Config } from '@svgr/core';
4
- import type { CreateFilter } from '@rollup/pluginutils';
5
- import type { MinifyOptions as TerserMinifyOptions } from 'terser';
6
- import type { TestConfig } from '@modern-js/types';
7
- import { internalPreset, presetList } from '../../constants/preset';
8
- import { ICompiler } from '../esbuild';
9
- import type { CopyConfig } from './copy';
10
- import type { Dev } from './dev';
11
- import type { Style, StyleConfig } from './style';
12
- export * from './style';
13
- export * from './dev';
14
- export * from './copy';
15
- export type HookList = {
16
- name: string;
17
- apply: (compiler: ICompiler) => void;
18
- }[];
19
- export type EsbuildOptions = (options: BuildOptions) => BuildOptions;
20
- export type BuildType = 'bundleless' | 'bundle';
21
- export type Target = 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
22
- export type Minify = 'esbuild' | 'terser' | false | TerserMinifyOptions;
23
- export type Format = 'esm' | 'cjs' | 'umd' | 'iife';
24
- export type Input = {
25
- [name: string]: string;
26
- } | string[];
27
- export type Globals = Record<any, any>;
28
- export type Define = Record<string, string>;
29
- export type Externals = (string | RegExp)[];
30
- export type Platform = 'node' | 'browser';
31
- export type SideEffects = RegExp[] | boolean | ((id: string, external: boolean) => boolean);
32
- /**
33
- * @experimental
34
- */
35
- export type Redirect = {
36
- alias?: boolean;
37
- style?: boolean;
38
- asset?: boolean;
39
- autoExtension?: boolean;
40
- };
41
- export type DTSOptions = {
42
- abortOnError: boolean;
43
- distPath: string;
44
- only: boolean;
45
- /**
46
- * @deprecated
47
- * use buildConfig.tsconfig instead.
48
- */
49
- tsconfigPath?: string;
50
- /**
51
- * Only for rollup-plugin-dts, see more in https://github.com/Swatinem/rollup-plugin-dts#what-to-expect.
52
- * We hope you use external to prevent them(like @types) which come from node_modules from be bundled.
53
- * However, some types from outside that we don't re-export are also checked by plugin.
54
- * And a third-party package is uncontrollable, it may cause errors.
55
- * You can overridden by setting it false to excluded all packages from node_modules.
56
- * @default true
57
- */
58
- respectExternal: boolean;
59
- };
60
- export type DTS = false | Partial<DTSOptions>;
61
- export interface SvgrOptions extends Config {
62
- include?: Parameters<CreateFilter>[0];
63
- exclude?: Parameters<CreateFilter>[1];
64
- }
65
- export interface Asset {
66
- path?: string;
67
- limit?: number;
68
- publicPath?: string | ((filePath: string) => string);
69
- svgr?: boolean | SvgrOptions;
70
- }
71
- export type AutoExternal = boolean | {
72
- dependencies?: boolean;
73
- peerDependencies?: boolean;
74
- };
75
- export type JSX = 'automatic' | 'transform' | 'preserve';
76
- export type ExternalHelpers = boolean;
77
- export type BannerAndFooter = {
78
- js?: string;
79
- css?: string;
80
- dts?: string;
81
- };
82
- export type AliasOption = Record<string, string> | ((aliases: Record<string, string>) => Record<string, string> | void);
83
- export type Resolve = {
84
- mainFields?: string[];
85
- jsExtensions?: string[];
86
- };
87
- export type BaseBuildConfig = Omit<Required<PartialBaseBuildConfig>, 'dts' | 'style' | 'alias' | 'sideEffects' | 'asset' | 'resolve'> & {
88
- sideEffects?: SideEffects;
89
- dts: false | DTSOptions;
90
- style: Style;
91
- alias: Record<string, string>;
92
- asset: Required<Asset>;
93
- resolve: Required<Resolve>;
94
- };
95
- export type PartialBaseBuildConfig = {
96
- shims?: boolean;
97
- autoExtension?: boolean;
98
- resolve?: Resolve;
99
- footer?: BannerAndFooter;
100
- banner?: BannerAndFooter;
101
- buildType?: 'bundleless' | 'bundle';
102
- format?: Format;
103
- target?: Target;
104
- dts?: DTS;
105
- sourceMap?: boolean | 'inline' | 'external';
106
- sourceDir?: string;
107
- copy?: CopyConfig;
108
- asset?: Asset;
109
- jsx?: JSX;
110
- outDir?: string;
111
- alias?: AliasOption;
112
- hooks?: HookList;
113
- input?: Input;
114
- tsconfig?: string;
115
- metafile?: boolean;
116
- platform?: Platform;
117
- splitting?: boolean;
118
- minify?: Minify;
119
- externals?: Externals;
120
- autoExternal?: AutoExternal;
121
- umdGlobals?: Globals;
122
- umdModuleName?: ((chunkName: string) => string) | string | undefined;
123
- define?: Define;
124
- style?: StyleConfig;
125
- redirect?: Redirect;
126
- sideEffects?: SideEffects;
127
- esbuildOptions?: EsbuildOptions;
128
- /**
129
- * @internal
130
- * cache transform result or not
131
- */
132
- transformCache?: boolean;
133
- externalHelpers?: ExternalHelpers;
134
- transformImport?: ImportItem[];
135
- transformLodash?: boolean;
136
- /**
137
- * @deprecated
138
- * @internal
139
- */
140
- disableSwcTransform?: boolean;
141
- /**
142
- * @deprecated
143
- */
144
- sourceType?: 'commonjs' | 'module';
145
- };
146
- export type BuildConfig = BaseBuildConfig | BaseBuildConfig[];
147
- export type PartialBuildConfig = PartialBaseBuildConfig | PartialBaseBuildConfig[];
148
- export type BuildPreset = keyof typeof presetList | ((options: {
149
- preset: typeof internalPreset;
150
- extendPreset: (extendPresetName: keyof typeof internalPreset, extendBuildConfig: PartialBaseBuildConfig) => PartialBaseBuildConfig[];
151
- }) => PartialBaseBuildConfig[] | Promise<PartialBaseBuildConfig[]>);
152
- export interface RuntimeUserConfig {
153
- [name: string]: any;
154
- }
155
- export interface ModuleExtraConfig {
156
- /**
157
- * @deprecated designSystem is no longer required.
158
- * If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
159
- */
160
- designSystem?: Record<string, any>;
161
- buildConfig?: PartialBuildConfig;
162
- buildPreset?: BuildPreset;
163
- dev?: Dev;
164
- testing?: TestConfig;
165
- runtime?: RuntimeUserConfig;
166
- }
@@ -1,64 +0,0 @@
1
- import type { AcceptedPlugin as PostCSSPlugin, ProcessOptions, Plugin } from 'postcss';
2
- import type { Options as sassOptions } from '../../../compiled/sass';
3
- import Less from '../../../compiled/less';
4
- type LocalsConventionFunction = (originalClassName: string, generatedClassName: string, inputFile: string) => string;
5
- type GenerateScopedNameFunction = (name: string, filename: string, css: string) => string;
6
- declare class Loader {
7
- finalSource?: string | undefined;
8
- constructor(root: string, plugins: Plugin[]);
9
- fetch(file: string, relativeTo: string, depTrace: string): Promise<{
10
- [key: string]: string;
11
- }>;
12
- }
13
- type AdditionalData = string | ((filePath: string) => string);
14
- export type Modules = {
15
- localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly' | LocalsConventionFunction;
16
- scopeBehaviour?: 'global' | 'local';
17
- globalModulePaths?: RegExp[];
18
- generateScopedName?: string | GenerateScopedNameFunction;
19
- hashPrefix?: string;
20
- exportGlobals?: boolean;
21
- root?: string;
22
- resolve?: (file: string) => string | Promise<string>;
23
- Loader?: typeof Loader;
24
- getJSON?: (cssFilename: string, json: {
25
- [name: string]: string;
26
- }, outputFilename?: string) => void;
27
- };
28
- export type AutoModules = boolean | RegExp;
29
- export type LessOptions = {
30
- additionalData?: AdditionalData;
31
- implementation?: object | string;
32
- lessOptions?: Less.Options;
33
- };
34
- export type SassOptions = {
35
- additionalData?: AdditionalData;
36
- implementation?: object | string;
37
- sassOptions?: sassOptions<'async'>;
38
- };
39
- export type PostcssOptions = {
40
- processOptions?: ProcessOptions;
41
- plugins?: PostCSSPlugin[];
42
- };
43
- export type LessConfig = LessOptions | ((options: LessOptions) => LessOptions | void);
44
- export type SassConfig = SassOptions | ((options: SassOptions) => SassOptions | void);
45
- export type PostCSSConfigUtils = {
46
- addPlugins: (plugins: PostCSSPlugin | PostCSSPlugin[]) => void;
47
- };
48
- export type PostCSSConfig = PostcssOptions | ((options: PostcssOptions, utils: PostCSSConfigUtils) => PostcssOptions | void);
49
- export type TailwindCSSConfig = Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
50
- export interface Style extends Required<StyleConfig> {
51
- sass: SassOptions;
52
- less: LessOptions;
53
- postcss: PostcssOptions;
54
- }
55
- export interface StyleConfig {
56
- inject?: boolean;
57
- sass?: SassConfig;
58
- less?: LessConfig;
59
- postcss?: PostCSSConfig;
60
- autoModules?: boolean | RegExp;
61
- modules?: Modules;
62
- tailwindcss?: TailwindCSSConfig;
63
- }
64
- export {};
@@ -1,5 +0,0 @@
1
- export interface ModuleContext {
2
- isTsProject: boolean;
3
- appDirectory: string;
4
- srcDirectory: string;
5
- }
@@ -1,46 +0,0 @@
1
- import type { AliasOption, BaseBuildConfig, Input } from './config';
2
- export interface GeneratorDtsConfig {
3
- appDirectory: string;
4
- tsconfigPath: string;
5
- watch: boolean;
6
- sourceDir: string;
7
- alias: AliasOption;
8
- abortOnError?: boolean;
9
- footer?: string;
10
- banner?: string;
11
- distPath: string;
12
- externals: BaseBuildConfig['externals'];
13
- input: Input;
14
- respectExternal: boolean;
15
- dtsExtension: string;
16
- userTsconfig: ITsconfig;
17
- }
18
- export interface GeneratedDtsInfo {
19
- userTsconfig: ITsconfig;
20
- tempTsconfigPath: string;
21
- tempDistAbsRootPath: string;
22
- tempDistAbsSrcPath: string;
23
- }
24
- export type TsTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
25
- export interface ITsconfig {
26
- compilerOptions?: {
27
- rootDir?: string;
28
- baseUrl?: string;
29
- declaration?: boolean;
30
- declarationDir?: string;
31
- emitDeclarationOnly?: boolean;
32
- emitDecoratorMetadata?: boolean;
33
- isolatedModules?: boolean;
34
- allowJs?: boolean;
35
- outDir?: string;
36
- paths?: Record<string, string[]>;
37
- target?: TsTarget;
38
- useDefineForClassFields?: boolean;
39
- } | undefined;
40
- include?: string[];
41
- exclude?: string[];
42
- extends?: string;
43
- references?: {
44
- path?: string;
45
- }[];
46
- }