@vef-framework/dev 1.0.111 → 1.0.112
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/es/cli.js +1 -1
- package/es/commitlint-config.js +1 -1
- package/es/config.js +1 -1
- package/es/constants.js +1 -1
- package/es/eslint-config.js +1 -1
- package/es/index.js +1 -1
- package/es/json/monaco.nls.json.js +15920 -300
- package/es/json/monaco.theme.github-light.json.js +349 -1
- package/es/modules.d.js +1 -1
- package/es/plugin-app-config.js +1 -1
- package/es/plugin-conventional-config.js +1 -1
- package/es/plugin-eslint.js +1 -1
- package/es/plugin-html.js +1 -1
- package/es/plugin-icons.js +1 -1
- package/es/plugin-initialization.js +2 -2
- package/es/plugin-injection.js +1 -1
- package/es/plugin-inspect.js +1 -1
- package/es/plugin-monaco-nls.js +2 -2
- package/es/plugin-react-swc.js +1 -1
- package/es/plugin-router.js +1 -1
- package/es/plugin-stylelint.js +1 -1
- package/es/plugin-svgr.js +1 -1
- package/es/plugin-tailwind.js +1 -1
- package/es/plugin-tailwindcss.js +1 -1
- package/es/plugin-tsconfig-paths.js +1 -1
- package/es/plugin-visualizer.js +1 -1
- package/es/plugin-webfont.js +1 -1
- package/es/stylelint-config.js +1 -1
- package/es/tailwind-config.js +1 -1
- package/lib/cli.cjs +1 -1
- package/lib/commitlint-config.cjs +1 -1
- package/lib/config.cjs +1 -1
- package/lib/constants.cjs +1 -1
- package/lib/eslint-config.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/json/monaco.nls.json.cjs +15920 -300
- package/lib/json/monaco.theme.github-light.json.cjs +349 -1
- package/lib/modules.d.cjs +1 -1
- package/lib/plugin-app-config.cjs +1 -1
- package/lib/plugin-conventional-config.cjs +1 -1
- package/lib/plugin-eslint.cjs +1 -1
- package/lib/plugin-html.cjs +1 -1
- package/lib/plugin-icons.cjs +1 -1
- package/lib/plugin-initialization.cjs +2 -2
- package/lib/plugin-injection.cjs +1 -1
- package/lib/plugin-inspect.cjs +1 -1
- package/lib/plugin-monaco-nls.cjs +2 -2
- package/lib/plugin-react-swc.cjs +1 -1
- package/lib/plugin-router.cjs +1 -1
- package/lib/plugin-stylelint.cjs +1 -1
- package/lib/plugin-svgr.cjs +1 -1
- package/lib/plugin-tailwind.cjs +1 -1
- package/lib/plugin-tailwindcss.cjs +1 -1
- package/lib/plugin-tsconfig-paths.cjs +1 -1
- package/lib/plugin-visualizer.cjs +1 -1
- package/lib/plugin-webfont.cjs +1 -1
- package/lib/stylelint-config.cjs +1 -1
- package/lib/tailwind-config.cjs +1 -1
- package/lib/types.cjs +1 -1
- package/package.json +1 -1
- package/template/_package.json +5 -5
package/es/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.112, build time: 2025-03-10T02:36:06.138Z, made by Venus. */import chalk from"chalk";import{program}from"commander";import consola from"consola";import{execa}from"execa";import fsExtra from"fs-extra";import{resolve}from"node:path";import process from"node:process";import ora from"ora";import prompts from"prompts";import{loadConfigFromFile,createServer,build,preview}from"vite";const{exists,readJsonSync,writeFile,readJson,writeJson,copy,readFile,move}=fsExtra,currentDir=process.cwd();function readPackageVersion(){const packageJsonPath=resolve(import.meta.dirname,"../package.json");return readJsonSync(packageJsonPath,{encoding:"utf-8"}).version}const frameworkVersion=readPackageVersion();async function importHoistPatterns(){return(await import("../bin/hoist-patterns.js")).default}function resolveEnvMode(command,userMode){return userMode||(command==="build"?"production":"development")}async function loadVefConfig(configPath,command,mode){const vefConfigPath=resolve(currentDir,configPath||"vef.config.ts");if(!await exists(vefConfigPath))throw consola.error(`Config file not found: ${vefConfigPath}, it is required for VEF Framework`),new Error(`Config file not found: ${vefConfigPath}`);return(await loadConfigFromFile({command,mode},vefConfigPath))?.config??{}}function handleError(phase,error){consola.error(`Error during ${phase}:`,error),process.exit(1)}program.name("vef").description(chalk.magenta("VEF Framework CLI")).addHelpText("before",chalk.blue("VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus.")).addHelpText("before",chalk.bgGreenBright(`Version: ${frameworkVersion}`)).version(frameworkVersion).option("--mode <mode>","Specify running mode (will override default NODE_ENV)"),program.command("dev").description("Start dev server").option("-c, --config <file>","Specify vef config file","vef.config.ts").action(async options=>{try{const mode=resolveEnvMode("serve",program.opts().mode);process.env.NODE_ENV=mode,process.env.VEF_FRAMEWORK_VERSION=frameworkVersion;const config=await loadVefConfig(options.config,"serve",mode),server=await createServer({...config,mode,configFile:!1,logLevel:"info"});await server.listen(),server.printUrls(),server.bindCLIShortcuts({print:!0})}catch(e){handleError("dev server startup",e)}}),program.command("build").description("Build for production").option("-c, --config <file>","Specify vef config file","vef.config.ts").action(async options=>{try{const mode=resolveEnvMode("build",program.opts().mode);process.env.NODE_ENV=mode,process.env.VEF_FRAMEWORK_VERSION=frameworkVersion;const config=await loadVefConfig(options.config,"build",mode);await build({...config,mode,configFile:!1,logLevel:"info"}),consola.success("Build completed successfully!")}catch(e){handleError("build",e)}}),program.command("preview").description("Preview the build").option("-c, --config <file>","Specify vef config file","vef.config.ts").action(async options=>{try{const mode=resolveEnvMode("build",program.opts().mode);process.env.NODE_ENV=mode,process.env.VEF_FRAMEWORK_VERSION=frameworkVersion;const config=await loadVefConfig(options.config,"build",mode),server=await preview({...config,mode,configFile:!1,logLevel:"info"});server.printUrls(),server.bindCLIShortcuts({print:!0})}catch(e){handleError("preview server startup",e)}}),program.command("prepare").description("Sets up the project for development mode").action(async()=>{await exists(resolve(currentDir,".husky"))||((await import("husky")).default(),consola.success("Successfully set up husky")),await exists(resolve(currentDir,".husky/pre-commit"))||(await writeFile(resolve(currentDir,".husky/pre-commit"),"pnpm dlx lint-staged"),consola.success("Successfully set up pre-commit hook")),await exists(resolve(currentDir,".husky/commit-msg"))||(await writeFile(resolve(currentDir,".husky/commit-msg"),"pnpm dlx commitlint --edit $1"),consola.success("Successfully set up commit-msg hook"));const packageJson=await readJson(resolve(currentDir,"package.json"),{encoding:"utf-8"}),{scripts}=packageJson;let changed=!1;scripts.prepare||(scripts.prepare="vef prepare",changed=!0),changed&&(await writeJson(resolve(currentDir,"package.json"),packageJson,{encoding:"utf-8",spaces:2}),consola.success("Successfully set up prepare script and lint-staged"))}),program.command("install").description("Install the dependencies of the project").action(async()=>{const hoistedPatterns=await importHoistPatterns();await execa({cwd:currentDir,stdio:"inherit"})("pnpm",["install",...hoistedPatterns.flatMap(pattern=>["--public-hoist-pattern",pattern])])}),program.command("update").description("Update the dependencies of the vef framework to latest version").action(async()=>{await execa({cwd:currentDir,stdio:"inherit"})("pnpm",["update","@vef-framework/*"])}),program.command("init").description("Initialize an empty VEF project").action(async()=>{console.log(chalk.blue(`Welcome to use the cli tool of VEF Framework
|
|
2
2
|
`));const result=await prompts([{type:"text",name:"appName",message:"What is the name of your app?",validate:value=>typeof value=="string"&&value.trim().length>0?!0:"App name is required"},{type:"text",name:"appTitle",message:"What is the title of your app?",validate:value=>typeof value=="string"&&value.trim().length>0?!0:"App title is required"}]),{appName,appTitle}=result;await copy(resolve(import.meta.dirname,"../template"),resolve(currentDir,appName)),consola.success("Successfully copied template files"),await move(resolve(currentDir,appName,"_gitignore"),resolve(currentDir,appName,".gitignore")),await move(resolve(currentDir,appName,"_tsconfig.json"),resolve(currentDir,appName,"tsconfig.json")),await move(resolve(currentDir,appName,"_package.json"),resolve(currentDir,appName,"package.json"));const packageJson=await readJson(resolve(currentDir,appName,"package.json"),{encoding:"utf-8"});packageJson.name=appName,await writeJson(resolve(currentDir,appName,"package.json"),packageJson,{encoding:"utf-8",spaces:2}),consola.success("Successfully replaced name and title in package.json");const replacedEnvContent=(await readFile(resolve(currentDir,appName,"env/.env"),{encoding:"utf-8"})).replace(/APP_NAME=.*$/m,`APP_NAME=${appName}`).replace(/APP_TITLE=.*$/m,`APP_TITLE=${appTitle}`);await writeFile(resolve(currentDir,appName,"env/.env"),replacedEnvContent),consola.success("Successfully replaced name and title in .env file");const spinner=ora("Initializing git repository...").start();try{await execa`git --version`,await execa({cwd:resolve(currentDir,appName)})`git init`,spinner.succeed("Successfully initialized git repository")}catch(e){spinner.fail("Failed to initialize git repository"),handleError("init",e)}spinner.start("Installing dependencies...");try{const hoistedPatterns=await importHoistPatterns();await execa({cwd:resolve(currentDir,appName)})("pnpm",["install",...hoistedPatterns.flatMap(pattern=>["--public-hoist-pattern",pattern])]),spinner.succeed("Successfully installed dependencies")}catch(e){spinner.fail("Failed to install dependencies"),handleError("init",e)}consola.success(chalk.green(`
|
|
3
3
|
🎉🎉🎉 VEF project created successfully !`)),console.log(chalk.blue(`
|
|
4
4
|
✨ Next steps:`)),console.log(chalk.cyan(` cd ${appName}`)),console.log(chalk.cyan(" pnpm dev"))}),program.parse();/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/commitlint-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.112, build time: 2025-03-10T02:36:06.138Z, made by Venus. */function defineCommitlintConfig(){return{extends:["@commitlint/config-conventional"],formatter:"@commitlint/format"}}/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */export{defineCommitlintConfig};
|
package/es/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.112, build time: 2025-03-10T02:36:06.138Z, made by Venus. */import consola from"consola";import fsExtra from"fs-extra";import{resolve}from"node:path";import{defineConfig as defineConfig$1,loadEnv}from"vite";import{ENV_DIR,ENV_BUILD_PREFIX}from"./constants.js";import{createAppConfigPlugin}from"./plugin-app-config.js";import{createConventionalConfigPlugin}from"./plugin-conventional-config.js";import{createEslintPlugin}from"./plugin-eslint.js";import{createHtmlPlugin}from"./plugin-html.js";import{createIconsPlugin}from"./plugin-icons.js";import{createInitializationPlugin}from"./plugin-initialization.js";import{createInjectionPlugin}from"./plugin-injection.js";import{createInspectPlugin}from"./plugin-inspect.js";import{createMonacoNlsRollupPlugin}from"./plugin-monaco-nls.js";import{createReactSwcPlugin}from"./plugin-react-swc.js";import{createRouterPlugin}from"./plugin-router.js";import{createStylelintPlugin}from"./plugin-stylelint.js";import{createSvgrPlugin}from"./plugin-svgr.js";import{createTailwindPlugin}from"./plugin-tailwind.js";import{createTailwindcssPlugin}from"./plugin-tailwindcss.js";import{createTsconfigPathsPlugin}from"./plugin-tsconfig-paths.js";import{createVisualizerPlugin}from"./plugin-visualizer.js";import{createWebfontPlugin}from"./plugin-webfont.js";const{readJson}=fsExtra;function defineConfig({projectDir,proxies,visualizer=!1,routerHistory="browser",autoCodeSplitting=!0}){return defineConfig$1(async({mode,command})=>{const env=loadEnv(mode,ENV_DIR,ENV_BUILD_PREFIX);Object.keys(env).length>0&&(consola.info("Loaded environment variables:"),console.table(env));const appVersion=await getAppVersion(projectDir);return{plugins:[...command==="build"?[createMonacoNlsRollupPlugin()]:[],createInspectPlugin(),createConventionalConfigPlugin({appVersion,projectDir,basePublicPath:env.VEF_BUILD_BASE_PUBLIC_PATH,outputDir:env.VEF_BUILD_OUTPUT_DIR,serverPort:Number(env.VEF_BUILD_SERVER_PORT),proxies}),createReactSwcPlugin(),createTsconfigPathsPlugin(projectDir),createHtmlPlugin(),createTailwindPlugin(),createTailwindcssPlugin(),createInjectionPlugin(),createAppConfigPlugin({basePublicPath:env.VEF_BUILD_BASE_PUBLIC_PATH,outputDir:env.VEF_BUILD_OUTPUT_DIR,appName:env.VEF_APP_NAME}),createInitializationPlugin(),createIconsPlugin(projectDir),createSvgrPlugin(),createWebfontPlugin(),createRouterPlugin(projectDir,routerHistory,autoCodeSplitting),createEslintPlugin(),createStylelintPlugin(),visualizer?createVisualizerPlugin(projectDir):void 0].filter(Boolean)}})}async function getAppVersion(projectDir){return(await readJson(resolve(projectDir,"package.json"),{encoding:"utf-8"})).version}/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */export{defineConfig};
|
package/es/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.112, build time: 2025-03-10T02:36:06.138Z, made by Venus. */const PUBLIC_DIR="public",ENV_DIR="env",ASSETS_DIR="assets",ENV_APP_PREFIX="VEF_APP_",ENV_BUILD_PREFIX="VEF_BUILD_",SRC_DIR="src",DEFAULT_OUTPUT_DIR="dist",DEFAULT_SERVER_PORT=3833,DEFAULT_APP_NAME="APP",PAGES_DIR="pages",ROUTER_DIR="router";/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */export{ASSETS_DIR,DEFAULT_APP_NAME,DEFAULT_OUTPUT_DIR,DEFAULT_SERVER_PORT,ENV_APP_PREFIX,ENV_BUILD_PREFIX,ENV_DIR,PAGES_DIR,PUBLIC_DIR,ROUTER_DIR,SRC_DIR};
|
package/es/eslint-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.112, build time: 2025-03-10T02:36:06.138Z, made by Venus. */import{antfu}from"@antfu/eslint-config";import pluginRouter from"@tanstack/eslint-plugin-router";function defineEslintConfig(){return antfu({ignores:["**/node_modules","**/dist","**/public"],stylistic:{indent:2,jsx:!0,quotes:"double",semi:!0,overrides:{"style/line-comment-position":["error",{position:"above"}],"style/jsx-self-closing-comp":["error",{component:!0,html:!0}],"style/jsx-newline":["error",{prevent:!0,allowMultilines:!0}],"style/jsx-props-no-multi-spaces":"error","style/jsx-sort-props":["error",{callbacksLast:!0,shorthandFirst:!0,shorthandLast:!1,multiline:"last",ignoreCase:!0,noSortAlphabetically:!1,reservedFirst:["key","ref"]}],"style/newline-per-chained-call":["error",{ignoreChainWithDepth:3}],"style/object-property-newline":"error","style/brace-style":["error","1tbs"],"style/arrow-parens":["error","as-needed"],"style/multiline-comment-style":["error","separate-lines",{checkJSDoc:!1}],"style/implicit-arrow-linebreak":["error","beside"],"style/no-extra-semi":"error","style/array-element-newline":["error",{consistent:!0,multiline:!0,minItems:7}],"style/function-call-argument-newline":["error","consistent"],"style/padding-line-between-statements":["error",{blankLine:"always",prev:"*",next:["block","multiline-block-like","type","interface","enum","function","function-overload"]},{blankLine:"always",prev:["block","multiline-block-like","type","interface","enum","function","function-overload"],next:"*"}],"style/jsx-pascal-case":["error",{allowAllCaps:!1,allowLeadingUnderscore:!1,allowNamespace:!1,ignore:[]}],"style/switch-colon-spacing":["error",{before:!1,after:!0}],"style/object-curly-newline":["error",{ObjectExpression:{multiline:!0,consistent:!0,minProperties:3},ObjectPattern:{multiline:!0,consistent:!0,minProperties:3},ImportDeclaration:{consistent:!0,multiline:!0},ExportDeclaration:{consistent:!0,multiline:!0}}],"style/no-extra-parens":["error","all",{nestedBinaryExpressions:!1,ternaryOperandBinaryExpressions:!1,ignoreJSX:"multi-line"}]}},javascript:{overrides:{"no-duplicate-imports":"off","prefer-object-spread":"error","func-style":["error","declaration",{allowArrowFunctions:!0}],curly:["error","all"],"no-useless-escape":"error","no-useless-concat":"error","no-unused-private-class-members":"error","no-unsafe-optional-chaining":"error","no-dupe-else-if":"error","no-eq-null":"error","no-extra-label":"error","no-negated-condition":"error","no-invalid-this":"error","arrow-body-style":["error","as-needed"],"prefer-object-has-own":"error","prefer-numeric-literals":"error","prefer-named-capture-group":"error","prefer-destructuring":"error","object-shorthand":"error","require-atomic-updates":"error","require-await":"error",camelcase:["error",{properties:"always",ignoreGlobals:!0}],"no-promise-executor-return":["error",{allowVoid:!0}],"sort-imports":"off","no-console":"off"}},typescript:{overrides:{"ts/no-unused-expressions":["error",{enforceForJSX:!0}],"ts/no-unused-vars":["error",{args:"after-used",caughtErrors:"all",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0}],"ts/array-type":["error",{default:"array-simple",readonly:"array-simple"}],"ts/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow"}],"ts/consistent-type-definitions":["error","interface"],"ts/max-params":["error",{max:5}]}},react:{overrides:{"react-naming-convention/component-name":["error","PascalCase"],"react-naming-convention/filename-extension":["error",{allow:"as-needed",extensions:[".tsx"]}],"react-hooks-extra/no-redundant-custom-hook":"error","react-hooks-extra/no-unnecessary-use-memo":"error","react-hooks-extra/no-unnecessary-use-callback":"error","react-naming-convention/use-state":"error","react-refresh/only-export-components":"error","react-hooks/exhaustive-deps":["error",{additionalHooks:"^use(Deep|Shallow)"}],"react/no-clone-element":"off","react/no-class-component":"error","react/no-children-prop":"off","react/no-children-to-array":"off","react/no-children-for-each":"off","react/no-children-count":"off"}},vue:!1,jsx:!0,regexp:!0,jsonc:!0,yaml:!0,toml:!0,markdown:{overrides:{"markdown/fenced-code-language":"error","markdown/no-duplicate-headings":"error","markdown/no-empty-links":"error"}},test:!0,formatters:{markdown:"prettier",prettierOptions:{singleQuote:!1,semi:!0,tabWidth:2,useTabs:!1,trailingComma:"all",endOfLine:"lf",printWidth:160,proseWrap:"never",arrowParens:"avoid",htmlWhitespaceSensitivity:"strict",bracketSameLine:!0,bracketSpacing:!0,quoteProps:"as-needed",jsxSingleQuote:!1,singleAttributePerLine:!1}}},{rules:{"unicorn/filename-case":["error",{case:"kebabCase",ignore:["README.md"]}],"unicorn/prefer-date-now":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-object-from-entries":"error","unicorn/prefer-default-parameters":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-index-of":"error","unicorn/prefer-array-some":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/no-array-push-push":"error","unicorn/no-empty-file":"error","unicorn/no-array-for-each":"error","unicorn/no-for-loop":"error","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-polyfills":"error","unicorn/no-useless-undefined":"error","unicorn/no-useless-switch-case":"error","unicorn/no-useless-spread":"error","unicorn/no-console-spaces":"error","unicorn/no-unused-properties":"error","unicorn/no-useless-promise-resolve-reject":"error","import/order":"off","import/first":"error","import/export":"error","import/no-named-as-default":"off","import/no-named-default":"off","perfectionist/sort-imports":["error",{type:"natural"}],"perfectionist/sort-exports":["error",{type:"natural"}],"perfectionist/sort-named-imports":["error",{type:"natural",groupKind:"values-first"}],"perfectionist/sort-named-exports":["error",{type:"natural",groupKind:"values-first"}],"eslint-comments/no-unlimited-disable":"off"}},{ignores:["**/*.md","**/*.md/*.{ts,tsx}","**/src/pages/__root.{ts,tsx}"],rules:{"react-naming-convention/filename":["error",{rule:"kebab-case"}]}},...pluginRouter.configs["flat/recommended"])}/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */export{defineEslintConfig};
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.112, build time: 2025-03-10T02:36:06.138Z, made by Venus. */import{defineCommitlintConfig}from"./commitlint-config.js";import{defineConfig}from"./config.js";import{defineEslintConfig}from"./eslint-config.js";import{defineStylelintConfig}from"./stylelint-config.js";import{defineTailwindConfig}from"./tailwind-config.js";/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */export{defineCommitlintConfig,defineConfig,defineEslintConfig,defineStylelintConfig,defineTailwindConfig};
|