@lntvow/dev 4.1.4 → 4.1.6
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/README.md +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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.1.6";var l=p(require("fs"),1),c=p(require("path"),1),h=require("url"),g=p(require("picocolors"),1),T=(0,h.fileURLToPath)(d),D=c.default.dirname(T),[S]=process.cwd().split("node_modules");console.log("cwd: ",S);function x(t,o){l.default.existsSync(o)||l.default.mkdirSync(o),l.default.readdirSync(t,{withFileTypes:!0}).forEach(n=>{let i=c.default.resolve(t,n.name),s=c.default.resolve(o,n.name);if(n.isDirectory())x(i,s);else{if(l.default.existsSync(s))return;l.default.copyFileSync(i,s)}})}function w(){console.log(g.default.blue("Start copying template files")),x(c.default.resolve(D,"./template"),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:{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",...s.scripts}},(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
|
|
3
|
-
You may need to re-execute the "pnpm install" command`))});
|
|
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 c}from"commander";import o from"picocolors";var a="@lntvow/dev",d="4.1.6";import n from"node:fs";import r from"node:path";import{fileURLToPath as v}from"node:url";import g from"picocolors";var h=v(import.meta.url),x=r.dirname(h),[u]=process.cwd().split("node_modules");console.log("cwd: ",u);function f(l,e){n.existsSync(e)||n.mkdirSync(e),n.readdirSync(l,{withFileTypes:!0}).forEach(s=>{let i=r.resolve(l,s.name),t=r.resolve(e,s.name);if(s.isDirectory())f(i,t);else{if(n.existsSync(t))return;n.copyFileSync(i,t)}})}function y(){console.log(g.blue("Start copying template files")),f(r.resolve(x,"./template"),u),console.log(g.green("Template files copied successfully"))}c.name(a).version(d,"-v, --version","output the version number");c.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:{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",...t.scripts}},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
|
+
You may need to re-execute the "pnpm install" command`))});c.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/dev",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "开发环境依赖包",
|
|
6
6
|
"keywords": [
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"commitizen": "^4.3.1",
|
|
26
26
|
"cz-conventional-changelog": "^3.3.0",
|
|
27
27
|
"lint-staged": "^15.5.1",
|
|
28
|
+
"npm-run-all": "^4.1.5",
|
|
28
29
|
"picocolors": "^1.1.1",
|
|
29
30
|
"rimraf": "^6.0.1",
|
|
30
31
|
"simple-git-hooks": "^2.12.1"
|
|
@@ -36,13 +37,12 @@
|
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"postinstall": "simple-git-hooks",
|
|
39
|
-
"check": "tsc --noEmit",
|
|
40
|
-
"lint": "run-p lint:eslint lint:tsc",
|
|
41
40
|
"rimraf": "rimraf ./node_modules/",
|
|
42
41
|
"commit": "git add . && git-cz && git push",
|
|
43
42
|
"release": "git add . && bumpp package.json --all --no-tag --no-print-commits",
|
|
44
43
|
"lint:eslint": "eslint \"src/**/*.{js,jsx,ts,tsx,vue}\" --fix",
|
|
45
44
|
"lint:tsc": "tsc --noEmit",
|
|
45
|
+
"lint": "run-p lint:eslint lint:tsc",
|
|
46
46
|
"dev": "tsx src/cli.ts",
|
|
47
47
|
"build": "tsup && tsx scripts/copy.ts"
|
|
48
48
|
}
|