@soybeanjs/cli 0.8.4 → 0.8.7

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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- "use strict";const process=require("node:process"),p=require("cac"),path=require("node:path"),node_fs=require("node:fs"),l$1=require("enquirer"),kolorist=require("kolorist"),cryptoJs=require("crypto-js"),rimraf=require("rimraf"),changelog=require("@soybeanjs/changelog"),e=require("bumpp"),consola=require("consola"),fs=require("node:fs/promises"),c12=require("c12");function _interopDefaultCompat(t){return t&&typeof t=="object"&&"default"in t?t.default:t}const process__default=_interopDefaultCompat(process),p__default=_interopDefaultCompat(p),path__default=_interopDefaultCompat(path),l__default=_interopDefaultCompat(l$1),e__default=_interopDefaultCompat(e),name="@soybeanjs/cli",type="module",version="0.8.4",packageManager="pnpm@8.11.0",description="SoybeanJS's command line tools",author={name:"Soybean",email:"soybeanjs@outlook.com",url:"https://github.com/soybeanjs"},license="MIT",homepage="https://github.com/soybeanjs/cli",repository={url:"https://github.com/soybeanjs/cli.git"},bugs={url:"https://github.com/soybeanjs/cli/issues"},publishConfig={registry:"https://registry.npmjs.org/"},exports$1={".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.cjs"}},main="dist/index.cjs",module$1="dist/index.mjs",types="dist/index.d.ts",bin={soybean:"dist/index.cjs",soy:"dist/index.cjs"},files=["dist"],scripts={stub:"pnpm -r run stub",build:"run-s typecheck build-only build-pkg","build-only":"unbuild","build-pkg":"pnpm -r --filter='./packages/*' run build",lint:"eslint . --fix",commit:"soy git-commit",cleanup:"soy cleanup","update-pkg":"soy ncu",typecheck:"tsc --noEmit --skipLibCheck","publish-pkg":"pnpm -r publish --access public","release-pkg":"soy release",release:"run-s release-pkg build publish-pkg",prepare:"pnpm build-only && simple-git-hooks"},dependencies={"@soybeanjs/changelog":"0.3.4",bumpp:"9.2.0",c12:"1.5.1",cac:"6.7.14",consola:"3.2.3","crypto-js":"4.2.0",enquirer:"2.4.1",execa:"8.0.1",kolorist:"1.8.0",minimist:"1.2.8","npm-check-updates":"16.14.11",rimraf:"5.0.5"},devDependencies={"@soybeanjs/cli":"link:","@soybeanjs/eslint-config":"1.0.5","@types/crypto-js":"4.2.1","@types/node":"20.10.4",eslint:"8.55.0","lint-staged":"15.2.0","npm-run-all":"4.1.5","simple-git-hooks":"2.9.0",tsx:"4.6.2",typescript:"5.3.3",unbuild:"2.0.0"},a$2={name,type,version,packageManager,description,author,license,homepage,repository,bugs,publishConfig,exports:exports$1,main,module:module$1,types,bin,files,scripts,dependencies,devDependencies,"simple-git-hooks":{"commit-msg":"pnpm soy git-commit-verify","pre-commit":"pnpm typecheck && pnpm lint-staged"},"lint-staged":{"*":"eslint --fix"}};var c=Object.defineProperty,a$1=(t,o,s)=>o in t?c(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,n=(t,o,s)=>(a$1(t,typeof o!="symbol"?o+"":o,s),s);async function execCommand(t,o,s){const{execa:u}=await import("execa");return(await u(t,o,s))?.stdout?.trim()||""}class Crypto{constructor(o){n(this,"secret"),this.secret=o}enCrypto(o){const s=JSON.stringify(o);return cryptoJs.AES.encrypt(s,this.secret).toString()}deCrypto(o){const s=cryptoJs.AES.decrypt(o,this.secret).toString(cryptoJs.enc.Utf8);if(s)try{return JSON.parse(s)}catch{return null}return null}}async function gitCommit(t,o){const s=t.map(([y,h])=>{const w=`${`${y}:`.padEnd(12)}${h}`;return{name:y,message:w}}),u=o.map(([y,h])=>({name:y,message:`${y.padEnd(30)} (${h})`})),f=await l__default.prompt([{name:"types",type:"select",message:"Please select a type",choices:s},{name:"scopes",type:"select",message:"Please select a scope",choices:u},{name:"description",type:"text",message:"Please enter a description"}]),g=`${f.types}(${f.scopes}): ${f.description}`;await execCommand("git",["commit","-m",g],{stdio:"inherit"})}async function gitCommitVerify(){const t=await execCommand("git",["rev-parse","--show-toplevel"]),o=path__default.join(t,".git","COMMIT_EDITMSG"),s=node_fs.readFileSync(o,"utf8").trim();if(!/(?<type>[a-z]+)(?:\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i.test(s))throw new Error(`${kolorist.bgRed(" ERROR ")} ${kolorist.red("git commit message must match the Conventional Commits standard!")}
2
+ "use strict";const process=require("node:process"),d$1=require("cac"),path=require("node:path"),node_fs=require("node:fs"),l$1=require("enquirer"),kolorist=require("kolorist"),cryptoJs=require("crypto-js"),rimraf=require("rimraf"),changelog=require("@soybeanjs/changelog"),r=require("bumpp"),consola=require("consola"),fs=require("node:fs/promises"),c12=require("c12");function _interopDefaultCompat(e){return e&&typeof e=="object"&&"default"in e?e.default:e}const process__default=_interopDefaultCompat(process),d__default=_interopDefaultCompat(d$1),path__default=_interopDefaultCompat(path),l__default=_interopDefaultCompat(l$1),r__default=_interopDefaultCompat(r),name="@soybeanjs/cli",type="module",version="0.8.7",packageManager="pnpm@8.12.0",description="SoybeanJS's command line tools",author={name:"Soybean",email:"soybeanjs@outlook.com",url:"https://github.com/soybeanjs"},license="MIT",homepage="https://github.com/soybeanjs/cli",repository={url:"https://github.com/soybeanjs/cli.git"},bugs={url:"https://github.com/soybeanjs/cli/issues"},publishConfig={registry:"https://registry.npmjs.org/"},bin={soybean:"dist/index.cjs",soy:"dist/index.cjs"},exports$1={".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.cjs"}},main="dist/index.cjs",module$1="dist/index.mjs",types="dist/index.d.ts",files=["dist"],scripts={build:"unbuild && pnpm build-pkg","build-pkg":"pnpm -r --filter='./packages/*' run build",cleanup:"soy cleanup",commit:"soy git-commit",lint:"eslint . --fix",prepare:"simple-git-hooks","publish-pkg":"pnpm -r publish --access public",release:"soy release",stub:"pnpm -r run stub",typecheck:"tsc --noEmit --skipLibCheck","update-pkg":"soy ncu"},dependencies={"@soybeanjs/changelog":"0.3.4",bumpp:"9.2.0",c12:"1.5.1",cac:"6.7.14",consola:"3.2.3","crypto-js":"4.2.0",enquirer:"2.4.1",execa:"8.0.1",kolorist:"1.8.0",minimist:"1.2.8","npm-check-updates":"16.14.11",rimraf:"5.0.5"},devDependencies={"@soybeanjs/cli":"link:","@soybeanjs/eslint-config":"1.0.9","@types/crypto-js":"4.2.1","@types/node":"20.10.4",eslint:"8.55.0","eslint-plugin-vue":"9.19.2","lint-staged":"15.2.0","simple-git-hooks":"2.9.0",tsx:"4.6.2",typescript:"5.3.3",unbuild:"2.0.0","vue-eslint-parser":"9.3.2"},a$2={name,type,version,packageManager,description,author,license,homepage,repository,bugs,publishConfig,bin,exports:exports$1,main,module:module$1,types,files,scripts,dependencies,devDependencies,"simple-git-hooks":{"commit-msg":"pnpm soy git-commit-verify","pre-commit":"pnpm typecheck"},"lint-staged":{"*":"eslint --fix"}};var c=Object.defineProperty,a$1=(e,t,o)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,n=(e,t,o)=>(a$1(e,typeof t!="symbol"?t+"":t,o),o);async function execCommand(e,t,o){const{execa:s}=await import("execa");return(await s(e,t,o))?.stdout?.trim()||""}class Crypto{constructor(t){n(this,"secret"),this.secret=t}enCrypto(t){const o=JSON.stringify(t);return cryptoJs.AES.encrypt(o,this.secret).toString()}deCrypto(t){const o=cryptoJs.AES.decrypt(t,this.secret).toString(cryptoJs.enc.Utf8);if(o)try{return JSON.parse(o)}catch{return null}return null}}async function gitCommit(e,t){const o=e.map(([g,f])=>{const y=`${`${g}:`.padEnd(12)}${f}`;return{name:g,message:y}}),s=t.map(([g,f])=>({name:g,message:`${g.padEnd(30)} (${f})`})),u=await l__default.prompt([{name:"types",type:"select",message:"Please select a type",choices:o},{name:"scopes",type:"select",message:"Please select a scope",choices:s},{name:"description",type:"text",message:"Please enter a description"}]),h=`${u.types}(${u.scopes}): ${u.description}`;await execCommand("git",["commit","-m",h],{stdio:"inherit"})}async function gitCommitVerify(){const e=await execCommand("git",["rev-parse","--show-toplevel"]),t=path__default.join(e,".git","COMMIT_EDITMSG"),o=node_fs.readFileSync(t,"utf8").trim();if(!/(?<type>[a-z]+)(?:\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i.test(o))throw new Error(`${kolorist.bgRed(" ERROR ")} ${kolorist.red("git commit message must match the Conventional Commits standard!")}
3
3
 
4
- ${kolorist.green("Recommended to use the command `pnpm commit` to generate Conventional Commits compliant commit information.\nGet more info about Conventional Commits, follow this link: https://conventionalcommits.org")}`)}async function cleanup(t){await rimraf.rimraf(t,{glob:!0})}async function ncu(t=["--deep","-u"]){execCommand("npx",["ncu",...t],{stdio:"inherit"})}async function genChangelog(t,o=!1){o?await changelog.generateTotalChangelog(t):await changelog.generateChangelog(t)}async function release(){await e__default({files:["**/package.json","!**/node_modules"],execute:"npx soy changelog",all:!0,tag:!0,commit:"chore(projects): release v%s",push:!0})}const suspectProtoRx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,suspectConstructorRx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,JsonSigRx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jsonParseTransform(t,o){if(t==="__proto__"||t==="constructor"&&o&&typeof o=="object"&&"prototype"in o){warnKeyDropped(t);return}return o}function warnKeyDropped(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function destr(t,o={}){if(typeof t!="string")return t;const s=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return s.slice(1,-1);if(s.length<=9){const u=s.toLowerCase();if(u==="true")return!0;if(u==="false")return!1;if(u==="undefined")return;if(u==="null")return null;if(u==="nan")return Number.NaN;if(u==="infinity")return Number.POSITIVE_INFINITY;if(u==="-infinity")return Number.NEGATIVE_INFINITY}if(!JsonSigRx.test(t)){if(o.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(suspectProtoRx.test(t)||suspectConstructorRx.test(t)){if(o.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,jsonParseTransform)}return JSON.parse(t)}catch(u){if(o.strict)throw u;return t}}const HASH_RE=/#/g,AMPERSAND_RE=/&/g,EQUAL_RE=/=/g,PLUS_RE=/\+/g,ENC_CARET_RE=/%5e/gi,ENC_BACKTICK_RE=/%60/gi,ENC_PIPE_RE=/%7c/gi,ENC_SPACE_RE=/%20/gi;function encode(t){return encodeURI(""+t).replace(ENC_PIPE_RE,"|")}function encodeQueryValue(t){return encode(typeof t=="string"?t:JSON.stringify(t)).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CARET_RE,"^")}function encodeQueryKey(t){return encodeQueryValue(t).replace(EQUAL_RE,"%3D")}function decode(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function decodeQueryKey(t){return decode(t.replace(PLUS_RE," "))}function decodeQueryValue(t){return decode(t.replace(PLUS_RE," "))}function parseQuery(t=""){const o={};t[0]==="?"&&(t=t.slice(1));for(const s of t.split("&")){const u=s.match(/([^=]+)=?(.*)/)||[];if(u.length<2)continue;const f=decodeQueryKey(u[1]);if(f==="__proto__"||f==="constructor")continue;const g=decodeQueryValue(u[2]||"");o[f]===void 0?o[f]=g:Array.isArray(o[f])?o[f].push(g):o[f]=[o[f],g]}return o}function encodeQueryItem(t,o){return(typeof o=="number"||typeof o=="boolean")&&(o=String(o)),o?Array.isArray(o)?o.map(s=>`${encodeQueryKey(t)}=${encodeQueryValue(s)}`).join("&"):`${encodeQueryKey(t)}=${encodeQueryValue(o)}`:encodeQueryKey(t)}function stringifyQuery(t){return Object.keys(t).filter(o=>t[o]!==void 0).map(o=>encodeQueryItem(o,t[o])).filter(Boolean).join("&")}const PROTOCOL_STRICT_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,PROTOCOL_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,PROTOCOL_RELATIVE_REGEX=/^([/\\]\s*){2,}[^/\\]/;function hasProtocol(t,o={}){return typeof o=="boolean"&&(o={acceptRelative:o}),o.strict?PROTOCOL_STRICT_REGEX.test(t):PROTOCOL_REGEX.test(t)||(o.acceptRelative?PROTOCOL_RELATIVE_REGEX.test(t):!1)}const TRAILING_SLASH_RE=/\/$|\/\?|\/#/;function hasTrailingSlash(t="",o){return o?TRAILING_SLASH_RE.test(t):t.endsWith("/")}function withoutTrailingSlash(t="",o){if(!o)return(hasTrailingSlash(t)?t.slice(0,-1):t)||"/";if(!hasTrailingSlash(t,!0))return t||"/";let s=t,u="";const f=t.indexOf("#");f>=0&&(s=t.slice(0,f),u=t.slice(f));const[g,...y]=s.split("?");return(g.slice(0,-1)||"/")+(y.length>0?`?${y.join("?")}`:"")+u}function withTrailingSlash(t="",o){if(!o)return t.endsWith("/")?t:t+"/";if(hasTrailingSlash(t,!0))return t||"/";let s=t,u="";const f=t.indexOf("#");if(f>=0&&(s=t.slice(0,f),u=t.slice(f),!s))return u;const[g,...y]=s.split("?");return g+"/"+(y.length>0?`?${y.join("?")}`:"")+u}function withBase(t,o){if(isEmptyURL(o)||hasProtocol(t))return t;const s=withoutTrailingSlash(o);return t.startsWith(s)?t:joinURL(s,t)}function withQuery(t,o){const s=parseURL(t),u={...parseQuery(s.search),...o};return s.search=stringifyQuery(u),stringifyParsedURL(s)}function isEmptyURL(t){return!t||t==="/"}function isNonEmptyURL(t){return t&&t!=="/"}const JOIN_LEADING_SLASH_RE=/^\.?\//;function joinURL(t,...o){let s=t||"";for(const u of o.filter(f=>isNonEmptyURL(f)))if(s){const f=u.replace(JOIN_LEADING_SLASH_RE,"");s=withTrailingSlash(s)+f}else s=u;return s}function parseURL(t="",o){const s=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(s){const[,C,b=""]=s;return{protocol:C.toLowerCase(),pathname:b,href:C+b,auth:"",host:"",search:"",hash:""}}if(!hasProtocol(t,{acceptRelative:!0}))return o?parseURL(o+t):parsePath(t);const[,u="",f,g=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,y="",h=""]=g.match(/([^#/?]*)(.*)?/)||[],{pathname:w,search:_,hash:r}=parsePath(h.replace(/\/(?=[A-Za-z]:)/,""));return{protocol:u.toLowerCase(),auth:f?f.slice(0,Math.max(0,f.length-1)):"",host:y,pathname:w,search:_,hash:r}}function parsePath(t=""){const[o="",s="",u=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:o,search:s,hash:u}}function stringifyParsedURL(t){const o=t.pathname||"",s=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",u=t.hash||"",f=t.auth?t.auth+"@":"",g=t.host||"";return(t.protocol?t.protocol+"//":"")+f+g+o+s+u}var __defProp=Object.defineProperty,__defNormalProp=(t,o,s)=>o in t?__defProp(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,__publicField=(t,o,s)=>(__defNormalProp(t,typeof o!="symbol"?o+"":o,s),s);class FetchError extends Error{constructor(){super(...arguments),__publicField(this,"name","FetchError"),__publicField(this,"request"),__publicField(this,"response"),__publicField(this,"data"),__publicField(this,"status"),__publicField(this,"statusText"),__publicField(this,"statusCode"),__publicField(this,"statusMessage")}}function createFetchError(t,o,s){let u="";o&&(u=o.message),t&&s?u=`${u} (${s.status} ${s.statusText} (${t.toString()}))`:t&&(u=`${u} (${t.toString()})`);const f=new FetchError(u);return Object.defineProperty(f,"request",{get(){return t}}),Object.defineProperty(f,"response",{get(){return s}}),Object.defineProperty(f,"data",{get(){return s&&s._data}}),Object.defineProperty(f,"status",{get(){return s&&s.status}}),Object.defineProperty(f,"statusText",{get(){return s&&s.statusText}}),Object.defineProperty(f,"statusCode",{get(){return s&&s.status}}),Object.defineProperty(f,"statusMessage",{get(){return s&&s.statusText}}),f}const payloadMethods=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function isPayloadMethod(t="GET"){return payloadMethods.has(t.toUpperCase())}function isJSONSerializable(t){if(t===void 0)return!1;const o=typeof t;return o==="string"||o==="number"||o==="boolean"||o===null?!0:o!=="object"?!1:Array.isArray(t)?!0:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const textTypes=new Set(["image/svg","application/xml","application/xhtml","application/html"]),JSON_RE=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function detectResponseType(t=""){if(!t)return"json";const o=t.split(";").shift()||"";return JSON_RE.test(o)?"json":textTypes.has(o)||o.startsWith("text/")?"text":"blob"}function mergeFetchOptions(t,o,s=globalThis.Headers){const u={...o,...t};if(o?.params&&t?.params&&(u.params={...o?.params,...t?.params}),o?.query&&t?.query&&(u.query={...o?.query,...t?.query}),o?.headers&&t?.headers){u.headers=new s(o?.headers||{});for(const[f,g]of new s(t?.headers||{}))u.headers.set(f,g)}return u}const retryStatusCodes=new Set([408,409,425,429,500,502,503,504]);function createFetch(t={}){const{fetch:o=globalThis.fetch,Headers:s=globalThis.Headers,AbortController:u=globalThis.AbortController}=t;async function f(h){const w=h.error&&h.error.name==="AbortError"&&!h.options.timeout||!1;if(h.options.retry!==!1&&!w){let r;typeof h.options.retry=="number"?r=h.options.retry:r=isPayloadMethod(h.options.method)?0:1;const C=h.response&&h.response.status||500;if(r>0&&retryStatusCodes.has(C)){const b=h.options.retryDelay||0;return b>0&&await new Promise(E=>setTimeout(E,b)),g(h.request,{...h.options,retry:r-1,timeout:h.options.timeout})}}const _=createFetchError(h.request,h.error,h.response);throw Error.captureStackTrace&&Error.captureStackTrace(_,g),_}const g=async function(w,_={}){const r={request:w,options:mergeFetchOptions(_,t.defaults,s),response:void 0,error:void 0};if(r.options.method=r.options.method?.toUpperCase(),r.options.onRequest&&await r.options.onRequest(r),typeof r.request=="string"&&(r.options.baseURL&&(r.request=withBase(r.request,r.options.baseURL)),(r.options.query||r.options.params)&&(r.request=withQuery(r.request,{...r.options.params,...r.options.query})),r.options.body&&isPayloadMethod(r.options.method)&&isJSONSerializable(r.options.body)&&(r.options.body=typeof r.options.body=="string"?r.options.body:JSON.stringify(r.options.body),r.options.headers=new s(r.options.headers||{}),r.options.headers.has("content-type")||r.options.headers.set("content-type","application/json"),r.options.headers.has("accept")||r.options.headers.set("accept","application/json"))),!r.options.signal&&r.options.timeout){const b=new u;setTimeout(()=>b.abort(),r.options.timeout),r.options.signal=b.signal}try{r.response=await o(r.request,r.options)}catch(b){return r.error=b,r.options.onRequestError&&await r.options.onRequestError(r),await f(r)}const C=(r.options.parseResponse?"json":r.options.responseType)||detectResponseType(r.response.headers.get("content-type")||"");if(C==="json"){const b=await r.response.text(),E=r.options.parseResponse||destr;r.response._data=E(b)}else C==="stream"?r.response._data=r.response.body:r.response._data=await r.response[C]();return r.options.onResponse&&await r.options.onResponse(r),!r.options.ignoreResponseError&&r.response.status>=400&&r.response.status<600?(r.options.onResponseError&&await r.options.onResponseError(r),await f(r)):r.response},y=async function(w,_){return(await g(w,_))._data};return y.raw=g,y.native=o,y.create=(h={})=>createFetch({...t,defaults:{...t.defaults,...h}}),y}const _globalThis=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),fetch=_globalThis.fetch||(()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!"))),Headers=_globalThis.Headers,AbortController=_globalThis.AbortController,ofetch=createFetch({fetch,Headers,AbortController});async function syncNpmmirror(t=a$2.name,o=!0){const s=`https://registry-direct.npmmirror.com/${t}/sync?sync_upstream=true`,{logId:u=""}=await ofetch(s,{method:"PUT"});if(!u)return;const f=`https://registry.npmmirror.com/-/package/${t}/syncs/${u}/log`,g=`Sync ${t} success`;let y="",h=setInterval(async()=>{try{y=await ofetch(f,{method:"GET"}),o&&consola.consola.log(y),y.includes(g)&&h&&(clearInterval(h),h=null)}catch{}},2e3)}async function execLintStaged(t){const o=(await import("./chunks/index.cjs").then(function(s){return s.index})).default;return o({config:t,allowEmpty:!0})}async function initSimpleGitHooks(t=process__default.cwd()){const o=path__default.join(t,".husky"),s=node_fs.existsSync(o),u=path__default.join(t,".git","hooks");s&&(await rimraf.rimraf(o),await execCommand("git",["config","core.hooksPath",u],{stdio:"inherit"})),await rimraf.rimraf(u),await execCommand("npx",["simple-git-hooks"],{stdio:"inherit"})}async function prettierWrite(t){await execCommand("npx",["prettier","--write",".",...t],{stdio:"inherit"})}async function eslintPrettier(){await execCommand("npx",["eslint",".","--fix"],{stdio:"inherit"}),await execCommand("npx",["soy","prettier-format"],{stdio:"inherit"})}const a="*.{js,jsx,mjs,cjs,json,ts,tsx,mts,cts,vue,svelte,astro}",l={cwd:process__default.cwd(),cleanupDirs:["**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/node_modules","!node_modules/**"],gitCommitTypes:[["feat","A new feature"],["fix","A bug fix"],["docs","Documentation only changes"],["style","Changes that do not affect the meaning of the code"],["refactor","A code change that neither fixes a bug nor adds a feature"],["perf","A code change that improves performance"],["test","Adding missing tests or correcting existing tests"],["build","Changes that affect the build system or external dependencies"],["ci","Changes to our CI configuration files and scripts"],["chore","Other changes that don't modify src or test files"],["revert","Reverts a previous commit"]],gitCommitScopes:[["projects","project"],["components","components"],["hooks","hook functions"],["utils","utils functions"],["types","TS declaration"],["styles","style"],["deps","project dependencies"],["release","release project"],["other","other changes"]],ncuCommandArgs:["--deep","-u"],changelogOptions:{},prettierWriteGlob:[`!**/${a}`,"!*.min.*","!CHANGELOG.md","!dist","!LICENSE*","!output","!coverage","!public","!temp","!package-lock.json","!pnpm-lock.yaml","!yarn.lock","!.github","!__snapshots__","!node_modules"],lintStagedConfig:{[a]:"eslint --fix","*":"soy prettier-write"}},m="U2FsdGVkX18dc7x8PmAq30sl+nyGmi5VJJwninmYBRs8vVILEIjY+kT/F8ajm/6gRTMbDAEmx5WKInQBzeNSig==";async function loadCliOptions(t,o=process__default.cwd()){const{config:s}=await c12.loadConfig({name:"soybean",defaults:l,overrides:t,cwd:o,packageJson:!0}),u=await d(o);if(s&&u){const f=new Crypto("SOYBEAN_JS");s.changelogOptions={...s.changelogOptions,github:{repo:"",token:f.deCrypto(m)||""}}}return s}async function d(t){let o=!1;const s="soybean";try{const u=await fs.readFile(`${t}/package.json`,"utf-8"),f=JSON.parse(u);o=f.name?.includes(s)||f.repository?.url?.includes(s)||f.author?.includes(s)||f.author?.name?.includes(s)||f.author?.url?.includes(s)}catch{}return o}const i="the command is deprecated, it will be removed in the next major version 1.0.0";async function A(){const t=await loadCliOptions(),o=p__default("soybean");o.version(version).option("--total","Generate changelog by total tags").help();const s={cleanup:{desc:"delete dirs: node_modules, dist, etc.",action:async()=>{await cleanup(t.cleanupDirs)}},ncu:{desc:"npm-check-updates, it can update package.json dependencies to the latest version",action:async()=>{await ncu(t.ncuCommandArgs)}},"git-commit":{desc:"git commit, generate commit message which match Conventional Commits standard",action:async()=>{await gitCommit(t.gitCommitTypes,t.gitCommitScopes)}},"git-commit-verify":{desc:"verify git commit message, make sure it match Conventional Commits standard",action:async()=>{await gitCommitVerify()}},changelog:{desc:"generate changelog",action:async u=>{await genChangelog(t.changelogOptions,u?.total)}},release:{desc:"release: update version, generate changelog, commit code",action:async()=>{await release()}},"sync-npmmirror":{desc:"sync npmmirror",action:async u=>{await syncNpmmirror(u?.syncName,u?.syncLog)}},"prettier-write":{desc:`run prettier --write (${i})`,action:async()=>{await prettierWrite(t.prettierWriteGlob)}},"lint-staged":{desc:`run lint-staged (${i})`,action:async()=>{const u=await execLintStaged(t.lintStagedConfig).catch(()=>{process__default.exitCode=1});process__default.exitCode=u?0:1}},"init-simple-git-hooks":{desc:`init simple-git-hooks and remove husky (${i})`,action:async()=>{await initSimpleGitHooks(t.cwd)}},"init-git-hooks":{desc:`same as init-simple-git-hooks (${i})`,action:async()=>{await initSimpleGitHooks(t.cwd)}},"update-pkg":{desc:`same as ncu (${i})`,action:async()=>{await ncu(t.ncuCommandArgs)}},"prettier-format":{desc:`same as prettier-write (${i})`,action:async()=>{await prettierWrite(t.prettierWriteGlob)}},"eslint-prettier":{desc:i,action:async()=>{await eslintPrettier()}}};for await(const[u,{desc:f,action:g}]of Object.entries(s))o.command(u,f).action(g);o.parse()}A();function defineConfig(t){return t}exports.defineConfig=defineConfig;
4
+ ${kolorist.green("Recommended to use the command `pnpm commit` to generate Conventional Commits compliant commit information.\nGet more info about Conventional Commits, follow this link: https://conventionalcommits.org")}`)}async function cleanup(e){await rimraf.rimraf(e,{glob:!0})}async function ncu(e=["--deep","-u"]){execCommand("npx",["ncu",...e],{stdio:"inherit"})}async function genChangelog(e,t=!1){t?await changelog.generateTotalChangelog(e):await changelog.generateChangelog(e)}async function release(e="npx soy changelog",t=!0){await r__default({files:["**/package.json","!**/node_modules"],execute:e,all:!0,tag:!0,commit:"chore(projects): release v%s",push:t})}const suspectProtoRx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,suspectConstructorRx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,JsonSigRx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jsonParseTransform(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){warnKeyDropped(e);return}return t}function warnKeyDropped(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function destr(e,t={}){if(typeof e!="string")return e;const o=e.trim();if(e[0]==='"'&&e.at(-1)==='"'&&!e.includes("\\"))return o.slice(1,-1);if(o.length<=9){const s=o.toLowerCase();if(s==="true")return!0;if(s==="false")return!1;if(s==="undefined")return;if(s==="null")return null;if(s==="nan")return Number.NaN;if(s==="infinity")return Number.POSITIVE_INFINITY;if(s==="-infinity")return Number.NEGATIVE_INFINITY}if(!JsonSigRx.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(suspectProtoRx.test(e)||suspectConstructorRx.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,jsonParseTransform)}return JSON.parse(e)}catch(s){if(t.strict)throw s;return e}}const HASH_RE=/#/g,AMPERSAND_RE=/&/g,EQUAL_RE=/=/g,PLUS_RE=/\+/g,ENC_CARET_RE=/%5e/gi,ENC_BACKTICK_RE=/%60/gi,ENC_PIPE_RE=/%7c/gi,ENC_SPACE_RE=/%20/gi;function encode(e){return encodeURI(""+e).replace(ENC_PIPE_RE,"|")}function encodeQueryValue(e){return encode(typeof e=="string"?e:JSON.stringify(e)).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CARET_RE,"^")}function encodeQueryKey(e){return encodeQueryValue(e).replace(EQUAL_RE,"%3D")}function decode(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}function decodeQueryKey(e){return decode(e.replace(PLUS_RE," "))}function decodeQueryValue(e){return decode(e.replace(PLUS_RE," "))}function parseQuery(e=""){const t={};e[0]==="?"&&(e=e.slice(1));for(const o of e.split("&")){const s=o.match(/([^=]+)=?(.*)/)||[];if(s.length<2)continue;const u=decodeQueryKey(s[1]);if(u==="__proto__"||u==="constructor")continue;const h=decodeQueryValue(s[2]||"");t[u]===void 0?t[u]=h:Array.isArray(t[u])?t[u].push(h):t[u]=[t[u],h]}return t}function encodeQueryItem(e,t){return(typeof t=="number"||typeof t=="boolean")&&(t=String(t)),t?Array.isArray(t)?t.map(o=>`${encodeQueryKey(e)}=${encodeQueryValue(o)}`).join("&"):`${encodeQueryKey(e)}=${encodeQueryValue(t)}`:encodeQueryKey(e)}function stringifyQuery(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>encodeQueryItem(t,e[t])).filter(Boolean).join("&")}const PROTOCOL_STRICT_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,PROTOCOL_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,PROTOCOL_RELATIVE_REGEX=/^([/\\]\s*){2,}[^/\\]/;function hasProtocol(e,t={}){return typeof t=="boolean"&&(t={acceptRelative:t}),t.strict?PROTOCOL_STRICT_REGEX.test(e):PROTOCOL_REGEX.test(e)||(t.acceptRelative?PROTOCOL_RELATIVE_REGEX.test(e):!1)}const TRAILING_SLASH_RE=/\/$|\/\?|\/#/;function hasTrailingSlash(e="",t){return t?TRAILING_SLASH_RE.test(e):e.endsWith("/")}function withoutTrailingSlash(e="",t){if(!t)return(hasTrailingSlash(e)?e.slice(0,-1):e)||"/";if(!hasTrailingSlash(e,!0))return e||"/";let o=e,s="";const u=e.indexOf("#");u>=0&&(o=e.slice(0,u),s=e.slice(u));const[h,...g]=o.split("?");return(h.slice(0,-1)||"/")+(g.length>0?`?${g.join("?")}`:"")+s}function withTrailingSlash(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(hasTrailingSlash(e,!0))return e||"/";let o=e,s="";const u=e.indexOf("#");if(u>=0&&(o=e.slice(0,u),s=e.slice(u),!o))return s;const[h,...g]=o.split("?");return h+"/"+(g.length>0?`?${g.join("?")}`:"")+s}function withBase(e,t){if(isEmptyURL(t)||hasProtocol(e))return e;const o=withoutTrailingSlash(t);return e.startsWith(o)?e:joinURL(o,e)}function withQuery(e,t){const o=parseURL(e),s={...parseQuery(o.search),...t};return o.search=stringifyQuery(s),stringifyParsedURL(o)}function isEmptyURL(e){return!e||e==="/"}function isNonEmptyURL(e){return e&&e!=="/"}const JOIN_LEADING_SLASH_RE=/^\.?\//;function joinURL(e,...t){let o=e||"";for(const s of t.filter(u=>isNonEmptyURL(u)))if(o){const u=s.replace(JOIN_LEADING_SLASH_RE,"");o=withTrailingSlash(o)+u}else o=s;return o}function parseURL(e="",t){const o=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(o){const[,_,w=""]=o;return{protocol:_.toLowerCase(),pathname:w,href:_+w,auth:"",host:"",search:"",hash:""}}if(!hasProtocol(e,{acceptRelative:!0}))return t?parseURL(t+e):parsePath(e);const[,s="",u,h=""]=e.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,g="",f=""]=h.match(/([^#/?]*)(.*)?/)||[],{pathname:y,search:b,hash:p}=parsePath(f.replace(/\/(?=[A-Za-z]:)/,""));return{protocol:s.toLowerCase(),auth:u?u.slice(0,Math.max(0,u.length-1)):"",host:g,pathname:y,search:b,hash:p}}function parsePath(e=""){const[t="",o="",s=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:o,hash:s}}function stringifyParsedURL(e){const t=e.pathname||"",o=e.search?(e.search.startsWith("?")?"":"?")+e.search:"",s=e.hash||"",u=e.auth?e.auth+"@":"",h=e.host||"";return(e.protocol?e.protocol+"//":"")+u+h+t+o+s}var __defProp=Object.defineProperty,__defNormalProp=(e,t,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,__publicField=(e,t,o)=>(__defNormalProp(e,typeof t!="symbol"?t+"":t,o),o);class FetchError extends Error{constructor(){super(...arguments),__publicField(this,"name","FetchError"),__publicField(this,"request"),__publicField(this,"response"),__publicField(this,"data"),__publicField(this,"status"),__publicField(this,"statusText"),__publicField(this,"statusCode"),__publicField(this,"statusMessage")}}function createFetchError(e,t,o){let s="";t&&(s=t.message),e&&o?s=`${s} (${o.status} ${o.statusText} (${e.toString()}))`:e&&(s=`${s} (${e.toString()})`);const u=new FetchError(s);return Object.defineProperty(u,"request",{get(){return e}}),Object.defineProperty(u,"response",{get(){return o}}),Object.defineProperty(u,"data",{get(){return o&&o._data}}),Object.defineProperty(u,"status",{get(){return o&&o.status}}),Object.defineProperty(u,"statusText",{get(){return o&&o.statusText}}),Object.defineProperty(u,"statusCode",{get(){return o&&o.status}}),Object.defineProperty(u,"statusMessage",{get(){return o&&o.statusText}}),u}const payloadMethods=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function isPayloadMethod(e="GET"){return payloadMethods.has(e.toUpperCase())}function isJSONSerializable(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}const textTypes=new Set(["image/svg","application/xml","application/xhtml","application/html"]),JSON_RE=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function detectResponseType(e=""){if(!e)return"json";const t=e.split(";").shift()||"";return JSON_RE.test(t)?"json":textTypes.has(t)||t.startsWith("text/")?"text":"blob"}function mergeFetchOptions(e,t,o=globalThis.Headers){const s={...t,...e};if(t?.params&&e?.params&&(s.params={...t?.params,...e?.params}),t?.query&&e?.query&&(s.query={...t?.query,...e?.query}),t?.headers&&e?.headers){s.headers=new o(t?.headers||{});for(const[u,h]of new o(e?.headers||{}))s.headers.set(u,h)}return s}const retryStatusCodes=new Set([408,409,425,429,500,502,503,504]);function createFetch(e={}){const{fetch:t=globalThis.fetch,Headers:o=globalThis.Headers,AbortController:s=globalThis.AbortController}=e;async function u(f){const y=f.error&&f.error.name==="AbortError"&&!f.options.timeout||!1;if(f.options.retry!==!1&&!y){let p;typeof f.options.retry=="number"?p=f.options.retry:p=isPayloadMethod(f.options.method)?0:1;const _=f.response&&f.response.status||500;if(p>0&&retryStatusCodes.has(_)){const w=f.options.retryDelay||0;return w>0&&await new Promise(E=>setTimeout(E,w)),h(f.request,{...f.options,retry:p-1,timeout:f.options.timeout})}}const b=createFetchError(f.request,f.error,f.response);throw Error.captureStackTrace&&Error.captureStackTrace(b,h),b}const h=async function(y,b={}){const p={request:y,options:mergeFetchOptions(b,e.defaults,o),response:void 0,error:void 0};if(p.options.method=p.options.method?.toUpperCase(),p.options.onRequest&&await p.options.onRequest(p),typeof p.request=="string"&&(p.options.baseURL&&(p.request=withBase(p.request,p.options.baseURL)),(p.options.query||p.options.params)&&(p.request=withQuery(p.request,{...p.options.params,...p.options.query})),p.options.body&&isPayloadMethod(p.options.method)&&isJSONSerializable(p.options.body)&&(p.options.body=typeof p.options.body=="string"?p.options.body:JSON.stringify(p.options.body),p.options.headers=new o(p.options.headers||{}),p.options.headers.has("content-type")||p.options.headers.set("content-type","application/json"),p.options.headers.has("accept")||p.options.headers.set("accept","application/json"))),!p.options.signal&&p.options.timeout){const w=new s;setTimeout(()=>w.abort(),p.options.timeout),p.options.signal=w.signal}try{p.response=await t(p.request,p.options)}catch(w){return p.error=w,p.options.onRequestError&&await p.options.onRequestError(p),await u(p)}const _=(p.options.parseResponse?"json":p.options.responseType)||detectResponseType(p.response.headers.get("content-type")||"");if(_==="json"){const w=await p.response.text(),E=p.options.parseResponse||destr;p.response._data=E(w)}else _==="stream"?p.response._data=p.response.body:p.response._data=await p.response[_]();return p.options.onResponse&&await p.options.onResponse(p),!p.options.ignoreResponseError&&p.response.status>=400&&p.response.status<600?(p.options.onResponseError&&await p.options.onResponseError(p),await u(p)):p.response},g=async function(y,b){return(await h(y,b))._data};return g.raw=h,g.native=t,g.create=(f={})=>createFetch({...e,defaults:{...e.defaults,...f}}),g}const _globalThis=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),fetch=_globalThis.fetch||(()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!"))),Headers=_globalThis.Headers,AbortController=_globalThis.AbortController,ofetch=createFetch({fetch,Headers,AbortController});async function syncNpmmirror(e,t=!0){if(!e||e===!0){await syncNpmmirrorAction(a$2.name,t);return}const o=(e?.split?.(",")||[]).filter(Boolean).map(u=>u.trim()),s=[...new Set(o)];for await(const u of s)await syncNpmmirrorAction(u,t)}async function syncNpmmirrorAction(e=a$2.name,t=!0){const o=`https://registry-direct.npmmirror.com/${e}/sync?sync_upstream=true`,{logId:s=""}=await ofetch(o,{method:"PUT"});if(!s)return;const u=`https://registry.npmmirror.com/-/package/${e}/syncs/${s}/log`,h=`Sync ${e} success`,g=1e3*60,f=Date.now();let y="",b=setInterval(async()=>{try{y=await ofetch(u,{method:"GET"}),t&&consola.consola.log(y);const p=Date.now()-f>g;b&&(y.includes(h)||p)&&(clearInterval(b),b=null)}catch{}},2e3)}async function execLintStaged(e){const t=(await import("./chunks/index.cjs").then(function(o){return o.index})).default;return t({config:e,allowEmpty:!0})}async function initSimpleGitHooks(e=process__default.cwd()){const t=path__default.join(e,".husky"),o=node_fs.existsSync(t),s=path__default.join(e,".git","hooks");o&&(await rimraf.rimraf(t),await execCommand("git",["config","core.hooksPath",s],{stdio:"inherit"})),await rimraf.rimraf(s),await execCommand("npx",["simple-git-hooks"],{stdio:"inherit"})}async function prettierWrite(e){await execCommand("npx",["prettier","--write",".",...e],{stdio:"inherit"})}async function eslintPrettier(){await execCommand("npx",["eslint",".","--fix"],{stdio:"inherit"}),await execCommand("npx",["soy","prettier-format"],{stdio:"inherit"})}const a="*.{js,jsx,mjs,cjs,json,ts,tsx,mts,cts,vue,svelte,astro}",l={cwd:process__default.cwd(),cleanupDirs:["**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/node_modules","!node_modules/**"],gitCommitTypes:[["feat","A new feature"],["fix","A bug fix"],["docs","Documentation only changes"],["style","Changes that do not affect the meaning of the code"],["refactor","A code change that neither fixes a bug nor adds a feature"],["perf","A code change that improves performance"],["test","Adding missing tests or correcting existing tests"],["build","Changes that affect the build system or external dependencies"],["ci","Changes to our CI configuration files and scripts"],["chore","Other changes that don't modify src or test files"],["revert","Reverts a previous commit"]],gitCommitScopes:[["projects","project"],["components","components"],["hooks","hook functions"],["utils","utils functions"],["types","TS declaration"],["styles","style"],["deps","project dependencies"],["release","release project"],["other","other changes"]],ncuCommandArgs:["--deep","-u"],changelogOptions:{},prettierWriteGlob:[`!**/${a}`,"!*.min.*","!CHANGELOG.md","!dist","!LICENSE*","!output","!coverage","!public","!temp","!package-lock.json","!pnpm-lock.yaml","!yarn.lock","!.github","!__snapshots__","!node_modules"],lintStagedConfig:{[a]:"eslint --fix","*":"soy prettier-write"}},m="U2FsdGVkX18dc7x8PmAq30sl+nyGmi5VJJwninmYBRs8vVILEIjY+kT/F8ajm/6gRTMbDAEmx5WKInQBzeNSig==";async function loadCliOptions(e,t=process__default.cwd()){const{config:o}=await c12.loadConfig({name:"soybean",defaults:l,overrides:e,cwd:t,packageJson:!0}),s=await d(t);if(o&&s){const u=new Crypto("SOYBEAN_JS");o.changelogOptions={...o.changelogOptions,github:{repo:"",token:u.deCrypto(m)||""}}}return o}async function d(e){let t=!1;const o="soybean";try{const s=await fs.readFile(`${e}/package.json`,"utf-8"),u=JSON.parse(s);t=u.name?.includes(o)||u.repository?.url?.includes(o)||u.author?.includes(o)||u.author?.name?.includes(o)||u.author?.url?.includes(o)}catch{}return t}const i="the command is deprecated, it will be removed in the next major version 1.0.0";async function v(){const e=await loadCliOptions(),t=d__default("soybean");t.version(version).option("--execute [command]","Execute additional command after bumping and before git commit. Defaults to 'npx soy changelog'").option("--push","Indicates whether to push the git commit and tag").option("--total","Generate changelog by total tags").option("--syncName [name]",'The package name of sync npmmirror, if it has multiple packages, you can use "," to separate them').option("--syncLog","Whether show sync package log").help();const o={cleanup:{desc:"delete dirs: node_modules, dist, etc.",action:async()=>{await cleanup(e.cleanupDirs)}},ncu:{desc:"npm-check-updates, it can update package.json dependencies to the latest version",action:async()=>{await ncu(e.ncuCommandArgs)}},"git-commit":{desc:"git commit, generate commit message which match Conventional Commits standard",action:async()=>{await gitCommit(e.gitCommitTypes,e.gitCommitScopes)}},"git-commit-verify":{desc:"verify git commit message, make sure it match Conventional Commits standard",action:async()=>{await gitCommitVerify()}},changelog:{desc:"generate changelog",action:async s=>{await genChangelog(e.changelogOptions,s?.total)}},release:{desc:"release: update version, generate changelog, commit code",action:async s=>{await release(s?.execute,s?.push)}},"sync-npmmirror":{desc:"sync npmmirror",action:async s=>{await syncNpmmirror(s?.syncName,s?.syncLog)}},"prettier-write":{desc:`run prettier --write (${i})`,action:async()=>{await prettierWrite(e.prettierWriteGlob)}},"lint-staged":{desc:`run lint-staged (${i})`,action:async()=>{const s=await execLintStaged(e.lintStagedConfig).catch(()=>{process__default.exitCode=1});process__default.exitCode=s?0:1}},"init-simple-git-hooks":{desc:`init simple-git-hooks and remove husky (${i})`,action:async()=>{await initSimpleGitHooks(e.cwd)}},"init-git-hooks":{desc:`same as init-simple-git-hooks (${i})`,action:async()=>{await initSimpleGitHooks(e.cwd)}},"update-pkg":{desc:`same as ncu (${i})`,action:async()=>{await ncu(e.ncuCommandArgs)}},"prettier-format":{desc:`same as prettier-write (${i})`,action:async()=>{await prettierWrite(e.prettierWriteGlob)}},"eslint-prettier":{desc:i,action:async()=>{await eslintPrettier()}}};for await(const[s,{desc:u,action:h}]of Object.entries(o))t.command(s,u).action(h);t.parse()}v();function defineConfig(e){return e}exports.defineConfig=defineConfig;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import g from"node:process";import F from"cac";import b from"node:path";import{readFileSync as G,existsSync as J}from"node:fs";import U from"enquirer";import{bgRed as D,red as M,green as H}from"kolorist";import{AES as S,enc as Q}from"crypto-js";import{rimraf as w}from"rimraf";import{generateTotalChangelog as W,generateChangelog as V}from"@soybeanjs/changelog";import B from"bumpp";import{consola as K}from"consola";import{readFile as z}from"node:fs/promises";import{loadConfig as Y}from"c12";const X="@soybeanjs/cli",Z="module",T="0.8.4",tt="pnpm@8.11.0",et="SoybeanJS's command line tools",ot={name:"Soybean",email:"soybeanjs@outlook.com",url:"https://github.com/soybeanjs"},nt="MIT",st="https://github.com/soybeanjs/cli",rt={url:"https://github.com/soybeanjs/cli.git"},it={url:"https://github.com/soybeanjs/cli/issues"},at={registry:"https://registry.npmjs.org/"},ct={".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.cjs"}},pt="dist/index.cjs",ut="dist/index.mjs",lt="dist/index.d.ts",mt={soybean:"dist/index.cjs",soy:"dist/index.cjs"},dt=["dist"],ft={stub:"pnpm -r run stub",build:"run-s typecheck build-only build-pkg","build-only":"unbuild","build-pkg":"pnpm -r --filter='./packages/*' run build",lint:"eslint . --fix",commit:"soy git-commit",cleanup:"soy cleanup","update-pkg":"soy ncu",typecheck:"tsc --noEmit --skipLibCheck","publish-pkg":"pnpm -r publish --access public","release-pkg":"soy release",release:"run-s release-pkg build publish-pkg",prepare:"pnpm build-only && simple-git-hooks"},ht={"@soybeanjs/changelog":"0.3.4",bumpp:"9.2.0",c12:"1.5.1",cac:"6.7.14",consola:"3.2.3","crypto-js":"4.2.0",enquirer:"2.4.1",execa:"8.0.1",kolorist:"1.8.0",minimist:"1.2.8","npm-check-updates":"16.14.11",rimraf:"5.0.5"},gt={"@soybeanjs/cli":"link:","@soybeanjs/eslint-config":"1.0.5","@types/crypto-js":"4.2.1","@types/node":"20.10.4",eslint:"8.55.0","lint-staged":"15.2.0","npm-run-all":"4.1.5","simple-git-hooks":"2.9.0",tsx:"4.6.2",typescript:"5.3.3",unbuild:"2.0.0"},yt={name:X,type:Z,version:T,packageManager:tt,description:et,author:ot,license:nt,homepage:st,repository:rt,bugs:it,publishConfig:at,exports:ct,main:pt,module:ut,types:lt,bin:mt,files:dt,scripts:ft,dependencies:ht,devDependencies:gt,"simple-git-hooks":{"commit-msg":"pnpm soy git-commit-verify","pre-commit":"pnpm typecheck && pnpm lint-staged"},"lint-staged":{"*":"eslint --fix"}};var bt=Object.defineProperty,wt=(t,e,o)=>e in t?bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Et=(t,e,o)=>(wt(t,typeof e!="symbol"?e+"":e,o),o);async function d(t,e,o){const{execa:s}=await import("execa");return(await s(t,e,o))?.stdout?.trim()||""}class Ct{constructor(e){Et(this,"secret"),this.secret=e}enCrypto(e){const o=JSON.stringify(e);return S.encrypt(o,this.secret).toString()}deCrypto(e){const o=S.decrypt(e,this.secret).toString(Q.Utf8);if(o)try{return JSON.parse(o)}catch{return null}return null}}async function jt(t,e){const o=t.map(([c,i])=>{const u=`${`${c}:`.padEnd(12)}${i}`;return{name:c,message:u}}),s=e.map(([c,i])=>({name:c,message:`${c.padEnd(30)} (${i})`})),r=await U.prompt([{name:"types",type:"select",message:"Please select a type",choices:o},{name:"scopes",type:"select",message:"Please select a scope",choices:s},{name:"description",type:"text",message:"Please enter a description"}]),a=`${r.types}(${r.scopes}): ${r.description}`;await d("git",["commit","-m",a],{stdio:"inherit"})}async function _t(){const t=await d("git",["rev-parse","--show-toplevel"]),e=b.join(t,".git","COMMIT_EDITMSG"),o=G(e,"utf8").trim();if(!/(?<type>[a-z]+)(?:\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i.test(o))throw new Error(`${D(" ERROR ")} ${M("git commit message must match the Conventional Commits standard!")}
2
+ import g from"node:process";import D from"cac";import b from"node:path";import{readFileSync as J,existsSync as U}from"node:fs";import M from"enquirer";import{bgRed as H,red as Q,green as W}from"kolorist";import{AES as S,enc as V}from"crypto-js";import{rimraf as w}from"rimraf";import{generateTotalChangelog as B,generateChangelog as K}from"@soybeanjs/changelog";import z from"bumpp";import{consola as Y}from"consola";import{readFile as X}from"node:fs/promises";import{loadConfig as Z}from"c12";const tt="@soybeanjs/cli",et="module",T="0.8.7",ot="pnpm@8.12.0",nt="SoybeanJS's command line tools",st={name:"Soybean",email:"soybeanjs@outlook.com",url:"https://github.com/soybeanjs"},rt="MIT",it="https://github.com/soybeanjs/cli",at={url:"https://github.com/soybeanjs/cli.git"},ct={url:"https://github.com/soybeanjs/cli/issues"},pt={registry:"https://registry.npmjs.org/"},ut={soybean:"dist/index.cjs",soy:"dist/index.cjs"},mt={".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.cjs"}},lt="dist/index.cjs",ft="dist/index.mjs",dt="dist/index.d.ts",ht=["dist"],gt={build:"unbuild && pnpm build-pkg","build-pkg":"pnpm -r --filter='./packages/*' run build",cleanup:"soy cleanup",commit:"soy git-commit",lint:"eslint . --fix",prepare:"simple-git-hooks","publish-pkg":"pnpm -r publish --access public",release:"soy release",stub:"pnpm -r run stub",typecheck:"tsc --noEmit --skipLibCheck","update-pkg":"soy ncu"},yt={"@soybeanjs/changelog":"0.3.4",bumpp:"9.2.0",c12:"1.5.1",cac:"6.7.14",consola:"3.2.3","crypto-js":"4.2.0",enquirer:"2.4.1",execa:"8.0.1",kolorist:"1.8.0",minimist:"1.2.8","npm-check-updates":"16.14.11",rimraf:"5.0.5"},bt={"@soybeanjs/cli":"link:","@soybeanjs/eslint-config":"1.0.9","@types/crypto-js":"4.2.1","@types/node":"20.10.4",eslint:"8.55.0","eslint-plugin-vue":"9.19.2","lint-staged":"15.2.0","simple-git-hooks":"2.9.0",tsx:"4.6.2",typescript:"5.3.3",unbuild:"2.0.0","vue-eslint-parser":"9.3.2"},k={name:tt,type:et,version:T,packageManager:ot,description:nt,author:st,license:rt,homepage:it,repository:at,bugs:ct,publishConfig:pt,bin:ut,exports:mt,main:lt,module:ft,types:dt,files:ht,scripts:gt,dependencies:yt,devDependencies:bt,"simple-git-hooks":{"commit-msg":"pnpm soy git-commit-verify","pre-commit":"pnpm typecheck"},"lint-staged":{"*":"eslint --fix"}};var wt=Object.defineProperty,Et=(t,e,o)=>e in t?wt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Ct=(t,e,o)=>(Et(t,typeof e!="symbol"?e+"":e,o),o);async function f(t,e,o){const{execa:n}=await import("execa");return(await n(t,e,o))?.stdout?.trim()||""}class jt{constructor(e){Ct(this,"secret"),this.secret=e}enCrypto(e){const o=JSON.stringify(e);return S.encrypt(o,this.secret).toString()}deCrypto(e){const o=S.decrypt(e,this.secret).toString(V.Utf8);if(o)try{return JSON.parse(o)}catch{return null}return null}}async function _t(t,e){const o=t.map(([c,i])=>{const p=`${`${c}:`.padEnd(12)}${i}`;return{name:c,message:p}}),n=e.map(([c,i])=>({name:c,message:`${c.padEnd(30)} (${i})`})),r=await M.prompt([{name:"types",type:"select",message:"Please select a type",choices:o},{name:"scopes",type:"select",message:"Please select a scope",choices:n},{name:"description",type:"text",message:"Please enter a description"}]),a=`${r.types}(${r.scopes}): ${r.description}`;await f("git",["commit","-m",a],{stdio:"inherit"})}async function Rt(){const t=await f("git",["rev-parse","--show-toplevel"]),e=b.join(t,".git","COMMIT_EDITMSG"),o=J(e,"utf8").trim();if(!/(?<type>[a-z]+)(?:\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i.test(o))throw new Error(`${H(" ERROR ")} ${Q("git commit message must match the Conventional Commits standard!")}
3
3
 
4
- ${H("Recommended to use the command `pnpm commit` to generate Conventional Commits compliant commit information.\nGet more info about Conventional Commits, follow this link: https://conventionalcommits.org")}`)}async function Rt(t){await w(t,{glob:!0})}async function k(t=["--deep","-u"]){d("npx",["ncu",...t],{stdio:"inherit"})}async function St(t,e=!1){e?await W(t):await V(t)}async function Tt(){await B({files:["**/package.json","!**/node_modules"],execute:"npx soy changelog",all:!0,tag:!0,commit:"chore(projects): release v%s",push:!0})}const kt=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,xt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,$t=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Ot(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){At(t);return}return e}function At(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Pt(t,e={}){if(typeof t!="string")return t;const o=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return o.slice(1,-1);if(o.length<=9){const s=o.toLowerCase();if(s==="true")return!0;if(s==="false")return!1;if(s==="undefined")return;if(s==="null")return null;if(s==="nan")return Number.NaN;if(s==="infinity")return Number.POSITIVE_INFINITY;if(s==="-infinity")return Number.NEGATIVE_INFINITY}if(!$t.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(kt.test(t)||xt.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Ot)}return JSON.parse(t)}catch(s){if(e.strict)throw s;return t}}const Nt=/#/g,It=/&/g,vt=/=/g,E=/\+/g,Lt=/%5e/gi,qt=/%60/gi,Ft=/%7c/gi,Gt=/%20/gi;function Jt(t){return encodeURI(""+t).replace(Ft,"|")}function C(t){return Jt(typeof t=="string"?t:JSON.stringify(t)).replace(E,"%2B").replace(Gt,"+").replace(Nt,"%23").replace(It,"%26").replace(qt,"`").replace(Lt,"^")}function j(t){return C(t).replace(vt,"%3D")}function x(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function Ut(t){return x(t.replace(E," "))}function Dt(t){return x(t.replace(E," "))}function Mt(t=""){const e={};t[0]==="?"&&(t=t.slice(1));for(const o of t.split("&")){const s=o.match(/([^=]+)=?(.*)/)||[];if(s.length<2)continue;const r=Ut(s[1]);if(r==="__proto__"||r==="constructor")continue;const a=Dt(s[2]||"");e[r]===void 0?e[r]=a:Array.isArray(e[r])?e[r].push(a):e[r]=[e[r],a]}return e}function Ht(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(o=>`${j(t)}=${C(o)}`).join("&"):`${j(t)}=${C(e)}`:j(t)}function Qt(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>Ht(e,t[e])).filter(Boolean).join("&")}const Wt=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Vt=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Bt=/^([/\\]\s*){2,}[^/\\]/;function $(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?Wt.test(t):Vt.test(t)||(e.acceptRelative?Bt.test(t):!1)}const Kt=/\/$|\/\?|\/#/;function _(t="",e){return e?Kt.test(t):t.endsWith("/")}function zt(t="",e){if(!e)return(_(t)?t.slice(0,-1):t)||"/";if(!_(t,!0))return t||"/";let o=t,s="";const r=t.indexOf("#");r>=0&&(o=t.slice(0,r),s=t.slice(r));const[a,...c]=o.split("?");return(a.slice(0,-1)||"/")+(c.length>0?`?${c.join("?")}`:"")+s}function Yt(t="",e){if(!e)return t.endsWith("/")?t:t+"/";if(_(t,!0))return t||"/";let o=t,s="";const r=t.indexOf("#");if(r>=0&&(o=t.slice(0,r),s=t.slice(r),!o))return s;const[a,...c]=o.split("?");return a+"/"+(c.length>0?`?${c.join("?")}`:"")+s}function Xt(t,e){if(te(e)||$(t))return t;const o=zt(e);return t.startsWith(o)?t:ne(o,t)}function Zt(t,e){const o=O(t),s={...Mt(o.search),...e};return o.search=Qt(s),se(o)}function te(t){return!t||t==="/"}function ee(t){return t&&t!=="/"}const oe=/^\.?\//;function ne(t,...e){let o=t||"";for(const s of e.filter(r=>ee(r)))if(o){const r=s.replace(oe,"");o=Yt(o)+r}else o=s;return o}function O(t="",e){const o=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(o){const[,m,p=""]=o;return{protocol:m.toLowerCase(),pathname:p,href:m+p,auth:"",host:"",search:"",hash:""}}if(!$(t,{acceptRelative:!0}))return e?O(e+t):A(t);const[,s="",r,a=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,c="",i=""]=a.match(/([^#/?]*)(.*)?/)||[],{pathname:u,search:l,hash:n}=A(i.replace(/\/(?=[A-Za-z]:)/,""));return{protocol:s.toLowerCase(),auth:r?r.slice(0,Math.max(0,r.length-1)):"",host:c,pathname:u,search:l,hash:n}}function A(t=""){const[e="",o="",s=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:o,hash:s}}function se(t){const e=t.pathname||"",o=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",s=t.hash||"",r=t.auth?t.auth+"@":"",a=t.host||"";return(t.protocol?t.protocol+"//":"")+r+a+e+o+s}var re=Object.defineProperty,ie=(t,e,o)=>e in t?re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,f=(t,e,o)=>(ie(t,typeof e!="symbol"?e+"":e,o),o);class ae extends Error{constructor(){super(...arguments),f(this,"name","FetchError"),f(this,"request"),f(this,"response"),f(this,"data"),f(this,"status"),f(this,"statusText"),f(this,"statusCode"),f(this,"statusMessage")}}function ce(t,e,o){let s="";e&&(s=e.message),t&&o?s=`${s} (${o.status} ${o.statusText} (${t.toString()}))`:t&&(s=`${s} (${t.toString()})`);const r=new ae(s);return Object.defineProperty(r,"request",{get(){return t}}),Object.defineProperty(r,"response",{get(){return o}}),Object.defineProperty(r,"data",{get(){return o&&o._data}}),Object.defineProperty(r,"status",{get(){return o&&o.status}}),Object.defineProperty(r,"statusText",{get(){return o&&o.statusText}}),Object.defineProperty(r,"statusCode",{get(){return o&&o.status}}),Object.defineProperty(r,"statusMessage",{get(){return o&&o.statusText}}),r}const pe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function P(t="GET"){return pe.has(t.toUpperCase())}function ue(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const le=new Set(["image/svg","application/xml","application/xhtml","application/html"]),me=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function de(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return me.test(e)?"json":le.has(e)||e.startsWith("text/")?"text":"blob"}function fe(t,e,o=globalThis.Headers){const s={...e,...t};if(e?.params&&t?.params&&(s.params={...e?.params,...t?.params}),e?.query&&t?.query&&(s.query={...e?.query,...t?.query}),e?.headers&&t?.headers){s.headers=new o(e?.headers||{});for(const[r,a]of new o(t?.headers||{}))s.headers.set(r,a)}return s}const he=new Set([408,409,425,429,500,502,503,504]);function N(t={}){const{fetch:e=globalThis.fetch,Headers:o=globalThis.Headers,AbortController:s=globalThis.AbortController}=t;async function r(i){const u=i.error&&i.error.name==="AbortError"&&!i.options.timeout||!1;if(i.options.retry!==!1&&!u){let n;typeof i.options.retry=="number"?n=i.options.retry:n=P(i.options.method)?0:1;const m=i.response&&i.response.status||500;if(n>0&&he.has(m)){const p=i.options.retryDelay||0;return p>0&&await new Promise(y=>setTimeout(y,p)),a(i.request,{...i.options,retry:n-1,timeout:i.options.timeout})}}const l=ce(i.request,i.error,i.response);throw Error.captureStackTrace&&Error.captureStackTrace(l,a),l}const a=async function(u,l={}){const n={request:u,options:fe(l,t.defaults,o),response:void 0,error:void 0};if(n.options.method=n.options.method?.toUpperCase(),n.options.onRequest&&await n.options.onRequest(n),typeof n.request=="string"&&(n.options.baseURL&&(n.request=Xt(n.request,n.options.baseURL)),(n.options.query||n.options.params)&&(n.request=Zt(n.request,{...n.options.params,...n.options.query})),n.options.body&&P(n.options.method)&&ue(n.options.body)&&(n.options.body=typeof n.options.body=="string"?n.options.body:JSON.stringify(n.options.body),n.options.headers=new o(n.options.headers||{}),n.options.headers.has("content-type")||n.options.headers.set("content-type","application/json"),n.options.headers.has("accept")||n.options.headers.set("accept","application/json"))),!n.options.signal&&n.options.timeout){const p=new s;setTimeout(()=>p.abort(),n.options.timeout),n.options.signal=p.signal}try{n.response=await e(n.request,n.options)}catch(p){return n.error=p,n.options.onRequestError&&await n.options.onRequestError(n),await r(n)}const m=(n.options.parseResponse?"json":n.options.responseType)||de(n.response.headers.get("content-type")||"");if(m==="json"){const p=await n.response.text(),y=n.options.parseResponse||Pt;n.response._data=y(p)}else m==="stream"?n.response._data=n.response.body:n.response._data=await n.response[m]();return n.options.onResponse&&await n.options.onResponse(n),!n.options.ignoreResponseError&&n.response.status>=400&&n.response.status<600?(n.options.onResponseError&&await n.options.onResponseError(n),await r(n)):n.response},c=async function(u,l){return(await a(u,l))._data};return c.raw=a,c.native=e,c.create=(i={})=>N({...t,defaults:{...t.defaults,...i}}),c}const R=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),ge=R.fetch||(()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!"))),ye=R.Headers,be=R.AbortController,I=N({fetch:ge,Headers:ye,AbortController:be});async function we(t=yt.name,e=!0){const o=`https://registry-direct.npmmirror.com/${t}/sync?sync_upstream=true`,{logId:s=""}=await I(o,{method:"PUT"});if(!s)return;const r=`https://registry.npmmirror.com/-/package/${t}/syncs/${s}/log`,a=`Sync ${t} success`;let c="",i=setInterval(async()=>{try{c=await I(r,{method:"GET"}),e&&K.log(c),c.includes(a)&&i&&(clearInterval(i),i=null)}catch{}},2e3)}async function Ee(t){const e=(await import("./chunks/index.mjs").then(function(o){return o.i})).default;return e({config:t,allowEmpty:!0})}async function v(t=g.cwd()){const e=b.join(t,".husky"),o=J(e),s=b.join(t,".git","hooks");o&&(await w(e),await d("git",["config","core.hooksPath",s],{stdio:"inherit"})),await w(s),await d("npx",["simple-git-hooks"],{stdio:"inherit"})}async function L(t){await d("npx",["prettier","--write",".",...t],{stdio:"inherit"})}async function Ce(){await d("npx",["eslint",".","--fix"],{stdio:"inherit"}),await d("npx",["soy","prettier-format"],{stdio:"inherit"})}const q="*.{js,jsx,mjs,cjs,json,ts,tsx,mts,cts,vue,svelte,astro}",je={cwd:g.cwd(),cleanupDirs:["**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/node_modules","!node_modules/**"],gitCommitTypes:[["feat","A new feature"],["fix","A bug fix"],["docs","Documentation only changes"],["style","Changes that do not affect the meaning of the code"],["refactor","A code change that neither fixes a bug nor adds a feature"],["perf","A code change that improves performance"],["test","Adding missing tests or correcting existing tests"],["build","Changes that affect the build system or external dependencies"],["ci","Changes to our CI configuration files and scripts"],["chore","Other changes that don't modify src or test files"],["revert","Reverts a previous commit"]],gitCommitScopes:[["projects","project"],["components","components"],["hooks","hook functions"],["utils","utils functions"],["types","TS declaration"],["styles","style"],["deps","project dependencies"],["release","release project"],["other","other changes"]],ncuCommandArgs:["--deep","-u"],changelogOptions:{},prettierWriteGlob:[`!**/${q}`,"!*.min.*","!CHANGELOG.md","!dist","!LICENSE*","!output","!coverage","!public","!temp","!package-lock.json","!pnpm-lock.yaml","!yarn.lock","!.github","!__snapshots__","!node_modules"],lintStagedConfig:{[q]:"eslint --fix","*":"soy prettier-write"}},_e="U2FsdGVkX18dc7x8PmAq30sl+nyGmi5VJJwninmYBRs8vVILEIjY+kT/F8ajm/6gRTMbDAEmx5WKInQBzeNSig==";async function Re(t,e=g.cwd()){const{config:o}=await Y({name:"soybean",defaults:je,overrides:t,cwd:e,packageJson:!0}),s=await Se(e);if(o&&s){const r=new Ct("SOYBEAN_JS");o.changelogOptions={...o.changelogOptions,github:{repo:"",token:r.deCrypto(_e)||""}}}return o}async function Se(t){let e=!1;const o="soybean";try{const s=await z(`${t}/package.json`,"utf-8"),r=JSON.parse(s);e=r.name?.includes(o)||r.repository?.url?.includes(o)||r.author?.includes(o)||r.author?.name?.includes(o)||r.author?.url?.includes(o)}catch{}return e}const h="the command is deprecated, it will be removed in the next major version 1.0.0";async function Te(){const t=await Re(),e=F("soybean");e.version(T).option("--total","Generate changelog by total tags").help();const o={cleanup:{desc:"delete dirs: node_modules, dist, etc.",action:async()=>{await Rt(t.cleanupDirs)}},ncu:{desc:"npm-check-updates, it can update package.json dependencies to the latest version",action:async()=>{await k(t.ncuCommandArgs)}},"git-commit":{desc:"git commit, generate commit message which match Conventional Commits standard",action:async()=>{await jt(t.gitCommitTypes,t.gitCommitScopes)}},"git-commit-verify":{desc:"verify git commit message, make sure it match Conventional Commits standard",action:async()=>{await _t()}},changelog:{desc:"generate changelog",action:async s=>{await St(t.changelogOptions,s?.total)}},release:{desc:"release: update version, generate changelog, commit code",action:async()=>{await Tt()}},"sync-npmmirror":{desc:"sync npmmirror",action:async s=>{await we(s?.syncName,s?.syncLog)}},"prettier-write":{desc:`run prettier --write (${h})`,action:async()=>{await L(t.prettierWriteGlob)}},"lint-staged":{desc:`run lint-staged (${h})`,action:async()=>{const s=await Ee(t.lintStagedConfig).catch(()=>{g.exitCode=1});g.exitCode=s?0:1}},"init-simple-git-hooks":{desc:`init simple-git-hooks and remove husky (${h})`,action:async()=>{await v(t.cwd)}},"init-git-hooks":{desc:`same as init-simple-git-hooks (${h})`,action:async()=>{await v(t.cwd)}},"update-pkg":{desc:`same as ncu (${h})`,action:async()=>{await k(t.ncuCommandArgs)}},"prettier-format":{desc:`same as prettier-write (${h})`,action:async()=>{await L(t.prettierWriteGlob)}},"eslint-prettier":{desc:h,action:async()=>{await Ce()}}};for await(const[s,{desc:r,action:a}]of Object.entries(o))e.command(s,r).action(a);e.parse()}Te();function ke(t){return t}export{ke as defineConfig};
4
+ ${W("Recommended to use the command `pnpm commit` to generate Conventional Commits compliant commit information.\nGet more info about Conventional Commits, follow this link: https://conventionalcommits.org")}`)}async function St(t){await w(t,{glob:!0})}async function x(t=["--deep","-u"]){f("npx",["ncu",...t],{stdio:"inherit"})}async function Tt(t,e=!1){e?await B(t):await K(t)}async function kt(t="npx soy changelog",e=!0){await z({files:["**/package.json","!**/node_modules"],execute:t,all:!0,tag:!0,commit:"chore(projects): release v%s",push:e})}const xt=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,$t=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Ot=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function At(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Pt(t);return}return e}function Pt(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Nt(t,e={}){if(typeof t!="string")return t;const o=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return o.slice(1,-1);if(o.length<=9){const n=o.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Ot.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(xt.test(t)||$t.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,At)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const It=/#/g,vt=/&/g,Lt=/=/g,E=/\+/g,qt=/%5e/gi,Ft=/%60/gi,Gt=/%7c/gi,Dt=/%20/gi;function Jt(t){return encodeURI(""+t).replace(Gt,"|")}function C(t){return Jt(typeof t=="string"?t:JSON.stringify(t)).replace(E,"%2B").replace(Dt,"+").replace(It,"%23").replace(vt,"%26").replace(Ft,"`").replace(qt,"^")}function j(t){return C(t).replace(Lt,"%3D")}function $(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function Ut(t){return $(t.replace(E," "))}function Mt(t){return $(t.replace(E," "))}function Ht(t=""){const e={};t[0]==="?"&&(t=t.slice(1));for(const o of t.split("&")){const n=o.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const r=Ut(n[1]);if(r==="__proto__"||r==="constructor")continue;const a=Mt(n[2]||"");e[r]===void 0?e[r]=a:Array.isArray(e[r])?e[r].push(a):e[r]=[e[r],a]}return e}function Qt(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(o=>`${j(t)}=${C(o)}`).join("&"):`${j(t)}=${C(e)}`:j(t)}function Wt(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>Qt(e,t[e])).filter(Boolean).join("&")}const Vt=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Bt=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Kt=/^([/\\]\s*){2,}[^/\\]/;function O(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?Vt.test(t):Bt.test(t)||(e.acceptRelative?Kt.test(t):!1)}const zt=/\/$|\/\?|\/#/;function _(t="",e){return e?zt.test(t):t.endsWith("/")}function Yt(t="",e){if(!e)return(_(t)?t.slice(0,-1):t)||"/";if(!_(t,!0))return t||"/";let o=t,n="";const r=t.indexOf("#");r>=0&&(o=t.slice(0,r),n=t.slice(r));const[a,...c]=o.split("?");return(a.slice(0,-1)||"/")+(c.length>0?`?${c.join("?")}`:"")+n}function Xt(t="",e){if(!e)return t.endsWith("/")?t:t+"/";if(_(t,!0))return t||"/";let o=t,n="";const r=t.indexOf("#");if(r>=0&&(o=t.slice(0,r),n=t.slice(r),!o))return n;const[a,...c]=o.split("?");return a+"/"+(c.length>0?`?${c.join("?")}`:"")+n}function Zt(t,e){if(ee(e)||O(t))return t;const o=Yt(e);return t.startsWith(o)?t:se(o,t)}function te(t,e){const o=A(t),n={...Ht(o.search),...e};return o.search=Wt(n),re(o)}function ee(t){return!t||t==="/"}function oe(t){return t&&t!=="/"}const ne=/^\.?\//;function se(t,...e){let o=t||"";for(const n of e.filter(r=>oe(r)))if(o){const r=n.replace(ne,"");o=Xt(o)+r}else o=n;return o}function A(t="",e){const o=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(o){const[,l,m=""]=o;return{protocol:l.toLowerCase(),pathname:m,href:l+m,auth:"",host:"",search:"",hash:""}}if(!O(t,{acceptRelative:!0}))return e?A(e+t):P(t);const[,n="",r,a=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,c="",i=""]=a.match(/([^#/?]*)(.*)?/)||[],{pathname:p,search:u,hash:s}=P(i.replace(/\/(?=[A-Za-z]:)/,""));return{protocol:n.toLowerCase(),auth:r?r.slice(0,Math.max(0,r.length-1)):"",host:c,pathname:p,search:u,hash:s}}function P(t=""){const[e="",o="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:o,hash:n}}function re(t){const e=t.pathname||"",o=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",r=t.auth?t.auth+"@":"",a=t.host||"";return(t.protocol?t.protocol+"//":"")+r+a+e+o+n}var ie=Object.defineProperty,ae=(t,e,o)=>e in t?ie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,d=(t,e,o)=>(ae(t,typeof e!="symbol"?e+"":e,o),o);class ce extends Error{constructor(){super(...arguments),d(this,"name","FetchError"),d(this,"request"),d(this,"response"),d(this,"data"),d(this,"status"),d(this,"statusText"),d(this,"statusCode"),d(this,"statusMessage")}}function pe(t,e,o){let n="";e&&(n=e.message),t&&o?n=`${n} (${o.status} ${o.statusText} (${t.toString()}))`:t&&(n=`${n} (${t.toString()})`);const r=new ce(n);return Object.defineProperty(r,"request",{get(){return t}}),Object.defineProperty(r,"response",{get(){return o}}),Object.defineProperty(r,"data",{get(){return o&&o._data}}),Object.defineProperty(r,"status",{get(){return o&&o.status}}),Object.defineProperty(r,"statusText",{get(){return o&&o.statusText}}),Object.defineProperty(r,"statusCode",{get(){return o&&o.status}}),Object.defineProperty(r,"statusMessage",{get(){return o&&o.statusText}}),r}const ue=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function N(t="GET"){return ue.has(t.toUpperCase())}function me(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const le=new Set(["image/svg","application/xml","application/xhtml","application/html"]),fe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function de(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return fe.test(e)?"json":le.has(e)||e.startsWith("text/")?"text":"blob"}function he(t,e,o=globalThis.Headers){const n={...e,...t};if(e?.params&&t?.params&&(n.params={...e?.params,...t?.params}),e?.query&&t?.query&&(n.query={...e?.query,...t?.query}),e?.headers&&t?.headers){n.headers=new o(e?.headers||{});for(const[r,a]of new o(t?.headers||{}))n.headers.set(r,a)}return n}const ge=new Set([408,409,425,429,500,502,503,504]);function I(t={}){const{fetch:e=globalThis.fetch,Headers:o=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function r(i){const p=i.error&&i.error.name==="AbortError"&&!i.options.timeout||!1;if(i.options.retry!==!1&&!p){let s;typeof i.options.retry=="number"?s=i.options.retry:s=N(i.options.method)?0:1;const l=i.response&&i.response.status||500;if(s>0&&ge.has(l)){const m=i.options.retryDelay||0;return m>0&&await new Promise(y=>setTimeout(y,m)),a(i.request,{...i.options,retry:s-1,timeout:i.options.timeout})}}const u=pe(i.request,i.error,i.response);throw Error.captureStackTrace&&Error.captureStackTrace(u,a),u}const a=async function(p,u={}){const s={request:p,options:he(u,t.defaults,o),response:void 0,error:void 0};if(s.options.method=s.options.method?.toUpperCase(),s.options.onRequest&&await s.options.onRequest(s),typeof s.request=="string"&&(s.options.baseURL&&(s.request=Zt(s.request,s.options.baseURL)),(s.options.query||s.options.params)&&(s.request=te(s.request,{...s.options.params,...s.options.query})),s.options.body&&N(s.options.method)&&me(s.options.body)&&(s.options.body=typeof s.options.body=="string"?s.options.body:JSON.stringify(s.options.body),s.options.headers=new o(s.options.headers||{}),s.options.headers.has("content-type")||s.options.headers.set("content-type","application/json"),s.options.headers.has("accept")||s.options.headers.set("accept","application/json"))),!s.options.signal&&s.options.timeout){const m=new n;setTimeout(()=>m.abort(),s.options.timeout),s.options.signal=m.signal}try{s.response=await e(s.request,s.options)}catch(m){return s.error=m,s.options.onRequestError&&await s.options.onRequestError(s),await r(s)}const l=(s.options.parseResponse?"json":s.options.responseType)||de(s.response.headers.get("content-type")||"");if(l==="json"){const m=await s.response.text(),y=s.options.parseResponse||Nt;s.response._data=y(m)}else l==="stream"?s.response._data=s.response.body:s.response._data=await s.response[l]();return s.options.onResponse&&await s.options.onResponse(s),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await s.options.onResponseError(s),await r(s)):s.response},c=async function(p,u){return(await a(p,u))._data};return c.raw=a,c.native=e,c.create=(i={})=>I({...t,defaults:{...t.defaults,...i}}),c}const R=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),ye=R.fetch||(()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!"))),be=R.Headers,we=R.AbortController,v=I({fetch:ye,Headers:be,AbortController:we});async function Ee(t,e=!0){if(!t||t===!0){await L(k.name,e);return}const o=(t?.split?.(",")||[]).filter(Boolean).map(r=>r.trim()),n=[...new Set(o)];for await(const r of n)await L(r,e)}async function L(t=k.name,e=!0){const o=`https://registry-direct.npmmirror.com/${t}/sync?sync_upstream=true`,{logId:n=""}=await v(o,{method:"PUT"});if(!n)return;const r=`https://registry.npmmirror.com/-/package/${t}/syncs/${n}/log`,a=`Sync ${t} success`,c=1e3*60,i=Date.now();let p="",u=setInterval(async()=>{try{p=await v(r,{method:"GET"}),e&&Y.log(p);const s=Date.now()-i>c;u&&(p.includes(a)||s)&&(clearInterval(u),u=null)}catch{}},2e3)}async function Ce(t){const e=(await import("./chunks/index.mjs").then(function(o){return o.i})).default;return e({config:t,allowEmpty:!0})}async function q(t=g.cwd()){const e=b.join(t,".husky"),o=U(e),n=b.join(t,".git","hooks");o&&(await w(e),await f("git",["config","core.hooksPath",n],{stdio:"inherit"})),await w(n),await f("npx",["simple-git-hooks"],{stdio:"inherit"})}async function F(t){await f("npx",["prettier","--write",".",...t],{stdio:"inherit"})}async function je(){await f("npx",["eslint",".","--fix"],{stdio:"inherit"}),await f("npx",["soy","prettier-format"],{stdio:"inherit"})}const G="*.{js,jsx,mjs,cjs,json,ts,tsx,mts,cts,vue,svelte,astro}",_e={cwd:g.cwd(),cleanupDirs:["**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/node_modules","!node_modules/**"],gitCommitTypes:[["feat","A new feature"],["fix","A bug fix"],["docs","Documentation only changes"],["style","Changes that do not affect the meaning of the code"],["refactor","A code change that neither fixes a bug nor adds a feature"],["perf","A code change that improves performance"],["test","Adding missing tests or correcting existing tests"],["build","Changes that affect the build system or external dependencies"],["ci","Changes to our CI configuration files and scripts"],["chore","Other changes that don't modify src or test files"],["revert","Reverts a previous commit"]],gitCommitScopes:[["projects","project"],["components","components"],["hooks","hook functions"],["utils","utils functions"],["types","TS declaration"],["styles","style"],["deps","project dependencies"],["release","release project"],["other","other changes"]],ncuCommandArgs:["--deep","-u"],changelogOptions:{},prettierWriteGlob:[`!**/${G}`,"!*.min.*","!CHANGELOG.md","!dist","!LICENSE*","!output","!coverage","!public","!temp","!package-lock.json","!pnpm-lock.yaml","!yarn.lock","!.github","!__snapshots__","!node_modules"],lintStagedConfig:{[G]:"eslint --fix","*":"soy prettier-write"}},Re="U2FsdGVkX18dc7x8PmAq30sl+nyGmi5VJJwninmYBRs8vVILEIjY+kT/F8ajm/6gRTMbDAEmx5WKInQBzeNSig==";async function Se(t,e=g.cwd()){const{config:o}=await Z({name:"soybean",defaults:_e,overrides:t,cwd:e,packageJson:!0}),n=await Te(e);if(o&&n){const r=new jt("SOYBEAN_JS");o.changelogOptions={...o.changelogOptions,github:{repo:"",token:r.deCrypto(Re)||""}}}return o}async function Te(t){let e=!1;const o="soybean";try{const n=await X(`${t}/package.json`,"utf-8"),r=JSON.parse(n);e=r.name?.includes(o)||r.repository?.url?.includes(o)||r.author?.includes(o)||r.author?.name?.includes(o)||r.author?.url?.includes(o)}catch{}return e}const h="the command is deprecated, it will be removed in the next major version 1.0.0";async function ke(){const t=await Se(),e=D("soybean");e.version(T).option("--execute [command]","Execute additional command after bumping and before git commit. Defaults to 'npx soy changelog'").option("--push","Indicates whether to push the git commit and tag").option("--total","Generate changelog by total tags").option("--syncName [name]",'The package name of sync npmmirror, if it has multiple packages, you can use "," to separate them').option("--syncLog","Whether show sync package log").help();const o={cleanup:{desc:"delete dirs: node_modules, dist, etc.",action:async()=>{await St(t.cleanupDirs)}},ncu:{desc:"npm-check-updates, it can update package.json dependencies to the latest version",action:async()=>{await x(t.ncuCommandArgs)}},"git-commit":{desc:"git commit, generate commit message which match Conventional Commits standard",action:async()=>{await _t(t.gitCommitTypes,t.gitCommitScopes)}},"git-commit-verify":{desc:"verify git commit message, make sure it match Conventional Commits standard",action:async()=>{await Rt()}},changelog:{desc:"generate changelog",action:async n=>{await Tt(t.changelogOptions,n?.total)}},release:{desc:"release: update version, generate changelog, commit code",action:async n=>{await kt(n?.execute,n?.push)}},"sync-npmmirror":{desc:"sync npmmirror",action:async n=>{await Ee(n?.syncName,n?.syncLog)}},"prettier-write":{desc:`run prettier --write (${h})`,action:async()=>{await F(t.prettierWriteGlob)}},"lint-staged":{desc:`run lint-staged (${h})`,action:async()=>{const n=await Ce(t.lintStagedConfig).catch(()=>{g.exitCode=1});g.exitCode=n?0:1}},"init-simple-git-hooks":{desc:`init simple-git-hooks and remove husky (${h})`,action:async()=>{await q(t.cwd)}},"init-git-hooks":{desc:`same as init-simple-git-hooks (${h})`,action:async()=>{await q(t.cwd)}},"update-pkg":{desc:`same as ncu (${h})`,action:async()=>{await x(t.ncuCommandArgs)}},"prettier-format":{desc:`same as prettier-write (${h})`,action:async()=>{await F(t.prettierWriteGlob)}},"eslint-prettier":{desc:h,action:async()=>{await je()}}};for await(const[n,{desc:r,action:a}]of Object.entries(o))e.command(n,r).action(a);e.parse()}ke();function xe(t){return t}export{xe as defineConfig};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@soybeanjs/cli",
3
3
  "type": "module",
4
- "version": "0.8.4",
5
- "packageManager": "pnpm@8.11.0",
4
+ "version": "0.8.7",
5
+ "packageManager": "pnpm@8.12.0",
6
6
  "description": "SoybeanJS's command line tools",
7
7
  "author": {
8
8
  "name": "Soybean",
@@ -20,6 +20,10 @@
20
20
  "publishConfig": {
21
21
  "registry": "https://registry.npmjs.org/"
22
22
  },
23
+ "bin": {
24
+ "soybean": "dist/index.cjs",
25
+ "soy": "dist/index.cjs"
26
+ },
23
27
  "exports": {
24
28
  ".": {
25
29
  "types": "./dist/index.d.ts",
@@ -30,10 +34,6 @@
30
34
  "main": "dist/index.cjs",
31
35
  "module": "dist/index.mjs",
32
36
  "types": "dist/index.d.ts",
33
- "bin": {
34
- "soybean": "dist/index.cjs",
35
- "soy": "dist/index.cjs"
36
- },
37
37
  "files": [
38
38
  "dist"
39
39
  ],
@@ -53,36 +53,35 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@soybeanjs/cli": "link:",
56
- "@soybeanjs/eslint-config": "1.0.5",
56
+ "@soybeanjs/eslint-config": "1.0.9",
57
57
  "@types/crypto-js": "4.2.1",
58
58
  "@types/node": "20.10.4",
59
59
  "eslint": "8.55.0",
60
+ "eslint-plugin-vue": "9.19.2",
60
61
  "lint-staged": "15.2.0",
61
- "npm-run-all": "4.1.5",
62
62
  "simple-git-hooks": "2.9.0",
63
63
  "tsx": "4.6.2",
64
64
  "typescript": "5.3.3",
65
- "unbuild": "2.0.0"
65
+ "unbuild": "2.0.0",
66
+ "vue-eslint-parser": "9.3.2"
66
67
  },
67
68
  "simple-git-hooks": {
68
69
  "commit-msg": "pnpm soy git-commit-verify",
69
- "pre-commit": "pnpm typecheck && pnpm lint-staged"
70
+ "pre-commit": "pnpm typecheck"
70
71
  },
71
72
  "lint-staged": {
72
73
  "*": "eslint --fix"
73
74
  },
74
75
  "scripts": {
75
- "stub": "pnpm -r run stub",
76
- "build": "run-s typecheck build-only build-pkg",
77
- "build-only": "unbuild",
76
+ "build": "unbuild && pnpm build-pkg",
78
77
  "build-pkg": "pnpm -r --filter='./packages/*' run build",
79
- "lint": "eslint . --fix",
80
- "commit": "soy git-commit",
81
78
  "cleanup": "soy cleanup",
82
- "update-pkg": "soy ncu",
83
- "typecheck": "tsc --noEmit --skipLibCheck",
79
+ "commit": "soy git-commit",
80
+ "lint": "eslint . --fix",
84
81
  "publish-pkg": "pnpm -r publish --access public",
85
- "release-pkg": "soy release",
86
- "release": "run-s release-pkg build publish-pkg"
82
+ "release": "soy release",
83
+ "stub": "pnpm -r run stub",
84
+ "typecheck": "tsc --noEmit --skipLibCheck",
85
+ "update-pkg": "soy ncu"
87
86
  }
88
87
  }