@moneko/core 3.26.0-beta.0 → 3.26.0-beta.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 (36) hide show
  1. package/lib/bin/build.mjs +1 -1
  2. package/lib/bin/changelog.mjs +1 -1
  3. package/lib/bin/conf/bootstrap +83 -0
  4. package/lib/bin/eslint.mjs +1 -1
  5. package/lib/bin/git-hooks.mjs +1 -1
  6. package/lib/bin/index.d.mts +9 -0
  7. package/lib/bin/index.mjs +1 -1
  8. package/lib/bin/lessc.mjs +1 -1
  9. package/lib/bin/start.mjs +1 -1
  10. package/lib/bin/stylelint.mjs +1 -1
  11. package/lib/bin/utils/{config.d.ts → config.d.mts} +1 -1
  12. package/lib/bin/utils/config.mjs +1 -1
  13. package/lib/bin/utils/setup-swcrc.mjs +1 -1
  14. package/lib/bin/version.mjs +1 -1
  15. package/lib/process-env.d.mts +2 -1
  16. package/lib/process-env.mjs +1 -1
  17. package/lib/vm/info.d.mts +0 -1
  18. package/lib/vm/info.mjs +1 -1
  19. package/package.json +3 -3
  20. package/lib/bin/index.d.ts +0 -9
  21. package/lib/bin/utils/require.d.ts +0 -2
  22. package/lib/bin/utils/require.mjs +0 -1
  23. /package/lib/bin/{build-app.d.ts → build-app.d.mts} +0 -0
  24. /package/lib/bin/{build.d.ts → build.d.mts} +0 -0
  25. /package/lib/bin/{changelog.d.ts → changelog.d.mts} +0 -0
  26. /package/lib/bin/{eslint.d.ts → eslint.d.mts} +0 -0
  27. /package/lib/bin/{file.d.ts → file.d.mts} +0 -0
  28. /package/lib/bin/{git-hooks.d.ts → git-hooks.d.mts} +0 -0
  29. /package/lib/bin/{lessc.d.ts → lessc.d.mts} +0 -0
  30. /package/lib/bin/{runlint.d.ts → runlint.d.mts} +0 -0
  31. /package/lib/bin/{start.d.ts → start.d.mts} +0 -0
  32. /package/lib/bin/{stylelint.d.ts → stylelint.d.mts} +0 -0
  33. /package/lib/bin/utils/{bundle-app.d.ts → bundle-app.d.mts} +0 -0
  34. /package/lib/bin/utils/{setup-env.d.ts → setup-env.d.mts} +0 -0
  35. /package/lib/bin/utils/{setup-swcrc.d.ts → setup-swcrc.d.mts} +0 -0
  36. /package/lib/bin/{version.d.ts → version.d.mts} +0 -0
package/lib/bin/build.mjs CHANGED
@@ -1 +1 @@
1
- import{spawn as e}from"child_process";import{join as o,relative as s}from"path";import{program as t}from"commander";import i from"./utils/setup-env.js";import{lesscCommonjs as r}from"./lessc.js";import{corePackageName as n,cwd as m,swcCachePath as l,runtimePath as c}from"./utils/config.js";import p from"./utils/setup-swcrc.js";import d from"./utils/require.js";import{__dirname as f}from"./file.js";import{deleteEmptyDirs as a,updateFileSync as u,removeDir as j,ink as $,println as y,scanFolderSync as g,removeFile as _}from"@moneko/utils";let b={stdio:"inherit",shell:!0};t.command("build <type> <framework>").description("编译项目").action(async(t,h,...x)=>{t||(y($(`type: 无效值 ${$(t,"245")}`,"red")),process.exit(1)),await i("production",t,h);let v=x[1].args.slice(2),C=!v.includes("no-docs"),w=!v.includes("no-lib"),E=!v.includes("no-es"),k=`${c} ${d.resolve(`${n}/lib/build.mjs`)}`;if("library"===t){let t=p(h),i=d.resolve("typescript/bin/tsc"),n=d.resolve("@swc/cli/bin/swc.js"),$=[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),y=o(f,".types.json");$.length&&u(y,JSON.stringify({extends:s(f,o(m,"tsconfig.json")),include:[s(f,o(m,"components")),s(f,o(m,"typings"))],exclude:[s(f,o(m,"components/**/examples/*")),s(f,o(m,"components/**/__tests__/*")),s(f,o(m,"components/**/__mocks__/*"))]}));for(let s=0,p=$.length;s<p;s++){let p=o(m,`./${$[s].dir}`);j(p),e(`${c} ${n} components -d ${$[s].dir} -q --strip-leading-paths --config-file ${t} -C jsc.experimental.cacheRoot=${l} -C module.type=${$[s].type} -D --ignore "**/*.test.(js|ts)x?$"`,b).on("close",function(e){0===e&&(g(p,["README.mdx","examples","__*__"]).forEach(_),a(p),"commonjs"===$[s].type&&r())}),e(`${c} ${i} --project ${y} --outDir ${$[s].dir}`,b)}}("library"!==t||C&&"library"===t)&&e(k,b)});
1
+ import{spawn as e}from"child_process";import{join as o,relative as s}from"path";import{program as t}from"commander";import i from"./utils/setup-env.mjs";import{lesscCommonjs as r}from"./lessc.mjs";import{corePackageName as m,cwd as n,swcCachePath as l,runtimePath as c}from"./utils/config.mjs";import p from"./utils/setup-swcrc.mjs";import d from"../utils/require.mjs";import{__dirname as f}from"./file.mjs";import{deleteEmptyDirs as a,updateFileSync as u,removeDir as j,ink as $,println as y,scanFolderSync as g,removeFile as _}from"@moneko/utils";let b={stdio:"inherit",shell:!0};t.command("build <type> <framework>").description("编译项目").action(async(t,h,...x)=>{t||(y($(`type: 无效值 ${$(t,"245")}`,"red")),process.exit(1)),await i("production",t,h);let v=x[1].args.slice(2),C=!v.includes("no-docs"),w=!v.includes("no-lib"),E=!v.includes("no-es"),k=`${c} ${d.resolve(`${m}/lib/build.mjs`)}`;if("library"===t){let t=p(h),i=d.resolve("typescript/bin/tsc"),m=d.resolve("@swc/cli/bin/swc.js"),$=[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),y=o(f,".types.json");$.length&&u(y,JSON.stringify({extends:s(f,o(n,"tsconfig.json")),include:[s(f,o(n,"components")),s(f,o(n,"typings"))],exclude:[s(f,o(n,"components/**/examples/*")),s(f,o(n,"components/**/__tests__/*")),s(f,o(n,"components/**/__mocks__/*"))]}));for(let s=0,p=$.length;s<p;s++){let p=o(n,`./${$[s].dir}`);j(p),e(`${c} ${m} components -d ${$[s].dir} -q --strip-leading-paths --config-file ${t} -C jsc.experimental.cacheRoot=${l} -C module.type=${$[s].type} -D --ignore "**/*.test.(js|ts)x?$"`,b).on("close",function(e){0===e&&(g(p,["README.mdx","examples","__*__"]).forEach(_),a(p),"commonjs"===$[s].type&&r())}),e(`${c} ${i} --project ${y} --outDir ${$[s].dir}`,b)}}("library"!==t||C&&"library"===t)&&e(k,b)});
@@ -1,4 +1,4 @@
1
- import{execSync as t}from"child_process";import{join as e}from"path";import{program as o}from"commander";import{cwd as r}from"./utils/config.js";import{updateFileSync as s}from"@moneko/utils";let i={feat:"✨ Features",fix:"🐛 Bug Fixes",docs:"📚 Documentation",style:"💎 Styles",refactor:"📦 Code Refactoring",perf:"🚀 Performance Improvements",test:"🚨 Tests",build:"🛠 Builds",ci:"⚙️ Continuous Integrations",chore:"♻️ Chores",revert:"🗑 Reverts"};function n(e,o){return function(t){let e=[];for(let o of t.trim().split("\n")){let[t,r,s,n,a]=o.split("|");if(a){let o=a.split(": "),l=i[o[0]];e.push({commitId:t,author:r,email:s,date:new Date(n).toLocaleString().replace(/\//g,"-"),message:l?o.slice(1).join(":"):a,type:l})}}return e}(t(`git log ${e?`${e}..`:""}${o||""} --format='%H|%an|%ae|%ad|%s'`,{encoding:"utf-8"}))}o.command("changelog <filename>").description("生成 CHANGELOG.md").action(o=>{let i=["# Change log"];try{t('git show-ref --quiet --verify "refs/heads/$(git rev-parse --abbrev-ref HEAD)";');let e=t('git config --get remote.origin.url | sed "s/\\.git$//"').toString().trim(),o=function(e){let o=t("git for-each-ref --sort='v:refname' --format '%(objectname) %(refname:short) %(creatordate:iso8601)' refs/tags",{encoding:"utf-8"}),r=[],s=o.trim().split("\n");return s.forEach((t,o)=>{let[i,n,a]=t.split(" "),l=s[o-1]?.split(" ")[1],c=`## ${n}`;l&&(c=`## [${n}](${e}/compare/${l}...${n}) (${new Date(a).toLocaleDateString().replace(/\//g,"-")})`),r.push({commitId:i,tag:n,date:a,title:c,logs:{}})}),r}(e);o.forEach((t,r)=>{if(r&&n(o[r-1].tag,t.tag).forEach(t=>{if(t.type){let s=o[r].logs[t.type]||[];s.push(`- ${t.message} ([${t.commitId.substring(0,7)}](${e}/commit/${t.commitId}))`),Object.assign(o[r].logs,{[t.type]:s})}}),r===o.length-1){let s=n(t.tag);s.length&&o.push({title:"## Last",logs:{}}),s.forEach(t=>{if(t.type){let s=o[r+1].logs[t.type]||[];s.push(`- ${t.message} ([${t.commitId.substring(0,7)}](${e}/commit/${t.commitId}))`),Object.assign(o[r+1].logs,{[t.type]:s})}})}}),o.reverse().forEach(t=>{for(let e in i.push(`
1
+ import{execSync as t}from"child_process";import{join as e}from"path";import{program as o}from"commander";import{cwd as r}from"./utils/config.mjs";import{updateFileSync as s}from"@moneko/utils";let i={feat:"✨ Features",fix:"🐛 Bug Fixes",docs:"📚 Documentation",style:"💎 Styles",refactor:"📦 Code Refactoring",perf:"🚀 Performance Improvements",test:"🚨 Tests",build:"🛠 Builds",ci:"⚙️ Continuous Integrations",chore:"♻️ Chores",revert:"🗑 Reverts"};function n(e,o){return function(t){let e=[];for(let o of t.trim().split("\n")){let[t,r,s,n,a]=o.split("|");if(a){let o=a.split(": "),l=i[o[0]];e.push({commitId:t,author:r,email:s,date:new Date(n).toLocaleString().replace(/\//g,"-"),message:l?o.slice(1).join(":"):a,type:l})}}return e}(t(`git log ${e?`${e}..`:""}${o||""} --format='%H|%an|%ae|%ad|%s'`,{encoding:"utf-8"}))}o.command("changelog <filename>").description("生成 CHANGELOG.md").action(o=>{let i=["# Change log"];try{t('git show-ref --quiet --verify "refs/heads/$(git rev-parse --abbrev-ref HEAD)";');let e=t('git config --get remote.origin.url | sed "s/\\.git$//"').toString().trim(),o=function(e){let o=t("git for-each-ref --sort='v:refname' --format '%(objectname) %(refname:short) %(creatordate:iso8601)' refs/tags",{encoding:"utf-8"}),r=[],s=o.trim().split("\n");return s.forEach((t,o)=>{let[i,n,a]=t.split(" "),l=s[o-1]?.split(" ")[1],c=`## ${n}`;l&&(c=`## [${n}](${e}/compare/${l}...${n}) (${new Date(a).toLocaleDateString().replace(/\//g,"-")})`),r.push({commitId:i,tag:n,date:a,title:c,logs:{}})}),r}(e);o.forEach((t,r)=>{if(r&&n(o[r-1].tag,t.tag).forEach(t=>{if(t.type){let s=o[r].logs[t.type]||[];s.push(`- ${t.message} ([${t.commitId.substring(0,7)}](${e}/commit/${t.commitId}))`),Object.assign(o[r].logs,{[t.type]:s})}}),r===o.length-1){let s=n(t.tag);s.length&&o.push({title:"## Last",logs:{}}),s.forEach(t=>{if(t.type){let s=o[r+1].logs[t.type]||[];s.push(`- ${t.message} ([${t.commitId.substring(0,7)}](${e}/commit/${t.commitId}))`),Object.assign(o[r+1].logs,{[t.type]:s})}})}}),o.reverse().forEach(t=>{for(let e in i.push(`
2
2
  ${t.title}`),t.logs)Object.prototype.hasOwnProperty.call(t.logs,e)&&(i.push(`
3
3
  ### ${e}
4
4
  `),t.logs[e].forEach(t=>i.push(t)))})}catch{i.push("\n当前分支尚无任何提交\n")}s(e(r,o),i.join("\n"))});
@@ -0,0 +1,83 @@
1
+ import 'package:flutter/material.dart';
2
+ import 'package:webview_flutter_plus/webview_flutter_plus.dart';
3
+
4
+ void main() {
5
+ runApp(const WebView());
6
+ }
7
+
8
+ class WebView extends StatelessWidget {
9
+ const WebView({Key? key}) : super(key: key);
10
+
11
+ @override
12
+ Widget build(BuildContext context) {
13
+ return const MaterialApp(
14
+ home: WebViewMainPage(),
15
+ );
16
+ }
17
+ }
18
+
19
+ class WebViewMainPage extends StatefulWidget {
20
+ const WebViewMainPage({Key? key}) : super(key: key);
21
+
22
+ @override
23
+ _WebViewMainPageState createState() => _WebViewMainPageState();
24
+ }
25
+
26
+ class _WebViewMainPageState extends State<WebViewMainPage> {
27
+ late WebViewPlusController _controller;
28
+
29
+ @override
30
+ Widget build(BuildContext context) {
31
+ return WillPopScope(
32
+ onWillPop: () {
33
+ Future<bool> canGoBack = _controller.webViewController.canGoBack();
34
+ return canGoBack.then((str) {
35
+ if (str) {
36
+ _controller.webViewController.goBack();
37
+ return false;
38
+ } else {
39
+ Navigator.of(context).pop();
40
+ return true;
41
+ }
42
+ });
43
+ },
44
+ child: Scaffold(
45
+ body: WebViewPlus(
46
+ gestureNavigationEnabled: true,
47
+ javascriptChannels: {
48
+ JavascriptChannel(
49
+ name: "Log",
50
+ onMessageReceived: (JavascriptMessage message) {
51
+ // ignore: avoid_print
52
+ print(message.message);
53
+ }),
54
+ },
55
+ initialUrl: 'assets/web/index.html',
56
+ onWebViewCreated: (controller) {
57
+ _controller = controller;
58
+ },
59
+ onPageFinished: (url) {
60
+ _controller.webViewController.runJavascript(initWebView(context));
61
+ },
62
+ javascriptMode: JavascriptMode.unrestricted,
63
+ ),
64
+ ),
65
+ );
66
+ }
67
+ }
68
+
69
+ String initWebView(context) {
70
+ final double areaPaddingTop = MediaQuery.of(context).padding.top;
71
+ final double areaPaddingBottom = MediaQuery.of(context).padding.bottom;
72
+ String initEval = '''
73
+ (function () {
74
+ window.areaPaddingTop = $areaPaddingTop;
75
+ window.areaPaddingBottom = $areaPaddingBottom;
76
+ document.documentElement.style.setProperty('--area-padding-top', $areaPaddingTop + 'px');
77
+ document.documentElement.style.setProperty('--area-padding-bottom', $areaPaddingBottom + 'px');
78
+ window.H5RemoteRuntime.bootstrap();
79
+ })();
80
+ ''';
81
+
82
+ return initEval;
83
+ }
@@ -1 +1 @@
1
- import{join as o,relative as i}from"path";import{program as t}from"commander";import{runLint as n}from"./runlint.js";import{cachePath as r,cwd as e,runtimePath as s}from"./utils/config.js";import c from"./utils/require.js";t.command("eslint <soucre>").option("-o, --output-file").option("-f, --format").option("--color, --no-color").option("--fix").option("--fix-dry-run").option("--ext").description("js代码规范检查").action((t,l,m)=>{let p=o(c.resolve("eslint"),"../../bin/eslint.js");n(`${s} ${p} ${i(e,t)} --config ${i(e,"eslint.config.mjs")} ${m.parent.args.slice(2).join(" ")} --cache --cache-location "${r}/.eslintcache"`,"eslint")});
1
+ import{join as o,relative as i}from"path";import{program as t}from"commander";import{runLint as n}from"./runlint.mjs";import{cachePath as r,cwd as e,runtimePath as m}from"./utils/config.mjs";import s from"../utils/require.mjs";t.command("eslint <soucre>").option("-o, --output-file").option("-f, --format").option("--color, --no-color").option("--fix").option("--fix-dry-run").option("--ext").description("js代码规范检查").action((t,c,l)=>{let p=o(s.resolve("eslint"),"../../bin/eslint.js");n(`${m} ${p} ${i(e,t)} --config ${i(e,"eslint.config.mjs")} ${l.parent.args.slice(2).join(" ")} --cache --cache-location "${r}/.eslintcache"`,"eslint")});
@@ -1 +1 @@
1
- import{program as o}from"commander";import{runLint as i}from"./runlint.js";o.command("githooks").description("git hooks工具").action((o,t)=>{let n="node_modules/.husky",m=t.args.map(o=>{let i=o.split("=");return`echo "${i[1]}" > ${n}/${i[0]}`}).join(" && ");i(`git init && husky ${n} && ${m}`,"githooks",[null])});
1
+ import{program as o}from"commander";import{runLint as i}from"./runlint.mjs";o.command("githooks").description("git hooks工具").action((o,t)=>{let m="node_modules/.husky",n=t.args.map(o=>{let i=o.split("=");return`echo "${i[1]}" > ${m}/${i[0]}`}).join(" && ");i(`git init && husky ${m} && ${n}`,"githooks",[null])});
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import './version.mjs';
3
+ import './eslint.mjs';
4
+ import './stylelint.mjs';
5
+ import './build.mjs';
6
+ import './start.mjs';
7
+ import './build-app.mjs';
8
+ import './git-hooks.mjs';
9
+ import './changelog.mjs';
package/lib/bin/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{program as i}from"commander";import"./version.js";import"./eslint.js";import"./stylelint.js";import"./build.js";import"./start.js";import"./build-app.js";import"./git-hooks.js";import"./changelog.js";i.option("-ig,--initgit","init git"),i.parse(process.argv),["SIGINT","SIGTERM","SIGQUIT"].forEach(i=>process.on(i,()=>{process.exit(0)}));
2
+ import{program as i}from"commander";import"./version.mjs";import"./eslint.mjs";import"./stylelint.mjs";import"./build.mjs";import"./start.mjs";import"./build-app.mjs";import"./git-hooks.mjs";import"./changelog.mjs";i.option("-ig,--initgit","init git"),i.parse(process.argv),["SIGINT","SIGTERM","SIGQUIT"].forEach(i=>process.on(i,()=>{process.exit(0)}));
package/lib/bin/lessc.mjs CHANGED
@@ -1 +1 @@
1
- import{join as s}from"path";import{exec as e}from"child_process";import{runtimePath as o,corePackageName as t}from"./utils/config.js";import i from"./utils/require.js";import{loadFile as l,saveFile as r,scanFolderSync as m}from"@moneko/utils";let n="";function a(t){let l=s(i.resolve("less"),"../bin/lessc");return new Promise((s,i)=>{e(`${o} ${l} --js ${n} ${t} > ${t.replace(/\.less$/g,".css")}`,function(e){if(e)return i(e);s(!0)})})}let c=/\*?\.less/g;async function f(s){let e=await l(s);e&&c.test(e)&&await r(s,e.replace(c,".css"))}export async function lesscCommonjs(){let s=m("lib",["\\.less$"]),e=(await import(i.resolve(`${t}/lib/options/modify-vars.mjs`))).default;for(let s in e)Object.hasOwnProperty.call(e,s)&&(n+=`--modify-var="${s}=${e[s]}" `);Promise.all(s.map(a)),s.length&&Promise.all(m("lib",["\\.js$"]).map(f))}
1
+ import{join as s}from"path";import{exec as e}from"child_process";import{runtimePath as o,corePackageName as t}from"./utils/config.mjs";import i from"../utils/require.mjs";import{loadFile as l,saveFile as r,scanFolderSync as m}from"@moneko/utils";let n="";function a(t){let l=s(i.resolve("less"),"../bin/lessc");return new Promise((s,i)=>{e(`${o} ${l} --js ${n} ${t} > ${t.replace(/\.less$/g,".css")}`,function(e){if(e)return i(e);s(!0)})})}let c=/\*?\.less/g;async function f(s){let e=await l(s);e&&c.test(e)&&await r(s,e.replace(c,".css"))}export async function lesscCommonjs(){let s=m("lib",["\\.less$"]),e=(await import(i.resolve(`${t}/lib/options/modify-vars.mjs`))).default;for(let s in e)Object.hasOwnProperty.call(e,s)&&(n+=`--modify-var="${s}=${e[s]}" `);Promise.all(s.map(a)),s.length&&Promise.all(m("lib",["\\.js$"]).map(f))}
package/lib/bin/start.mjs CHANGED
@@ -1 +1 @@
1
- import{spawn as e}from"child_process";import{program as i}from"commander";import{ink as o,println as r}from"@moneko/utils";import{corePackageName as t,runtimePath as s}from"./utils/config.js";import m from"./utils/setup-env.js";import p from"./utils/require.js";i.command("start <type> <framework>").description("运行项目").action(async(i,l,...n)=>{i||(r(o("type: 无效值 "+o(i,"245"),"red")),process.exit(1)),await m("development",i,l);let c=n[1].args.slice(2),f=c.indexOf("no-verify");-1!==f&&c.splice(f,1),e(`${s} ${p.resolve(`${t}/lib/dev.mjs`)}`,{stdio:"inherit",shell:!0})});
1
+ import{spawn as e}from"child_process";import{program as i}from"commander";import{ink as o,println as r}from"@moneko/utils";import{corePackageName as m,runtimePath as t}from"./utils/config.mjs";import s from"./utils/setup-env.mjs";import p from"../utils/require.mjs";i.command("start <type> <framework>").description("运行项目").action(async(i,l,...n)=>{i||(r(o("type: 无效值 "+o(i,"245"),"red")),process.exit(1)),await s("development",i,l);let c=n[1].args.slice(2),f=c.indexOf("no-verify");-1!==f&&c.splice(f,1),e(`${t} ${p.resolve(`${m}/lib/dev.mjs`)}`,{stdio:"inherit",shell:!0})});
@@ -1 +1 @@
1
- import{relative as o,join as t}from"path";import{program as i}from"commander";import{cachePath as s,cwd as e,runtimePath as n}from"./utils/config.js";import{runLint as r}from"./runlint.js";import l from"./utils/require.js";i.command("stylelint <soucre>").option("-o, --output-file").option("-f, --format").option("--color, --no-color").option("--fix").option("--fix-dry-run").option("--ext").description("css代码规范检查").action((i,c,m)=>{let p=t(l.resolve("stylelint"),"../../bin/stylelint.mjs");r(`${n} ${p} ${o(e,i)}/**/**/**/**/*.{less,css,scss,sass,style.ts,style.js} ${m.parent.args.slice(2).join(" ")} --cache --cache-location "${s}/.stylelintcache" --aei`,"stylelint")});
1
+ import{relative as o,join as t}from"path";import{program as i}from"commander";import{cachePath as s,cwd as e,runtimePath as n}from"./utils/config.mjs";import{runLint as r}from"./runlint.mjs";import l from"../utils/require.mjs";i.command("stylelint <soucre>").option("-o, --output-file").option("-f, --format").option("--color, --no-color").option("--fix").option("--fix-dry-run").option("--ext").description("css代码规范检查").action((i,c,m)=>{let p=t(l.resolve("stylelint"),"../../bin/stylelint.mjs");r(`${n} ${p} ${o(e,i)}/**/**/**/**/*.{less,css,scss,sass,style.ts,style.js} ${m.parent.args.slice(2).join(" ")} --cache --cache-location "${s}/.stylelintcache" --aei`,"stylelint")});
@@ -1,6 +1,6 @@
1
1
  export declare const runtimePath: string;
2
2
  export declare const cliVersion: any;
3
- export declare const corePackageName = "@moneko/core";
3
+ export declare const corePackageName: string;
4
4
  export declare const cwd: string;
5
5
  export declare const cachePath: string;
6
6
  export declare const swcCachePath: string;
@@ -1 +1 @@
1
- import{join as e,dirname as o}from"path";import{__dirname as c}from"../file.js";import t from"./require.js";let n=o(process.execPath);"win32"===process.platform&&n.includes(" ")&&(n=`"${n}"`);export const runtimePath=e(n,"undefined"!=typeof Deno?"deno":"undefined"!=typeof Bun?"bun":"node");export const cliVersion=t(e(c,"../package.json")).version;export const corePackageName="@moneko/core";export const cwd=process.cwd();export const cachePath=e(cwd,"node_modules/.cache");export const swcCachePath=e(cachePath,".swc");
1
+ import{join as e,dirname as o}from"path";import{coreName as c,coreVersion as t}from"../../process-env.mjs";let n=o(process.execPath);"win32"===process.platform&&n.includes(" ")&&(n=`"${n}"`),console.log(t);export const runtimePath=e(n,"undefined"!=typeof Deno?"deno":"undefined"!=typeof Bun?"bun":"node");export const cliVersion=t;export const corePackageName=c;export const cwd=process.cwd();export const cachePath=e(cwd,"node_modules/.cache");export const swcCachePath=e(cachePath,".swc");
@@ -1 +1 @@
1
- import{join as e}from"path";import{__dirname as o}from"../file.js";import r from"./require.js";import{updateFileSync as s}from"@moneko/utils";let m=e(o,".swcrc");export default function(e){let o="solid"===e;return s(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:o?"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"]}}],o&&[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/"]})),m}
1
+ import{join as e}from"path";import{__dirname as o}from"../file.mjs";import r from"../../utils/require.mjs";import{updateFileSync as s}from"@moneko/utils";let m=e(o,".swcrc");export default function(e){let o="solid"===e;return s(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:o?"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"]}}],o&&[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/"]})),m}
@@ -1 +1 @@
1
- import{program as o}from"commander";import{cliVersion as r}from"./utils/config.js";o.version(r,"-v, --version");
1
+ import{program as o}from"commander";import{cliVersion as m}from"./utils/config.mjs";o.version(m,"-v, --version");
@@ -11,7 +11,6 @@ export declare const SSR: boolean;
11
11
  /** 项目主要文件夹 */
12
12
  export declare const mainDirectory: string;
13
13
  export declare const jsxImportSource: string;
14
- export declare const frameworkVersion: any;
15
14
  declare const description: any, author: any, repository: any, keywords: any;
16
15
  export { description, author, repository, keywords };
17
16
  /** 应用名称 */
@@ -20,6 +19,8 @@ export declare const PACKAGENAME: string;
20
19
  export declare const PACKAGEVERSION: string;
21
20
  /** core 包名 */
22
21
  export declare const coreName: string;
22
+ /** core 版本 */
23
+ export declare const coreVersion: any;
23
24
  /** 是否为本地开发环境 */
24
25
  export declare const isDev: boolean;
25
26
  export declare const refresh: string | false;
@@ -1 +1 @@
1
- import o from"./utils/require.mjs";import e from"./utils/has-pkg.mjs";export const APPTYPE=process.env.APPTYPE;export const FRAMEWORK=process.env.FRAMEWORK;export const NODE_ENV=process.env.NODE_ENV;export const isLibrary="library"===APPTYPE;export const isMicro="micro"===APPTYPE;export const isMobile="mobile"===APPTYPE;export const isReact="react"===FRAMEWORK;export const isSolid="solid"===FRAMEWORK;export const SSR="true"===process.env.SSR;export const mainDirectory=isLibrary?"site":"src";export const jsxImportSource={react:"react",solid:"solid-js/h"}[FRAMEWORK];export const frameworkVersion=o(`${{react:"react",solid:"solid-js"}[FRAMEWORK]}/package.json`).version;let{name:r,version:s,description:t,author:c,repository:i,keywords:p}=o(`${process.cwd()}/package.json`);export const PACKAGENAME=r;export const PACKAGEVERSION=s;export const coreName="@moneko/core";export const isDev="development"===NODE_ENV;export const refresh=isDev&&(e("solid-refresh")||e("react-refresh"));export{t as description,c as author,i as repository,p as keywords};
1
+ import o from"./utils/require.mjs";import e from"./utils/has-pkg.mjs";export const APPTYPE=process.env.APPTYPE;export const FRAMEWORK=process.env.FRAMEWORK;export const NODE_ENV=process.env.NODE_ENV;export const isLibrary="library"===APPTYPE;export const isMicro="micro"===APPTYPE;export const isMobile="mobile"===APPTYPE;export const isReact="react"===FRAMEWORK;export const isSolid="solid"===FRAMEWORK;export const SSR="true"===process.env.SSR;export const mainDirectory=isLibrary?"site":"src";export const jsxImportSource={react:"react",solid:"solid-js/h"}[FRAMEWORK];let{name:r,version:s,description:t,author:c,repository:i,keywords:p}=o(`${process.cwd()}/package.json`);export const PACKAGENAME=r;export const PACKAGEVERSION=s;export const coreName="@moneko/core";export const coreVersion=o("@moneko/core/package.json").version;export const isDev="development"===NODE_ENV;export const refresh=isDev&&(e("solid-refresh")||e("react-refresh"));export{t as description,c as author,i as repository,p as keywords};
package/lib/vm/info.d.mts CHANGED
@@ -11,6 +11,5 @@ declare const app: {
11
11
  description: any;
12
12
  author: any;
13
13
  repository: any;
14
- frameworkVersion: any;
15
14
  };
16
15
  export default app;
package/lib/vm/info.mjs CHANGED
@@ -1 +1 @@
1
- import{CONFIG as e}from"../config.mjs";import{description as r,author as o,repository as t,APPTYPE as s,PACKAGENAME as m,PACKAGEVERSION as i,SSR as p,frameworkVersion as n}from"../process-env.mjs";import{convertToCamelCase as a}from"../utils/index.mjs";let f="string"==typeof o,l={name:m,projectName:a(m),ssr:p,version:i,base:e.basename,type:s,routerMode:e.routerMode,prefixCls:e.prefixCls,theme:e.theme,description:r,author:f?{name:o}:o,repository:f?{url:t}:t,frameworkVersion:n};export default l;
1
+ import{CONFIG as e}from"../config.mjs";import{description as r,author as o,repository as t,APPTYPE as s,PACKAGENAME as m,PACKAGEVERSION as i,SSR as p}from"../process-env.mjs";import{convertToCamelCase as n}from"../utils/index.mjs";let a="string"==typeof o,f={name:m,projectName:n(m),ssr:p,version:i,base:e.basename,type:s,routerMode:e.routerMode,prefixCls:e.prefixCls,theme:e.theme,description:r,author:a?{name:o}:o,repository:a?{url:t}:t};export default f;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.26.0-beta.0",
3
+ "version": "3.26.0-beta.2",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
@@ -10,7 +10,7 @@
10
10
  "prepublishOnly": "npm run build"
11
11
  },
12
12
  "bin": {
13
- "mo": "./lib/bin/index.js"
13
+ "mo": "./lib/bin/index.mjs"
14
14
  },
15
15
  "keywords": [],
16
16
  "author": "moneko",
@@ -20,6 +20,7 @@
20
20
  "@moneko/mdx": "0.1.42",
21
21
  "@moneko/transform-imports": "0.6.1",
22
22
  "@moneko/utils": "0.1.19",
23
+ "@swc/cli": "0.5.1",
23
24
  "@swc/core": "1.6.13",
24
25
  "@typescript/vfs": "1.6.0",
25
26
  "browserslist": "4.24.2",
@@ -52,7 +53,6 @@
52
53
  },
53
54
  "devDependencies": {
54
55
  "@moneko/css": "1.1.5",
55
- "@swc/cli": "0.5.1",
56
56
  "@types/babel__core": "7.20.5",
57
57
  "@types/express": "5.0.0",
58
58
  "@types/multer": "1.4.12",
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import './version.js';
3
- import './eslint.js';
4
- import './stylelint.js';
5
- import './build.js';
6
- import './start.js';
7
- import './build-app.js';
8
- import './git-hooks.js';
9
- import './changelog.js';
@@ -1,2 +0,0 @@
1
- declare const require: NodeRequire;
2
- export default require;
@@ -1 +0,0 @@
1
- import{createRequire as t}from"module";let e=t(import.meta.url);export default e;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes