@lntvow/dev 5.3.10 → 5.3.11

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/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var b=Object.create;var y=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var T=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of R(t))!z.call(e,r)&&r!==i&&y(e,r,{get:()=>t[r],enumerable:!(o=M(t,r))||o.enumerable});return e};var m=(e,t,i)=>(i=e!=null?b(_(e)):{},T(t||!e||!e.__esModule?y(i,"default",{value:e,enumerable:!0}):i,e));var F=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,c=F();var u=require("commander");var k="@lntvow/dev",v="5.3.10";var f=require("path"),l=require("fs"),x=require("url"),j=require("commander");var w=require("child_process"),s=require("fs"),a=require("path"),p=m(require("picocolors"),1),n={info:e=>console.log(p.default.blue(`\u25CF ${e}`)),success:e=>console.log(p.default.green(`\u2713 ${e}`)),warn:e=>console.log(p.default.yellow(`\u25B2 ${e}`)),error:e=>console.log(p.default.red(`\u2717 ${e}`))};function g(e,t={}){try{return(0,w.execSync)(e,{stdio:"inherit",...t})}catch(i){throw n.error(`\u547D\u4EE4\u6267\u884C\u5931\u8D25: ${e}`),i}}function S(){let e=[{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];for(let{file:i,manager:o}of e)if((0,s.existsSync)((0,a.resolve)(process.cwd(),i)))return o;let t=process.env.npm_config_user_agent||"";return t.startsWith("pnpm")?"pnpm":t.startsWith("yarn")?"yarn":"npm"}function d(e,t){if((0,s.statSync)(e).isDirectory()){if((0,a.basename)(e)==="node_modules")return;(0,s.mkdirSync)(t,{recursive:!0}),(0,s.readdirSync)(e).forEach(o=>{d((0,a.resolve)(e,o),(0,a.resolve)(t,o))})}else{if((0,s.existsSync)(t))return;(0,s.copyFileSync)(e,t)}}var D={prepare:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u --reject @types/node && pnpm install",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":"eslint --fix --cache","lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc"},$=["@commitlint/cli","@commitlint/config-conventional","@lntvow/eslint-config","bumpp","commitizen","cz-conventional-changelog","eslint","lint-staged","npm-run-all","prettier","simple-git-hooks","typescript"].sort((e,t)=>e.localeCompare(t));j.program.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").description("init project").action(U);function U(e){n.success("Init project by @lntvow/dev"),n.info(`Cwd is ${process.cwd()}`);let{temp:t,git:i,scripts:o}=e;try{t&&N(),O(),o&&L(),i&&G(),n.success("Project initialization completed successfully!")}catch(r){n.error(`Initialization failed: ${r.message}`),process.exit(1)}}function N(){try{let e=(0,f.resolve)((0,x.fileURLToPath)(new URL("./configs",c))),t=process.cwd();n.info(`Copying template files from "${e}" to "${t}"`),d(e,t),n.success("Template files copied successfully")}catch(e){throw n.error(`Failed to copy template files: ${e.message}`),e}}function G(){try{n.info("Initializing Git hooks..."),g("npx simple-git-hooks"),n.success("Git hooks initialized successfully")}catch(e){throw n.error(`Failed to initialize Git hooks: ${e.message}`),e}}function L(){let e,t=(0,f.resolve)(process.cwd(),"package.json");try{n.info("Updating package.json scripts..."),e=(0,l.readFileSync)(t,"utf-8");let i=JSON.parse(e),o={...i,scripts:{...D,...i.scripts}};(0,l.writeFileSync)(t,JSON.stringify(o,null,2)),n.success("Package.json scripts updated successfully")}catch(i){throw e&&(0,l.writeFileSync)(t,e),n.error(`Failed to update package.json: ${i.message}`),i}}function O(){try{let e=$.map(r=>`${r}@latest`).join(" "),t=S(),o={pnpm:`pnpm add -D ${e}`,yarn:`yarn add -D ${e}`,npm:`npm install -D ${e}`}[t];n.info(`Installing dependencies: ${o}`),g(o),n.success("Dependencies installed successfully")}catch(e){throw n.error(`Dependency installation failed: ${e.message}`),e}}var E=require("commander"),C=m(require("picocolors"),1),P=m(require("dayjs"),1),I=m(require("simple-git"),1);E.program.command("release").description("git release").action(Y);async function Y(){console.log(C.default.green("Release project..."));try{await A(),n.success("Release completed successfully!")}catch(e){n.error(`Release failed: ${e.message}`),process.exit(1)}}async function A(){let e=(0,I.default)(process.cwd());try{let t=(0,P.default)().format("YYYYMMDD");await e.pull(),await e.add("."),await e.commit(t,["--no-verify"]),await e.push("origin"),n.success(`\u63D0\u4EA4\u6210\u529F: ${t}`)}catch(t){n.error(`Git\u64CD\u4F5C\u5931\u8D25: ${t.message}`),process.exit(1)}}u.program.name(k).version(v,"-v, --version","output the version number");u.program.parse();
2
+ "use strict";var b=Object.create;var y=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var T=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of R(t))!z.call(e,r)&&r!==i&&y(e,r,{get:()=>t[r],enumerable:!(o=M(t,r))||o.enumerable});return e};var m=(e,t,i)=>(i=e!=null?b(_(e)):{},T(t||!e||!e.__esModule?y(i,"default",{value:e,enumerable:!0}):i,e));var F=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,c=F();var u=require("commander");var k="@lntvow/dev",v="5.3.11";var f=require("path"),l=require("fs"),x=require("url"),j=require("commander");var w=require("child_process"),s=require("fs"),a=require("path"),p=m(require("picocolors"),1),n={info:e=>console.log(p.default.blue(`\u25CF ${e}`)),success:e=>console.log(p.default.green(`\u2713 ${e}`)),warn:e=>console.log(p.default.yellow(`\u25B2 ${e}`)),error:e=>console.log(p.default.red(`\u2717 ${e}`))};function g(e,t={}){try{return(0,w.execSync)(e,{stdio:"inherit",...t})}catch(i){throw n.error(`\u547D\u4EE4\u6267\u884C\u5931\u8D25: ${e}`),i}}function S(){let e=[{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];for(let{file:i,manager:o}of e)if((0,s.existsSync)((0,a.resolve)(process.cwd(),i)))return o;let t=process.env.npm_config_user_agent||"";return t.startsWith("pnpm")?"pnpm":t.startsWith("yarn")?"yarn":"npm"}function d(e,t){if((0,s.statSync)(e).isDirectory()){if((0,a.basename)(e)==="node_modules")return;(0,s.mkdirSync)(t,{recursive:!0}),(0,s.readdirSync)(e).forEach(o=>{d((0,a.resolve)(e,o),(0,a.resolve)(t,o))})}else{if((0,s.existsSync)(t))return;(0,s.copyFileSync)(e,t)}}var D={prepare:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u --reject @types/node && pnpm install",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":"eslint --fix --cache","lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc"},$=["@commitlint/cli","@commitlint/config-conventional","@lntvow/eslint-config","bumpp","commitizen","cz-conventional-changelog","eslint","lint-staged","npm-run-all","prettier","simple-git-hooks","typescript"].sort((e,t)=>e.localeCompare(t));j.program.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").description("init project").action(U);function U(e){n.success("Init project by @lntvow/dev"),n.info(`Cwd is ${process.cwd()}`);let{temp:t,git:i,scripts:o}=e;try{t&&N(),O(),o&&L(),i&&G(),n.success("Project initialization completed successfully!")}catch(r){n.error(`Initialization failed: ${r.message}`),process.exit(1)}}function N(){try{let e=(0,f.resolve)((0,x.fileURLToPath)(new URL("./configs",c))),t=process.cwd();n.info(`Copying template files from "${e}" to "${t}"`),d(e,t),n.success("Template files copied successfully")}catch(e){throw n.error(`Failed to copy template files: ${e.message}`),e}}function G(){try{n.info("Initializing Git hooks..."),g("npx simple-git-hooks"),n.success("Git hooks initialized successfully")}catch(e){throw n.error(`Failed to initialize Git hooks: ${e.message}`),e}}function L(){let e,t=(0,f.resolve)(process.cwd(),"package.json");try{n.info("Updating package.json scripts..."),e=(0,l.readFileSync)(t,"utf-8");let i=JSON.parse(e),o={...i,scripts:{...D,...i.scripts}};(0,l.writeFileSync)(t,JSON.stringify(o,null,2)),n.success("Package.json scripts updated successfully")}catch(i){throw e&&(0,l.writeFileSync)(t,e),n.error(`Failed to update package.json: ${i.message}`),i}}function O(){try{let e=$.map(r=>`${r}@latest`).join(" "),t=S(),o={pnpm:`pnpm add -D ${e}`,yarn:`yarn add -D ${e}`,npm:`npm install -D ${e}`}[t];n.info(`Installing dependencies: ${o}`),g(o),n.success("Dependencies installed successfully")}catch(e){throw n.error(`Dependency installation failed: ${e.message}`),e}}var E=require("commander"),C=m(require("picocolors"),1),P=m(require("dayjs"),1),I=m(require("simple-git"),1);E.program.command("release").description("git release").action(Y);async function Y(){console.log(C.default.green("Release project..."));try{await A(),n.success("Release completed successfully!")}catch(e){n.error(`Release failed: ${e.message}`),process.exit(1)}}async function A(){let e=(0,I.default)(process.cwd());try{let t=(0,P.default)().format("YYYYMMDD");await e.pull(),await e.add("."),await e.commit(t,["--no-verify"]),await e.push("origin"),n.success(`\u63D0\u4EA4\u6210\u529F: ${t}`)}catch(t){n.error(`Git\u64CD\u4F5C\u5931\u8D25: ${t.message}`),process.exit(1)}}u.program.name(k).version(v,"-v, --version","output the version number");u.program.parse();
package/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{program as D}from"commander";var d="@lntvow/dev",f="5.3.10";import{resolve as w}from"path";import{readFileSync as C,writeFileSync as v}from"fs";import{fileURLToPath as b}from"url";import{program as z}from"commander";import{execSync as S}from"child_process";import{copyFileSync as $,existsSync as u,mkdirSync as x,readdirSync as j,statSync as E}from"fs";import{basename as P,resolve as p}from"path";import c from"picocolors";var i={info:e=>console.log(c.blue(`\u25CF ${e}`)),success:e=>console.log(c.green(`\u2713 ${e}`)),warn:e=>console.log(c.yellow(`\u25B2 ${e}`)),error:e=>console.log(c.red(`\u2717 ${e}`))};function l(e,t={}){try{return S(e,{stdio:"inherit",...t})}catch(n){throw i.error(`\u547D\u4EE4\u6267\u884C\u5931\u8D25: ${e}`),n}}function y(){let e=[{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];for(let{file:n,manager:o}of e)if(u(p(process.cwd(),n)))return o;let t=process.env.npm_config_user_agent||"";return t.startsWith("pnpm")?"pnpm":t.startsWith("yarn")?"yarn":"npm"}function m(e,t){if(E(e).isDirectory()){if(P(e)==="node_modules")return;x(t,{recursive:!0}),j(e).forEach(o=>{m(p(e,o),p(t,o))})}else{if(u(t))return;$(e,t)}}var h={prepare:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u --reject @types/node && pnpm install",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":"eslint --fix --cache","lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc"},k=["@commitlint/cli","@commitlint/config-conventional","@lntvow/eslint-config","bumpp","commitizen","cz-conventional-changelog","eslint","lint-staged","npm-run-all","prettier","simple-git-hooks","typescript"].sort((e,t)=>e.localeCompare(t));z.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").description("init project").action(I);function I(e){i.success("Init project by @lntvow/dev"),i.info(`Cwd is ${process.cwd()}`);let{temp:t,git:n,scripts:o}=e;try{t&&M(),_(),o&&T(),n&&F(),i.success("Project initialization completed successfully!")}catch(a){i.error(`Initialization failed: ${a.message}`),process.exit(1)}}function M(){try{let e=w(b(new URL("./configs",import.meta.url))),t=process.cwd();i.info(`Copying template files from "${e}" to "${t}"`),m(e,t),i.success("Template files copied successfully")}catch(e){throw i.error(`Failed to copy template files: ${e.message}`),e}}function F(){try{i.info("Initializing Git hooks..."),l("npx simple-git-hooks"),i.success("Git hooks initialized successfully")}catch(e){throw i.error(`Failed to initialize Git hooks: ${e.message}`),e}}function T(){let e,t=w(process.cwd(),"package.json");try{i.info("Updating package.json scripts..."),e=C(t,"utf-8");let n=JSON.parse(e),o={...n,scripts:{...h,...n.scripts}};v(t,JSON.stringify(o,null,2)),i.success("Package.json scripts updated successfully")}catch(n){throw e&&v(t,e),i.error(`Failed to update package.json: ${n.message}`),n}}function _(){try{let e=k.map(a=>`${a}@latest`).join(" "),t=y(),o={pnpm:`pnpm add -D ${e}`,yarn:`yarn add -D ${e}`,npm:`npm install -D ${e}`}[t];i.info(`Installing dependencies: ${o}`),l(o),i.success("Dependencies installed successfully")}catch(e){throw i.error(`Dependency installation failed: ${e.message}`),e}}import{program as R}from"commander";import G from"picocolors";import N from"dayjs";import O from"simple-git";R.command("release").description("git release").action(U);async function U(){console.log(G.green("Release project..."));try{await L(),i.success("Release completed successfully!")}catch(e){i.error(`Release failed: ${e.message}`),process.exit(1)}}async function L(){let e=O(process.cwd());try{let t=N().format("YYYYMMDD");await e.pull(),await e.add("."),await e.commit(t,["--no-verify"]),await e.push("origin"),i.success(`\u63D0\u4EA4\u6210\u529F: ${t}`)}catch(t){i.error(`Git\u64CD\u4F5C\u5931\u8D25: ${t.message}`),process.exit(1)}}D.name(d).version(f,"-v, --version","output the version number");D.parse();
2
+ import{program as D}from"commander";var d="@lntvow/dev",f="5.3.11";import{resolve as w}from"path";import{readFileSync as C,writeFileSync as v}from"fs";import{fileURLToPath as b}from"url";import{program as z}from"commander";import{execSync as S}from"child_process";import{copyFileSync as $,existsSync as u,mkdirSync as x,readdirSync as j,statSync as E}from"fs";import{basename as P,resolve as p}from"path";import c from"picocolors";var i={info:e=>console.log(c.blue(`\u25CF ${e}`)),success:e=>console.log(c.green(`\u2713 ${e}`)),warn:e=>console.log(c.yellow(`\u25B2 ${e}`)),error:e=>console.log(c.red(`\u2717 ${e}`))};function l(e,t={}){try{return S(e,{stdio:"inherit",...t})}catch(n){throw i.error(`\u547D\u4EE4\u6267\u884C\u5931\u8D25: ${e}`),n}}function y(){let e=[{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];for(let{file:n,manager:o}of e)if(u(p(process.cwd(),n)))return o;let t=process.env.npm_config_user_agent||"";return t.startsWith("pnpm")?"pnpm":t.startsWith("yarn")?"yarn":"npm"}function m(e,t){if(E(e).isDirectory()){if(P(e)==="node_modules")return;x(t,{recursive:!0}),j(e).forEach(o=>{m(p(e,o),p(t,o))})}else{if(u(t))return;$(e,t)}}var h={prepare:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u --reject @types/node && pnpm install",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":"eslint --fix --cache","lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc"},k=["@commitlint/cli","@commitlint/config-conventional","@lntvow/eslint-config","bumpp","commitizen","cz-conventional-changelog","eslint","lint-staged","npm-run-all","prettier","simple-git-hooks","typescript"].sort((e,t)=>e.localeCompare(t));z.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").description("init project").action(I);function I(e){i.success("Init project by @lntvow/dev"),i.info(`Cwd is ${process.cwd()}`);let{temp:t,git:n,scripts:o}=e;try{t&&M(),_(),o&&T(),n&&F(),i.success("Project initialization completed successfully!")}catch(a){i.error(`Initialization failed: ${a.message}`),process.exit(1)}}function M(){try{let e=w(b(new URL("./configs",import.meta.url))),t=process.cwd();i.info(`Copying template files from "${e}" to "${t}"`),m(e,t),i.success("Template files copied successfully")}catch(e){throw i.error(`Failed to copy template files: ${e.message}`),e}}function F(){try{i.info("Initializing Git hooks..."),l("npx simple-git-hooks"),i.success("Git hooks initialized successfully")}catch(e){throw i.error(`Failed to initialize Git hooks: ${e.message}`),e}}function T(){let e,t=w(process.cwd(),"package.json");try{i.info("Updating package.json scripts..."),e=C(t,"utf-8");let n=JSON.parse(e),o={...n,scripts:{...h,...n.scripts}};v(t,JSON.stringify(o,null,2)),i.success("Package.json scripts updated successfully")}catch(n){throw e&&v(t,e),i.error(`Failed to update package.json: ${n.message}`),n}}function _(){try{let e=k.map(a=>`${a}@latest`).join(" "),t=y(),o={pnpm:`pnpm add -D ${e}`,yarn:`yarn add -D ${e}`,npm:`npm install -D ${e}`}[t];i.info(`Installing dependencies: ${o}`),l(o),i.success("Dependencies installed successfully")}catch(e){throw i.error(`Dependency installation failed: ${e.message}`),e}}import{program as R}from"commander";import G from"picocolors";import N from"dayjs";import O from"simple-git";R.command("release").description("git release").action(U);async function U(){console.log(G.green("Release project..."));try{await L(),i.success("Release completed successfully!")}catch(e){i.error(`Release failed: ${e.message}`),process.exit(1)}}async function L(){let e=O(process.cwd());try{let t=N().format("YYYYMMDD");await e.pull(),await e.add("."),await e.commit(t,["--no-verify"]),await e.push("origin"),i.success(`\u63D0\u4EA4\u6210\u529F: ${t}`)}catch(t){i.error(`Git\u64CD\u4F5C\u5931\u8D25: ${t.message}`),process.exit(1)}}D.name(d).version(f,"-v, --version","output the version number");D.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/dev",
3
- "version": "5.3.10",
3
+ "version": "5.3.11",
4
4
  "type": "module",
5
5
  "description": "Development environment dependencies package",
6
6
  "keywords": [