@moneko/core 3.26.7 → 3.26.9

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 (125) hide show
  1. package/lib/bin/build-app.d.mts +11 -16
  2. package/lib/bin/build.d.mts +10 -1
  3. package/lib/bin/build.mjs +1 -1
  4. package/lib/bin/changelog.d.mts +12 -1
  5. package/lib/bin/convert.d.mts +14 -0
  6. package/lib/bin/convert.mjs +1 -0
  7. package/lib/bin/eslint.d.mts +6 -1
  8. package/lib/bin/eslint.mjs +2 -1
  9. package/lib/bin/file.d.mts +2 -0
  10. package/lib/bin/git-hooks.d.mts +4 -1
  11. package/lib/bin/git-hooks.mjs +2 -1
  12. package/lib/bin/help.d.mts +2 -1
  13. package/lib/bin/index.d.mts +5 -1
  14. package/lib/bin/lessc.d.mts +10 -1
  15. package/lib/bin/start.d.mts +4 -1
  16. package/lib/bin/start.mjs +1 -1
  17. package/lib/bin/stylelint.d.mts +6 -1
  18. package/lib/bin/stylelint.mjs +2 -1
  19. package/lib/bin/tsc.d.mts +5 -0
  20. package/lib/bin/tsc.mjs +1 -0
  21. package/lib/bin/utils/bundle-app.d.mts +6 -2
  22. package/lib/bin/utils/config.d.mts +8 -1
  23. package/lib/bin/utils/config.mjs +1 -1
  24. package/lib/bin/utils/setup-swcrc.d.mts +3 -2
  25. package/lib/bin/utils/setup-swcrc.mjs +1 -1
  26. package/lib/build/common.d.mts +13 -2
  27. package/lib/build/common.mjs +1 -1
  28. package/lib/build/server.d.mts +4 -0
  29. package/lib/build.d.mts +21 -1
  30. package/lib/build.mjs +1 -1
  31. package/lib/commom/diff-object.d.mts +1 -1
  32. package/lib/commom/esm.d.mts +1 -1
  33. package/lib/commom/has-pkg.d.mts +1 -0
  34. package/lib/commom/log.d.mts +4 -0
  35. package/lib/commom/log.mjs +3 -3
  36. package/lib/commom/match-path.d.mts +0 -16
  37. package/lib/commom/net.d.mts +4 -2
  38. package/lib/commom/os-tmp-dir.d.mts +0 -3
  39. package/lib/commom/parse-module-meta.d.mts +4 -1
  40. package/lib/commom/paths.d.mts +21 -39
  41. package/lib/commom/reactive-object.d.mts +4 -4
  42. package/lib/commom/require.d.mts +6 -0
  43. package/lib/commom/rule.d.mts +17 -23
  44. package/lib/commom/setup-env.d.mts +2 -5
  45. package/lib/commom/sigint-exit.d.mts +1 -1
  46. package/lib/common.d.mts +16 -1
  47. package/lib/config.d.mts +21 -0
  48. package/lib/config.mjs +1 -1
  49. package/lib/dev/config.d.mts +11 -1
  50. package/lib/dev/json-schema.d.mts +72 -3
  51. package/lib/dev/mock.d.mts +12 -21
  52. package/lib/dev/proxy.d.mts +4 -4
  53. package/lib/dev.d.mts +57 -1
  54. package/lib/dev.mjs +1 -1
  55. package/lib/index.d.mts +4 -4
  56. package/lib/loader/css-in-js-minify.d.cts +4 -1
  57. package/lib/loader/lightning-css/codegen.d.cts +4 -3
  58. package/lib/loader/lightning-css/loader.cjs +1 -1
  59. package/lib/loader/lightning-css/loader.d.cts +22 -3
  60. package/lib/loader/lightning-css/runtime/api.d.cts +3 -1
  61. package/lib/loader/lightning-css/runtime/get-url.d.cts +4 -1
  62. package/lib/loader/lightning-css/utils.d.cts +21 -11
  63. package/lib/loader/mdx.d.cts +3 -2
  64. package/lib/loader/react-compiler.d.cts +3 -1
  65. package/lib/loader/solid.d.cts +5 -4
  66. package/lib/loader/ts-doc.d.cts +6 -2
  67. package/lib/module.config.d.mts +48 -3
  68. package/lib/module.config.mjs +2 -2
  69. package/lib/options/css-extract.d.mts +6 -0
  70. package/lib/options/html-plugin-option.d.mts +9 -0
  71. package/lib/options/html-plugin-option.mjs +1 -1
  72. package/lib/options/js-minify.d.mts +12 -11
  73. package/lib/options/md-to-html.d.mts +3 -1
  74. package/lib/options/modify-vars.d.mts +7 -4
  75. package/lib/options/reslove.d.mts +9 -7
  76. package/lib/options/split-chunk.d.mts +2 -0
  77. package/lib/options/swcrc.d.mts +14 -3
  78. package/lib/plugin/add-entry-attribute.d.mts +3 -11
  79. package/lib/plugin/copy.d.mts +10 -21
  80. package/lib/plugin/copy.mjs +1 -1
  81. package/lib/plugin/done.d.mts +2 -1
  82. package/lib/plugin/exposes-declararion.d.mts +8 -4
  83. package/lib/plugin/external-remotes.d.mts +6 -2
  84. package/lib/plugin/external-remotes.mjs +1 -1
  85. package/lib/plugin/lightningcss-plugin.d.mts +14 -8
  86. package/lib/plugin/lightningcss-plugin.mjs +1 -1
  87. package/lib/plugin/module-federation.d.mts +19 -1
  88. package/lib/plugin/module-federation.mjs +1 -1
  89. package/lib/plugin/override-resolve.d.mts +6 -17
  90. package/lib/plugin/virtual-module.d.mts +18 -6
  91. package/lib/plugins.config.d.mts +20 -1
  92. package/lib/plugins.config.mjs +1 -1
  93. package/lib/polyfills/polyfills.d.mts +6 -2
  94. package/lib/polyfills/replace-children.d.mts +1 -0
  95. package/lib/polyfills/targets.d.mts +7 -3
  96. package/lib/process-env.d.mts +9 -9
  97. package/lib/process-env.mjs +1 -1
  98. package/lib/utils/create-types.d.mts +4 -1
  99. package/lib/utils/dts.d.mts +10 -12
  100. package/lib/utils/fetch-module-federation-dts.d.mts +4 -1
  101. package/lib/utils/index.d.mts +3 -26
  102. package/lib/utils/run.d.mts +2 -1
  103. package/lib/utils/seo.d.mts +9 -1
  104. package/lib/utils/svg-to-data-uri.d.mts +58 -1
  105. package/lib/utils/vts.d.mts +5 -13
  106. package/lib/vm/coverage.d.mts +38 -1
  107. package/lib/vm/docs.d.mts +12 -0
  108. package/lib/vm/docs.mjs +1 -1
  109. package/lib/vm/example.d.mts +10 -2
  110. package/lib/vm/generate-doc.d.mts +35 -1
  111. package/lib/vm/generate-doc.mjs +1 -1
  112. package/lib/vm/info.d.mts +20 -13
  113. package/lib/vm/locales.d.mts +24 -0
  114. package/lib/vm/locales.mjs +2 -2
  115. package/lib/vm/modules.d.mts +23 -0
  116. package/lib/vm/routes.d.mts +10 -1
  117. package/lib/vm/routes.mjs +1 -1
  118. package/lib/vm/utils.d.mts +5 -1
  119. package/package.json +11 -13
  120. package/typings/global.d.ts +4 -0
  121. package/lib/bin/runlint.d.mts +0 -2
  122. package/lib/bin/runlint.mjs +0 -2
  123. package/lib/commom/get-current-time.d.mts +0 -2
  124. package/lib/commom/get-current-time.mjs +0 -1
  125. package/lib/polyfills/replace-children.d.ts +0 -1
@@ -1,16 +1,11 @@
1
- /**
2
- * 拷贝文件
3
- * @param {String} source 源文件
4
- * @param {String} target 目标文件
5
- * @constructor
6
- * */
7
- export declare function copyFileSync(source: string, target: string): void;
8
- /**
9
- * 拷贝文件夹
10
- * @param {String} source 源文件夹
11
- * @param {String} target 目标文件夹
12
- * @param {String} sun 是否子文件夹
13
- * @constructor
14
- * */
15
- export declare function copyFolderRecursiveSync(source: string, target: string, sun?: boolean): void;
16
- export default function createApp(): Promise<void>;
1
+ import { execSync } from 'node:child_process';
2
+ import { existsSync, readdirSync, statSync } from 'node:fs';
3
+ import path from 'node:path';
4
+ import { argv } from 'node:process';
5
+ import { buildPlist, buildXml, createDir, ink, jsonToYaml, loadFileSync, parsePlist, parseXml, parseYaml, print, println, removeDir, saveFile, saveFileSync } from '@moneko/utils';
6
+ import { bundleApk, bundleIOS } from './utils/bundle-app.mjs';
7
+ import { corePkg, cwd } from './utils/config.mjs';
8
+ import { __dirname } from './file.mjs';
9
+ export declare function copyFileSync(source: string, target: string);
10
+ export declare function copyFolderRecursiveSync(source: string, target: string, sun?: boolean);
11
+ export default async function createApp();
@@ -1,2 +1,11 @@
1
- declare function build(): Promise<void>;
1
+ import { join } from 'node:path';
2
+ import { argv } from 'node:process';
3
+ import { deleteEmptyDirs, ink, println, removeDir, removeFile, scanFolderSync } from '@moneko/utils';
4
+ import setupEnv from '../commom/setup-env.mjs';
5
+ import { cwd, swcCachePath } from './utils/config.mjs';
6
+ import { getSwcOption } from './utils/setup-swcrc.mjs';
7
+ import convert from './convert.mjs';
8
+ import { lesscCommonjs } from './lessc.mjs';
9
+ import tsc from './tsc.mjs';
10
+ declare async function build();
2
11
  export default build;
package/lib/bin/build.mjs CHANGED
@@ -1 +1 @@
1
- import{spawn as o}from"node:child_process";import{join as e,relative as s}from"node:path";import{argv as t}from"node:process";import{deleteEmptyDirs as i,ink as r,println as n,removeDir as m,removeFile as l,scanFolderSync as c,updateFileSync as p}from"@moneko/utils";import d from"../commom/require.mjs";import f from"../commom/setup-env.mjs";import{corePkg as u,cwd as a,runtimePath as j,swcCachePath as $}from"./utils/config.mjs";import y from"./utils/setup-swcrc.mjs";import{__dirname as _}from"./file.mjs";import{lesscCommonjs as g}from"./lessc.mjs";let b={stdio:"inherit",shell:!0};async function h(){let h=t[3],x=t[4],v=t.slice(5);h||(n(r(`type: 无效值 ${r(h,"245")}`,"red")),process.exit(1));let C=!v.includes("no-docs"),w=!v.includes("no-lib"),E=!v.includes("no-es"),D=v.filter(o=>!["no-docs","no-es","no-lib"].includes(o));await f("production",h,x,D);let S=`${j} ${d.resolve(`${u}/lib/build.mjs`)}`;if("library"===h){let t=y(x),r=d.resolve("typescript/bin/tsc"),n=d.resolve("@swc/cli/bin/swc.js"),f=[w&&{type:"commonjs",dir:"lib",msg:"Convert to CommonJS"},E&&{type:"es6 -C jsc.target=es2015",dir:"es",msg:"Convert to ES Module"}].filter(Boolean),u=e(_,".types.json");f.length&&p(u,JSON.stringify({extends:s(_,e(a,"tsconfig.json")),include:[s(_,e(a,"components")),s(_,e(a,"typings"))],exclude:[s(_,e(a,"components/**/examples/*")),s(_,e(a,"components/**/__tests__/*")),s(_,e(a,"components/**/__mocks__/*"))]}));for(let s=0,p=f.length;s<p;s++){let p=e(a,`./${f[s].dir}`);m(p),o(`${j} ${n} components -d ${f[s].dir} -q --strip-leading-paths --config-file ${t} -C jsc.experimental.cacheRoot=${$} -C module.type=${f[s].type} -D --ignore "**/*.test.(js|ts)x?$"`,b).on("close",function(o){0===o&&(c(p,["README.mdx","examples","__*__"]).forEach(l),i(p),"commonjs"===f[s].type&&g())}),o(`${j} ${r} --project ${u} --outDir ${f[s].dir}`,b)}}("library"!==h||C&&"library"===h)&&o(S,b)}export default h;
1
+ import{join as o}from"node:path";import{argv as e}from"node:process";import{deleteEmptyDirs as t,ink as s,println as i,removeDir as r,removeFile as m,scanFolderSync as n}from"@moneko/utils";import l from"../commom/setup-env.mjs";import{cwd as c,swcCachePath as p}from"./utils/config.mjs";import{getSwcOption as d}from"./utils/setup-swcrc.mjs";import f from"./convert.mjs";import{lesscCommonjs as a}from"./lessc.mjs";import u from"./tsc.mjs";async function j(){let j=e[3],y=e[4],b=e.slice(5);j||(i(s(`type: 无效值 ${s(j,"245")}`,"red")),process.exit(1));let g=!b.includes("no-docs"),x=!b.includes("no-lib"),h=!b.includes("no-es"),v=!b.includes("no-dts"),w=b.filter(o=>!["no-docs","no-es","no-lib"].includes(o));if(await l("production",j,y,w),"library"===j){let{CONFIG:e}=await import("../config.mjs"),s="swc"===e.dts,i=[x&&{type:"commonjs",dir:"lib",msg:"Convert to CommonJS"},h&&{type:"es6",dir:"es",msg:"Convert to ES Module"}].filter(Boolean);for(let e=0,l=i.length;e<l;e++){let l=o(c,`./${i[e].dir}`);r(l);let j=d(y);"es6"===i[e].type&&(j.jsc.target="es2015"),j.jsc.experimental.emitIsolatedDts=v&&s,j.jsc.experimental.cacheRoot=p,j.module.type=i[e].type,f({outDir:i[e].dir,filenames:["components"],copyFiles:!0,ignore:["**/*.test.(js|ts)x?$"]},j,function(){n(l,["README.mdx","examples","__*__"]).forEach(m),t(l),"commonjs"===i[e].type&&a()}),v&&!s&&u(i[e].dir)}}("library"!==j||g&&"library"===j)&&import("../build.mjs")}export default j;
@@ -1 +1,12 @@
1
- export default function changelog(): void;
1
+ import { execSync } from 'node:child_process';
2
+ import { join } from 'node:path';
3
+ import { argv } from 'node:process';
4
+ import { updateFileSync } from '@moneko/utils';
5
+ import log from '../commom/log.mjs';
6
+ import { cwd } from './utils/config.mjs';
7
+ declare function getRemoteUrl();
8
+ declare const types: Record<string, string>;
9
+ declare function extractCommits(text: string);
10
+ declare function getCommitsBetweenTags(tag1?: string, tag2?: string);
11
+ declare function getTags(remoteUrl: string);
12
+ export default function changelog();
@@ -0,0 +1,14 @@
1
+ import { swcDir } from '@swc/cli';
2
+ import type { Config as SwcConfig } from '@swc/core';
3
+ export type CliOptions = {
4
+ outDir: string;
5
+ filenames: string[];
6
+ extensions?: string[];
7
+ stripLeadingPaths?: boolean;
8
+ outFileExtension?: string;
9
+ quiet?: boolean;
10
+ copyFiles?: boolean;
11
+ ignore?: string[];
12
+ };
13
+ declare async function convert(cliOptions: CliOptions, swcOptions: SwcConfig, onSuccess: VoidFunction);
14
+ export default convert;
@@ -0,0 +1 @@
1
+ import{swcDir as s}from"@swc/cli";async function t(t,c,i){s({cliOptions:{extensions:[".ts",".js",".tsx",".jsx",".mts",".mjs",".cts",".cjs"],stripLeadingPaths:!0,quiet:!0,...t},swcOptions:c,callbacks:{onSuccess:i}})}export default t;
@@ -1 +1,6 @@
1
- export default function eslint(): void;
1
+ import { relative } from 'node:path';
2
+ import { argv } from 'node:process';
3
+ import { ink, print } from '@moneko/utils';
4
+ import { ESLint } from 'eslint';
5
+ import { cachePath, cwd, parseBraced } from './utils/config.mjs';
6
+ export default async function eslint();
@@ -1 +1,2 @@
1
- import{join as o,relative as i}from"node:path";import{argv as e}from"node:process";import t from"../commom/require.mjs";import{cachePath as m,cwd as n,runtimePath as r}from"./utils/config.mjs";import{runLint as s}from"./runlint.mjs";export default function c(){let c=e[3],l=e.slice(4),f=o(t.resolve("eslint"),"../../bin/eslint.js");s(`${r} ${f} ${i(n,c)} --config ${i(n,"eslint.config.mjs")} ${l.join(" ")} --cache --cache-location "${m}/.eslintcache"`,"eslint")}
1
+ import{relative as e}from"node:path";import{argv as t}from"node:process";import{ink as o,print as i}from"@moneko/utils";import{ESLint as r}from"eslint";import{cachePath as s,cwd as a,parseBraced as c}from"./utils/config.mjs";export default async function l(){let l=o("eslint","cyan");i(`${l}: ${o("Runing...","yellow")}`,!0);let n=t[3],m=t.slice(4),f=m.includes("--fix"),u=new r({cache:!m.includes("--cache=false"),cacheLocation:`${s}/.eslintcache`,fix:f}),p=await u.lintFiles(c(n).map(t=>e(a,t))),d=await u.loadFormatter("stylish"),w=await d.format(p);f&&await r.outputFixes(p),w&&process.stdout.write(w);let h=p.some(e=>e.errorCount>0);i(`${l}: ${o(`✨ ${h?"Error":"Successfully"}!
2
+ `,h?"red":"green")}`,!0),h&&process.exit(1)}
@@ -1,2 +1,4 @@
1
+ import path from 'node:path';
2
+ import url from 'node:url';
1
3
  export declare const __filename: string;
2
4
  export declare const __dirname: string;
@@ -1 +1,4 @@
1
- export default function githooks(): void;
1
+ import { spawn } from 'node:child_process';
2
+ import { argv } from 'node:process';
3
+ import { ink, print } from '@moneko/utils';
4
+ export default function githooks();
@@ -1 +1,2 @@
1
- import{argv as o}from"node:process";import{runLint as t}from"./runlint.mjs";export default function e(){let e="node_modules/.husky",i=o.slice(3).map(o=>{let t=o.split("=");return`echo ${t[1]} > ${e}/${t[0]}`}).join(" && ");t(`git init && husky ${e} && ${i}`,"githooks",[null])}
1
+ import{spawn as o}from"node:child_process";import{argv as e}from"node:process";import{ink as l,print as t}from"@moneko/utils";export default function s(){let s=l("githooks","cyan");t(`${s}: ${l("Runing...","yellow")}`,!0);let i="node_modules/.husky",n=e.slice(3).map(o=>{let e=o.split("=");return`echo ${e[1]} > ${i}/${e[0]}`}).join(" && ");o(`git init && husky ${i} && ${n}`,{stdio:[null],shell:!0}).on("close",function(o){let e=0!==o;t(`${s}: ${l(`✨ ${e?"Error":"Successfully"}!
2
+ `,e?"red":"green")}`,!0),process.exit(o)})}
@@ -1,2 +1,3 @@
1
- declare function printHelp(): void;
1
+ import { ink, println } from '@moneko/utils';
2
+ declare function printHelp();
2
3
  export default printHelp;
@@ -1,2 +1,6 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ import { argv } from 'node:process';
3
+ import { ink, println } from '@moneko/utils';
4
+ import require from '../commom/require.mjs';
5
+ import sigintExit from '../commom/sigint-exit.mjs';
6
+ import { corePkg } from './utils/config.mjs';
@@ -1 +1,10 @@
1
- export declare function lesscCommonjs(): Promise<void>;
1
+ import { exec } from 'node:child_process';
2
+ import { join } from 'node:path';
3
+ import { loadFile, saveFile, scanFolderSync } from '@moneko/utils';
4
+ import require from '../commom/require.mjs';
5
+ import { corePkg, runtimePath } from './utils/config.mjs';
6
+ declare let modifyVarBash: string;
7
+ declare function lessc(file: string);
8
+ declare const lessRegExp: RegExp;
9
+ declare async function lesscFile(filepath: string);
10
+ export declare async function lesscCommonjs();
@@ -1,2 +1,5 @@
1
- declare function start(): Promise<void>;
1
+ import { argv } from 'node:process';
2
+ import { ink, println } from '@moneko/utils';
3
+ import setupEnv from '../commom/setup-env.mjs';
4
+ declare async function start();
2
5
  export default start;
package/lib/bin/start.mjs CHANGED
@@ -1 +1 @@
1
- import{spawn as o}from"node:child_process";import{argv as e}from"node:process";import{ink as m,println as i}from"@moneko/utils";import r from"../commom/require.mjs";import t from"../commom/setup-env.mjs";import{corePkg as s,runtimePath as p}from"./utils/config.mjs";async function l(){let l=e[3],n=e[4],c=e.slice(5);l||(i(m(`type: 无效值 ${m(l,"245")}`,"red")),process.exit(1));let f=c.indexOf("no-verify");-1!==f&&c.splice(f,1),await t("development",l,n,c),o(`${p} ${r.resolve(`${s}/lib/dev.mjs`)}`,{stdio:"inherit",shell:!0})}export default l;
1
+ import{argv as e}from"node:process";import{ink as o,println as t}from"@moneko/utils";import m from"../commom/setup-env.mjs";async function i(){let i=e[3],r=e[4],p=e.slice(5);i||(t(o(`type: 无效值 ${o(i,"245")}`,"red")),process.exit(1));let s=p.indexOf("no-verify");-1!==s&&p.splice(s,1),await m("development",i,r,p),import("../dev.mjs")}export default i;
@@ -1 +1,6 @@
1
- export default function stylelint(): void;
1
+ import { relative } from 'node:path';
2
+ import { argv } from 'node:process';
3
+ import { ink, print } from '@moneko/utils';
4
+ import stylelints from 'stylelint';
5
+ import { cachePath, cwd, parseBraced } from './utils/config.mjs';
6
+ export default async function stylelint();
@@ -1 +1,2 @@
1
- import{join as s,relative as t}from"node:path";import{argv as e}from"node:process";import o from"../commom/require.mjs";import{cachePath as i,cwd as l,runtimePath as m}from"./utils/config.mjs";import{runLint as r}from"./runlint.mjs";export default function c(){let c=e[3],n=e.slice(4),a=s(o.resolve("stylelint"),"../../bin/stylelint.mjs");r(`${m} ${a} ${t(l,c)}/**/**/**/**/*.{less,css,scss,sass,style.ts,style.js} ${n.join(" ")} --cache --cache-location "${i}/.stylelintcache" --aei`,"stylelint")}
1
+ import{relative as s}from"node:path";import{argv as e}from"node:process";import{ink as t,print as r}from"@moneko/utils";import o from"stylelint";import{cachePath as i,cwd as c,parseBraced as l}from"./utils/config.mjs";export default async function n(){let n=t("stylelint","cyan");r(`${n}: ${t("Runing...","yellow")}`,!0);let a=e[3],f=e.slice(4),m=f.includes("--fix"),p=await o.lint({files:l(a).map(e=>s(c,`${e}/**/**/**/**/*.{css,scss,sass,less,ts,tsx,js,jsx}`)),fix:m,cache:!f.includes("--cache=false"),cacheLocation:`${i}/.stylelintcache`,formatter:"string"}),u=p.errored;p.report&&process.stdout.write(p.report),r(`${n}: ${t(`✨ ${u?"Error":"Successfully"}!
2
+ `,u?"red":"green")}`,!0),u&&process.exit(1)}
@@ -0,0 +1,5 @@
1
+ import { join } from 'node:path';
2
+ import ts from 'typescript';
3
+ import { cwd } from './utils/config.mjs';
4
+ declare async function tsc(outDir: string);
5
+ export default tsc;
@@ -0,0 +1 @@
1
+ import{join as e}from"node:path";import t from"typescript";import{cwd as o}from"./utils/config.mjs";async function s(s){return new Promise(i=>{let n=t.parseJsonConfigFileContent({extends:e(o,"tsconfig.json"),compilerOptions:{outDir:s,typeRoots:["node_modules/@types/","node_modules/.pnpm/node_modules/@types/"],declaration:!0,emitDeclarationOnly:!0,skipLibCheck:!0,skipDefaultLibCheck:!0,noEmitOnError:!1},include:[e(o,"components"),e(o,"typings")],exclude:[e(o,"components/**/examples/*"),e(o,"components/**/__tests__/*"),e(o,"components/**/__mocks__/*")]},t.sys,o);n.options.incremental&&(n.options.tsBuildInfoFile=n.options.tsBuildInfoFile??e(s,".tsbuildinfo"));let r=t.createProgram(n.fileNames,n.options),l=r.emit();t.getPreEmitDiagnostics(r).concat(l.diagnostics).forEach(e=>{if(process.stdout.write("\n"),e.file){let{line:o,character:s}=e.file.getLineAndCharacterOfPosition(e.start),i=t.flattenDiagnosticMessageText(e.messageText,"\n");process.stdout.write(`${e.file.fileName} (${o+1},${s+1}): ${i}`)}else process.stdout.write(t.flattenDiagnosticMessageText(e.messageText,"\n"))}),i(!0)})}export default s;
@@ -1,2 +1,6 @@
1
- export declare function bundleApk(outputPath: string, outputBundleDir: string, type?: string): void;
2
- export declare function bundleIOS(outputPath: string, outputBundleDir: string, type?: string): void;
1
+ import { execSync } from 'node:child_process';
2
+ import { renameSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { bundleIpa, createDir, ink, print } from '@moneko/utils';
5
+ export declare function bundleApk(outputPath: string, outputBundleDir: string, type?: string);
6
+ export declare function bundleIOS(outputPath: string, outputBundleDir: string, type?: string);
@@ -1,5 +1,12 @@
1
+ import { dirname, join } from 'node:path';
2
+ declare const Deno: VoidFunction;
3
+ declare const Bun: VoidFunction;
4
+ declare function getRuntime();
5
+ declare const runtime: 'deno' | 'bun' | 'node';
6
+ declare let runtimeDir: string;
1
7
  export declare const runtimePath: string;
2
- export declare const corePkg = "@moneko/core";
8
+ export declare const corePkg: string;
3
9
  export declare const cwd: string;
4
10
  export declare const cachePath: string;
5
11
  export declare const swcCachePath: string;
12
+ export declare function parseBraced(input: string);
@@ -1 +1 @@
1
- import{dirname as e,join as o}from"node:path";let c="undefined"!=typeof Deno?"deno":"undefined"!=typeof Bun?"bun":"node",t=e(process.execPath);"win32"===process.platform&&t.includes(" ")&&(t=`"${t}"`);export const runtimePath=o(t,c);export const corePkg="@moneko/core";export const cwd=process.cwd();export const cachePath=o(cwd,"node_modules/.cache");export const swcCachePath=o(cachePath,".swc");
1
+ import{dirname as e,join as o}from"node:path";let t="undefined"!=typeof Deno?"deno":"undefined"!=typeof Bun?"bun":"node",c=e(process.execPath);"win32"===process.platform&&c.includes(" ")&&(c=`"${c}"`);export const runtimePath=o(c,t);export const corePkg="@moneko/core";export const cwd=process.cwd();export const cachePath=o(cwd,"node_modules/.cache");export const swcCachePath=o(cachePath,".swc");export function parseBraced(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1).split(","):[e]}
@@ -1,2 +1,3 @@
1
- declare function setupSwcRc(framework: string): string;
2
- export default setupSwcRc;
1
+ import type { Config, JscConfig } from '@swc/core';
2
+ import require from '../../commom/require.mjs';
3
+ export declare function getSwcOption(framework: string): Config;
@@ -1 +1 @@
1
- import{join as e}from"node:path";import{updateFileSync as o}from"@moneko/utils";import r from"../../commom/require.mjs";import{__dirname as s}from"../file.mjs";let m=e(s,".swcrc");export default function(e){let s="solid"===e;return o(m,JSON.stringify({$schema:"https://json.schemastore.org/swcrc",module:{type:"es6"},minify:!0,jsc:{minify:{mangle:!0,compress:!0,format:{comments:"some"}},parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:"react"===e,development:!1,importSource:s?"solid-js/h":void 0}},experimental:{plugins:[[r.resolve("@moneko/transform-imports"),{"@moneko/common":{transform:"@moneko/common/lib/${member}"},lodash:{transform:"lodash/${member}"},"@ant-design/icons":{transform:"es/icons/${member}"},antd:{transform:"es/${member}",memberTransformers:["dashed_case"]},"neko-ui":{transform:"es/${member}",memberTransformers:["dashed_case"]}}],s&&[r.resolve("@moneko/jsx-dom-expressions"),{moduleName:"solid-js/web",builtIns:["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"],contextToCustomElements:!0,wrapConditionals:!0,generate:"dom",hydratable:!1}]].filter(Boolean)}},sourceMaps:!0,exclude:["__tests__/","examples/","\\.d\\.ts$"]})),m}
1
+ import e from"../../commom/require.mjs";export function getSwcOption(o){let r="solid"===o;return{module:{type:"es6"},minify:!0,jsc:{minify:{mangle:!0,compress:!0,format:{comments:"some"}},parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:"react"===o,development:!1,importSource:r?"solid-js/h":void 0}},experimental:{plugins:[[e.resolve("@moneko/transform-imports"),{"@moneko/common":{transform:"@moneko/common/lib/${member}"},lodash:{transform:"lodash/${member}"},"@ant-design/icons":{transform:"es/icons/${member}"},antd:{transform:"es/${member}",memberTransformers:["dashed_case"]},"neko-ui":{transform:"es/${member}",memberTransformers:["dashed_case"]}}],r&&[e.resolve("@moneko/jsx-dom-expressions"),{moduleName:"solid-js/web",builtIns:["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"],contextToCustomElements:!0,wrapConditionals:!0,generate:"dom",hydratable:!1}]].filter(Boolean)}},sourceMaps:!0,exclude:["__tests__/","examples/","\\.d\\.ts$"]}}
@@ -1,3 +1,14 @@
1
- import webpack from 'webpack';
2
- declare const buildCommon: webpack.Configuration;
1
+ import MiniCssExtractPlugin from 'mini-css-extract-plugin';
2
+ import TerserPlugin from 'terser-webpack-plugin';
3
+ import webpack, { type Configuration } from 'webpack';
4
+ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
5
+ import { merge } from 'webpack-merge';
6
+ import { commonConfig } from '../common.mjs';
7
+ import { CONFIG } from '../config.mjs';
8
+ import { getMinifyOption } from '../options/js-minify.mjs';
9
+ import { LightningCssMinifyPlugin } from '../plugin/lightningcss-plugin.mjs';
10
+ import { getLightningCssTargets } from '../polyfills/targets.mjs';
11
+ declare const minimizer: readonly [];
12
+ declare const defaultPerformance: Configuration['performance'];
13
+ declare const buildCommon: Configuration;
3
14
  export default buildCommon;
@@ -1 +1 @@
1
- import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as m}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import{commonConfig as t}from"../common.mjs";import{CONFIG as o}from"../config.mjs";import{getMinifyOption as s}from"../options/js-minify.mjs";import{LightningCssMinifyPlugin as l}from"../plugin/lightningcss-plugin.mjs";import{getLightningCssTargets as p}from"../polyfills/targets.mjs";let{optimize:{MinChunkSizePlugin:a}}=n,u=[];o.minifier&&(u.push(new i(s(o.minifier.type,o.minifier.options))),u.push(new l({targets:p()})));let c={maxAssetSize:256e3,maxEntrypointSize:256e3,assetFilter:e=>!e.endsWith(".map")&&!e.endsWith("ce28377f3a428346.js"),...o.performance},f=r(t,{performance:o.performance&&c,plugins:[new e({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",ignoreOrder:!0}),o.splitChunk&&new a({minChunkSize:51200}),o.bundleAnalyzer&&new m({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...o.bundleAnalyzer})].filter(Boolean),optimization:{splitChunks:o.splitChunk,runtimeChunk:o.runtimeChunk,chunkIds:"deterministic",moduleIds:"deterministic",concatenateModules:!0,emitOnErrors:!1,removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:u}});export default f;
1
+ import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as m}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import{commonConfig as t}from"../common.mjs";import{CONFIG as o}from"../config.mjs";import{getMinifyOption as s}from"../options/js-minify.mjs";import{LightningCssMinifyPlugin as l}from"../plugin/lightningcss-plugin.mjs";import{getLightningCssTargets as p}from"../polyfills/targets.mjs";let a=[];o.minifier&&(a.push(new i(s(o.minifier.type,o.minifier.options))),a.push(new l({targets:p()})));let u={maxAssetSize:256e3,maxEntrypointSize:256e3,assetFilter:e=>!e.endsWith(".map")&&!e.endsWith("ce28377f3a428346.js"),...o.performance},c=r(t,{performance:o.performance&&u,plugins:[new e({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",ignoreOrder:!0}),o.splitChunk&&new n.optimize.MinChunkSizePlugin({minChunkSize:51200}),o.bundleAnalyzer&&new m({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...o.bundleAnalyzer})].filter(Boolean),optimization:{splitChunks:o.splitChunk,runtimeChunk:o.runtimeChunk,chunkIds:"deterministic",moduleIds:"deterministic",concatenateModules:!0,emitOnErrors:!1,removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,minimize:!0,minimizer:a}});export default c;
@@ -1,3 +1,7 @@
1
1
  import { type Configuration } from 'webpack';
2
+ import { CUSTOMCONFIG } from '../commom/paths.mjs';
3
+ import moduleConfig from '../module.config.mjs';
4
+ import { isLibrary } from '../process-env.mjs';
5
+ import { resolveProgram } from '../utils/index.mjs';
2
6
  declare const serverOption: Configuration;
3
7
  export default serverOption;
package/lib/build.d.mts CHANGED
@@ -1 +1,21 @@
1
- export {};
1
+ import { relative } from 'node:path';
2
+ import { analyzeBundleSize, completedInfo, ink, println, progressBar } from '@moneko/utils';
3
+ import webpack, { type Stats, type WebpackPluginInstance } from 'webpack';
4
+ import { merge } from 'webpack-merge';
5
+ import buildCommon from './build/common.mjs';
6
+ import paths from './commom/paths.mjs';
7
+ import DoneWebpackPlugin from './plugin/done.mjs';
8
+ import { empty } from './utils/index.mjs';
9
+ import seo from './utils/seo.mjs';
10
+ import { CONFIG } from './config.mjs';
11
+ import moduleConfig from './module.config.mjs';
12
+ declare const bar: {
13
+ name: string;
14
+ color: string;
15
+ };
16
+ declare const bar_name: string;
17
+ declare const ProgressPlugin: typeof webpack.ProgressPlugin;
18
+ declare const clientOption: webpack.Configuration;
19
+ declare const instance: webpack.Compiler;
20
+ declare function printCompilationMessages(stats: Stats);
21
+ declare async function build();
package/lib/build.mjs CHANGED
@@ -1 +1 @@
1
- import{relative as o}from"node:path";import{analyzeBundleSize as m,completedInfo as r,ink as t,println as i,progressBar as e}from"@moneko/utils";import n from"webpack";import{merge as s}from"webpack-merge";import a from"./build/common.mjs";import p from"./commom/paths.mjs";import l from"./plugin/done.mjs";import{empty as c}from"./utils/index.mjs";import f from"./utils/seo.mjs";import{CONFIG as u}from"./config.mjs";import d from"./module.config.mjs";let h=u.bar.name||"Build",{ProgressPlugin:g}=n,w=n(s(a,{module:d(!1),plugins:[u.done&&new l({done:u.done}),!!u.bar&&new g({handler(o,m,...r){e(o||0,1,h,r.length?`[${m}] ${r.join(" ")}`:""),1===o&&process.stdout.write("\r\x1b[2K")}})].filter(Boolean)}));async function j(){let e=await new Promise((o,m)=>{w.run((r,t)=>{r&&m(r),t?o(t):m(Error("编译过程中没有生成统计信息"))})});(e.hasErrors()||e.hasWarnings())&&function(o){let{warnings:m,errors:r}=o.compilation;m.forEach(o=>{i(t(o.message,"178"))}),r.forEach(o=>{i(t(o.message,"red"))})}(e),await new Promise(n=>{e.compilation.compiler.cache.shutdown(s=>{s&&i(t(s.toString(),"red")),m(e.compilation.outputOptions.path,["\\.js$"]),r(~~((e.endTime-e.startTime)/10)/100,o(p.programPath,e.compilation.outputOptions.path)),n()})}),u.seo&&f()}process.on("exit",c),await j();
1
+ import{relative as o}from"node:path";import{analyzeBundleSize as r,completedInfo as m,ink as i,println as t,progressBar as e}from"@moneko/utils";import n from"webpack";import{merge as s}from"webpack-merge";import a from"./build/common.mjs";import p from"./commom/paths.mjs";import l from"./plugin/done.mjs";import{empty as c}from"./utils/index.mjs";import u from"./utils/seo.mjs";import{CONFIG as f}from"./config.mjs";import d from"./module.config.mjs";let g=f.bar.name||"Build",h=n.ProgressPlugin,w=n(s(a,{module:d(!1),plugins:[f.done&&new l({done:f.done}),!!f.bar&&new h({handler(o,r,...m){e(o||0,1,g,m.length?`[${r}] ${m.join(" ")}`:""),1===o&&process.stdout.write("\r\x1b[2K")}})].filter(Boolean)}));async function j(){let e=await new Promise((o,r)=>{w.run((m,i)=>{m&&r(m),i?o(i):r(Error("编译过程中没有生成统计信息"))})});(e.hasErrors()||e.hasWarnings())&&function(o){let{warnings:r,errors:m}=o.compilation;r.forEach(o=>{t(i(o.message,"178"))}),m.forEach(o=>{t(i(o.message,"red"))})}(e),await new Promise(n=>{e.compilation.compiler.cache.shutdown(s=>{s&&t(i(s.toString(),"red")),r(e.compilation.outputOptions.path,["\\.js$"]),m(~~((e.endTime-e.startTime)/10)/100,o(p.programPath,e.compilation.outputOptions.path)),n()})}),f.seo&&u()}process.on("exit",c),await j();
@@ -1,2 +1,2 @@
1
1
  import type { ConfigType } from '../index.mjs';
2
- export declare function diffObject(prev?: Partial<ConfigType>, next?: Partial<ConfigType>): Partial<ConfigType>;
2
+ export declare function diffObject(prev?: Partial<ConfigType>, next?: Partial<ConfigType>);
@@ -1,2 +1,2 @@
1
- declare function esm(templateStrings: TemplateStringsArray, ...substitutions: unknown[]): string;
1
+ declare function esm(templateStrings: TemplateStringsArray, ...substitutions: unknown[]);
2
2
  export default esm;
@@ -1,2 +1,3 @@
1
+ import require from './require.mjs';
1
2
  declare function hasPkg(name: string): string | false;
2
3
  export default hasPkg;
@@ -1,2 +1,6 @@
1
+ import { appendToFile } from '@moneko/utils';
2
+ declare const startDate: Date;
3
+ declare const startHrTime: [number, number];
4
+ declare function getCurrentTime(): string;
1
5
  declare function log(message: unknown): void;
2
6
  export default log;
@@ -1,3 +1,3 @@
1
- import{appendToFile as t}from"@moneko/utils";import e from"./get-current-time.mjs";export default function(o){let i=e(),n=String(o).split("\n"),r=`[${i}] ${n[0]}`,$=" ".repeat(`[${i}] `.length),l=n.slice(1).map(t=>`${$}${t}`).join("\n"),m=`${r}${l?`
2
- ${l}`:""}
3
- `;t(`logs/${i.substring(0,16)}.log`,m)}
1
+ import{appendToFile as t}from"@moneko/utils";let e=new Date,r=process.hrtime();export default function(n){let a=function(){let t=process.hrtime(r),n=t[0],a=t[1],i=new Date(e.getTime()+1e3*n+Math.floor(a/1e6)),g=i.getFullYear(),o=String(i.getMonth()+1).padStart(2,"0"),$=String(i.getDate()).padStart(2,"0"),S=String(i.getHours()).padStart(2,"0"),l=String(i.getMinutes()).padStart(2,"0"),p=String(i.getSeconds()).padStart(2,"0"),s=String(Math.floor(a%1e6/1e3)).padStart(3,"0"),d=String(a%1e3).padStart(3,"0");return`${g}-${o}-${$} ${S}:${l}:${p}.${s}${d}`}(),i=String(n).split("\n"),g=`[${a}] ${i[0]}`,o=" ".repeat(`[${a}] `.length),$=i.slice(1).map(t=>`${o}${t}`).join("\n"),S=`${g}${$?`
2
+ ${$}`:""}
3
+ `;t(`logs/${a.substring(0,16)}.log`,S)}
@@ -2,21 +2,5 @@ type MatchPath = {
2
2
  path: string;
3
3
  params: Record<string, unknown>;
4
4
  };
5
- /**
6
- * RESTful 风格api
7
- * @param {String} pattern pattern
8
- * @param {String} path paths
9
- * @example
10
- * const pattern = '/users/:id';
11
- * const pathToMatch = '/users/123';
12
- * const result = matchPath(pattern, pathToMatch);
13
- * if (result) {
14
- * console.log('Match found:', result);
15
- * console.log('Params:', result.params);
16
- * } else {
17
- * console.log('No match found.');
18
- * }
19
- * @returns {MatchPath|null} MatchPath
20
- */
21
5
  declare function matchPath(pattern: string, path: string): MatchPath | null;
22
6
  export default matchPath;
@@ -1,2 +1,4 @@
1
- export declare function getIPv4(): string | null;
2
- export declare function getPort<T = number>(start: T, host?: string): Promise<T>;
1
+ import { createConnection } from 'node:net';
2
+ import { networkInterfaces } from 'node:os';
3
+ export declare function getIPv4();
4
+ export declare function getPort<T = number>(start: T, host?: string);
@@ -1,5 +1,2 @@
1
- /** 获取系统临时缓存文件目录
2
- * @returns {String} 系统临时缓存目录
3
- */
4
1
  declare function osTmpDir(): string;
5
2
  export default osTmpDir;
@@ -1,8 +1,11 @@
1
- declare function parseModuleMeta(path: string, version?: number): {
1
+ import { resolve } from 'node:path';
2
+ import paths from './paths.mjs';
3
+ export type ModuleMeta = {
2
4
  name: string;
3
5
  main: string;
4
6
  pkg: string;
5
7
  file: string;
6
8
  meta: string;
7
9
  };
10
+ declare function parseModuleMeta(path: string, version?: number): ModuleMeta;
8
11
  export default parseModuleMeta;
@@ -1,48 +1,30 @@
1
- /** 当前文件所在目录的绝对路径 */
1
+ import { resolve } from 'node:path';
2
+ import url from 'node:url';
3
+ import { fileExists } from '@moneko/utils';
4
+ declare const original: string[];
2
5
  export declare const __dirname: string;
3
- /** yarn 命令行参数对象,包含配置选项 */
4
6
  export declare const yarnArgv: Record<string, string> & {
5
7
  config?: string;
6
8
  };
7
- /** 附加启动配置名称
8
- * @example
9
- * 当通过以下命令启动时, 此时 CUSTOMCONFIG 为 test
10
- * ```sh
11
- * npm run start --config=test
12
- * ```
13
- */
14
9
  export declare const CUSTOMCONFIG: string | undefined;
10
+ declare const programPath: string;
11
+ declare const nodeModules: string;
15
12
  declare const paths: {
16
- /** node_modules 目录路径 */
17
- nodeModules: string;
18
- /** pnpm node_modules 目录路径 */
19
- pnpmNodeModules: string;
20
- /** deno node_modules 目录路径 */
21
- denoNodeModules: string;
22
- /** 核心代码路径 */
23
- corePath: string;
24
- /** 项目根目录路径 */
25
- programPath: string;
26
- /** webpack 缓存目录路径 */
27
- webpackCachePath: string;
28
- /** 代码检查工具(ESLint、Stylelint等)的缓存目录路径 */
29
- lintCachePath: string;
30
- /** HTTP 远程模块缓存路径 */
31
- httpCachePath: string;
32
- /** SWC 缓存目录路径 */
33
- swcCachePath: string;
34
- /** 默认配置文件路径 */
35
- configPath: string;
36
- /** 自定义配置文件路径 */
37
- customConfigPath: string;
38
- /** 测试覆盖率报告路径 */
39
- coveragePath: string;
40
- /** 页面目录路径 */
41
- pagesPath: string;
42
- /** 组件目录路径 */
43
- componentsPath: string;
44
- /** Mock 数据目录路径 */
45
- mockPath: string;
13
+ readonly nodeModules;
14
+ readonly pnpmNodeModules;
15
+ readonly denoNodeModules;
16
+ readonly corePath;
17
+ readonly programPath;
18
+ readonly webpackCachePath;
19
+ readonly lintCachePath;
20
+ readonly httpCachePath;
21
+ readonly swcCachePath;
22
+ readonly configPath;
23
+ readonly customConfigPath;
24
+ readonly coveragePath;
25
+ readonly pagesPath;
26
+ readonly componentsPath;
27
+ readonly mockPath;
46
28
  };
47
29
  export declare const config_files: string[];
48
30
  export declare const routeDir: string;
@@ -1,10 +1,10 @@
1
1
  import EventEmitter from 'node:events';
2
2
  declare class ReactiveObject<T extends object = Record<string, string | undefined>> extends EventEmitter {
3
3
  readonly data: T;
4
- constructor(props?: T);
5
- setData(key: keyof T, value: T[keyof T]): void;
6
- getData(key: keyof T): T[keyof T];
7
- removeData(key: keyof T): void;
4
+ constructor(props = {} as T);
5
+ setData(key: keyof T, value: T[keyof T]);
6
+ getData(key: keyof T);
7
+ removeData(key: keyof T);
8
8
  [Symbol.iterator](): Iterator<[keyof T, T[keyof T]]>;
9
9
  }
10
10
  export default ReactiveObject;
@@ -1,2 +1,8 @@
1
+ import { createRequire } from 'node:module';
2
+ import { type Options, transformFileSync } from '@swc/core';
1
3
  declare const require: NodeRequire;
4
+ declare const transformOptions: Options;
5
+ declare function requireEsm(module: NodeJS.Module & {
6
+ _compile?: (code: string, filename: string) => void;
7
+ }, filename: string);
2
8
  export default require;
@@ -1,26 +1,20 @@
1
1
  declare const Rule: {
2
- js: RegExp;
3
- css: RegExp;
4
- less: RegExp;
5
- scss: RegExp;
6
- wasm: RegExp;
7
- txt: RegExp;
8
- image: RegExp;
9
- video: RegExp;
10
- font: RegExp;
11
- markdown: RegExp;
12
- tsdoc: RegExp;
13
- css_module: RegExp;
14
- node_modules_css_module: RegExp;
15
- node_modules: RegExp;
16
- __tests__: RegExp;
17
- dev_watch_ignored: RegExp;
18
- /**
19
- * 提取函数字符串
20
- * @example
21
- * // () => import('@app')
22
- * "rr(() => import('@app'))rr".replace(Rule.extract_func, '$1')
23
- * */
24
- extract_func: RegExp;
2
+ readonly js: RegExp;
3
+ readonly css: RegExp;
4
+ readonly less: RegExp;
5
+ readonly scss: RegExp;
6
+ readonly wasm: RegExp;
7
+ readonly txt: RegExp;
8
+ readonly image: RegExp;
9
+ readonly video: RegExp;
10
+ readonly font: RegExp;
11
+ readonly markdown: RegExp;
12
+ readonly tsdoc: RegExp;
13
+ readonly css_module: RegExp;
14
+ readonly node_modules_css_module: RegExp;
15
+ readonly node_modules: RegExp;
16
+ readonly __tests__: RegExp;
17
+ readonly dev_watch_ignored: RegExp;
18
+ readonly extract_func: RegExp;
25
19
  };
26
20
  export default Rule;
@@ -1,6 +1,3 @@
1
- declare function setupEnv(mode: string, type: string, framework: string, args: string[]): Promise<{
2
- NODE_ENV: string;
3
- APPTYPE: string;
4
- FRAMEWORK: string;
5
- }>;
1
+ import { loadFile } from '@moneko/utils';
2
+ declare async function setupEnv(mode: string, type: string, framework: string, args: string[]);
6
3
  export default setupEnv;
@@ -1,2 +1,2 @@
1
- declare function sigintExit(call: VoidFunction): void;
1
+ declare function sigintExit(call: VoidFunction);
2
2
  export default sigintExit;
package/lib/common.d.mts CHANGED
@@ -1,3 +1,18 @@
1
- import type { Configuration } from 'webpack';
1
+ import { extname, join, resolve } from 'node:path';
2
+ import type { Configuration, FileCacheOptions, ResolvePluginInstance } from 'webpack';
3
+ import paths, { config_files, CUSTOMCONFIG } from './commom/paths.mjs';
4
+ import OverrideResolverPlugin, { type OverrideResolverOption } from './plugin/override-resolve.mjs';
5
+ import { isObject, node_modules, resolveProgram } from './utils/index.mjs';
6
+ import { exampleModuleName } from './vm/example.mjs';
7
+ import app from './vm/info.mjs';
8
+ import { CONFIG, PUBLICPATH } from './config.mjs';
9
+ import plugins from './plugins.config.mjs';
10
+ import { isDev, isLibrary, NODE_ENV, PACKAGENAME, PACKAGEVERSION } from './process-env.mjs';
2
11
  export declare const outputConfig: Configuration['output'];
12
+ declare let entryMap: Configuration['entry'];
13
+ declare let cacheConfig: FileCacheOptions | false;
14
+ declare const overrideResolve: {
15
+ original: string;
16
+ override: string;
17
+ };
3
18
  export declare const commonConfig: Configuration;