@moneko/core 4.1.4 → 4.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/lib/bin/build-app.mjs.d.ts +17 -0
  2. package/lib/bin/{commit-lint.d.mts → commit-lint.mjs.d.ts} +5 -8
  3. package/lib/bin/help.mjs +1 -1
  4. package/lib/bin/{index.d.mts → index.mjs.d.ts} +1 -1
  5. package/lib/bin/{pin.d.mts → pin.mjs.d.ts} +1 -2
  6. package/lib/bin/{pure-lint.d.mts → pure-lint.mjs.d.ts} +1 -1
  7. package/lib/bin/server.mjs +1 -1
  8. package/lib/bin/server.mjs.d.ts +2 -0
  9. package/lib/bin/setup.mjs +1 -1
  10. package/lib/bin/tsc.mjs.d.ts +2 -0
  11. package/lib/bin/utils/{bundle-app.d.mts → bundle-app.mjs.d.ts} +2 -0
  12. package/lib/bin/utils/config.mjs +1 -1
  13. package/lib/bin/utils/convert-react.mjs.d.ts +174 -0
  14. package/lib/bin/utils/get-commit-files.mjs +1 -1
  15. package/lib/bin/utils/get-commit-files.mjs.d.ts +2 -0
  16. package/lib/build-dev.mjs.d.ts +1 -0
  17. package/lib/build.mjs.d.ts +1 -0
  18. package/lib/commom/{ca.d.mts → ca.mjs.d.ts} +3 -5
  19. package/lib/commom/check-npm.mjs +1 -1
  20. package/lib/commom/{check-npm.d.mts → check-npm.mjs.d.ts} +1 -2
  21. package/lib/commom/{corepack.d.mts → corepack.mjs.d.ts} +1 -2
  22. package/lib/commom/css-in-js-minify.mjs.d.ts +12 -0
  23. package/lib/commom/esm.mjs +1 -1
  24. package/lib/commom/has-pkg.mjs +1 -1
  25. package/lib/commom/is-ci-environment.mjs +1 -1
  26. package/lib/commom/{is-ci-environment.d.mts → is-ci-environment.mjs.d.ts} +1 -2
  27. package/lib/commom/match-path.mjs +1 -1
  28. package/lib/commom/{match-path.d.mts → match-path.mjs.d.ts} +1 -2
  29. package/lib/commom/module-resolve.mjs +1 -1
  30. package/lib/commom/open.mjs +1 -1
  31. package/lib/commom/{package-manager.d.mts → package-manager.mjs.d.ts} +2 -3
  32. package/lib/commom/parse-args.mjs +1 -1
  33. package/lib/commom/paths.mjs.d.ts +33 -0
  34. package/lib/commom/print-log.mjs +1 -1
  35. package/lib/commom/{reactive-object.d.mts → reactive-object.mjs.d.ts} +1 -0
  36. package/lib/commom/rule.mjs.d.ts +2 -0
  37. package/lib/commom/{setup-env.d.mts → setup-env.mjs.d.ts} +4 -2
  38. package/lib/commom/sigint-exit.mjs +1 -1
  39. package/lib/commom/{timer.d.mts → timer.mjs.d.ts} +1 -2
  40. package/lib/commom/transfer-import-on-demand.mjs.d.ts +54 -0
  41. package/lib/create-development-configuration.mjs.d.ts +2 -0
  42. package/lib/dev/config.mjs.d.ts +9 -0
  43. package/lib/dev/generate-progress-html.mjs +1 -1
  44. package/lib/dev/get-cert.mjs.d.ts +10 -0
  45. package/lib/dev/{json-schema.d.mts → json-schema.mjs.d.ts} +3 -1
  46. package/lib/dev/mock.mjs +1 -1
  47. package/lib/dev/{mock.d.mts → mock.mjs.d.ts} +17 -21
  48. package/lib/dev/{proxy.d.mts → proxy.mjs.d.ts} +1 -1
  49. package/lib/dev.mjs.d.ts +1 -0
  50. package/lib/{index.d.mts → index.mjs.d.ts} +5 -5
  51. package/lib/lint/stylelint/{index.d.mts → index.mjs.d.ts} +1 -1
  52. package/lib/loader/{css-in-js-minify.d.cts → css-in-js-minify.cjs.d.ts} +3 -1
  53. package/lib/loader/{lightning-css.d.cts → lightning-css.cjs.d.ts} +2 -0
  54. package/lib/loader/mdx.cjs.d.ts +5 -0
  55. package/lib/loader/react-compiler.cjs.d.ts +27 -0
  56. package/lib/loader/{solid.d.cts → solid.cjs.d.ts} +1 -1
  57. package/lib/module.config.mjs.d.ts +3 -0
  58. package/lib/options/md-to-html.mjs +1 -1
  59. package/lib/options/reslove.mjs.d.ts +10 -0
  60. package/lib/options/{swcrc.d.mts → swcrc.mjs.d.ts} +2 -2
  61. package/lib/plugin/{compression.d.mts → compression.mjs.d.ts} +1 -1
  62. package/lib/plugin/{copy.d.mts → copy.mjs.d.ts} +3 -6
  63. package/lib/plugin/{exposes-declararion.d.mts → exposes-declararion.mjs.d.ts} +1 -1
  64. package/lib/plugin/{html-plugin.d.mts → html-plugin.mjs.d.ts} +20 -29
  65. package/lib/plugin/{lightningcss-plugin.d.mts → lightningcss-plugin.mjs.d.ts} +1 -1
  66. package/lib/plugin/manifest/index.mjs +1 -1
  67. package/lib/plugin/manifest/{index.d.mts → index.mjs.d.ts} +1 -1
  68. package/lib/plugin/manifest/types.mjs.d.ts +508 -0
  69. package/lib/plugin/override-resolve.mjs.d.ts +23 -0
  70. package/lib/plugin/{virtual-module.d.mts → virtual-module.mjs.d.ts} +1 -1
  71. package/lib/polyfills/inject-react-refresh.mjs.d.ts +1 -0
  72. package/lib/polyfills/polyfills.mjs +1 -1
  73. package/lib/polyfills/replace-children.mjs.d.ts +1 -0
  74. package/lib/{process-env.d.mts → process-env.mjs.d.ts} +14 -14
  75. package/lib/utils/{compile-dts.d.mts → compile-dts.mjs.d.ts} +2 -3
  76. package/lib/utils/create-types.mjs +1 -1
  77. package/lib/utils/{dts.d.mts → dts.mjs.d.ts} +2 -4
  78. package/lib/utils/{index.d.mts → index.mjs.d.ts} +9 -15
  79. package/lib/utils/run.mjs +1 -1
  80. package/lib/utils/run.mjs.d.ts +2 -0
  81. package/lib/utils/seo.mjs +2 -2
  82. package/lib/utils/seo.mjs.d.ts +2 -0
  83. package/lib/utils/svg-to-data-uri.mjs +1 -1
  84. package/lib/utils/{vts.d.mts → vts.mjs.d.ts} +3 -3
  85. package/lib/vm/coverage.mjs +1 -1
  86. package/lib/vm/{docs.d.mts → docs.mjs.d.ts} +1 -0
  87. package/lib/vm/generate-doc.mjs +1 -1
  88. package/lib/vm/{locales.d.mts → locales.mjs.d.ts} +1 -0
  89. package/lib/worker/compression.mjs.d.ts +1 -0
  90. package/lib/worker/css-in-js-minify.mjs.d.ts +1 -0
  91. package/lib/worker/dts.mjs.d.ts +1 -0
  92. package/lib/worker/react-compiler.mjs.d.ts +1 -0
  93. package/lib/worker/solid.mjs.d.ts +1 -0
  94. package/lib/worker/swc-minify.mjs.d.ts +1 -0
  95. package/package.json +13 -16
  96. package/lib/bin/build-app.d.mts +0 -16
  97. package/lib/bin/server.d.mts +0 -2
  98. package/lib/bin/tsc.d.mts +0 -2
  99. package/lib/bin/utils/convert-react.d.mts +0 -1
  100. package/lib/bin/utils/get-commit-files.d.mts +0 -2
  101. package/lib/build-dev.d.mts +0 -1
  102. package/lib/build.d.mts +0 -1
  103. package/lib/commom/css-in-js-minify.d.mts +0 -13
  104. package/lib/commom/paths.d.mts +0 -52
  105. package/lib/commom/rule.d.mts +0 -27
  106. package/lib/commom/transfer-import-on-demand.d.mts +0 -78
  107. package/lib/create-development-configuration.d.mts +0 -2
  108. package/lib/dev/config.d.mts +0 -4
  109. package/lib/dev/get-cert.d.mts +0 -8
  110. package/lib/dev.d.mts +0 -1
  111. package/lib/loader/mdx.d.cts +0 -3
  112. package/lib/loader/react-compiler.d.cts +0 -29
  113. package/lib/module.config.d.mts +0 -3
  114. package/lib/options/reslove.d.mts +0 -9
  115. package/lib/plugin/manifest/types.d.mts +0 -576
  116. package/lib/plugin/override-resolve.d.mts +0 -25
  117. package/lib/polyfills/inject-react-refresh.d.mts +0 -1
  118. package/lib/polyfills/replace-children.d.mts +0 -1
  119. package/lib/utils/run.d.mts +0 -2
  120. package/lib/utils/seo.d.mts +0 -2
  121. package/lib/worker/compression.d.mts +0 -1
  122. package/lib/worker/css-in-js-minify.d.mts +0 -1
  123. package/lib/worker/dts.d.mts +0 -1
  124. package/lib/worker/react-compiler.d.mts +0 -1
  125. package/lib/worker/solid.d.mts +0 -1
  126. package/lib/worker/swc-minify.d.mts +0 -1
  127. /package/lib/bin/{build-dev.d.mts → build-dev.mjs.d.ts} +0 -0
  128. /package/lib/bin/{build.d.mts → build.mjs.d.ts} +0 -0
  129. /package/lib/bin/{changelog.d.mts → changelog.mjs.d.ts} +0 -0
  130. /package/lib/bin/{eslint.d.mts → eslint.mjs.d.ts} +0 -0
  131. /package/lib/bin/{file.d.mts → file.mjs.d.ts} +0 -0
  132. /package/lib/bin/{git-hooks.d.mts → git-hooks.mjs.d.ts} +0 -0
  133. /package/lib/bin/{help.d.mts → help.mjs.d.ts} +0 -0
  134. /package/lib/bin/{lessc.d.mts → lessc.mjs.d.ts} +0 -0
  135. /package/lib/bin/{setup.d.mts → setup.mjs.d.ts} +0 -0
  136. /package/lib/bin/{start.d.mts → start.mjs.d.ts} +0 -0
  137. /package/lib/bin/{stylelint.d.mts → stylelint.mjs.d.ts} +0 -0
  138. /package/lib/bin/utils/{config.d.mts → config.mjs.d.ts} +0 -0
  139. /package/lib/bin/utils/{setup-swcrc.d.mts → setup-swcrc.mjs.d.ts} +0 -0
  140. /package/lib/build/{common.d.mts → common.mjs.d.ts} +0 -0
  141. /package/lib/build/{server.d.mts → server.mjs.d.ts} +0 -0
  142. /package/lib/commom/{diff-object.d.mts → diff-object.mjs.d.ts} +0 -0
  143. /package/lib/commom/{esm.d.mts → esm.mjs.d.ts} +0 -0
  144. /package/lib/commom/{has-pkg.d.mts → has-pkg.mjs.d.ts} +0 -0
  145. /package/lib/commom/{host.d.mts → host.mjs.d.ts} +0 -0
  146. /package/lib/commom/{log.d.mts → log.mjs.d.ts} +0 -0
  147. /package/lib/commom/{mime.d.mts → mime.mjs.d.ts} +0 -0
  148. /package/lib/commom/{module-resolve.d.mts → module-resolve.mjs.d.ts} +0 -0
  149. /package/lib/commom/{net.d.mts → net.mjs.d.ts} +0 -0
  150. /package/lib/commom/{open.d.mts → open.mjs.d.ts} +0 -0
  151. /package/lib/commom/{parse-args.d.mts → parse-args.mjs.d.ts} +0 -0
  152. /package/lib/commom/{print-log.d.mts → print-log.mjs.d.ts} +0 -0
  153. /package/lib/commom/{read-json.d.mts → read-json.mjs.d.ts} +0 -0
  154. /package/lib/commom/{require.d.mts → require.mjs.d.ts} +0 -0
  155. /package/lib/commom/{sigint-exit.d.mts → sigint-exit.mjs.d.ts} +0 -0
  156. /package/lib/commom/{transform-solid-js.d.mts → transform-solid-js.mjs.d.ts} +0 -0
  157. /package/lib/{common.d.mts → common.mjs.d.ts} +0 -0
  158. /package/lib/{config.d.mts → config.mjs.d.ts} +0 -0
  159. /package/lib/dev/{generate-progress-html.d.mts → generate-progress-html.mjs.d.ts} +0 -0
  160. /package/lib/dev/{server.d.mts → server.mjs.d.ts} +0 -0
  161. /package/lib/{file-system.d.mts → file-system.mjs.d.ts} +0 -0
  162. /package/lib/lint/eslint/{base.d.mts → base.mjs.d.ts} +0 -0
  163. /package/lib/lint/eslint/{index.d.mts → index.mjs.d.ts} +0 -0
  164. /package/lib/lint/eslint/{react-jsx.d.mts → react-jsx.mjs.d.ts} +0 -0
  165. /package/lib/lint/eslint/{react-legacy.d.mts → react-legacy.mjs.d.ts} +0 -0
  166. /package/lib/lint/eslint/{react.d.mts → react.mjs.d.ts} +0 -0
  167. /package/lib/lint/eslint/{solid.d.mts → solid.mjs.d.ts} +0 -0
  168. /package/lib/lint/eslint/{vue.d.mts → vue.mjs.d.ts} +0 -0
  169. /package/lib/lint/stylelint/{config.d.mts → config.mjs.d.ts} +0 -0
  170. /package/lib/options/{jsx-dom-expressions.d.mts → jsx-dom-expressions.mjs.d.ts} +0 -0
  171. /package/lib/options/{md-to-html.d.mts → md-to-html.mjs.d.ts} +0 -0
  172. /package/lib/options/{modify-vars.d.mts → modify-vars.mjs.d.ts} +0 -0
  173. /package/lib/options/{split-chunk.d.mts → split-chunk.mjs.d.ts} +0 -0
  174. /package/lib/plugin/{css-module-dts.d.mts → css-module-dts.mjs.d.ts} +0 -0
  175. /package/lib/plugin/{done.d.mts → done.mjs.d.ts} +0 -0
  176. /package/lib/plugin/{eslint.d.mts → eslint.mjs.d.ts} +0 -0
  177. /package/lib/plugin/{external-remotes.d.mts → external-remotes.mjs.d.ts} +0 -0
  178. /package/lib/plugin/{module-federation.d.mts → module-federation.mjs.d.ts} +0 -0
  179. /package/lib/plugin/{stylelint.d.mts → stylelint.mjs.d.ts} +0 -0
  180. /package/lib/plugin/{swc-minify-plugin.d.mts → swc-minify-plugin.mjs.d.ts} +0 -0
  181. /package/lib/{plugins.config.d.mts → plugins.config.mjs.d.ts} +0 -0
  182. /package/lib/polyfills/{polyfills.d.mts → polyfills.mjs.d.ts} +0 -0
  183. /package/lib/polyfills/{public-path.d.mts → public-path.mjs.d.ts} +0 -0
  184. /package/lib/polyfills/{targets.d.mts → targets.mjs.d.ts} +0 -0
  185. /package/lib/utils/{create-types.d.mts → create-types.mjs.d.ts} +0 -0
  186. /package/lib/utils/{fetch-module-federation-dts.d.mts → fetch-module-federation-dts.mjs.d.ts} +0 -0
  187. /package/lib/utils/{svg-to-data-uri.d.mts → svg-to-data-uri.mjs.d.ts} +0 -0
  188. /package/lib/vm/{app.d.mts → app.mjs.d.ts} +0 -0
  189. /package/lib/vm/{coverage.d.mts → coverage.mjs.d.ts} +0 -0
  190. /package/lib/vm/{dts.d.mts → dts.mjs.d.ts} +0 -0
  191. /package/lib/vm/{example.d.mts → example.mjs.d.ts} +0 -0
  192. /package/lib/vm/{generate-doc.d.mts → generate-doc.mjs.d.ts} +0 -0
  193. /package/lib/vm/{render-app.d.mts → render-app.mjs.d.ts} +0 -0
  194. /package/lib/vm/{routes.d.mts → routes.mjs.d.ts} +0 -0
  195. /package/lib/vm/{scope.d.mts → scope.mjs.d.ts} +0 -0
  196. /package/lib/vm/{virtual.d.mts → virtual.mjs.d.ts} +0 -0
  197. /package/lib/worker/{eslint.d.mts → eslint.mjs.d.ts} +0 -0
  198. /package/lib/worker/{stylelint.d.mts → stylelint.mjs.d.ts} +0 -0
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 拷贝文件
3
+ * @param {String} source 源文件
4
+ * @param {String} target 目标文件
5
+ * @constructor
6
+ * */ export declare function copyFileSync(source: string, target: string): void;
7
+ /**
8
+ * 拷贝文件夹
9
+ * @param {String} source 源文件夹
10
+ * @param {String} target 目标文件夹
11
+ * @param {String} sun 是否子文件夹
12
+ * @constructor
13
+ * */ export declare function copyFolderRecursiveSync(source: string, target: string, sun?: boolean): void;
14
+ export default function createApp(): Promise<void>; // program
15
+ // .command('buildApp')
16
+ // .description('编译将 h5 应用打包成移动客户端,使用 Flutter')
17
+ // .action(createApp);
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ // Rules definitions
2
3
  declare const LEVEL: {
3
4
  readonly DISABLED: 0;
4
5
  readonly WARNING: 1;
5
6
  readonly ERROR: 2;
6
7
  };
7
8
  declare const RULE_OUTCOME: {
8
- readonly ALWAYS: "always";
9
- readonly NEVER: "never";
9
+ readonly ALWAYS: 'always';
10
+ readonly NEVER: 'never';
10
11
  };
11
12
  type Level = (typeof LEVEL)[keyof typeof LEVEL];
12
13
  type When = (typeof RULE_OUTCOME)[keyof typeof RULE_OUTCOME];
@@ -17,11 +18,7 @@ export type CommitRules = {
17
18
  'footer-max-line-length': [level: Level, when: When, value: number];
18
19
  'header-max-length': [level: Level, when: When, value: number];
19
20
  'header-trim': [level: Level, when: When];
20
- 'subject-case': [
21
- level: Level,
22
- when: When,
23
- value: ('sentence-case' | 'start-case' | 'pascal-case' | 'upper-case')[]
24
- ];
21
+ 'subject-case': [level: Level, when: When, value: ('sentence-case' | 'start-case' | 'pascal-case' | 'upper-case')[]];
25
22
  'subject-empty': [level: Level, when: When];
26
23
  'subject-full-stop': [level: Level, when: When, value: string];
27
24
  'type-case': [level: Level, when: When, value: 'lower-case' | 'upper-case'];
@@ -29,4 +26,4 @@ export type CommitRules = {
29
26
  'type-enum': [level: Level, when: When, value: [type: string, message: string | string[]][]];
30
27
  };
31
28
  export type CommitRuleConfig = Partial<CommitRules>;
32
- export {};
29
+ export { };
package/lib/bin/help.mjs CHANGED
@@ -10,4 +10,4 @@ ${e("选项:","white")}
10
10
 
11
11
  示例:
12
12
  ${s}
13
- `)}
13
+ `)};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ export { };
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * 检测过时依赖
3
3
  * @returns {Promise<void>} 返回码 1 失败,0 成功
4
- */
5
- declare function pin(): Promise<void>;
4
+ */ declare function pin(): Promise<void>;
6
5
  export default pin;
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ export { };
@@ -1 +1 @@
1
- import e from"node:fs";import{ink as r,println as o}from"@moneko/utils";import m from"../commom/parse-args.mjs";import s from"../commom/print-log.mjs";import{CONFIG as t}from"../config.mjs";import p from"../dev/server.mjs";export default(async()=>{let{argv:i}=process,{port:a=t.devServer.port??8080,root_dir:n="./dist",https:l=t.devServer.https,host:v=t.devServer.host??"localhost"}=m(i.slice(2));p({port:a,root_dir:n,https:l,host:v,fileSystem:e,headers:t.devServer.headers,open:t.devServer.open,basename:t.basename}),o(r("You application is running here:","245"),!0),o("",!0),s("Preview",`${l?"https":"http"}://${v}:${a}`,{timestamp:!1,labelBackgroundColor:"blue"}),o("",!0)});
1
+ import e from"node:fs";import{ink as r,println as o}from"@moneko/utils";import m from"../commom/parse-args.mjs";import t from"../commom/print-log.mjs";import{CONFIG as s}from"../config.mjs";import i from"../dev/server.mjs";async function p(){let{argv:p}=process,{port:a=s.devServer.port??8080,root_dir:n="./dist",https:l=s.devServer.https,host:v=s.devServer.host??"localhost"}=m(p.slice(2));i({port:a,root_dir:n,https:l,host:v,fileSystem:e,headers:s.devServer.headers,open:s.devServer.open,basename:s.basename}),o(r("You application is running here:","245"),!0),o("",!0),t("Preview",`${l?"https":"http"}://${v}:${a}`,{timestamp:!1,labelBackgroundColor:"blue"}),o("",!0)}export default p;
@@ -0,0 +1,2 @@
1
+ declare function httpServer(): Promise<void>;
2
+ export default httpServer;
package/lib/bin/setup.mjs CHANGED
@@ -1 +1 @@
1
- import m from"../commom/check-npm.mjs";import{corepack as o}from"../commom/corepack.mjs";import{CONFIG as c}from"../config.mjs";export default function(){o(c.corepack),m()}
1
+ import m from"../commom/check-npm.mjs";import{corepack as o}from"../commom/corepack.mjs";import{CONFIG as c}from"../config.mjs";export default function(){o(c.corepack),m()};
@@ -0,0 +1,2 @@
1
+ declare function tsc(outDir: string): Promise<boolean>;
2
+ export default tsc;
@@ -1,2 +1,4 @@
1
+ // build apk
1
2
  export declare function bundleApk(outputPath: string, outputBundleDir: string, type?: string): void;
3
+ // build ios
2
4
  export declare function bundleIOS(outputPath: string, outputBundleDir: string, type?: string): void;
@@ -1 +1 @@
1
- import{dirname as e,join as o}from"node:path";import{cwd as t,execPath as n,platform as c}from"node:process";let r="undefined"!=typeof Deno?"deno":"undefined"!=typeof Bun?"bun":"node",s=e(n);"win32"===c&&s.includes(" ")&&(s=`"${s}"`);export const runtimePath=o(s,r);export const corePkg="@moneko/core";export const cwd=t();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
+ import{dirname as e,join as o}from"node:path";import{cwd as t,execPath as c,platform as n}from"node:process";let r="u">typeof Deno?"deno":"u">typeof Bun?"bun":"node",s=e(c);"win32"===n&&s.includes(" ")&&(s=`"${s}"`);export const runtimePath=o(s,r);export const corePkg="@moneko/core";export const cwd=t();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]}
@@ -0,0 +1,174 @@
1
+ // import { join, sep, extname, normalize } from 'node:path';
2
+ // import { copyFile, ink, println, scanFolderSync, updateFile } from '@moneko/utils';
3
+ // import { JsMinifyOptions, type Options, type Output, transformFile } from '@swc/core';
4
+ // function getOutfilePath(outDir: string, file: string, outFileExtension?: string) {
5
+ // // 处理输出路径
6
+ // const parts = file.split(sep);
7
+ // const baseDir = parts[0] === '' ? parts[1] : parts[0];
8
+ // const outputPath = file.replace(baseDir, '');
9
+ // const output = join(outDir, outputPath);
10
+ // if (outFileExtension) {
11
+ // return output.replace(extname(output), outFileExtension);
12
+ // }
13
+ // return output;
14
+ // }
15
+ // interface ConvertOptions {
16
+ // outDir: string;
17
+ // inputDir: string;
18
+ // options: Options;
19
+ // ignore?: RegExp[];
20
+ // extensions?: string[];
21
+ // copy?: boolean;
22
+ // quiet?: boolean;
23
+ // outputExtension?: string;
24
+ // }
25
+ // interface ConvertResult {
26
+ // duration: number;
27
+ // compiled: string[];
28
+ // copied: string[];
29
+ // failed: string[];
30
+ // }
31
+ // interface ConvertOutput extends Output {
32
+ // output?: string;
33
+ // }
34
+ // const normalizeExtension: Record<string, string> = {
35
+ // '.ts': '.js',
36
+ // '.tsx': '.js',
37
+ // '.mts': '.mjs',
38
+ // '.cts': '.cjs',
39
+ // '.js': '.js',
40
+ // '.jsx': '.js',
41
+ // '.mjs': '.mjs',
42
+ // '.cjs': '.cjs',
43
+ // };
44
+ // const jscMinify: JsMinifyOptions = {
45
+ // format: {
46
+ // comments: false,
47
+ // },
48
+ // ecma: 2015,
49
+ // compress: {
50
+ // drop_console: true,
51
+ // drop_debugger: true,
52
+ // global_defs: {
53
+ // '@alert': 'console.log',
54
+ // },
55
+ // pure_funcs: ['console.log', 'console.warn', 'console.error', 'console.info'], // 移除console
56
+ // ecma: 2015,
57
+ // toplevel: false, // 为true表示只在顶级作用域压缩清理变量
58
+ // module: false,
59
+ // ie8: false,
60
+ // keep_classnames: void 0,
61
+ // keep_fnames: false,
62
+ // top_retain: [],
63
+ // keep_infinity: true,
64
+ // },
65
+ // mangle: true,
66
+ // };
67
+ // export async function convert({
68
+ // ignore = [],
69
+ // quiet = true,
70
+ // copy = true,
71
+ // outDir,
72
+ // outputExtension,
73
+ // inputDir,
74
+ // options,
75
+ // extensions = ['.ts', '.js', '.tsx', '.jsx', '.mts', '.mjs', '.cts', '.cjs'],
76
+ // }: ConvertOptions): Promise<ConvertResult> {
77
+ // // 记录运行时间
78
+ // const start = process.hrtime();
79
+ // const result: ConvertResult = {
80
+ // duration: 0,
81
+ // compiled: [],
82
+ // copied: [],
83
+ // failed: [],
84
+ // };
85
+ // const allfile = scanFolderSync(inputDir, ['^.*']).map((file) => normalize(file));
86
+ // // 获取匹配的文件
87
+ // const files: string[] = [];
88
+ // const copyFiles: string[] = [];
89
+ // allfile.forEach((file) => {
90
+ // if (/\.DS_Store/.test(file) || ignore.some((item: RegExp) => item.test(file))) {
91
+ // return;
92
+ // }
93
+ // if (extensions.includes(extname(file))) {
94
+ // files.push(file);
95
+ // } else if (copy) {
96
+ // copyFiles.push(file);
97
+ // }
98
+ // });
99
+ // const promises = files
100
+ // .map(async (file) => {
101
+ // try {
102
+ // const outExtension = outputExtension || normalizeExtension[extname(file)];
103
+ // // 使用 SWC 转换文件
104
+ // const { code, map, output } = (await transformFile(file, {
105
+ // ...options,
106
+ // jsc: {
107
+ // externalHelpers: false,
108
+ // ...options.jsc,
109
+ // minify: {
110
+ // ...jscMinify,
111
+ // ...options.jsc?.minify,
112
+ // },
113
+ // },
114
+ // })) as ConvertOutput;
115
+ // // 处理输出路径
116
+ // const outputPath = getOutfilePath(outDir, file, outExtension);
117
+ // // 写入转换后的代码
118
+ // await updateFile(outputPath, code);
119
+ // // 如果存在 sourcemap,也写入
120
+ // if (map) {
121
+ // await updateFile(`${outputPath}.map`, map);
122
+ // }
123
+ // result.compiled.push(`${file} -> ${outputPath}`);
124
+ // if (output) {
125
+ // const dtsContent = JSON.parse(output);
126
+ // if (dtsContent.__swc_isolated_declarations__) {
127
+ // const ext = extname(file);
128
+ // const dtsPath = getOutfilePath(outDir, file.replace(ext, `.d${ext}`));
129
+ // await updateFile(dtsPath, dtsContent.__swc_isolated_declarations__);
130
+ // }
131
+ // }
132
+ // } catch (error) {
133
+ // result.failed.push(`Error converting ${file}: ${error}`);
134
+ // }
135
+ // })
136
+ // .concat(
137
+ // copyFiles.map(async (file) => {
138
+ // const outputPath = getOutfilePath(outDir, file);
139
+ // const isCopy = await copyFile(file, outputPath);
140
+ // if (isCopy) {
141
+ // result.copied.push(`${file} -> ${outputPath}`);
142
+ // } else {
143
+ // result.failed.push(`Error copying ${file} -> ${outputPath}`);
144
+ // }
145
+ // }),
146
+ // );
147
+ // await Promise.all(promises);
148
+ // const end = process.hrtime(start);
149
+ // result.duration = end[0] * 1000 + end[1] / 1e6;
150
+ // // 调用成功回调
151
+ // if (quiet) {
152
+ // const moduleType = {
153
+ // es6: 'ES6',
154
+ // commonjs: 'CommonJS',
155
+ // esm: 'ESM',
156
+ // amd: 'AMD',
157
+ // umd: 'UMD',
158
+ // systemjs: 'SystemJS',
159
+ // nodenext: 'NodeNext',
160
+ // }[options.module!.type];
161
+ // const list = [
162
+ // `${ink('✨ 编译成功!🎉', '82', { bold: true })} ${ink(`(${moduleType})`, '213')}`,
163
+ // ink(`⏱️ 总耗时:${result.duration.toFixed(3)} ms`, '117'),
164
+ // result.compiled.length && ink(`📄 编译文件:${result.compiled.length} 个`, '111'),
165
+ // result.copied.length && ink(`📋 复制文件:${result.copied.length} 个`, '226'),
166
+ // result.failed.length && ink(`❌ 编译失败:${result.failed.length} 个`, '203'),
167
+ // ]
168
+ // .filter(Boolean)
169
+ // .join('\n- ');
170
+ // println(list);
171
+ // }
172
+ // return result;
173
+ // }
174
+ export { };
@@ -1 +1 @@
1
- import{spawn as t}from"node:child_process";export default function(){return new Promise(function(n,o){let r=t("git",["diff","--name-only","HEAD^","HEAD"]),i="",e="";r.stdout.on("data",function(t){i+=t.toString()}),r.stderr.on("data",function(t){e+=t.toString()}),r.on("close",function(t){0===t?n(i.trim().split("\n")):o({code:t,error:e})})})}
1
+ import{spawn as t}from"node:child_process";export default function(){return new Promise(function(n,o){let r=t("git",["diff","--name-only","HEAD^","HEAD"]),i="",e="";r.stdout.on("data",function(t){i+=t.toString()}),r.stderr.on("data",function(t){e+=t.toString()}),r.on("close",function(t){0===t?n(i.trim().split("\n")):o({code:t,error:e})})})};
@@ -0,0 +1,2 @@
1
+ declare function getCommitFiles(): Promise<string[]>;
2
+ export default getCommitFiles;
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -1,15 +1,13 @@
1
1
  import { type ChildProcess } from 'node:child_process';
2
2
  import { type CertificateResult } from '@moneko/utils';
3
- export declare const CA_ORGANIZATION = "Local Root Certificate Authority - Moneko";
3
+ export declare const CA_ORGANIZATION = 'Local Root Certificate Authority - Moneko';
4
4
  /**
5
5
  * 检查根证书是否已安装
6
6
  * @param organization 颁发机构
7
7
  * @returns Promise<boolean> 是否已安装
8
- */
9
- export declare function isCertificateInstalled(organization: string): Promise<boolean>;
8
+ */ export declare function isCertificateInstalled(organization: string): Promise<boolean>;
10
9
  /**
11
10
  * 安装本地根 CA 到用户证书存储区(开发时信任 HTTPS 证书)
12
11
  * @param certPath 本地 CA 证书路径
13
- */
14
- export declare function installCA(certPath: string): ChildProcess | void;
12
+ */ export declare function installCA(certPath: string): ChildProcess | void;
15
13
  export declare function setupCert(domain?: string, install?: boolean): Promise<CertificateResult>;
@@ -1 +1 @@
1
- import{spawn as t}from"node:child_process";export default function(){t("npm",["-v"],{stdio:"pipe",shell:!0}).stdout.on("data",e=>{e.toString().split(".")[0]<9&&t("npm",["config","get","enable-pre-post-scripts"],{stdio:"pipe",shell:!0}).stdout.on("data",e=>{"true"!==e.toString().trim()&&t("npm",["config","set","enable-pre-post-scripts","true","-L","project"],{stdio:"ignore",shell:!0})})})}
1
+ import{spawn as t}from"node:child_process";export default function(){t("npm",["-v"],{stdio:"pipe",shell:!0}).stdout.on("data",e=>{e.toString().split(".")[0]<9&&t("npm",["config","get","enable-pre-post-scripts"],{stdio:"pipe",shell:!0}).stdout.on("data",e=>{"true"!==e.toString().trim()&&t("npm",["config","set","enable-pre-post-scripts","true","-L","project"],{stdio:"ignore",shell:!0})})})};
@@ -1,4 +1,3 @@
1
1
  /** 检查 npm 是否需要启用 pre 和 post 脚本
2
- */
3
- declare function checkNpm(): void;
2
+ */ declare function checkNpm(): void;
4
3
  export default checkNpm;
@@ -7,5 +7,4 @@
7
7
  * corepack(true);
8
8
  * ```
9
9
  * @returns
10
- */
11
- export declare function corepack(enable?: boolean): void;
10
+ */ export declare function corepack(enable?: boolean): void;
@@ -0,0 +1,12 @@
1
+ import { type Output } from '@swc/core';
2
+ export interface CssInJsMinifyOption {
3
+ /**
4
+ * css in js 使用的模块
5
+ * @default '@moneko/css'
6
+ */ moduleName: string;
7
+ /**
8
+ * css in js 字符串模版函数
9
+ * @default ['css', 'injectGlobal']
10
+ */ allowFuncs: string[];
11
+ }
12
+ export declare function cssInJsMinify(sourceCode: string, options: CssInJsMinifyOption): Promise<Output>;
@@ -1 +1 @@
1
- export default function(t,...e){let r=t.raw[0];for(let a=0;a<e.length;a++)r+=e[a]+t.raw[a+1];return`data:text/javascript;base64,${Buffer.from(r).toString("base64")}`}
1
+ export default function(t,...e){let r=t.raw[0];for(let a=0;a<e.length;a++)r+=e[a]+t.raw[a+1];return`data:text/javascript;base64,${Buffer.from(r).toString("base64")}`};
@@ -1 +1 @@
1
- import r from"./require.mjs";export default function(e){try{return r.resolve(e)}catch{return!1}}
1
+ import r from"./require.mjs";export default function(e){try{return r.resolve(e)}catch{return!1}};
@@ -1 +1 @@
1
- import{env as I}from"node:process";export default function(){if(I.DOCKER_BUILD_ID||I.DOCKER_APP_NAME||"true"===I.CI||"1"===I.CI)return!0;let E=["CI","CONTINUOUS_INTEGRATION","BUILD_NUMBER","RUN_ID","GITHUB_ACTIONS","GITLAB_CI","TRAVIS","CIRCLECI","JENKINS_URL","TF_BUILD","APPVEYOR","BITBUCKET_BUILD_NUMBER","CODEBUILD_BUILD_ID","TEAMCITY_VERSION","BAMBOO_BUILDKEY","BUILDKITE","DRONE","SEMAPHORE","NETLIFY","VERCEL","NOW_BUILDER","HEROKU_TEST_RUN_ID","CODEBUILD_BUILD_ID","HUDSON_URL","TASK_ID","GO_PIPELINE_NAME","CI_NAME","CI_WORKER_ID"].some(E=>void 0!==I[E]&&""!==I[E]),_="true"===I.NETLIFY||"true"===I.VERCEL||"production"===I.NODE_ENV&&!!I.HEROKU_APP_ID||"codeship"===I.CI_NAME||"true"===I.BUDDY||"true"===I.SCRUTINIZER||void 0!==I.CF_BUILD_ID;return E||_}
1
+ import{env as I}from"node:process";export default function(){if(I.DOCKER_BUILD_ID||I.DOCKER_APP_NAME||"true"===I.CI||"1"===I.CI)return!0;let E=["CI","CONTINUOUS_INTEGRATION","BUILD_NUMBER","RUN_ID","GITHUB_ACTIONS","GITLAB_CI","TRAVIS","CIRCLECI","JENKINS_URL","TF_BUILD","APPVEYOR","BITBUCKET_BUILD_NUMBER","CODEBUILD_BUILD_ID","TEAMCITY_VERSION","BAMBOO_BUILDKEY","BUILDKITE","DRONE","SEMAPHORE","NETLIFY","VERCEL","NOW_BUILDER","HEROKU_TEST_RUN_ID","CODEBUILD_BUILD_ID","HUDSON_URL","TASK_ID","GO_PIPELINE_NAME","CI_NAME","CI_WORKER_ID"].some(E=>void 0!==I[E]&&""!==I[E]),_="true"===I.NETLIFY||"true"===I.VERCEL||"production"===I.NODE_ENV&&!!I.HEROKU_APP_ID||"codeship"===I.CI_NAME||"true"===I.BUDDY||"true"===I.SCRUTINIZER||void 0!==I.CF_BUILD_ID;return E||_};
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * 检测当前是否运行在 CI 环境中
3
3
  * @returns {boolean} 如果是 CI 环境返回 true,否则返回 false
4
- */
5
- declare function isCIEnvironment(): boolean;
4
+ */ declare function isCIEnvironment(): boolean;
6
5
  export default isCIEnvironment;
@@ -1 +1 @@
1
- export default function(t,l){let e=t.split("/"),n=l.split("/");if(e.length!==n.length)return null;let r={};for(let t=0;t<e.length;t++){let l=e[t],i=n[t];if(l.startsWith(":"))r[l.slice(1)]=i;else if(l!==i)return null}return{path:l,params:r}}
1
+ export default function(t,l){let e=t.split("/"),n=l.split("/");if(e.length!==n.length)return null;let r={};for(let t=0;t<e.length;t++){let l=e[t],i=n[t];if(l.startsWith(":"))r[l.slice(1)]=i;else if(l!==i)return null}return{path:l,params:r}};
@@ -17,6 +17,5 @@ type MatchPath = {
17
17
  * console.log('No match found.');
18
18
  * }
19
19
  * @returns {MatchPath|null} MatchPath
20
- */
21
- declare function matchPath(pattern: string, path: string): MatchPath | null;
20
+ */ declare function matchPath(pattern: string, path: string): MatchPath | null;
22
21
  export default matchPath;
@@ -1 +1 @@
1
- import r from"./require.mjs";export default function t(e,o){try{return o&&"function"==typeof import.meta.resolve?import.meta.resolve(e):r.resolve(e)}catch{try{return t(e,!0)}catch{return e}}}
1
+ import r from"./require.mjs";export default(function t(e,o){try{return o&&"function"==typeof import.meta.resolve?import.meta.resolve(e):r.resolve(e)}catch{try{return t(e,!0)}catch{return e}}});
@@ -1 +1 @@
1
- import{spawn as e}from"node:child_process";import{platform as o}from"node:process";import{empty as r}from"../utils/index.mjs";export default function(t){let n,d;"win32"===o?(n="cmd.exe",d=["/c","start",'""',"/b",t.replace(/&/g,"^&")]):(n="darwin"===o?"open":"xdg-open",d=[t]);let i=e(n,d,{detached:!0,stdio:"ignore"});i.on("error",r),i.unref()}
1
+ import{spawn as e}from"node:child_process";import{platform as o}from"node:process";import{empty as r}from"../utils/index.mjs";export default function(t){let n,d;"win32"===o?(n="cmd.exe",d=["/c","start",'""',"/b",t.replace(/&/g,"^&")]):(n="darwin"===o?"open":"xdg-open",d=[t]);let i=e(n,d,{detached:!0,stdio:"ignore"});i.on("error",r),i.unref()};
@@ -3,6 +3,5 @@ type PackageManager = 'pnpm' | 'yarn' | 'bun' | 'deno' | 'npm';
3
3
  * 获取包管理器
4
4
  * @param {string | void} packageManager 包管理器
5
5
  * @returns {PackageManager}
6
- */
7
- export declare function getPackageManager(packageManager?: string): PackageManager;
8
- export {};
6
+ */ export declare function getPackageManager(packageManager?: string): PackageManager;
7
+ export { };
@@ -1 +1 @@
1
- export default function(e){return Object.fromEntries(e.map(function(e){let t=e.split("="),r=t[1];return void 0===r||"true"===r?r=!0:"false"===r?r=!1:/-?\d+(\.\d+)?([eE][+-]?\d+)?/.test(r)&&(r=parseFloat(r)),[t[0].replace(/^--/,""),r]}))}
1
+ export default function(e){return Object.fromEntries(e.map(function(e){let t=e.split("="),r=t[1];return void 0===r||"true"===r?r=!0:"false"===r?r=!1:/-?\d+(\.\d+)?([eE][+-]?\d+)?/.test(r)&&(r=parseFloat(r)),[t[0].replace(/^--/,""),r]}))};
@@ -0,0 +1,33 @@
1
+ /** 当前文件所在目录的绝对路径 */ export declare const __dirname: string;
2
+ /** yarn 命令行参数对象,包含配置选项 */ export declare const yarnArgv: Record<string, string> & {
3
+ config?: string;
4
+ };
5
+ /** 附加启动配置名称
6
+ * @example
7
+ * 当通过以下命令启动时, 此时 CUSTOMCONFIG 为 test
8
+ * ```sh
9
+ * npm run start --config=test
10
+ * ```
11
+ */ export declare const CUSTOMCONFIG: string | undefined;
12
+ export declare const TMP_DIR: string;
13
+ declare const paths: {
14
+ /** node_modules 目录路径 */ readonly nodeModules: string;
15
+ /** pnpm node_modules 目录路径 */ readonly pnpmNodeModules: string;
16
+ /** deno node_modules 目录路径 */ readonly denoNodeModules: string;
17
+ /** 核心代码路径 */ readonly corePath: string;
18
+ /** 项目根目录路径 */ readonly programPath: string;
19
+ /** CA 目录路径 */ readonly CA_DIR: string;
20
+ /** webpack 缓存目录路径 */ readonly webpackCachePath: string;
21
+ /** 代码检查工具(ESLint、Stylelint等)的缓存目录路径 */ readonly lintCachePath: string;
22
+ /** HTTP 远程模块缓存路径 */ readonly httpCachePath: string;
23
+ /** SWC 缓存目录路径 */ readonly swcCachePath: string;
24
+ /** 默认配置文件路径 */ readonly configPath: string;
25
+ /** 自定义配置文件路径 */ readonly customConfigPath: string;
26
+ /** 测试覆盖率报告路径 */ readonly coveragePath: string;
27
+ /** 页面目录路径 */ readonly pagesPath: string;
28
+ /** 组件目录路径 */ readonly componentsPath: string;
29
+ /** Mock 数据目录路径 */ readonly mockPath: string;
30
+ };
31
+ export declare const config_files: string[];
32
+ export declare const routeDir: string;
33
+ export default paths;
@@ -1 +1 @@
1
- import{ink as e,println as l}from"@moneko/utils";export const METHOD_COLOR={GET:{fg:"255",bg:"22"},POST:{fg:"255",bg:"57"},PUT:{fg:"0",bg:"214"},PATCH:{fg:"0",bg:"44"},DELETE:{fg:"255",bg:"160"},HEAD:{fg:"0",bg:"153"},OPTIONS:{fg:"0",bg:"101"},TRACE:{fg:"255",bg:"240"},CONNECT:{fg:"255",bg:"90"}};export default function(o,t,a={}){let g=` ${o} `,n=Object.assign({timestamp:!0,labelAlign:"left",labelLen:g.length,labelForegroundColor:"255",labelBackgroundColor:"22",noteForegroundColor:"yellow"},a),r=g.length;switch(n.labelAlign){case"center":g=g.padStart(r+(n.labelLen-r)/2).padEnd(n.labelLen);break;case"right":g=g.padStart(n.labelLen);break;default:g=g.padEnd(n.labelLen)}let b=e(g,n.labelForegroundColor,{bg:n.labelBackgroundColor}),d=e(" • ","245"),f=e(new Date().toLocaleTimeString(),"245"),i=e("[","245"),C=e("]","245"),$=n.note?`${i}${e(n.note,n.noteForegroundColor)}${C}`:"",c=n.timestamp?`${i}${f}${C}`:"",u=n.note||n.timestamp?d:"";l(`${b} ${e(t,n.labelBackgroundColor)}${u}${$}${c}`,!0)}
1
+ import{ink as e,println as l}from"@moneko/utils";export const METHOD_COLOR={GET:{fg:"255",bg:"22"},POST:{fg:"255",bg:"57"},PUT:{fg:"0",bg:"214"},PATCH:{fg:"0",bg:"44"},DELETE:{fg:"255",bg:"160"},HEAD:{fg:"0",bg:"153"},OPTIONS:{fg:"0",bg:"101"},TRACE:{fg:"255",bg:"240"},CONNECT:{fg:"255",bg:"90"}};export default function(o,t,a={}){let g=` ${o} `,n=Object.assign({timestamp:!0,labelAlign:"left",labelLen:g.length,labelForegroundColor:"255",labelBackgroundColor:"22",noteForegroundColor:"yellow"},a),r=g.length;switch(n.labelAlign){case"center":g=g.padStart(r+(n.labelLen-r)/2).padEnd(n.labelLen);break;case"right":g=g.padStart(n.labelLen);break;default:g=g.padEnd(n.labelLen)}let b=e(g,n.labelForegroundColor,{bg:n.labelBackgroundColor}),d=e(" • ","245"),f=e(new Date().toLocaleTimeString(),"245"),i=e("[","245"),C=e("]","245"),$=n.note?`${i}${e(n.note,n.noteForegroundColor)}${C}`:"",c=n.timestamp?`${i}${f}${C}`:"",u=n.note||n.timestamp?d:"";l(`${b} ${e(t,n.labelBackgroundColor)}${u}${$}${c}`,!0)};
@@ -6,6 +6,7 @@ declare class ReactiveObject<T extends object = Record<string, unknown | undefin
6
6
  setData(key: keyof T, value: T[keyof T]): void;
7
7
  getData(key: keyof T): T[keyof T];
8
8
  removeData(key: keyof T): void;
9
+ // 实现迭代器接口
9
10
  [Symbol.iterator](): Iterator<[keyof T, T[keyof T]]>;
10
11
  }
11
12
  export default ReactiveObject;
@@ -0,0 +1,2 @@
1
+ declare const Rule: Record<string, RegExp>;
2
+ export default Rule;
@@ -1,7 +1,9 @@
1
- declare function setupEnv(mode: string, type: string, framework: string, args: string[], IS_BUILD: boolean): Promise<{
1
+ interface SetupEnv {
2
2
  NODE_ENV: string;
3
3
  APPTYPE: string;
4
4
  FRAMEWORK: string;
5
5
  IS_BUILD: boolean;
6
- }>;
6
+ [key: string]: string | boolean | number;
7
+ }
8
+ declare function setupEnv(mode: string, type: string, framework: string, args: string[], IS_BUILD: boolean): Promise<SetupEnv>;
7
9
  export default setupEnv;
@@ -1 +1 @@
1
- import o from"node:process";export default function(n){o.on("SIGINT",n),o.on("SIGTERM",n),o.on("SIGQUIT",n)}
1
+ import o from"node:process";export default function(n){o.on("SIGINT",n),o.on("SIGTERM",n),o.on("SIGQUIT",n)};
@@ -7,6 +7,5 @@ interface Timer {
7
7
  }
8
8
  /**
9
9
  * 最高精度的计时方法,返回纳秒级精度的bigint
10
- */
11
- declare const timer: Timer;
10
+ */ declare const timer: Timer;
12
11
  export default timer;
@@ -0,0 +1,54 @@
1
+ export type MemberTransformer = /** 帕斯卡拼写法(大驼峰): 所有单词的首字母大写,然后直接连接起来,单词之间没有连接符 */ 'pascal_case' | 'camel_case' | 'kebab_case' | 'dashed_case' | 'snake_case' | 'upper_case' | 'upper_first' | 'lower_case' | 'lower_first';
2
+ export interface TransformerOption {
3
+ /**
4
+ * 要使用的库名称,而不是导入语句中指定的库名称。`${member}` 是替换的成员
5
+ */ transform: string;
6
+ /**
7
+ * 设置转换时需要单独导入的样式,`${member}` 是替换的成员
8
+ * @default false
9
+ */ style?: string | boolean;
10
+ /**
11
+ * 当设置为true时,将保留 `import { Button }` 语法,而不是转换为 `import Button`
12
+ * @default false
13
+ */ skipDefaultConversion?: boolean;
14
+ /**
15
+ * 当遇到会导致导入整个模块时,是否抛出
16
+ * @default true
17
+ */ preventFullImport?: boolean;
18
+ /**
19
+ * `${member}` 成员转换规则
20
+ * @default []
21
+ */ memberTransformers?: MemberTransformer[];
22
+ }
23
+ /**
24
+ * 引入语法转换
25
+ * @example
26
+ * ```javascript
27
+ * // 案例
28
+ * const conf = {
29
+ * importOnDemand: {
30
+ * antd: {
31
+ * transform: 'lib/${member}',
32
+ * skipDefaultConversion: false,
33
+ * preventFullImport: true,
34
+ * style: 'lib/${member}/style',
35
+ * memberTransformers: ['dashed_case'],
36
+ * },
37
+ * lodash: {
38
+ * transform: '${member}',
39
+ * preventFullImport: true,
40
+ * },
41
+ * },
42
+ * };
43
+ * // 以下代码将会按照预期进行转换
44
+ * import { Button as MyButton, BackTop } from "antd";
45
+ * import { merge } from "lodash";
46
+ * // to
47
+ * import MyButton from "antd/lib/button";
48
+ * import BackTop from "antd/lib/back-top";
49
+ * import "antd/lib/back-top/style";
50
+ * import "antd/lib/button/style";
51
+ * import merge from "lodash/merge";
52
+ * ```
53
+ */ export type SwcImportOnDemandTransform = Record<string, TransformerOption | false>;
54
+ export declare function swcImportOnDemandConfig(config: SwcImportOnDemandTransform): SwcImportOnDemandTransform;
@@ -0,0 +1,2 @@
1
+ import { type Configuration } from 'webpack';
2
+ export declare function createDevelopmentConfiguration(override?: Configuration): Promise<Configuration>;
@@ -0,0 +1,9 @@
1
+ import webpack from 'webpack';
2
+ export declare const PORT: number;
3
+ export declare function getServerAddress(type: 'local' | 'net'): string;
4
+ // const serverSuccessMsg: string = `${ink(' Local ', '231', { bg: 'blue' })} ${ink(
5
+ // getServerAddress('local'),
6
+ // '75',
7
+ // )}
8
+ // ${ink(' Network ', '231', { bg: '29' })} ${ink(getServerAddress('net'), 'green')}`;
9
+ export declare function devLog(err?: Error | null, stats?: webpack.Stats): void;
@@ -1 +1 @@
1
- export default function(e,t){let r=Math.floor(100*t.percentage);return`<!DOCTYPE html><html><head><title>Building...</title><link rel="image/x-icon" href="/favicon.ico"><style>html{ display:flex; justify-content:center; align-items:center; block-size:100vb;}.progress-container{ position:relative; overflow:hidden; margin:1rem auto; border:0.0625rem solid #ccc; border-radius:0.625rem; inline-size:18.75rem; block-size:1.25rem;}.progress-bar{ block-size:100%; background:#4caf50; inline-size:0%; transition:inline-size 0.5s ease;}#progress-text{ position:absolute; margin:auto; font-size:0.875rem; font-family:sans-serif; font-weight:600; text-align:center; color:#fff; text-shadow:0 0 0.0625rem black; inset-inline:0; inset-block:0; line-height:1.25rem;}#progress-info{ font-size:small; font-family:sans-serif; font-weight:100; text-align:center; opacity:0.5; margin-block-start:0.625rem;}</style></head><body><div class="progress-container"><div class="progress-bar"></div><div id="progress-text">${r}%</div></div><div id="progress-info">${t.info}</div><script>function checkProgress() {fetch('${e}').then(r => r.json()) .then(data => {const percentage = Math.floor(data.percentage * 100);document.querySelector('.progress-bar').style.width = percentage + '%';document.getElementById('progress-text').textContent = percentage + '%';document.getElementById('progress-info').textContent = data.info;if (percentage === 100) {window.location.reload();} else {setTimeout(checkProgress, 500);}});}checkProgress();</script></body></html>`}
1
+ export default function(e,t){let r=Math.floor(100*t.percentage);return`<!DOCTYPE html><html><head><title>Building...</title><link rel="image/x-icon" href="/favicon.ico"><style>html{ display:flex; justify-content:center; align-items:center; block-size:100vb;}.progress-container{ position:relative; overflow:hidden; margin:1rem auto; border:0.0625rem solid #ccc; border-radius:0.625rem; inline-size:18.75rem; block-size:1.25rem;}.progress-bar{ block-size:100%; background:#4caf50; inline-size:0%; transition:inline-size 0.5s ease;}#progress-text{ position:absolute; margin:auto; font-size:0.875rem; font-family:sans-serif; font-weight:600; text-align:center; color:#fff; text-shadow:0 0 0.0625rem black; inset-inline:0; inset-block:0; line-height:1.25rem;}#progress-info{ font-size:small; font-family:sans-serif; font-weight:100; text-align:center; opacity:0.5; margin-block-start:0.625rem;}</style></head><body><div class="progress-container"><div class="progress-bar"></div><div id="progress-text">${r}%</div></div><div id="progress-info">${t.info}</div><script>function checkProgress() {fetch('${e}').then(r => r.json()) .then(data => {const percentage = Math.floor(data.percentage * 100);document.querySelector('.progress-bar').style.width = percentage + '%';document.getElementById('progress-text').textContent = percentage + '%';document.getElementById('progress-info').textContent = data.info;if (percentage === 100) {window.location.reload();} else {setTimeout(checkProgress, 500);}});}checkProgress();</script></body></html>`};
@@ -0,0 +1,10 @@
1
+ interface CertInstallOption {
2
+ install: boolean;
3
+ }
4
+ interface CertKeyCertOption {
5
+ key: string;
6
+ cert: string;
7
+ }
8
+ export type CertOption = CertInstallOption | CertKeyCertOption;
9
+ declare function getCert(domain: string, option: CertOption): Promise<CertKeyCertOption>;
10
+ export default getCert;
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1
2
  type Any = any;
2
3
  type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
3
4
  type ArraySchemaObjectType = 'array';
@@ -66,5 +67,6 @@ interface XMLObject {
66
67
  interface ReferenceObject {
67
68
  $ref: string;
68
69
  }
70
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
71
  export declare function jsonSchema<T>(schema: SchemaObject): any;
70
- export {};
72
+ export { };