@vef-framework/dev 2.0.5 → 2.0.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/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! @vef-framework/dev v2.0.5 made by Venus | 2025-11-26T04:10:49.173Z */
2
- import{resolve as t}from"node:path";import g from"node:process";import o from"chalk";import{program as p}from"commander";import n from"consola";import{execa as m}from"execa";import j from"fs-extra";import x from"ora";import E from"prompts";const{exists:d,readJsonSync:S,writeFile:u,readJson:y,writeJson:w,copy:F,readFile:P,move:f}=j,s=g.cwd();function V(){const a=t(import.meta.dirname,"../package.json");return S(a,{encoding:"utf-8"}).version}const k=V();function h(a,e){n.error(`Error during ${a}:`,e),g.exit(1)}p.name("vef").description(o.magenta("VEF Framework CLI")).addHelpText("before",o.blue("VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus.")).addHelpText("before",o.bgGreenBright(`Version: ${k}`)).version(k).option("--mode <mode>","Specify running mode (will override default NODE_ENV)"),p.command("prepare").description("Sets up the project for development mode").action(async()=>{if(!await d(t(s,".husky"))){const{default:l}=await import("husky");l(),n.success("Successfully set up husky")}await d(t(s,".husky/pre-commit"))||(await u(t(s,".husky/pre-commit"),"pnpm dlx lint-staged"),n.success("Successfully set up pre-commit hook")),await d(t(s,".husky/commit-msg"))||(await u(t(s,".husky/commit-msg"),"pnpm dlx commitlint --edit $1"),n.success("Successfully set up commit-msg hook"));const a=await y(t(s,"package.json"),{encoding:"utf-8"}),{scripts:e}=a;let r=!1;e.prepare||(e.prepare="vef prepare",r=!0),a["lint-staged"]||(a["lint-staged"]={"*.{js,ts,tsx,json,jsonc,md,mdx,html}":"eslint --fix","*.{css,scss}":"stylelint --fix"},r=!0),r&&(await w(t(s,"package.json"),a,{encoding:"utf-8",spaces:2}),n.success("Successfully set up prepare script and lint-staged"))}),p.command("update").description("Update the dependencies of the vef framework to latest version").action(async()=>{await m({cwd:s,stdio:"inherit"})("pnpm",["update","@vef-framework/*"])}),p.command("init").description("Initialize an empty VEF project").action(async()=>{console.log(o.blue(`Welcome to use the cli tool of VEF Framework
1
+ /*! @vef-framework/dev v2.0.7 made by Venus | 2025-11-26T04:22:07.763Z */
2
+ import{resolve as t}from"node:path";import g from"node:process";import o from"chalk";import{program as p}from"commander";import n from"consola";import{execa as m}from"execa";import j from"fs-extra";import x from"ora";import E from"prompts";const{exists:d,readJsonSync:S,writeFile:u,readJson:y,writeJson:w,copy:F,readFile:P,move:f}=j,s=g.cwd();function V(){const a=t(import.meta.dirname,"../../package.json");return S(a,{encoding:"utf-8"}).version}const k=V();function h(a,e){n.error(`Error during ${a}:`,e),g.exit(1)}p.name("vef").description(o.magenta("VEF Framework CLI")).addHelpText("before",o.blue("VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus.")).addHelpText("before",o.bgGreenBright(`Version: ${k}`)).version(k).option("--mode <mode>","Specify running mode (will override default NODE_ENV)"),p.command("prepare").description("Sets up the project for development mode").action(async()=>{if(!await d(t(s,".husky"))){const{default:l}=await import("husky");l(),n.success("Successfully set up husky")}await d(t(s,".husky/pre-commit"))||(await u(t(s,".husky/pre-commit"),"pnpm dlx lint-staged"),n.success("Successfully set up pre-commit hook")),await d(t(s,".husky/commit-msg"))||(await u(t(s,".husky/commit-msg"),"pnpm dlx commitlint --edit $1"),n.success("Successfully set up commit-msg hook"));const a=await y(t(s,"package.json"),{encoding:"utf-8"}),{scripts:e}=a;let r=!1;e.prepare||(e.prepare="vef prepare",r=!0),a["lint-staged"]||(a["lint-staged"]={"*.{js,ts,tsx,json,jsonc,md,mdx,html}":"eslint --fix","*.{css,scss}":"stylelint --fix"},r=!0),r&&(await w(t(s,"package.json"),a,{encoding:"utf-8",spaces:2}),n.success("Successfully set up prepare script and lint-staged"))}),p.command("update").description("Update the dependencies of the vef framework to latest version").action(async()=>{await m({cwd:s,stdio:"inherit"})("pnpm",["update","@vef-framework/*"])}),p.command("init").description("Initialize an empty VEF project").action(async()=>{console.log(o.blue(`Welcome to use the cli tool of VEF Framework
3
3
  `));const a=await E([{type:"text",name:"appName",message:"What is the name of your app?",validate:i=>typeof i=="string"&&i.trim().length>0?!0:"App name is required"},{type:"text",name:"appTitle",message:"What is the title of your app?",validate:i=>typeof i=="string"&&i.trim().length>0?!0:"App title is required"}]),{appName:e,appTitle:r}=a;await F(t(import.meta.dirname,"../template"),t(s,e)),n.success("Successfully copied template files"),await f(t(s,e,"_gitignore"),t(s,e,".gitignore")),await f(t(s,e,"_tsconfig.json"),t(s,e,"tsconfig.json")),await f(t(s,e,"_package.json"),t(s,e,"package.json"));const l=await y(t(s,e,"package.json"),{encoding:"utf-8"});l.name=e,await w(t(s,e,"package.json"),l,{encoding:"utf-8",spaces:2}),n.success("Successfully replaced name and title in package.json");const v=(await P(t(s,e,"env/.env"),{encoding:"utf-8"})).replace(/APP_NAME=.*$/m,`APP_NAME=${e}`).replace(/APP_TITLE=.*$/m,`APP_TITLE=${r}`);await u(t(s,e,"env/.env"),v),n.success("Successfully replaced name and title in .env file");const c=x("Initializing git repository...").start();try{await m`git --version`,await m({cwd:t(s,e)})`git init`,c.succeed("Successfully initialized git repository")}catch(i){c.fail("Failed to initialize git repository"),h("init",i)}c.start("Installing dependencies...");try{await m({cwd:t(s,e)})("pnpm",["install"]),c.succeed("Successfully installed dependencies")}catch(i){c.fail("Failed to install dependencies"),h("init",i)}n.success(o.green(`
4
4
  \u{1F389}\u{1F389}\u{1F389} VEF project created successfully !`)),console.log(o.blue(`
5
5
  \u2728 Next steps:`)),console.log(o.cyan(` cd ${e}`)),console.log(o.cyan(" pnpm dev"))}),p.parse();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vef-framework/dev",
3
3
  "type": "module",
4
- "version": "2.0.5",
4
+ "version": "2.0.7",
5
5
  "private": false,
6
6
  "description": "Dev tools for VEF framework",
7
7
  "author": {
@@ -96,6 +96,7 @@
96
96
  "eslint-plugin-regexp": "^2.10.0",
97
97
  "eslint-plugin-unicorn": "^62.0.0",
98
98
  "eslint-plugin-unused-imports": "^4.3.0",
99
+ "execa": "^9.6.0",
99
100
  "fs-extra": "^11.3.2",
100
101
  "html-minifier-terser": "^7.2.0",
101
102
  "ora": "^9.0.0",