@lntvow/dev 4.2.3 → 4.2.4
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 +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/configs/.gitignore +0 -2
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var j=Object.create;var u=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var I=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of U(o))!F.call(t,i)&&i!==e&&u(t,i,{get:()=>o[i],enumerable:!(n=_(o,i))||n.enumerable});return t};var p=(t,o,e)=>(e=t!=null?j(z(t)):{},I(o||!t||!t.__esModule?u(e,"default",{value:t,enumerable:!0}):e,t));var R=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,d=R();var b=require("child_process"),m=require("fs"),k=require("path"),a=require("commander"),r=p(require("picocolors"),1);var y="@lntvow/dev",v="4.2.
|
|
2
|
+
"use strict";var j=Object.create;var u=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var I=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of U(o))!F.call(t,i)&&i!==e&&u(t,i,{get:()=>o[i],enumerable:!(n=_(o,i))||n.enumerable});return t};var p=(t,o,e)=>(e=t!=null?j(z(t)):{},I(o||!t||!t.__esModule?u(e,"default",{value:t,enumerable:!0}):e,t));var R=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,d=R();var b=require("child_process"),m=require("fs"),k=require("path"),a=require("commander"),r=p(require("picocolors"),1);var y="@lntvow/dev",v="4.2.4";var c=p(require("fs"),1),l=p(require("path"),1),h=require("url"),g=p(require("picocolors"),1),T=(0,h.fileURLToPath)(d),D=l.default.dirname(T),[S]=process.cwd().split("node_modules");console.log("cwd: ",S);function x(t,o){c.default.existsSync(o)||c.default.mkdirSync(o),c.default.readdirSync(t,{withFileTypes:!0}).forEach(n=>{let i=l.default.resolve(t,n.name),s=l.default.resolve(o,n.name);if(n.isDirectory())x(i,s);else{if(c.default.existsSync(s))return;c.default.copyFileSync(i,s)}})}function w(){console.log(g.default.blue("Start copying template files")),x(l.default.resolve(D,"./configs"),S),console.log(g.default.green("Template files copied successfully"))}a.program.name(y).version(v,"-v, --version","output the version number");a.program.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(t=>{console.log(r.default.green("Init project by @lntvow/dev"));let{temp:o,git:e,scripts:n}=t;if(o&&w(),e){console.log(r.default.blue("Start init simple-git-hooks"));let i=(0,b.execSync)("npx simple-git-hooks");console.log(i.toString())}if(n){console.log(r.default.blue("Start init scripts"));try{let i=(0,k.resolve)(process.cwd(),"package.json"),s=JSON.parse((0,m.readFileSync)(i,"utf-8"));s={...s,scripts:{...s.scripts,postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc"}},(0,m.writeFileSync)(i,JSON.stringify(s,null,2)),console.log(r.default.green("Scripts added successfully"))}catch{console.log(r.default.yellow("No package.json file found ignoring scripts"))}}console.log(r.default.yellow(`
|
|
3
3
|
You may need to re-execute the "pnpm install" command`))});a.program.parse();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{execSync as S}from"child_process";import{readFileSync as w,writeFileSync as b}from"fs";import{resolve as k}from"path";import{program as r}from"commander";import o from"picocolors";var a="@lntvow/dev",d="4.2.
|
|
2
|
+
import{execSync as S}from"child_process";import{readFileSync as w,writeFileSync as b}from"fs";import{resolve as k}from"path";import{program as r}from"commander";import o from"picocolors";var a="@lntvow/dev",d="4.2.4";import n from"node:fs";import c from"node:path";import{fileURLToPath as v}from"node:url";import g from"picocolors";var h=v(import.meta.url),x=c.dirname(h),[f]=process.cwd().split("node_modules");console.log("cwd: ",f);function u(l,e){n.existsSync(e)||n.mkdirSync(e),n.readdirSync(l,{withFileTypes:!0}).forEach(s=>{let i=c.resolve(l,s.name),t=c.resolve(e,s.name);if(s.isDirectory())u(i,t);else{if(n.existsSync(t))return;n.copyFileSync(i,t)}})}function y(){console.log(g.blue("Start copying template files")),u(c.resolve(x,"./configs"),f),console.log(g.green("Template files copied successfully"))}r.name(a).version(d,"-v, --version","output the version number");r.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(l=>{console.log(o.green("Init project by @lntvow/dev"));let{temp:e,git:p,scripts:s}=l;if(e&&y(),p){console.log(o.blue("Start init simple-git-hooks"));let i=S("npx simple-git-hooks");console.log(i.toString())}if(s){console.log(o.blue("Start init scripts"));try{let i=k(process.cwd(),"package.json"),t=JSON.parse(w(i,"utf-8"));t={...t,scripts:{...t.scripts,postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc"}},b(i,JSON.stringify(t,null,2)),console.log(o.green("Scripts added successfully"))}catch{console.log(o.yellow("No package.json file found ignoring scripts"))}}console.log(o.yellow(`
|
|
3
3
|
You may need to re-execute the "pnpm install" command`))});r.parse();
|
package/dist/configs/.gitignore
CHANGED