@vef-framework-react/dev 2.4.4 → 2.6.0
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/cjs/index.cjs +1 -1
- package/dist/cjs/lint/commitlint.cjs +1 -1
- package/dist/cjs/lint/eslint.cjs +1 -1
- package/dist/cjs/lint/index.cjs +1 -1
- package/dist/cjs/lint/no-legacy-middle-size.cjs +1 -0
- package/dist/cjs/lint/stylelint.cjs +1 -1
- package/dist/cjs/lint/tanstack.cjs +1 -0
- package/dist/cli/index.js +1 -1
- package/dist/es/lint/commitlint.js +2 -13
- package/dist/es/lint/eslint.js +16 -753
- package/dist/es/lint/no-legacy-middle-size.js +53 -0
- package/dist/es/lint/stylelint.js +7 -64
- package/dist/es/lint/tanstack.js +6 -0
- package/dist/types/cli/commands/init.test.d.ts +1 -0
- package/dist/types/code-generation/dictionary/core.test.d.ts +1 -0
- package/dist/types/code-generation/dictionary/render.test.d.ts +1 -0
- package/dist/types/lint/commitlint.d.ts +1 -2
- package/dist/types/lint/eslint.d.ts +9 -1
- package/dist/types/lint/no-legacy-middle-size.d.ts +10 -0
- package/dist/types/lint/stylelint.d.ts +7 -1
- package/dist/types/lint/tanstack.d.ts +7 -0
- package/package.json +31 -61
- package/types.d.ts +2 -2
- package/dist/cjs/lint/custom-react-rules.cjs +0 -1
- package/dist/es/lint/custom-react-rules.js +0 -118
- package/dist/types/lint/custom-react-rules.d.ts +0 -30
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./code-generation/dictionary/errors.cjs"),e=require("./code-generation/dictionary/render.cjs"),r=require("./code-generation/dictionary/core.cjs"),n=require("./code-generation/dictionary/types.cjs"),t=require("./lint/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./code-generation/dictionary/errors.cjs"),e=require("./code-generation/dictionary/render.cjs"),r=require("./code-generation/dictionary/core.cjs"),n=require("./code-generation/dictionary/types.cjs"),t=require("./lint/eslint.cjs"),o=require("./lint/stylelint.cjs"),f=require("./vite/config.cjs");let u=require("@coldsmirk/commitlint-config"),d=require("recast");exports.CodeGenerationValidationError=i.CodeGenerationValidationError;exports.DICTIONARY_AUGMENT_TARGET=e.DICTIONARY_AUGMENT_TARGET;exports.defineCodeGenerationConfig=n.defineCodeGenerationConfig;Object.defineProperty(exports,"defineCommitlintConfig",{enumerable:!0,get:function(){return u.defineCommitlintConfig}});exports.defineEslintConfig=t.defineEslintConfig;exports.defineStylelintConfig=o.defineStylelintConfig;exports.defineViteConfig=f.defineViteConfig;exports.generateDictionaryKeys=r.generateDictionaryKeys;exports.renderDictionaryKeysFile=e.renderDictionaryKeysFile;Object.defineProperty(exports,"types",{enumerable:!0,get:function(){return d.types}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let
|
|
1
|
+
let i=require("@coldsmirk/commitlint-config");
|
package/dist/cjs/lint/eslint.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../_internal/_rolldown/runtime.cjs"),s=require("./custom-react-rules.cjs");let i=require("@eslint-community/eslint-plugin-eslint-comments/configs");i=e.__toESM(i,1);let a=require("@eslint-react/eslint-plugin");a=e.__toESM(a,1);let l=require("@eslint/js");l=e.__toESM(l,1);let c=require("@stylistic/eslint-plugin");c=e.__toESM(c,1);let u=require("@tanstack/eslint-plugin-query");u=e.__toESM(u,1);let p=require("@tanstack/eslint-plugin-router");p=e.__toESM(p,1);let f=require("eslint-config-flat-gitignore");f=e.__toESM(f,1);let d=require("eslint-plugin-antfu");d=e.__toESM(d,1);let t=require("eslint-plugin-format");t=e.__toESM(t,1);let m=require("eslint-plugin-import-lite");m=e.__toESM(m,1);let y=require("eslint-plugin-jsdoc");y=e.__toESM(y,1);let g=require("eslint-plugin-perfectionist");g=e.__toESM(g,1);let _=require("eslint-plugin-react-dom");_=e.__toESM(_,1);let b=require("eslint-plugin-react-hooks");b=e.__toESM(b,1);let w=require("eslint-plugin-react-jsx");w=e.__toESM(w,1);let v=require("eslint-plugin-react-naming-convention");v=e.__toESM(v,1);let x=require("eslint-plugin-react-web-api");x=e.__toESM(x,1);let S=require("eslint-plugin-regexp");S=e.__toESM(S,1);let h=require("eslint-plugin-unicorn");h=e.__toESM(h,1);let k=require("eslint-plugin-unused-imports");k=e.__toESM(k,1);let C=require("eslint/config"),o=require("typescript-eslint");o=e.__toESM(o,1);var U={arrowParens:"avoid",bracketSameLine:!1,bracketSpacing:!0,endOfLine:"lf",htmlWhitespaceSensitivity:"strict",jsxSingleQuote:!1,objectWrap:"preserve",printWidth:120,proseWrap:"never",quoteProps:"as-needed",semi:!0,singleAttributePerLine:!1,singleQuote:!1,tabWidth:2,trailingComma:"none",useTabs:!1},R={"accessor-pairs":["error",{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":["error",{allowImplicit:!0}],"arrow-body-style":["error","as-needed",{requireReturnForObjectLiteral:!0}],"block-scoped-var":"error",camelcase:"off",curly:["error","all"],"default-case-last":"error","dot-notation":["error",{allowKeywords:!0}],eqeqeq:["error","smart"],"func-style":["error","declaration",{allowArrowFunctions:!0}],"new-cap":["error",{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":"error","no-caller":"error","no-cond-assign":["error","always"],"no-empty":["error",{allowEmptyCatch:!0}],"no-eq-null":"error","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-implied-eval":"error","no-invalid-this":"error","no-iterator":"error","no-labels":["error",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-obj-calls":"error","no-octal-escape":"error","no-promise-executor-return":["error",{allowVoid:!0}],"no-proto":"error","no-restricted-globals":["error",{message:"Use `globalThis` instead.",name:"global"},{message:"Use `globalThis` instead.",name:"self"}],"no-restricted-properties":["error",{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:"__proto__"},{message:"Use `Object.defineProperty` instead.",property:"__defineGetter__"},{message:"Use `Object.defineProperty` instead.",property:"__defineSetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupGetter__"},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:"__lookupSetter__"}],"no-restricted-syntax":["error","TSEnumDeclaration[const=true]","TSExportAssignment",{selector:"JSXAttribute[name.name='ref'][value.type='Literal']",message:"Use callback refs or useRef instead of string refs."},{selector:"JSXAttribute[name.name='ref'] > JSXExpressionContainer > Literal",message:"Use callback refs or useRef instead of string refs."},{selector:"JSXAttribute[name.name='ref'] > JSXExpressionContainer > TemplateLiteral",message:"Use callback refs or useRef instead of string refs."}],"no-self-compare":"error","no-sequences":"error","no-template-curly-in-string":"error","no-throw-literal":"error","no-undef-init":"error","no-unmodified-loop-condition":"error","no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-unreachable":"error","no-unreachable-loop":"error","no-unused-vars":"off","no-useless-call":"error","no-useless-computed-key":"error","no-useless-concat":"error","no-useless-rename":"error","no-useless-return":"error","object-shorthand":["error","always",{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":["error",{initialized:"never"}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["error",{destructuring:"all",ignoreReadBeforeAssign:!0}],"prefer-destructuring":"error","prefer-exponentiation-operator":"error","prefer-named-capture-group":"error","prefer-numeric-literals":"error","prefer-object-has-own":"error","prefer-object-spread":"error","prefer-promise-reject-errors":"error","prefer-regex-literals":["error",{disallowRedundantWrapping:!0}],"prefer-template":"error","require-atomic-updates":"error","require-await":"error","symbol-description":"error","unicode-bom":["error","never"],"use-isnan":["error",{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":["error",{requireStringLiterals:!0}],yoda:["error","never"]},L={"@typescript-eslint/array-type":["error",{default:"array-simple",readonly:"array-simple"}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow"}],"@typescript-eslint/consistent-type-definitions":["error","interface"],"@typescript-eslint/max-params":["error",{max:5}],"@typescript-eslint/method-signature-style":["error","property"],"@typescript-eslint/naming-convention":["error",{selector:"default",format:["camelCase"],leadingUnderscore:"forbid",trailingUnderscore:"forbid"},{selector:"variable",format:["camelCase","UPPER_CASE","PascalCase"],leadingUnderscore:"forbid",trailingUnderscore:"forbid"},{selector:"function",format:["camelCase","PascalCase"],leadingUnderscore:"forbid",trailingUnderscore:"forbid"},{selector:"parameter",format:["camelCase","PascalCase"],leadingUnderscore:"allow",trailingUnderscore:"forbid"},{selector:"typeLike",format:["PascalCase"],leadingUnderscore:"forbid",trailingUnderscore:"forbid"},{selector:"enumMember",format:["PascalCase"],leadingUnderscore:"forbid",trailingUnderscore:"forbid"},{selector:"import",format:null},{selector:["objectLiteralProperty","typeProperty","classProperty"],format:["camelCase","PascalCase","snake_case"],leadingUnderscore:"forbid",trailingUnderscore:"forbid"},{selector:["objectLiteralMethod","typeMethod","classMethod"],format:["camelCase","PascalCase"],leadingUnderscore:"forbid",trailingUnderscore:"forbid"},{selector:["objectLiteralProperty","typeProperty","classProperty"],format:null,modifiers:["requiresQuotes"]}],"@typescript-eslint/no-dynamic-delete":"off","@typescript-eslint/no-empty-object-type":["error",{allowInterfaces:"always"}],"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/no-invalid-void-type":"off","@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-this-alias":"off","@typescript-eslint/no-unsafe-assignment":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-function-type":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/no-unused-expressions":["error",{enforceForJSX:!0}],"@typescript-eslint/no-unused-vars":"off"},M={"import-lite/consistent-type-specifier-style":["error","top-level"],"import-lite/first":"error","import-lite/newline-after-import":["error",{count:1}],"import-lite/no-duplicates":"error","import-lite/no-mutable-exports":"error","import-lite/no-named-default":"error"},O={"unicorn/consistent-empty-array-spread":"error","unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/filename-case":["error",{case:"kebabCase",ignore:["README.md","AGENTS.md","CLAUDE.md"]}],"unicorn/import-style":["error",{checkDynamicImport:!1,extendDefaultStyles:!1,styles:{react:{named:!0},"react-dom":{named:!0},"react-dom/client":{named:!0}}}],"unicorn/new-for-builtins":"error","unicorn/no-array-for-each":"error","unicorn/no-array-reduce":"off","unicorn/no-console-spaces":"error","unicorn/no-empty-file":"error","unicorn/no-for-loop":"error","unicorn/no-nested-ternary":"off","unicorn/no-new-array":"error","unicorn/no-new-buffer":"error","unicorn/no-null":"off","unicorn/no-unnecessary-await":"error","unicorn/no-unnecessary-polyfills":"error","unicorn/no-unused-properties":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-useless-undefined":"error","unicorn/number-literal-case":"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-date-now":"error","unicorn/prefer-default-parameters":"error","unicorn/prefer-dom-node-text-content":"error","unicorn/prefer-event-target":"off","unicorn/prefer-includes":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-object-from-entries":"error","unicorn/prefer-single-call":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/prevent-abbreviations":"off","unicorn/require-module-specifiers":"off","unicorn/text-encoding-identifier-case":["error",{withDash:!0}],"unicorn/throw-new-error":"error"},A={"react-dom/no-dangerously-set-innerhtml":"error","react-dom/no-dangerously-set-innerhtml-with-children":"error","react-dom/no-find-dom-node":"error","react-dom/no-flush-sync":"error","react-dom/no-hydrate":"error","react-dom/no-missing-button-type":"error","react-dom/no-missing-iframe-sandbox":"error","react-dom/no-render":"error","react-dom/no-render-return-value":"error","react-dom/no-script-url":"error","react-dom/no-string-style-prop":"error","react-dom/no-unknown-property":["error",{ignore:["css"]}],"react-dom/no-unsafe-iframe-sandbox":"error","react-dom/no-unsafe-target-blank":"error","react-dom/no-use-form-state":"error","react-dom/no-void-elements-with-children":"error","@eslint-react/set-state-in-effect":"off","@eslint-react/static-components":"off","react-jsx/no-key-after-spread":"error","react-jsx/no-comment-textnodes":"error","react-jsx/no-namespace":"error","react-naming-convention/context-name":"error","@eslint-react/no-access-state-in-setstate":"error","@eslint-react/no-array-index-key":"error","@eslint-react/no-children-for-each":"off","@eslint-react/no-children-map":"off","@eslint-react/no-children-to-array":"off","@eslint-react/no-class-component":"error","@eslint-react/no-clone-element":"off","@eslint-react/no-component-will-mount":"error","@eslint-react/no-component-will-receive-props":"error","@eslint-react/no-component-will-update":"error","@eslint-react/no-context-provider":"error","@eslint-react/no-create-ref":"error","@eslint-react/no-direct-mutation-state":"error","@eslint-react/no-duplicate-key":"error","@eslint-react/no-forward-ref":"error","@eslint-react/no-missing-component-display-name":"error","@eslint-react/no-missing-key":"error","@eslint-react/no-nested-component-definitions":"error","@eslint-react/no-set-state-in-component-did-mount":"error","@eslint-react/no-set-state-in-component-did-update":"error","@eslint-react/no-set-state-in-component-will-update":"error","@eslint-react/no-unnecessary-use-prefix":"error","@eslint-react/no-unsafe-component-will-mount":"error","@eslint-react/no-unsafe-component-will-receive-props":"error","@eslint-react/no-unsafe-component-will-update":"error","@eslint-react/no-unstable-context-value":"error","@eslint-react/no-unstable-default-props":"error","@eslint-react/no-unused-class-component-members":"error","@eslint-react/no-unused-state":"error","@eslint-react/no-use-context":"error","@eslint-react/unsupported-syntax":"error","@eslint-react/use-state":["error",{enforceAssignment:!1,enforceLazyInitialization:!0,enforceSetterName:!1}],"react-web-api/no-leaked-event-listener":"error","react-web-api/no-leaked-interval":"error","react-web-api/no-leaked-resize-observer":"error","react-web-api/no-leaked-timeout":"error"},D={"react-hooks/exhaustive-deps":["error",{additionalHooks:"^use(Deep|Shallow|Isomorphic)|^useDidUpdate"}]},T={"jsdoc/check-line-alignment":["error","always",{tags:[]}],"jsdoc/multiline-blocks":["error",{noSingleLineBlocks:!0}],"jsdoc/no-blank-blocks":"error","jsdoc/tag-lines":["error","never",{startLines:1}]},F={"antfu/consistent-chaining":"error","antfu/consistent-list-newline":"error","antfu/curly":"error","antfu/if-newline":"error","antfu/indent-unindent":"error","antfu/top-level-function":"error"},I={"unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["error",{args:"after-used",argsIgnorePattern:"^_",vars:"all",varsIgnorePattern:"^_"}]},J={"perfectionist/sort-exports":["error",{order:"asc",type:"natural"}],"perfectionist/sort-imports":["error",{groups:["type-import",["type-internal","type-parent","type-sibling","type-index"],"value-builtin","value-external","value-internal",["value-parent","value-sibling","value-index"],["value-side-effect","value-side-effect-style"],"unknown"],newlinesBetween:1,order:"asc",type:"natural"}],"perfectionist/sort-named-exports":["error",{groups:["value-export","type-export"],newlinesBetween:"ignore",order:"asc",type:"natural"}],"perfectionist/sort-named-imports":["error",{groups:["value-import","type-import"],newlinesBetween:"ignore",order:"asc",type:"natural"}],"perfectionist/sort-jsx-props":["error",{type:"natural",order:"asc",ignoreCase:!0,groups:["reserved","shorthand-prop","unknown","multiline-prop","callback"],customGroups:[{groupName:"reserved",elementNamePattern:"^(key|ref)$"},{groupName:"callback",elementNamePattern:"^on.+"}]}]},X={"@stylistic/array-bracket-newline":["error",{multiline:!0}],"@stylistic/array-element-newline":["error","consistent"],"@stylistic/arrow-parens":["error","as-needed"],"@stylistic/curly-newline":["error",{consistent:!0}],"@stylistic/function-paren-newline":["error","multiline-arguments"],"@stylistic/generator-star-spacing":["error",{after:!0,before:!1}],"@stylistic/implicit-arrow-linebreak":["error","beside"],"@stylistic/jsx-max-props-per-line":["error",{maximum:{multi:1,single:5}}],"@stylistic/jsx-newline":["error",{allowMultilines:!0,prevent:!0}],"@stylistic/jsx-self-closing-comp":["error",{component:!0,html:!0}],"@stylistic/line-comment-position":["error",{position:"above"}],"@stylistic/max-statements-per-line":["error",{max:1}],"@stylistic/multiline-comment-style":["error","separate-lines",{checkJSDoc:!1}],"@stylistic/newline-per-chained-call":["error",{ignoreChainWithDepth:6}],"@stylistic/no-extra-parens":["error","all",{ignoreJSX:"multi-line",nestedBinaryExpressions:!1,ternaryOperandBinaryExpressions:!1}],"@stylistic/no-extra-semi":"error","@stylistic/no-multiple-empty-lines":["error",{max:1,maxBOF:0,maxEOF:0}],"@stylistic/object-curly-newline":["error",{ExportDeclaration:{consistent:!0,multiline:!0},ImportDeclaration:{consistent:!0,multiline:!0},ObjectExpression:{consistent:!0,minProperties:3,multiline:!0},ObjectPattern:{consistent:!0,minProperties:3,multiline:!0}}],"@stylistic/object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"@stylistic/padding-line-between-statements":["error",{blankLine:"always",next:["block","multiline-block-like","type","interface","enum","function","function-overload"],prev:"*"},{blankLine:"always",next:"*",prev:["block","multiline-block-like","type","interface","enum","function","function-overload"]}],"@stylistic/switch-colon-spacing":["error",{after:!0,before:!1}],"@stylistic/yield-star-spacing":["error",{after:!0,before:!1}]},N={"@eslint-community/eslint-comments/disable-enable-pair":"off","@eslint-community/eslint-comments/no-unlimited-disable":"off"};function r(n,E){const{parser:q,additionalOptions:P={}}=E;return{files:[n],languageOptions:{parser:t.default.parserPlain},plugins:{format:t.default},rules:{"format/prettier":["error",{...U,parser:q,...P}]}}}var W=["**/*.ts","**/*.tsx","**/*.mts","**/*.cts","**/*.js","**/*.jsx","**/*.mjs","**/*.cjs"],B=["**/*.ts","**/*.mts","**/*.cts","**/*.js","**/*.jsx","**/*.mjs","**/*.cjs"],j=["**/*.gen.ts"];function G(...n){return(0,C.defineConfig)((0,f.default)({root:!0,strict:!0}),{files:W,ignores:j,extends:[l.default.configs.recommended,o.default.configs.strict,o.default.configs.stylistic,a.default.configs["recommended-typescript"],b.default.configs.flat.recommended,m.default.configs.recommended,h.default.configs.recommended,i.default.recommended,S.default.configs["flat/recommended"],c.default.configs.customize({blockSpacing:!0,braceStyle:"1tbs",commaDangle:"never",indent:2,jsx:!0,quoteProps:"as-needed",quotes:"double",semi:!0,severity:"error"}),u.default.configs["flat/recommended"],p.default.configs["flat/recommended"],s.kitConfig],plugins:{"react-dom":_.default,"react-jsx":w.default,"react-naming-convention":v.default,"react-web-api":x.default,antfu:d.default,jsdoc:y.default,"local-react":s.localReactPlugin,perfectionist:g.default,"unused-imports":k.default},rules:{...R,...L,...M,...O,...A,...s.localReactRules,...D,...F,...I,...J,...X,...T,...N}},{files:B,ignores:j,rules:{"no-restricted-syntax":["error","TSEnumDeclaration[const=true]","TSExportAssignment",{selector:"JSXAttribute[name.name='ref'][value.type='Literal']",message:"Use callback refs or useRef instead of string refs."},{selector:"JSXAttribute[name.name='ref'] > JSXExpressionContainer > Literal",message:"Use callback refs or useRef instead of string refs."},{selector:"JSXAttribute[name.name='ref'] > JSXExpressionContainer > TemplateLiteral",message:"Use callback refs or useRef instead of string refs."},"JSXElement","JSXFragment"]}},r("**/*.css",{parser:"css"}),r("**/*.scss",{parser:"scss"}),r("**/*.html",{parser:"html"}),r("**/*.json",{parser:"json"}),r("**/*.jsonc",{parser:"jsonc"}),r("**/*.md",{parser:"markdown",additionalOptions:{embeddedLanguageFormatting:"off",printWidth:320}}),r("**/*.mdx",{parser:"mdx",additionalOptions:{embeddedLanguageFormatting:"off",printWidth:320}}),...n)}exports.defineEslintConfig=G;
|
|
1
|
+
const l=require("./no-legacy-middle-size.cjs"),s=require("./tanstack.cjs");let t=require("@coldsmirk/eslint-config"),o=require("eslint/config");function c(e={}){const{react:i=!0,ignores:n=[],...r}=e;return(0,o.defineConfig)(...(0,t.defineEslintConfig)({react:i,ignores:["**/*.gen.ts",...n],...r}),...s.tanstackConfig,{files:["**/*.{ts,tsx}"],plugins:{local:l.localPlugin},rules:{"local/no-legacy-middle-size":"error"}})}exports.defineEslintConfig=c;
|
package/dist/cjs/lint/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./
|
|
1
|
+
const e=require("./eslint.cjs"),i=require("./stylelint.cjs");let r=require("@coldsmirk/commitlint-config");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=new Set(["size","componentSize","gap"]),u=new Set(["TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]);function s(i){return i?u.has(i.type)?s(i.expression):i.type==="Literal"?i.value==="middle"?i:null:i.type==="TemplateLiteral"&&i.expressions.length===0&&i.quasis.length===1&&i.quasis[0].value.cooked==="middle"?i:null:null}var p={create(i){function l(e,t){i.report({node:e,messageId:"useMedium",data:{prop:t},fix:r=>r.replaceText(e,'"medium"')})}return{JSXAttribute(e){const t=e.name?.name;if(typeof t!="string"||!n.has(t))return;const r=e.value?.type==="JSXExpressionContainer"?e.value.expression:e.value,a=s(r);a&&l(a,t)},Property(e){if(e.computed)return;const t=e.key?.type==="Identifier"?e.key.name:e.key?.type==="Literal"&&typeof e.key.value=="string"?e.key.value:null;if(typeof t!="string"||!n.has(t))return;const r=s(e.value);r&&l(r,t)}}},meta:{type:"problem",docs:{description:'Enforce "medium" instead of the legacy "middle" size token.'},fixable:"code",messages:{useMedium:'Use "medium" instead of "middle" for `{{prop}}`.'},schema:[]}},o={rules:{"no-legacy-middle-size":p}};exports.localPlugin=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let i=require("@coldsmirk/stylelint-config");function n(e={}){return(0,i.defineStylelintConfig)({scss:!0,...e})}exports.defineStylelintConfig=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=require("../_internal/_rolldown/runtime.cjs");let e=require("@tanstack/eslint-plugin-query");e=n.__toESM(e,1);let t=require("@tanstack/eslint-plugin-router");t=n.__toESM(t,1);var r=[...e.default.configs["flat/recommended"],...t.default.configs["flat/recommended"]];exports.tanstackConfig=r;
|
package/dist/cli/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/dev v2.
|
|
1
|
+
/*! @vef-framework-react/dev v2.6.0 made by Venus | 2026-06-25T07:06:48.193Z */
|
|
2
2
|
import ct from"chalk";import{program as u}from"commander";import N from"process";import R from"consola";import{randomBytes as fe}from"crypto";import{constants as h}from"fs";import{chmod as pe,lstat as de,mkdir as me,open as ge,readFile as ye,rename as le,unlink as ue}from"fs/promises";import{dirname as he,isAbsolute as T,relative as G,resolve as we}from"path";var c=class extends Error{constructor(t){super(t),this.name="CodeGenerationValidationError"}};import{existsSync as Q}from"fs";import{isAbsolute as P,relative as X,resolve as _}from"path";import{createJiti as Z}from"jiti";var ee=["code-generation.config.ts","code-generation.config.mts","code-generation.config.js","code-generation.config.mjs"];async function O({projectDir:e,configFile:t}){let n=t?[te(e,t)]:ee.map(s=>_(e,s)),i=n.find(s=>Q(s));if(!i)throw new c(`Code generation config not found. Looked for: ${n.join(", ")}`);let a=await Z(e).import(i),r=ne(a);return ie(r,i),{config:r,configPath:i}}function te(e,t){let n=P(t)?t:_(e,t),i=X(e,n);if(i.startsWith("..")||P(i))throw new c(`Code generation config file escapes project root: ${t}. Must stay within ${e}.`);return n}function ne(e){return e!==null&&typeof e=="object"&&"default"in e&&e.default!==null&&typeof e.default=="object"?e.default:e}function ie(e,t){if(typeof e!="object"||e===null)throw new c(`Code generation config at ${t} must export a CodeGenerationConfig object.`);e.dictionaryKeys!==void 0&&oe(e.dictionaryKeys,t)}function oe(e,t){if(typeof e!="object"||e===null)throw new c(`Code generation config at ${t} field \`dictionaryKeys\` must be an object when set.`);if(typeof e.fetchDictionaryKeys!="function")throw new c(`Code generation config at ${t} field \`dictionaryKeys.fetchDictionaryKeys\` must be a function.`);if(e.output!==void 0&&typeof e.output!="string")throw new c(`Code generation config at ${t} field \`dictionaryKeys.output\` must be a string when set; got ${typeof e.output}.`);if(e.timeout!==void 0&&!re(e.timeout))throw new c(`Code generation config at ${t} field \`dictionaryKeys.timeout\` must be a finite non-negative number when set; got ${String(e.timeout)}.`)}function re(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var se="@vef-framework-react/hooks",ae=["/* eslint-disable */","// @ts-nocheck","// noinspection JSUnusedGlobalSymbols","// AUTO-GENERATED by @vef-framework-react/dev (vef gen:dictionary-keys). DO NOT EDIT."];function S(e,t){let{configFile:n,augmentTarget:i=se}=t,o=[...ae,`// Source: ${n}`,""];if(e.length===0)o.push("export type DictionaryKey = never;");else{o.push("export type DictionaryKey =");for(let[a,r]of e.entries()){let s=a===e.length-1?";":"";r.comment&&o.push(` /** ${ce(r.comment)} */`),o.push(` | ${JSON.stringify(r.key)}${s}`)}}return o.push("",`declare module ${JSON.stringify(i)} {`," interface Register {"," dictionaryKeys: DictionaryKey;"," }","}",""),o.join(`
|
|
3
3
|
`)}function ce(e){return e.replaceAll(/\s+/g," ").trim().replaceAll("*/",String.raw`*\/`)}var Ee="src/types/dictionary.gen.ts",ve=3e4,A=/^[\w.-]+$/,Ce="letters, digits, underscore, dot, hyphen",ke=e=>console.warn(e);async function v({projectDir:e,configFile:t,output:n,check:i=!1,augmentTarget:o,onWarn:a=ke}){let{config:r,configPath:s}=await O({projectDir:e,configFile:t});if(!r.dictionaryKeys)throw new c(`Code generation config at ${s} has no \`dictionaryKeys\` block.`);let{dictionaryKeys:d}=r,g=await xe(d.fetchDictionaryKeys,d.timeout??ve);Ke(g);let f=De(g,a);f.length===0&&a("`fetchDictionaryKeys` returned no entries; the generated file will declare `DictionaryKey = never`.");let m=Pe(e,n??d.output??Ee),K=S(f,{configFile:G(e,s),augmentTarget:o}),D=await Oe(m)!==K;return D&&!i&&(await _e(m),await Se(m,K)),{outputPath:m,keyCount:f.length,changed:D}}async function xe(e,t){if(t<=0)return await e();let n;try{return await Promise.race([e(),new Promise((i,o)=>{n=setTimeout(()=>o(new Error(`fetchDictionaryKeys timed out after ${t}ms.`)),t)})])}finally{n&&clearTimeout(n)}}function Ke(e){for(let t of e)if(typeof t.key!="string"||!A.test(t.key))throw new c(`Invalid dictionary key ${JSON.stringify(t.key)}. Keys must match ${A} (${Ce}).`)}function De(e,t){let n=new Map;for(let i of e){let o=n.get(i.key);if(!o){n.set(i.key,i);continue}o.comment!==i.comment&&t(`Duplicate dictionary key "${i.key}" with conflicting comments; keeping the first occurrence.`)}return[...n.values()].toSorted((i,o)=>i.key<o.key?-1:i.key>o.key?1:0)}function Pe(e,t){if(T(t))throw new c(`Output path must be relative to project root; absolute paths are rejected: ${t}`);let n=we(e,t),i=G(e,n);if(i.startsWith("..")||T(i))throw new c(`Output path escapes project root: ${t}. Must stay within ${e}.`);return n}async function _e(e){let t;try{t=await de(e)}catch(n){if(n.code==="ENOENT")return;throw n}if(t.isSymbolicLink())throw new c(`Refusing to overwrite symlink at output path: ${e}. Delete the symlink and rerun generation if this is intentional.`)}async function Oe(e){try{return await ye(e,"utf-8")}catch(t){if(t.code==="ENOENT")return null;throw t}}async function Se(e,t){await me(he(e),{recursive:!0});let n=fe(6).toString("hex"),i=`${e}.${n}.tmp`,o=h.O_NOFOLLOW??0,a=h.O_WRONLY|h.O_CREAT|h.O_EXCL|o,r=await ge(i,a,384);try{await r.writeFile(t,"utf-8")}finally{await r.close()}try{await le(i,e)}catch(s){throw await ue(i).catch(()=>{}),s}await pe(e,420)}import{resolve as Te}from"path";import{exit as Ae}from"process";import F from"consola";import{execa as Ge}from"execa";import Fe from"fs-extra";var{readJsonSync:$e}=Fe,p=class extends Error{};function w(){let e=Te(import.meta.dirname,"../../package.json");return $e(e,{encoding:"utf-8"}).version}function $(e){e instanceof p?F.error(e.message):F.error(e),Ae(1)}async function E(){try{await Ge("pnpm",["--version"])}catch{throw new p("VEF requires pnpm. Install it from https://pnpm.io and try again.")}}async function I(e,t=N.cwd()){try{let n=await v({projectDir:t,configFile:e.config,output:e.output,check:e.check,onWarn:o=>R.warn(o)});if(e.check&&n.changed)throw new p(`Generated dictionary keys file is stale at ${n.outputPath}. Run \`vef gen:dictionary-keys\` to refresh.`);let i=n.changed?"":" (unchanged)";R.success(`Generated ${n.keyCount} dictionary keys -> ${n.outputPath}${i}`)}catch(n){if(n instanceof p)throw n;if(N.env.CI){let i=n instanceof Error?n.message:String(n);throw new p(`gen:dictionary-keys failed: ${i}`)}throw n}}import{resolve as y}from"path";import Ne,{exit as Re}from"process";import l from"consola";import{execa as k}from"execa";import Ie from"fs-extra";import H from"ora";import je from"prompts";var j={"pre-commit":"pnpm dlx lint-staged","commit-msg":"pnpm dlx commitlint --edit $1","pre-push":"pnpm typecheck && pnpm test"},b={"*.{js,ts,tsx,json,jsonc,md,mdx,html}":"eslint --fix","*.{css,scss}":"stylelint --fix"},U={prepare:"vef prepare",typecheck:"tsc --noEmit",test:"vitest run --passWithNoTests"},L="@vef-framework-react/";var{copy:be,exists:Ue,move:Le,readdir:Je,readFile:J,readJson:Ve,writeFile:V,writeJson:We}=Ie,W="http://127.0.0.1:8080";function Me(e){return e.trim().toLowerCase().replaceAll(/\s+/g,"-").replace(/^[._]+/,"").replaceAll(/[^a-z0-9~-]+/g,"-").replaceAll(/^-+|-+$/g,"")}function M(e){let t=typeof e=="string"?e.trim():"";return t?/[/\\]/.test(t)||t.includes("..")?"App name cannot contain path separators or '..'":!0:"App name is required"}function He(e,t){for(let n of["dependencies","devDependencies"]){let i=e[n];if(i)for(let o of Object.keys(i))o.startsWith(L)&&(i[o]=t)}}function C(e,t,n){return e.replace(new RegExp(`^${t}=.*$`,"m"),()=>`${t}=${n}`)}async function Y(e={},t=Ne.cwd()){l.start("Creating a new VEF project");let n=[];e.name===void 0&&n.push({type:"text",name:"name",message:"What is the name of your app?",validate:M}),e.title===void 0&&n.push({type:"text",name:"title",message:"What is the title of your app?",validate:m=>typeof m=="string"&&m.trim().length>0||"App title is required"}),e.apiUrl===void 0&&n.push({type:"text",name:"apiUrl",message:"Dev API base URL?",initial:W});let i=await je(n,{onCancel:()=>{l.info("Operation cancelled"),Re(0)}}),o=e.name??i.name,a=M(o);if(a!==!0)throw new p(a);let r=o.trim(),s=Me(r),d=(e.title??i.title)?.trim()||r,g=(e.apiUrl??i.apiUrl)?.trim()||W,f=y(t,r);if(await Ue(f)&&(await Je(f)).length>0)throw new p(`Target directory "${r}" already exists and is not empty. Choose another name or empty it first.`);await E(),await ze(f),await qe(s,f),await Be(f,{packageName:s,appTitle:d,apiUrl:g}),await Qe(f),await Xe(f),Ze(r)}var Ye=[["_gitignore",".gitignore"],["_gitattributes",".gitattributes"],["_editorconfig",".editorconfig"],["_package.json","package.json"],["_tsconfig.json","tsconfig.json"],["_eslint.config.ts","eslint.config.ts"],["_stylelint.config.js","stylelint.config.js"],["_commitlint.config.ts","commitlint.config.ts"],["_vite.config.ts","vite.config.ts"]];async function ze(e){let t=y(import.meta.dirname,"../template");await be(t,e),l.success("Successfully copied template files");for(let[n,i]of Ye)await Le(y(e,n),y(e,i))}async function qe(e,t){let n=y(t,"package.json"),i=await Ve(n,{encoding:"utf-8"}),o=w();i.name=e,He(i,o),await We(n,i,{encoding:"utf-8",spaces:2}),l.success(`Successfully set the app name and pinned framework packages to v${o}`)}async function Be(e,t){let n=y(e,"env/.env"),i=await J(n,{encoding:"utf-8"}),o=C(C(i,"VEF_APP_NAME",t.packageName),"VEF_APP_TITLE",t.appTitle);await V(n,o);let a=y(e,"env/.env.development"),r=await J(a,{encoding:"utf-8"});await V(a,C(r,"VEF_APP_API_BASE_URL",t.apiUrl)),l.success("Successfully configured environment files")}async function Qe(e){let t=H("Initializing git repository...").start();try{await k`git --version`,await k({cwd:e})`git init`,t.succeed("Successfully initialized git repository")}catch(n){throw t.fail("Failed to initialize git repository"),n}}async function Xe(e){let t=H("Installing dependencies...").start();try{await k({cwd:e})("pnpm",["install"]),t.succeed("Successfully installed dependencies")}catch(n){throw t.fail("Failed to install dependencies"),n}}function Ze(e){l.success("VEF project created successfully!"),l.box(`Next steps:
|
|
4
4
|
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var r = ["@commitlint/config-conventional"], t = "@commitlint/format";
|
|
3
|
-
function i() {
|
|
4
|
-
return {
|
|
5
|
-
extends: [...r],
|
|
6
|
-
formatter: t,
|
|
7
|
-
rules: {
|
|
8
|
-
"body-empty": [o.Error, "always"],
|
|
9
|
-
"footer-empty": [o.Error, "always"]
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
}
|
|
1
|
+
import { defineCommitlintConfig as o } from "@coldsmirk/commitlint-config";
|
|
13
2
|
export {
|
|
14
|
-
|
|
3
|
+
o as defineCommitlintConfig
|
|
15
4
|
};
|