@moneko/core 3.26.0-beta.0 → 3.26.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.
- package/lib/bin/build.mjs +1 -1
- package/lib/bin/changelog.mjs +1 -1
- package/lib/bin/eslint.mjs +1 -1
- package/lib/bin/git-hooks.mjs +1 -1
- package/lib/bin/index.d.mts +9 -0
- package/lib/bin/index.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.mjs +1 -1
- package/lib/bin/utils/setup-swcrc.mjs +1 -1
- package/lib/bin/version.mjs +1 -1
- package/package.json +2 -2
- package/lib/bin/index.d.ts +0 -9
- /package/lib/bin/{build-app.d.ts → build-app.d.mts} +0 -0
- /package/lib/bin/{build.d.ts → build.d.mts} +0 -0
- /package/lib/bin/{changelog.d.ts → changelog.d.mts} +0 -0
- /package/lib/bin/{eslint.d.ts → eslint.d.mts} +0 -0
- /package/lib/bin/{file.d.ts → file.d.mts} +0 -0
- /package/lib/bin/{git-hooks.d.ts → git-hooks.d.mts} +0 -0
- /package/lib/bin/{lessc.d.ts → lessc.d.mts} +0 -0
- /package/lib/bin/{runlint.d.ts → runlint.d.mts} +0 -0
- /package/lib/bin/{start.d.ts → start.d.mts} +0 -0
- /package/lib/bin/{stylelint.d.ts → stylelint.d.mts} +0 -0
- /package/lib/bin/utils/{bundle-app.d.ts → bundle-app.d.mts} +0 -0
- /package/lib/bin/utils/{config.d.ts → config.d.mts} +0 -0
- /package/lib/bin/utils/{require.d.ts → require.d.mts} +0 -0
- /package/lib/bin/utils/{setup-env.d.ts → setup-env.d.mts} +0 -0
- /package/lib/bin/utils/{setup-swcrc.d.ts → setup-swcrc.d.mts} +0 -0
- /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.
|
|
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)});
|
package/lib/bin/changelog.mjs
CHANGED
|
@@ -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.
|
|
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"))});
|
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.
|
|
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/git-hooks.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{program as o}from"commander";import{runLint as i}from"./runlint.
|
|
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])});
|
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.
|
|
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.
|
|
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
|
|
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})});
|
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.
|
|
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")});
|
package/lib/bin/utils/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e,dirname as o}from"path";import{__dirname as c}from"../file.
|
|
1
|
+
import{join as e,dirname as o}from"path";import{__dirname as c}from"../file.mjs";import t from"./require.mjs";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 +1 @@
|
|
|
1
|
-
import{join as e}from"path";import{__dirname as o}from"../file.
|
|
1
|
+
import{join as e}from"path";import{__dirname as o}from"../file.mjs";import r from"./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{cliVersion as
|
|
1
|
+
import{program as o}from"commander";import{cliVersion as m}from"./utils/config.mjs";o.version(m,"-v, --version");
|
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.1",
|
|
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.
|
|
13
|
+
"mo": "./lib/bin/index.mjs"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [],
|
|
16
16
|
"author": "moneko",
|
package/lib/bin/index.d.ts
DELETED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|