@moneko/core 3.55.2-beta.1 → 3.55.2

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 (134) hide show
  1. package/lib/loader/react-compiler.cjs +1 -1
  2. package/lib/loader/solid.cjs +1 -1
  3. package/lib/worker/react-compiler.mjs +1 -1
  4. package/package.json +1 -1
  5. package/lib/bin/build-app.d.mts +0 -16
  6. package/lib/bin/build.d.mts +0 -2
  7. package/lib/bin/changelog.d.mts +0 -1
  8. package/lib/bin/commit-lint.d.mts +0 -2
  9. package/lib/bin/eslint.d.mts +0 -1
  10. package/lib/bin/file.d.mts +0 -2
  11. package/lib/bin/git-hooks.d.mts +0 -1
  12. package/lib/bin/help.d.mts +0 -2
  13. package/lib/bin/index.d.mts +0 -2
  14. package/lib/bin/lessc.d.mts +0 -1
  15. package/lib/bin/pin.d.mts +0 -6
  16. package/lib/bin/pure-lint.d.mts +0 -2
  17. package/lib/bin/server.d.mts +0 -2
  18. package/lib/bin/setup.d.mts +0 -2
  19. package/lib/bin/start.d.mts +0 -2
  20. package/lib/bin/stylelint.d.mts +0 -2
  21. package/lib/bin/tsc.d.mts +0 -2
  22. package/lib/bin/utils/bundle-app.d.mts +0 -2
  23. package/lib/bin/utils/config.d.mts +0 -6
  24. package/lib/bin/utils/get-commit-files.d.mts +0 -2
  25. package/lib/bin/utils/setup-swcrc.d.mts +0 -2
  26. package/lib/build/common.d.mts +0 -3
  27. package/lib/build/server.d.mts +0 -3
  28. package/lib/build.d.mts +0 -1
  29. package/lib/commom/ca.d.mts +0 -8
  30. package/lib/commom/check-npm.d.mts +0 -4
  31. package/lib/commom/corepack.d.mts +0 -11
  32. package/lib/commom/diff-object.d.mts +0 -2
  33. package/lib/commom/esm.d.mts +0 -2
  34. package/lib/commom/has-pkg.d.mts +0 -2
  35. package/lib/commom/host.d.mts +0 -1
  36. package/lib/commom/is-ci-environment.d.mts +0 -6
  37. package/lib/commom/log.d.mts +0 -2
  38. package/lib/commom/match-path.d.mts +0 -22
  39. package/lib/commom/mime.d.mts +0 -2
  40. package/lib/commom/module-resolve.d.mts +0 -2
  41. package/lib/commom/net.d.mts +0 -2
  42. package/lib/commom/open.d.mts +0 -2
  43. package/lib/commom/parse-args.d.mts +0 -2
  44. package/lib/commom/parse-module-meta.d.mts +0 -9
  45. package/lib/commom/paths.d.mts +0 -52
  46. package/lib/commom/print-log.d.mts +0 -15
  47. package/lib/commom/reactive-object.d.mts +0 -10
  48. package/lib/commom/require.d.mts +0 -2
  49. package/lib/commom/rule.d.mts +0 -26
  50. package/lib/commom/setup-env.d.mts +0 -6
  51. package/lib/commom/sigint-exit.d.mts +0 -2
  52. package/lib/commom/timer.d.mts +0 -12
  53. package/lib/commom/transform-solid-js.d.mts +0 -18
  54. package/lib/common.d.mts +0 -3
  55. package/lib/config.d.mts +0 -4
  56. package/lib/dev/config.d.mts +0 -4
  57. package/lib/dev/generate-progress-html.d.mts +0 -6
  58. package/lib/dev/get-cert.d.mts +0 -8
  59. package/lib/dev/json-schema.d.mts +0 -70
  60. package/lib/dev/mock.d.mts +0 -67
  61. package/lib/dev/proxy.d.mts +0 -15
  62. package/lib/dev/server.d.mts +0 -26
  63. package/lib/dev.d.mts +0 -1
  64. package/lib/file-system.d.mts +0 -2
  65. package/lib/index.d.mts +0 -24
  66. package/lib/lint/eslint/base.d.mts +0 -2
  67. package/lib/lint/eslint/index.d.mts +0 -2
  68. package/lib/lint/eslint/react.d.mts +0 -2
  69. package/lib/lint/eslint/solid.d.mts +0 -2
  70. package/lib/lint/eslint/vue.d.mts +0 -2
  71. package/lib/lint/stylelint/config.d.mts +0 -2
  72. package/lib/lint/stylelint/index.d.mts +0 -1
  73. package/lib/loader/css-in-js-minify.d.cts +0 -14
  74. package/lib/loader/lightning-css/codegen.d.cts +0 -35
  75. package/lib/loader/lightning-css/loader.d.cts +0 -29
  76. package/lib/loader/lightning-css/runtime/api.d.cts +0 -1
  77. package/lib/loader/lightning-css/runtime/get-url.d.cts +0 -1
  78. package/lib/loader/lightning-css/utils.d.cts +0 -16
  79. package/lib/loader/mdx.d.cts +0 -3
  80. package/lib/loader/react-compiler.d.cts +0 -26
  81. package/lib/loader/solid.d.cts +0 -6
  82. package/lib/loader/ts-doc.d.cts +0 -7
  83. package/lib/module.config.d.mts +0 -3
  84. package/lib/options/css-extract.d.mts +0 -3
  85. package/lib/options/jsx-dom-expressions.d.mts +0 -10
  86. package/lib/options/md-to-html.d.mts +0 -2
  87. package/lib/options/modify-vars.d.mts +0 -2
  88. package/lib/options/reslove.d.mts +0 -9
  89. package/lib/options/split-chunk.d.mts +0 -4
  90. package/lib/options/swcrc.d.mts +0 -10
  91. package/lib/plugin/compression.d.mts +0 -15
  92. package/lib/plugin/copy.d.mts +0 -30
  93. package/lib/plugin/done.d.mts +0 -11
  94. package/lib/plugin/eslint.d.mts +0 -14
  95. package/lib/plugin/exposes-declararion.d.mts +0 -15
  96. package/lib/plugin/external-remotes.d.mts +0 -4
  97. package/lib/plugin/html-plugin.d.mts +0 -60
  98. package/lib/plugin/lightningcss-plugin.d.mts +0 -20
  99. package/lib/plugin/manifest.d.mts +0 -46
  100. package/lib/plugin/module-federation.d.mts +0 -3
  101. package/lib/plugin/override-resolve.d.mts +0 -25
  102. package/lib/plugin/stylelint.d.mts +0 -13
  103. package/lib/plugin/swc-minify-plugin.d.mts +0 -8
  104. package/lib/plugin/virtual-module.d.mts +0 -12
  105. package/lib/plugins.config.d.mts +0 -3
  106. package/lib/polyfills/polyfills.d.mts +0 -3
  107. package/lib/polyfills/replace-children.d.mts +0 -1
  108. package/lib/polyfills/targets.d.mts +0 -3
  109. package/lib/process-env.d.mts +0 -26
  110. package/lib/utils/compile-dts.d.mts +0 -23
  111. package/lib/utils/create-types.d.mts +0 -2
  112. package/lib/utils/dts.d.mts +0 -14
  113. package/lib/utils/fetch-module-federation-dts.d.mts +0 -2
  114. package/lib/utils/index.d.mts +0 -35
  115. package/lib/utils/run.d.mts +0 -2
  116. package/lib/utils/seo.d.mts +0 -2
  117. package/lib/utils/svg-to-data-uri.d.mts +0 -2
  118. package/lib/utils/vts.d.mts +0 -18
  119. package/lib/vm/coverage.d.mts +0 -2
  120. package/lib/vm/docs.d.mts +0 -7
  121. package/lib/vm/example.d.mts +0 -4
  122. package/lib/vm/generate-doc.d.mts +0 -1
  123. package/lib/vm/info.d.mts +0 -2
  124. package/lib/vm/locales.d.mts +0 -5
  125. package/lib/vm/modules.d.mts +0 -2
  126. package/lib/vm/render-app.d.mts +0 -2
  127. package/lib/vm/routes.d.mts +0 -8
  128. package/lib/vm/utils.d.mts +0 -1
  129. package/lib/worker/dts.d.mts +0 -1
  130. package/lib/worker/eslint.d.mts +0 -1
  131. package/lib/worker/react-compiler.d.mts +0 -1
  132. package/lib/worker/solid.d.mts +0 -1
  133. package/lib/worker/stylelint.d.mts +0 -1
  134. package/lib/worker/swc-minify.d.mts +0 -1
@@ -1,2 +0,0 @@
1
- import { type IFs } from 'memfs';
2
- export declare const outputFileSystem: IFs;
package/lib/index.d.mts DELETED
@@ -1,24 +0,0 @@
1
- export type * from '../typings/global.js';
2
- export { default as hasPkg } from './commom/has-pkg.mjs';
3
- export { getIPv4, getPort } from './commom/net.mjs';
4
- export { default as open } from './commom/open.mjs';
5
- export { default as parseArgs } from './commom/parse-args.mjs';
6
- export { CUSTOMCONFIG, default as paths, routeDir, yarnArgv } from './commom/paths.mjs';
7
- export { default as printLog } from './commom/print-log.mjs';
8
- export { default as require } from './commom/require.mjs';
9
- export { default as Rule } from './commom/rule.mjs';
10
- export { default as timer } from './commom/timer.mjs';
11
- export { type MockConfiguration, type ProxyFuncType, type RequestFormData, yApiMock, type YApiOption, type YApiOptionBySchema, yApiSchemaMock, } from './dev/mock.mjs';
12
- export type { ProxyConfig } from './dev/proxy.mjs';
13
- export type { CssInJsMinifyOption } from './loader/css-in-js-minify.cjs';
14
- export type { ReactCompilerOption } from './loader/react-compiler.cjs';
15
- export { type JsxDomExpressions, default as jsxDomExpressions, } from './options/jsx-dom-expressions.mjs';
16
- export { type OptimizationSplitChunksOptions, default as splitChunk, } from './options/split-chunk.mjs';
17
- export type { CompressionPluginOptions } from './plugin/compression.mjs';
18
- export type { HtmlMeta, HtmlPluginOption } from './plugin/html-plugin.mjs';
19
- export type { OverrideResolverOption } from './plugin/override-resolve.mjs';
20
- export type { VirtualModulePluginOption } from './plugin/virtual-module.mjs';
21
- export { APPTYPE, coreName, FRAMEWORK, isCI, isDev, isLibrary, isMicro, mainDirectory, packageJson, PACKAGENAME, } from './process-env.mjs';
22
- export { resolveProgram, toCamelCase } from './utils/index.mjs';
23
- export type { MdxOptions } from '@moneko/mdx';
24
- export * from '@moneko/utils';
@@ -1,2 +0,0 @@
1
- import base from '@moneko/eslint/base';
2
- export default base;
@@ -1,2 +0,0 @@
1
- export type { AST, Linter, Rule, RuleTester, Scope, SourceCode } from '@moneko/eslint';
2
- export { ESLint, loadESLint } from '@moneko/eslint';
@@ -1,2 +0,0 @@
1
- import react from '@moneko/eslint/react';
2
- export default react;
@@ -1,2 +0,0 @@
1
- import solid from '@moneko/eslint/solid';
2
- export default solid;
@@ -1,2 +0,0 @@
1
- import vue from '@moneko/eslint/vue';
2
- export default vue;
@@ -1,2 +0,0 @@
1
- import config from '@moneko/stylelint/config';
2
- export default config;
@@ -1 +0,0 @@
1
- export { type Config, type ConfigRuleSettings, type CoreRules, type CosmiconfigResult, type CssSyntaxError, type CustomSyntax, type DisabledRange, type DisabledRangeObject, type DisabledWarning, type DisableOptions, type DisableOptionsReport, type DisablePropertyName, type DisableReportRange, type EditInfo, type FixCallback, type FixMode, type FixObject, type Formatter, type FormatterType, type GetLintSourceOptions, type GetPostcssOptions, type InternalApi, type LinterOptions, type LinterResult, type LintResult, type LonghandSubPropertiesOfShorthandProperties, type Plugin, type PostcssPluginOptions, type PostcssResult, type Problem, type Processor, type PublicApi, type Range, type Rule, type RuleBase, type RuleContext, type RuleMessage, type RuleMessages, type RuleMeta, type RuleOptions, type RuleOptionsPossible, type Severity, type ShorthandProperties, stylelint, type StylelintPostcssResult, type Utils, type Warning, type WarningOptions, } from '@moneko/stylelint';
@@ -1,14 +0,0 @@
1
- import type { LoaderContext } from 'webpack';
2
- export interface CssInJsMinifyOption {
3
- /**
4
- * css in js 使用的模块
5
- * @default '@moneko/css'
6
- */
7
- moduleName: string;
8
- /**
9
- * css in js 字符串模版函数
10
- * @default ['css', 'injectGlobal']
11
- */
12
- allowFuncs: string[];
13
- }
14
- export default function cssInJsMinifyLoader(this: LoaderContext<CssInJsMinifyOption>, sourceCode: string): Promise<void>;
@@ -1,35 +0,0 @@
1
- import type { LoaderContext } from 'webpack';
2
- import type { LightningCssLoaderOption } from './loader.cjs';
3
- export interface CssImport {
4
- icss?: boolean;
5
- importName: string;
6
- url: string;
7
- type?: 'url' | string;
8
- index?: number;
9
- }
10
- export interface CssExport {
11
- name: string;
12
- value: string;
13
- }
14
- export interface ApiParam {
15
- url?: string;
16
- importName?: string;
17
- layer?: string;
18
- supports?: string;
19
- media?: string;
20
- dedupe?: boolean;
21
- index?: number;
22
- }
23
- export interface ApiReplacement {
24
- replacementName: string;
25
- localName?: string;
26
- importName: string;
27
- needQuotes?: boolean;
28
- hash?: string;
29
- }
30
- export declare function getImportCode(imports: CssImport[], options: LightningCssLoaderOption): string;
31
- export declare function getModuleCode(result: {
32
- map: void | Uint8Array;
33
- css: string;
34
- }, api: ApiParam[], replacements: ApiReplacement[], options: LightningCssLoaderOption, loaderContext: LoaderContext<LightningCssLoaderOption>): string;
35
- export declare function getExportCode(exports: CssExport[], replacements: ApiReplacement[], options: LightningCssLoaderOption): string;
@@ -1,29 +0,0 @@
1
- import { type CustomAtRules, type TransformOptions } from 'lightningcss';
2
- import type { LoaderContext } from 'webpack';
3
- type ExportLocalsConvention = 'asIs' | 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly' | ((name: string) => string);
4
- type Mode = 'local' | 'global' | 'pure' | 'icss' | ((resourcePath: string, resourceQuery: string, resourceFragment: string) => 'local' | 'global' | 'pure' | 'icss');
5
- export interface LightningCssLoaderOption extends Omit<TransformOptions<CustomAtRules>, 'filename' | 'code' | 'inputSourceMap'> {
6
- rem?: boolean;
7
- implementation?: typeof import('lightningcss');
8
- esModule?: boolean;
9
- modules?: {
10
- auto?(path: string): boolean;
11
- localIdentName?: string;
12
- exportOnlyLocals?: boolean;
13
- getJSON?(params: {
14
- resourcePath: string;
15
- exports: {
16
- name: string;
17
- value: string;
18
- }[];
19
- }): void;
20
- namedExport?: boolean;
21
- exportLocalsConvention?: ExportLocalsConvention;
22
- mode?: Mode;
23
- };
24
- importLoaders?: number;
25
- url?: string;
26
- import?(...args: unknown[]): boolean;
27
- }
28
- export default function LightningCssLoader(this: LoaderContext<LightningCssLoaderOption>, source: string, prevMap?: string): Promise<void>;
29
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import type { LoaderContext } from 'webpack';
2
- export declare function urlToRequest(e: string, i?: string | boolean): string;
3
- export declare function resolveRequests(resolve: (arg0: any, arg1: any) => Promise<any>, context: any, possibleRequests: any[]): Promise<any>;
4
- export declare function requestify(url: string, rootContext: string): string;
5
- export declare function isUrlRequestable(url: string): boolean;
6
- export declare function isDataUrl(url: string): boolean;
7
- export declare function getPreRequester({ loaders, loaderIndex, }: {
8
- loaders: {
9
- request: unknown;
10
- }[];
11
- loaderIndex: number;
12
- }): (number: string | false | number) => any;
13
- export declare function getFilter<T>(filter: T, resourcePath: string): (...args: T[]) => any;
14
- export declare function normalizeSourceMapForRuntime(map: any, loaderContext: LoaderContext<unknown>): string;
15
- export declare function dashesCamelCase(str: string): string;
16
- export declare const camelCase: (input: string | string[], options?: Record<string, unknown>) => string;
@@ -1,3 +0,0 @@
1
- import { type MdxOptions } from '@moneko/mdx';
2
- import type { LoaderContext } from 'webpack';
3
- export default function (this: LoaderContext<Omit<MdxOptions, 'value'>>, value: string): Promise<void>;
@@ -1,26 +0,0 @@
1
- import type { PluginOptions } from '@moneko/eslint/react-compiler';
2
- import type { LoaderContext } from 'webpack';
3
- export interface ReactCompilerOption extends PluginOptions {
4
- /**
5
- * 指定 React 的主要版本
6
- * @description
7
- * ReactCompiler 与 React 19+ 配合使用效果最佳;
8
- *
9
- * 将 ReactCompiler 与 React 17、18 一起使用需要安装额外的 `react-compiler-runtime` 依赖项;
10
- */
11
- target: '17' | '18' | '19';
12
- /** 编译模式
13
- * @description annotation 注释模式: 通过 "use memo"、"use no memo" 手动指定启用优化
14
- * @example
15
- * export default function Home() {
16
- * 'use memo';
17
- * // ...
18
- * }
19
- * export default function About() {
20
- * 'use no memo';
21
- * // ...
22
- * }
23
- */
24
- compilationMode: 'annotation' | 'infer' | 'syntax' | 'all';
25
- }
26
- export default function reactCompilerLoader(this: LoaderContext<ReactCompilerOption>, sourceCode: string): void;
@@ -1,6 +0,0 @@
1
- import { type TransformSolidJsOption } from '@moneko/convert/solid';
2
- import type { TransformOptions } from '@moneko/eslint/babel-core';
3
- import type { LoaderContext } from 'webpack';
4
- declare function solidLoader(this: LoaderContext<TransformSolidJsOption>, sourceCode: string, inputSourceMap?: TransformOptions['inputSourceMap']): Promise<void>;
5
- export declare function custom(this: LoaderContext<TransformSolidJsOption>, sourceCode: string, inputSourceMap?: TransformOptions['inputSourceMap']): () => Promise<void>;
6
- export default solidLoader;
@@ -1,7 +0,0 @@
1
- import type { LoaderContext } from 'webpack';
2
- import type ReactiveObject from '../commom/reactive-object.mjs';
3
- export default function (this: LoaderContext<{
4
- comment: ReactiveObject<Record<string, string>>;
5
- generateDoc(content: string, path: string): string;
6
- getCommentPath(filepath: string): string;
7
- }>, value: string): string;
@@ -1,3 +0,0 @@
1
- import type { ModuleOptions } from 'webpack';
2
- declare const _default: (ssr: boolean) => ModuleOptions;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { RuleSetUseItem } from 'webpack';
2
- declare let cssExtract: RuleSetUseItem;
3
- export default cssExtract;
@@ -1,10 +0,0 @@
1
- export interface JsxDomExpressions {
2
- moduleName?: string;
3
- builtIns?: string[];
4
- contextToCustomElements?: boolean;
5
- wrapConditionals?: boolean;
6
- generate?: 'ssr' | 'dom';
7
- hydratable?: boolean;
8
- }
9
- declare const jsxDomExpressions: JsxDomExpressions;
10
- export default jsxDomExpressions;
@@ -1,2 +0,0 @@
1
- declare function mdToHtml(text: string): string;
2
- export default mdToHtml;
@@ -1,2 +0,0 @@
1
- declare const modifyVars: Record<string, string | false | undefined>;
2
- export default modifyVars;
@@ -1,9 +0,0 @@
1
- declare const reslove: {
2
- styleLoader: string;
3
- sassLoader: string | false;
4
- lessLoader: string;
5
- swcLoader: string;
6
- transformImports: string | false;
7
- hotMiddlewareClient: string;
8
- };
9
- export default reslove;
@@ -1,4 +0,0 @@
1
- import webpack from 'webpack';
2
- export type OptimizationSplitChunksOptions = ConstructorParameters<typeof webpack.optimize.SplitChunksPlugin>[0];
3
- declare const splitChunk: OptimizationSplitChunksOptions;
4
- export default splitChunk;
@@ -1,10 +0,0 @@
1
- import type { Config as SwcConfig } from '@swc/core';
2
- export type SwcOption = SwcConfig & {
3
- module?: {
4
- resolveFully: boolean;
5
- };
6
- parseMap?: boolean;
7
- sync?: boolean;
8
- };
9
- declare const _default: (ssr: boolean, other?: SwcConfig) => SwcConfig;
10
- export default _default;
@@ -1,15 +0,0 @@
1
- import { type Compilation, type Compiler, type sources } from 'webpack';
2
- type Source = sources.Source;
3
- export interface CompressionPluginOptions {
4
- test: RegExp;
5
- algorithm: 'gzip' | 'brotli';
6
- }
7
- export declare class CompressionPlugin {
8
- private name;
9
- private options;
10
- constructor(options: CompressionPluginOptions);
11
- private runCompressionAlgorithm;
12
- compress(compiler: Compiler, compilation: Compilation, assets: Record<string, Source>): Promise<void>;
13
- apply(compiler: Compiler): void;
14
- }
15
- export {};
@@ -1,30 +0,0 @@
1
- import { type Compiler } from 'webpack';
2
- /** 需要拷贝的文件列表
3
- * @example
4
- * ```ts
5
- * export default {
6
- * copy: {
7
- * // 将 public 下的 a.json 和 s.txt 添加到资源
8
- * files: ['public/a.json', 'public/s.txt'],
9
- * // 将 static 文件夹添加到资源
10
- * dirs: ['static']
11
- * }
12
- * }
13
- * ```
14
- */
15
- export interface CopyPluginOption {
16
- /** 需要拷贝的文件列表 */
17
- files?: string[];
18
- /** 需要拷贝的文件夹 */
19
- dirs?: string[];
20
- }
21
- export declare class CopyPlugin {
22
- private readonly baseFiles;
23
- private readonly dirs;
24
- private cacheFiles;
25
- private fileTimestamps;
26
- constructor(option: CopyPluginOption);
27
- private getFiles;
28
- private hasFileChanged;
29
- apply(compiler: Compiler): void;
30
- }
@@ -1,11 +0,0 @@
1
- import type { Compiler, Stats } from 'webpack';
2
- export type DoneCallback = (stats: Stats) => void;
3
- export declare class DonePlugin {
4
- private name;
5
- private options;
6
- constructor(options: {
7
- done: DoneCallback;
8
- });
9
- apply(compiler: Compiler): void;
10
- }
11
- export type DonePluginOption = ConstructorParameters<typeof DonePlugin>[0]['done'];
@@ -1,14 +0,0 @@
1
- import { ESLint } from '@moneko/eslint';
2
- import { type Compiler } from 'webpack';
3
- export interface ESLintOption extends ESLint.Options {
4
- files: string[];
5
- lintDirtyModulesOnly?: boolean;
6
- }
7
- export declare class ESLintPlugin {
8
- private name;
9
- private worker;
10
- private options;
11
- constructor(options?: ESLintOption);
12
- apply(compiler: Compiler): void;
13
- private report;
14
- }
@@ -1,15 +0,0 @@
1
- import { type Compiler } from 'webpack';
2
- interface ModuleFederationExposesDeclarationPluginOptions {
3
- name: string;
4
- exposes: Record<string, string>;
5
- }
6
- export declare class ModuleFederationExposesDeclarationPlugin {
7
- private name;
8
- private assetName;
9
- private dts;
10
- private option;
11
- private worker;
12
- constructor(option: ModuleFederationExposesDeclarationPluginOptions);
13
- apply(compiler: Compiler): void;
14
- }
15
- export {};
@@ -1,4 +0,0 @@
1
- import { type Compiler } from 'webpack';
2
- export declare class ExternalRemotesPlugin {
3
- apply(compiler: Compiler): void;
4
- }
@@ -1,60 +0,0 @@
1
- import { type Compiler } from 'webpack';
2
- export interface HtmlMeta {
3
- [key: string]: string | undefined | HtmlMeta;
4
- }
5
- export interface HtmlPluginOption {
6
- /**
7
- * 网站图标
8
- */
9
- favicon?: string | false;
10
- /**
11
- * 页面标题
12
- */
13
- title?: string;
14
- /**
15
- * 模板文件
16
- */
17
- template?: string;
18
- /**
19
- * 输出文件名
20
- * @default index.html
21
- */
22
- filename?: string | ((entryName: string) => string);
23
- /**
24
- * 注入位置
25
- * @default head
26
- */
27
- inject?: boolean | 'head' | 'body';
28
- templateContent?: (options: HtmlPluginOption) => string;
29
- /**
30
- * 自定义额外的 tags, 当需要添加远程cdn时很有用
31
- * */
32
- tags?: {
33
- /**
34
- * 标签内容
35
- */
36
- textContent?: string;
37
- /** 标签
38
- * @default script
39
- */
40
- tag?: string;
41
- inject?: 'body' | 'head';
42
- [key: string]: string | null | boolean | number | undefined;
43
- }[];
44
- meta?: HtmlMeta;
45
- }
46
- export declare class HtmlPlugin {
47
- private options;
48
- private AddEntry;
49
- private faviconPath;
50
- private name;
51
- private cachedMetaTags;
52
- private cachedCustomTags;
53
- constructor(options?: HtmlPluginOption);
54
- apply(compiler: Compiler): void;
55
- private generateDefaultTemplate;
56
- private generateMetaTags;
57
- private generateCustomTags;
58
- private getAssets;
59
- private injectAssets;
60
- }
@@ -1,20 +0,0 @@
1
- import { type Targets } from 'lightningcss';
2
- import { type Compiler } from 'webpack';
3
- type Filter = string | RegExp;
4
- type Implementation = typeof import('lightningcss');
5
- interface MinifyPluginOpts {
6
- implementation?: Implementation;
7
- sourceMap?: boolean;
8
- test?: RegExp;
9
- include?: Filter | Filter[];
10
- exclude?: Filter | Filter[];
11
- targets?: Targets;
12
- }
13
- export declare class LightningCssMinifyPlugin {
14
- private readonly options;
15
- private readonly transform;
16
- constructor(opts?: MinifyPluginOpts);
17
- apply(compiler: Compiler): void;
18
- private transformAssets;
19
- }
20
- export {};
@@ -1,46 +0,0 @@
1
- import type { Compiler } from 'webpack';
2
- interface Icon {
3
- src: string;
4
- type: string;
5
- sizes: string;
6
- }
7
- export interface ManifestPluginOption {
8
- filename: string;
9
- id?: string;
10
- name?: string;
11
- version?: string;
12
- short_name?: string;
13
- description?: string;
14
- start_url?: string;
15
- display?: string;
16
- background_color?: string;
17
- theme_color?: string;
18
- icons?: Icon[];
19
- shortcuts?: {
20
- name: string;
21
- short_name: string;
22
- description: string;
23
- url: string;
24
- icons: Icon[];
25
- }[];
26
- screenshots?: {
27
- src: string;
28
- type: string;
29
- sizes: string;
30
- form_factor: string;
31
- }[];
32
- content_assets?: string[];
33
- [key: string]: unknown;
34
- }
35
- export declare function generateManifest(override: Partial<ManifestPluginOption>, hash?: string, content_assets?: string[]): ManifestPluginOption & Partial<ManifestPluginOption> & {
36
- version: string;
37
- hash: string | undefined;
38
- content_assets: string[] | undefined;
39
- };
40
- export declare class ManifestPlugin {
41
- private name;
42
- private options;
43
- constructor(options?: Partial<ManifestPluginOption>);
44
- apply(compiler: Compiler): void;
45
- }
46
- export {};
@@ -1,3 +0,0 @@
1
- import { type WebpackPluginInstance } from 'webpack';
2
- declare const moduleFederation: WebpackPluginInstance[];
3
- export default moduleFederation;
@@ -1,25 +0,0 @@
1
- import type { Resolver } from 'webpack';
2
- export interface OverrideResolverOption {
3
- /** 源文件夹地址
4
- * @default src 默认
5
- * @default site 组件库
6
- */
7
- original?: string;
8
- /** 用于覆盖的文件夹地址
9
- * @default CUSTOMCONFIG 启动命令的 config 值
10
- * // 当运行下面的命令启动时
11
- * @example
12
- * ```sh
13
- * npm run start --config=fix-1131
14
- * # or
15
- * yarn start config=fix-1131
16
- * ```
17
- * override 默认为 config 的值, 即 fix-1131 目录
18
- */
19
- override?: string;
20
- }
21
- export declare class OverrideResolverPlugin {
22
- private readonly options;
23
- constructor(options: Required<OverrideResolverOption>);
24
- apply(resolver: Resolver): void;
25
- }
@@ -1,13 +0,0 @@
1
- import type { LinterOptions } from '@moneko/stylelint';
2
- import { type Compiler } from 'webpack';
3
- export interface StylelintOption extends LinterOptions {
4
- files: string[];
5
- }
6
- export declare class StylelintPlugin {
7
- private name;
8
- private worker;
9
- private options;
10
- constructor(options?: StylelintOption);
11
- apply(compiler: Compiler): void;
12
- private report;
13
- }
@@ -1,8 +0,0 @@
1
- import { type JsMinifyOptions } from '@swc/core';
2
- import { type Compiler } from 'webpack';
3
- export declare class SwcMinifyPlugin {
4
- private name;
5
- private options;
6
- constructor(options: JsMinifyOptions);
7
- apply(compiler: Compiler): void;
8
- }
@@ -1,12 +0,0 @@
1
- import type { Compiler, WebpackPluginInstance } from 'webpack';
2
- export interface VirtualModulePluginOption {
3
- [key: string]: string | object;
4
- }
5
- export declare class VirtualModuleWebpackPlugin implements WebpackPluginInstance {
6
- private virtualModules;
7
- private options;
8
- private init;
9
- constructor(options?: VirtualModulePluginOption);
10
- private modify;
11
- apply(compiler: Compiler): void;
12
- }
@@ -1,3 +0,0 @@
1
- import { type WebpackPluginInstance } from 'webpack';
2
- declare const plugins: WebpackPluginInstance[];
3
- export default plugins;
@@ -1,3 +0,0 @@
1
- export declare const coreJsVersion: string;
2
- declare function polyfills(): string[];
3
- export default polyfills;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import { type Targets } from 'lightningcss';
2
- export declare function getBrowsersTargets(): string[];
3
- export declare function getLightningCssTargets(): Targets;
@@ -1,26 +0,0 @@
1
- import type { AppType, Framework } from './index.mjs';
2
- export declare const IS_WINDOW: boolean;
3
- export declare const APPTYPE: AppType;
4
- export declare const FRAMEWORK: Framework;
5
- export declare const NODE_ENV: string;
6
- export declare const isLibrary: boolean;
7
- export declare const isMicro: boolean;
8
- export declare const isMobile: boolean;
9
- export declare const isReact: boolean;
10
- export declare const isSolid: boolean;
11
- export declare const SSR: boolean;
12
- /** 项目主要文件夹 */
13
- export declare const mainDirectory: 'site' | 'src';
14
- export declare const jsxImportSource: string;
15
- export declare const framework: 'react' | 'solid-js';
16
- export declare const frameworkVersionStr: string;
17
- export declare const frameworkVersion: number;
18
- export declare const packageJson: typeof import('package.json');
19
- /** 应用名称 */
20
- export declare const PACKAGENAME: string;
21
- /** core 包名 */
22
- export declare const coreName: string;
23
- /** 是否为本地开发环境 */
24
- export declare const isDev: boolean;
25
- export declare const refresh: boolean;
26
- export declare const isCI: boolean;
@@ -1,23 +0,0 @@
1
- import ts from 'typescript';
2
- interface CompilerDtsOption {
3
- extends?: string;
4
- compilerOptions?: ts.CompilerOptions;
5
- include?: string[];
6
- }
7
- /**
8
- * 编译 TypeScript 文件
9
- * @param {CompilerDtsOption} config - 编译配置
10
- * @returns {string} 编译结果
11
- * @example
12
- * ```ts
13
- * const result = compileDts({
14
- * extends: './tsconfig.json',
15
- * compilerOptions: {
16
- * outFile: './module-federation.d.ts',
17
- * },
18
- * include: ['src/components/graph-editor']
19
- * });
20
- * ```
21
- */
22
- export declare function compileDts(config: CompilerDtsOption): string;
23
- export {};
@@ -1,2 +0,0 @@
1
- declare function createTypes(moduleName: string, dts: string): string;
2
- export default createTypes;