@moneko/core 3.26.0-beta.1 → 3.26.0-beta.3
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.
- package/lib/bin/build-app.mjs +1 -1
- package/lib/bin/build.mjs +1 -1
- package/lib/bin/conf/bootstrap +83 -0
- package/lib/bin/eslint.mjs +1 -1
- package/lib/bin/lessc.mjs +1 -1
- package/lib/bin/start.mjs +1 -1
- package/lib/bin/stylelint.mjs +1 -1
- package/lib/bin/utils/config.d.mts +2 -2
- package/lib/bin/utils/config.mjs +1 -1
- package/lib/bin/utils/setup-env.d.mts +1 -1
- package/lib/bin/utils/setup-env.mjs +1 -1
- package/lib/bin/utils/setup-swcrc.mjs +1 -1
- package/lib/bin/version.mjs +1 -1
- package/lib/paths.mjs +1 -1
- package/lib/process-env.d.mts +0 -1
- package/lib/process-env.mjs +1 -1
- package/lib/vm/info.mjs +1 -1
- package/package.json +2 -2
- package/lib/bin/utils/require.d.mts +0 -2
- package/lib/bin/utils/require.mjs +0 -1
package/lib/bin/build-app.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{program as r}from"commander";import{
|
|
1
|
+
import{execSync as e}from"child_process";import i from"fs";import n from"path";import{program as r}from"commander";import{bundleApk as s,bundleIOS as o}from"./utils/bundle-app.mjs";import{__dirname as t,copyFolderRecursiveSync as a}from"./file.mjs";import{corePkg as l}from"./utils/config.mjs";import{cwd as d}from"./utils/config.mjs";import{createDir as p,loadFileSync as m,removeDir as c,saveFile as f,parseYaml as u,jsonToYaml as S,parsePlist as b,buildPlist as w,parseXml as y,buildXml as g,ink as j,print as _}from"@moneko/utils";let k=async(r,k)=>{k.args.forEach(e=>{let[i,n]=e.replace(/^--/,"").split("=");process.env[`__args__${i}__`]=n});let{CONFIG:h}=await import(`${l}/lib/config.mjs`),A=h.bundleId;if(!A)throw Error("请配置 bundleId");if(!/(^com\.)([a-zA-Z_][a-zA-Z0-9_]*[.])*([a-zA-Z_][a-zA-Z0-9_]*)$/.test(A)||3!==A.split(".").length)throw Error("软件包名不合法");let O=h.bundles;if(!O||0===O.length)throw Error("请配置 bundles (打包类型)");let E=A.split(".").splice(-1,1).join(""),N=n.join(d,"/dist"),$=`flutter create -t app --org ${A} -i swift -a kotlin ${E}`,T=n.join(d,"/"+E),V=n.join(T,"assets/web/");e($,{encoding:"utf-8"}),p(V),_(j("正在注册资产...","yellow"),!0),a(N,V);let I=n.join(T,"pubspec.yaml"),J=JSON.parse(await u(I)||"{}"),x=[],R=(e,n="assets/web")=>{let r=i.readdirSync(e);!function s(o){o!=r.length&&(i.statSync(e+"/"+r[o]).isDirectory()&&(x.push(n+"/"+r[o]+"/"),R(e+"/"+r[o],n+"/"+r[o])),s(o+1))}(0)};if(R(N),J.dependencies.webview_flutter_plus="^0.2.3",J.flutter.assets=["assets/web/",...x],f(I,await S(JSON.stringify(J))),_(j("注册资产","cyan")+": "+j("完成","cyan"),!0),O.includes("apk -release")||O.includes("apk -debug")){_(j("正在配置安卓权限...","yellow"),!0);let e=n.join(T,"android/app/src/main/AndroidManifest.xml"),i=JSON.parse(y(e));i.manifest.application.$["android:usesCleartextTraffic"]="true",i.manifest["uses-permission"]=[{$:{"android:name":"android.permission.INTERNET"}},{$:{"android:name":"android.permission.ACCESS_NETWORK_STATE"}},{$:{"android:name":"android.permission.WAKE_LOCK"}}],f(e,g(JSON.stringify(i)));let r=n.join(T,"android/app/build.gradle"),s=m(r)||"",o="minSdkVersion flutter.minSdkVersion";if(s?.includes(o))s=s.replace(o,"minSdkVersion 20");else{let e=s.indexOf("minSdkVersion "),i=s.substring(e,e+16);s=s.replace(i,"minSdkVersion 20")}let t="compileSdkVersion flutter.compileSdkVersion";s.includes(t)&&(s=s.replace(t,"compileSdkVersion 32")),f(r,s),_(j("安卓权限配置","cyan")+": "+j("完成","cyan"),!0)}if(O.includes("ios -release")||O.includes("ios -debug")){_(j("开始配置IOS权限","yellow"),!0);let e=n.join(T,"ios/Runner/Info.plist"),i=Object.assign(JSON.parse(await b(e)),{NSAppTransportSecurity:{NSAllowsArbitraryLoads:!0},"io.flutter.embedded_views_preview":!0});f(e,await w(JSON.stringify(i))),_(j("IOS权限配置","cyan")+": "+j("完成","cyan"),!0)}f(n.join(T,"lib/main.dart"),m(n.join(t,"./conf/bootstrap"))||"");let v=n.join(d,"./bundle/");p(v),setTimeout(()=>{O.forEach(e=>{let i=e.split(" ");"apk"===i[0]&&s(T,v,i[1]),"ios"===i[0]&&o(T,v,i[1])}),c(T),i.existsSync(n.join(v,"Runner"))&&c(n.join(v,"Runner")),_("✨ "+j("Done","green"),!0),process.exit(0)},1e3)};r.command("buildApp").description("编译将 h5 应用打包成移动客户端,使用 Flutter").action(k);
|
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.mjs";import{lesscCommonjs as r}from"./lessc.mjs";import{
|
|
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{corePkg as n,cwd as m,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));let v=x[1].args.slice(2),C=!v.includes("no-docs"),w=!v.includes("no-lib"),E=!v.includes("no-es"),k=v.filter(e=>!["no-docs","no-es","no-lib"].includes(e));await i("production",t,h,k);let D=`${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(D,b)});
|
|
@@ -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
|
+
}
|
package/lib/bin/eslint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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"
|
|
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")});
|
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,
|
|
1
|
+
import{join as s}from"path";import{exec as e}from"child_process";import{runtimePath as o,corePkg 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{
|
|
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{corePkg 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));let c=n[1].args.slice(2),f=c.indexOf("no-verify");-1!==f&&c.splice(f,1),await s("development",i,l,c),e(`${t} ${p.resolve(`${m}/lib/dev.mjs`)}`,{stdio:"inherit",shell:!0})});
|
package/lib/bin/stylelint.mjs
CHANGED
|
@@ -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.mjs";import{runLint as r}from"./runlint.mjs";import l from"
|
|
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
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const corePkg = "@moneko/core";
|
|
3
|
+
export declare const coreVersion: any;
|
|
4
4
|
export declare const cwd: string;
|
|
5
5
|
export declare const cachePath: string;
|
|
6
6
|
export declare const swcCachePath: string;
|
package/lib/bin/utils/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e,dirname as o}from"path";import
|
|
1
|
+
import{join as e,dirname as o}from"path";import c from"../../utils/require.mjs";let t=o(process.execPath);"win32"===process.platform&&t.includes(" ")&&(t=`"${t}"`);export const runtimePath=e(t,"undefined"!=typeof Deno?"deno":"undefined"!=typeof Bun?"bun":"node");export const corePkg="@moneko/core";export const coreVersion=c("@moneko/core/package.json").version;export const cwd=process.cwd();export const cachePath=e(cwd,"node_modules/.cache");export const swcCachePath=e(cachePath,".swc");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loadFile as e}from"@moneko/utils";async function t(t,r,n){let
|
|
1
|
+
import{loadFile as e}from"@moneko/utils";async function t(t,r,n,i){let s=[".env",".env/.env",`.env/.${"production"===t?"prod":"dev"}.env`],o={NODE_ENV:t,APPTYPE:r,FRAMEWORK:n};return i.forEach(e=>{let[t,r]=e.replace(/^--/,"").split("=");Object.assign(o,{[`__args__${t}__`]:r||!0})}),(await Promise.all(s.map(e))).forEach(e=>{e&&Object.assign(o,e.split("\n").reduce((e,t)=>{if(!t||t.trim().startsWith("#"))return e;let[r,...n]=t.split("=");if(!r)return e;let i=n.join("=").trim();return e[r.trim()]=i.replace(/^["']|["']$/g,""),e},{}))}),Object.keys(o).forEach(e=>{let t=o[e];process.env[e]!==t&&(process.env[e]=o[e])}),o}export default t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e}from"path";import{__dirname as o}from"../file.mjs";import r from"
|
|
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}
|
package/lib/bin/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{program as o}from"commander";import{
|
|
1
|
+
import{program as o}from"commander";import{coreVersion as m}from"./utils/config.mjs";o.version(m,"-v, --version");
|
package/lib/paths.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"url";import{dirname as e,resolve as t}from"path";import{fileExists as a}from"@moneko/utils";let n=JSON.parse(process.env.npm_config_argv||'{"original":[]}').original;export const __filename=o.fileURLToPath(import.meta.url);export const __dirname=e(__filename);export const yarnArgv={};for(let o=0,e=n.length;o<e;o++){let e=n[o].split("=");Object.assign(yarnArgv,{[e[0]]:e[1]||!0})}export const CUSTOMCONFIG=process.env.npm_config_config||yarnArgv.config;let c=process.cwd(),r=t(c,"./node_modules"),
|
|
1
|
+
import o from"url";import{dirname as e,resolve as t}from"path";import{fileExists as a}from"@moneko/utils";let n=JSON.parse(process.env.npm_config_argv||'{"original":[]}').original;export const __filename=o.fileURLToPath(import.meta.url);export const __dirname=e(__filename);export const yarnArgv={};for(let o=0,e=n.length;o<e;o++){let e=n[o].split("=");Object.assign(yarnArgv,{[e[0]]:e[1]||!0})}export const CUSTOMCONFIG=process.env.npm_config_config||yarnArgv.config||process.env.__args__config__;let c=process.cwd(),r=t(c,"./node_modules"),s={__dirname,__filename,nodeModules:r,pnpmNodeModules:t(r,"./.pnpm/node_modules"),corePath:o.fileURLToPath(new URL(".",import.meta.url)),programPath:c,webpackCachePath:t(r,"./.cache"),lintCachePath:t(r,"./.cache"),httpCachePath:t(r,"./.cache/http"),swcCachePath:t(r,"./.cache/.swc"),configPath:t(c,"./config/index.ts"),customConfigPath:t(c,`./config/${CUSTOMCONFIG}.ts`),coveragePath:t(c,"./coverage/clover.xml"),pagesPath:t(c,"./src/pages"),componentsPath:t(c,"./components"),mockPath:t(c,"./mock")};export const config_files=[a(s.configPath)&&s.configPath,a(s.customConfigPath)&&s.customConfigPath].filter(Boolean);export const routeDir="library"===process.env.APPTYPE?s.componentsPath:s.pagesPath;export default s;
|
package/lib/process-env.d.mts
CHANGED
|
@@ -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
|
/** 应用名称 */
|
package/lib/process-env.mjs
CHANGED
|
@@ -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];
|
|
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 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.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONFIG as e}from"../config.mjs";import{description as r,author as o,repository as
|
|
1
|
+
import{CONFIG as e}from"../config.mjs";import{description as r,author as o,repository as s,APPTYPE as t,PACKAGENAME as i,PACKAGEVERSION as m,SSR as p,FRAMEWORK as a}from"../process-env.mjs";import{convertToCamelCase as n}from"../utils/index.mjs";import f from"../utils/require.mjs";let l=f(`${{react:"react",solid:"solid-js"}[a]}/package.json`).version,u="string"==typeof o,c={name:i,projectName:n(i),ssr:p,version:m,base:e.basename,type:t,routerMode:e.routerMode,prefixCls:e.prefixCls,theme:e.theme,description:r,author:u?{name:o}:o,repository:u?{url:s}:s,frameworkVersion:l};export default c;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.26.0-beta.
|
|
3
|
+
"version": "3.26.0-beta.3",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
import{createRequire as t}from"module";let e=t(import.meta.url);export default e;
|