@lntvow/dev 4.4.15 → 4.4.17

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 lntvow
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/cli.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var D=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var F=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of R(e))!Y.call(t,i)&&i!==n&&f(t,i,{get:()=>e[i],enumerable:!(s=z(e,i))||s.enumerable});return t};var r=(t,e,n)=>(n=t!=null?D(U(t)):{},F(e||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t));var I=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,d=I();var j=require("child_process"),a=require("fs"),b=require("path"),m=require("commander"),o=r(require("picocolors"),1),u=r(require("dayjs"),1),k=r(require("dayjs/plugin/timezone.js"),1),_=r(require("simple-git"),1);var v="@lntvow/dev",h="4.4.15";var l=r(require("fs"),1),p=r(require("path"),1),w=require("url"),g=r(require("picocolors"),1),M=(0,w.fileURLToPath)(d),T=p.default.dirname(M);function S(t,e){l.default.existsSync(e)||l.default.mkdirSync(e),l.default.readdirSync(t,{withFileTypes:!0}).forEach(s=>{let i=p.default.resolve(t,s.name),c=p.default.resolve(e,s.name);if(s.isDirectory())S(i,c);else{if(l.default.existsSync(c))return;l.default.copyFileSync(i,c)}})}function x(){console.log(g.default.blue("Start copying template files")),S(p.default.resolve(T,"./configs"),process.cwd()),console.log(g.default.green("Template files copied successfully"))}u.default.extend(k.default);console.log(o.default.blue(`Cwd is ${process.cwd()}`));m.program.name(v).version(h,"-v, --version","output the version number");m.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(o.default.green("Init project by @lntvow/dev"));let{temp:e,git:n,scripts:s}=t;if(e&&x(),n){console.log(o.default.blue("Start init simple-git-hooks"));let i=(0,j.execSync)("npx simple-git-hooks");console.log(i.toString())}if(s){console.log(o.default.blue("Start init scripts"));try{let i=(0,b.resolve)(process.cwd(),"package.json"),c=JSON.parse((0,a.readFileSync)(i,"utf-8"));c={...c,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u && pnpm install",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",...c.scripts}},(0,a.writeFileSync)(i,JSON.stringify(c,null,2)),console.log(o.default.green("Scripts added successfully"))}catch{console.log(o.default.yellow("No package.json file found ignoring scripts"))}}console.log(o.default.yellow(`
3
- You may need to re-execute the "pnpm install" command`))});m.program.command("release").description("git release").action(async()=>{console.log(o.default.green("Release project...")),await C()});m.program.parse();async function C(){let t=(0,_.default)(),e=(0,u.default)().format("YYYYMMDD");await t.cwd(process.cwd()),await t.pull(),await t.add("."),await t.commit(e,"--no-verify"),await t.push("origin"),console.log(o.default.green(`Changes committed with message: ${e}`))}
2
+ "use strict";var z=Object.create;var f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var I=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of R(e))!Y.call(t,i)&&i!==n&&f(t,i,{get:()=>e[i],enumerable:!(s=D(e,i))||s.enumerable});return t};var c=(t,e,n)=>(n=t!=null?z(U(t)):{},I(e||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t));var M=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,d=M();var j=require("child_process"),a=require("fs"),x=require("path"),p=require("commander"),o=c(require("picocolors"),1),u=c(require("dayjs"),1),k=c(require("dayjs/plugin/timezone.js"),1),_=c(require("simple-git"),1);var v="@lntvow/dev",h="4.4.17";var r=c(require("fs"),1),l=c(require("path"),1),w=require("url"),g=c(require("picocolors"),1),T=(0,w.fileURLToPath)(d),C=l.default.dirname(T);function S(t,e){if(r.default.statSync(t).isDirectory()){if(l.default.basename(t)==="node_modules")return;r.default.mkdirSync(e,{recursive:!0}),r.default.readdirSync(t).forEach(s=>{S(l.default.resolve(t,s),l.default.resolve(e,s))})}else{if(r.default.existsSync(e))return;r.default.copyFileSync(t,e)}}function b(){console.log(g.default.blue("Start copying template files")),S(l.default.resolve(C,"./configs"),process.cwd()),console.log(g.default.green("Template files copied successfully"))}u.default.extend(k.default);console.log(o.default.blue(`Cwd is ${process.cwd()}`));p.program.name(v).version(h,"-v, --version","output the version number");p.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(o.default.green("Init project by @lntvow/dev"));let{temp:e,git:n,scripts:s}=t;if(e&&b(),n){console.log(o.default.blue("Start init simple-git-hooks"));let i=(0,j.execSync)("npx simple-git-hooks");console.log(i.toString())}if(s){console.log(o.default.blue("Start init scripts"));try{let i=(0,x.resolve)(process.cwd(),"package.json"),m=JSON.parse((0,a.readFileSync)(i,"utf-8"));m={...m,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u && pnpm install",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",...m.scripts}},(0,a.writeFileSync)(i,JSON.stringify(m,null,2)),console.log(o.default.green("Scripts added successfully"))}catch{console.log(o.default.yellow("No package.json file found ignoring scripts"))}}console.log(o.default.yellow(`
3
+ You may need to re-execute the "pnpm install" command`))});p.program.command("release").description("git release").action(async()=>{console.log(o.default.green("Release project...")),await E()});p.program.parse();async function E(){let t=(0,_.default)(),e=(0,u.default)().format("YYYYMMDD");await t.cwd(process.cwd()),await t.pull(),await t.add("."),await t.commit(e,"--no-verify"),await t.push("origin"),console.log(o.default.green(`Changes committed with message: ${e}`))}
package/dist/cli.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{execSync as x}from"child_process";import{readFileSync as S,writeFileSync as j}from"fs";import{resolve as b}from"path";import{program as r}from"commander";import i from"picocolors";import y from"dayjs";import k from"dayjs/plugin/timezone.js";import D from"simple-git";var a="@lntvow/dev",d="4.4.15";import c from"fs";import l from"path";import{fileURLToPath as v}from"url";import g from"picocolors";var h=v(import.meta.url),w=l.dirname(h);function u(t,o){c.existsSync(o)||c.mkdirSync(o),c.readdirSync(t,{withFileTypes:!0}).forEach(s=>{let n=l.resolve(t,s.name),e=l.resolve(o,s.name);if(s.isDirectory())u(n,e);else{if(c.existsSync(e))return;c.copyFileSync(n,e)}})}function f(){console.log(g.blue("Start copying template files")),u(l.resolve(w,"./configs"),process.cwd()),console.log(g.green("Template files copied successfully"))}y.extend(k);console.log(i.blue(`Cwd is ${process.cwd()}`));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(t=>{console.log(i.green("Init project by @lntvow/dev"));let{temp:o,git:p,scripts:s}=t;if(o&&f(),p){console.log(i.blue("Start init simple-git-hooks"));let n=x("npx simple-git-hooks");console.log(n.toString())}if(s){console.log(i.blue("Start init scripts"));try{let n=b(process.cwd(),"package.json"),e=JSON.parse(S(n,"utf-8"));e={...e,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u && pnpm install",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",...e.scripts}},j(n,JSON.stringify(e,null,2)),console.log(i.green("Scripts added successfully"))}catch{console.log(i.yellow("No package.json file found ignoring scripts"))}}console.log(i.yellow(`
3
- You may need to re-execute the "pnpm install" command`))});r.command("release").description("git release").action(async()=>{console.log(i.green("Release project...")),await _()});r.parse();async function _(){let t=D(),o=y().format("YYYYMMDD");await t.cwd(process.cwd()),await t.pull(),await t.add("."),await t.commit(o,"--no-verify"),await t.push("origin"),console.log(i.green(`Changes committed with message: ${o}`))}
2
+ import{execSync as S}from"child_process";import{readFileSync as b,writeFileSync as j}from"fs";import{resolve as x}from"path";import{program as r}from"commander";import o from"picocolors";import y from"dayjs";import k from"dayjs/plugin/timezone.js";import _ from"simple-git";var a="@lntvow/dev",g="4.4.17";import e from"fs";import n from"path";import{fileURLToPath as v}from"url";import d from"picocolors";var h=v(import.meta.url),w=n.dirname(h);function u(t,i){if(e.statSync(t).isDirectory()){if(n.basename(t)==="node_modules")return;e.mkdirSync(i,{recursive:!0}),e.readdirSync(t).forEach(s=>{u(n.resolve(t,s),n.resolve(i,s))})}else{if(e.existsSync(i))return;e.copyFileSync(t,i)}}function f(){console.log(d.blue("Start copying template files")),u(n.resolve(w,"./configs"),process.cwd()),console.log(d.green("Template files copied successfully"))}y.extend(k);console.log(o.blue(`Cwd is ${process.cwd()}`));r.name(a).version(g,"-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(t=>{console.log(o.green("Init project by @lntvow/dev"));let{temp:i,git:p,scripts:s}=t;if(i&&f(),p){console.log(o.blue("Start init simple-git-hooks"));let l=S("npx simple-git-hooks");console.log(l.toString())}if(s){console.log(o.blue("Start init scripts"));try{let l=x(process.cwd(),"package.json"),c=JSON.parse(b(l,"utf-8"));c={...c,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",ncu:"ncu -u && pnpm install",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",...c.scripts}},j(l,JSON.stringify(c,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`))});r.command("release").description("git release").action(async()=>{console.log(o.green("Release project...")),await z()});r.parse();async function z(){let t=_(),i=y().format("YYYYMMDD");await t.cwd(process.cwd()),await t.pull(),await t.add("."),await t.commit(i,"--no-verify"),await t.push("origin"),console.log(o.green(`Changes committed with message: ${i}`))}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/dev",
3
- "version": "4.4.15",
3
+ "version": "4.4.17",
4
4
  "type": "module",
5
5
  "description": "Development environment dependencies package",
6
6
  "keywords": [
@@ -23,7 +23,7 @@
23
23
  "@commitlint/cli": "^19.8.1",
24
24
  "@commitlint/config-conventional": "^19.8.1",
25
25
  "@lntvow/eslint-config": "^9.24.5",
26
- "bumpp": "^10.1.1",
26
+ "bumpp": "^10.2.0",
27
27
  "commander": "^14.0.0",
28
28
  "commitizen": "^4.3.1",
29
29
  "cz-conventional-changelog": "^3.3.0",
@@ -40,12 +40,12 @@
40
40
  "scripts": {
41
41
  "postinstall": "simple-git-hooks",
42
42
  "rimraf": "rimraf ./node_modules/",
43
+ "ncu": "ncu -u && pnpm install",
43
44
  "commit": "git add . && git-cz && git push",
44
45
  "release": "git add . && bumpp package.json --all --no-tag --no-print-commits",
45
46
  "lint:eslint": "eslint \"src/**/*.{js,jsx,ts,tsx,vue}\" --fix",
46
47
  "lint:tsc": "tsc --noEmit",
47
48
  "lint": "run-p lint:eslint lint:tsc",
48
- "ncu": "ncu -u && pnpm install",
49
49
  "dev": "tsx src/cli.ts",
50
50
  "build": "tsup && tsx scripts/copy.ts"
51
51
  }