@kasoa/vite-plus-config 0.1.2 → 0.2.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-7cyIJaBC.mjs","names":[],"sources":["../src/shared/config.ts","../src/shared/constants.ts","../src/shared/fmt.ts","../src/shared/rule-policy.ts","../src/shared/lint.ts","../src/base/index.ts"],"sourcesContent":["import type { UserConfig } from \"vite-plus\";\nimport { defineConfig, lazyPlugins, mergeConfig } from \"vite-plus\";\n\nexport type PluginInput = object | readonly object[] | false | null | undefined;\n\nexport type ConfigInput = Omit<UserConfig, \"plugins\"> & {\n /**\n * Vite plugins to merge into the config.\n *\n * This is intentionally typed structurally instead of as Vite's recursive\n * PluginOption type. Vite 8 plugin types from different Vite entrypoints can\n * trigger excessive stack-depth comparisons before the config reaches Vite.\n */\n readonly plugins?: readonly PluginInput[];\n};\n\nexport function createLazyPluginInputs(\n factory: () => readonly PluginInput[],\n): readonly PluginInput[] | undefined {\n // eslint-disable-next-line typescript/no-unsafe-type-assertion -- Vite 8 plugin types recurse beyond TypeScript's comparison limit; runtime lazyPlugins accepts this structurally equivalent factory.\n return lazyPlugins(factory as never);\n}\n\nfunction toUserConfig(config: ConfigInput): UserConfig {\n // eslint-disable-next-line typescript/no-unsafe-type-assertion -- ConfigInput preserves UserConfig autocomplete but keeps plugin assignability shallow at our public boundary.\n return config as UserConfig;\n}\n\nfunction mergeConfigFragment(current: UserConfig, fragment: ConfigInput): UserConfig {\n const merged = toUserConfig(mergeConfig<UserConfig, UserConfig>(current, toUserConfig(fragment)));\n // Vite concatenates nested arrays, but an Oxlint rule tuple is one atomic value.\n const rules = fragment.lint?.rules;\n\n if (rules === undefined) {\n return merged;\n }\n\n return {\n ...merged,\n lint: {\n ...merged.lint,\n rules: {\n ...current.lint?.rules,\n ...rules,\n },\n },\n };\n}\n\nexport function mergeConfigFragments(base: ConfigInput, ...overrides: ConfigInput[]): UserConfig {\n let result = mergeConfigFragment({}, base);\n\n for (const override of overrides) {\n result = mergeConfigFragment(result, override);\n }\n\n return result;\n}\n\nexport function createDefinedConfig(base: ConfigInput, ...overrides: ConfigInput[]): UserConfig {\n return defineConfig(mergeConfigFragments(base, ...overrides));\n}\n","export const DEFAULT_TEST_INCLUDE = [\"**/*.{test,spec}.{ts,tsx,mts,cts}\"] as const;\nexport const DEFAULT_IGNORE_PATTERNS = [\n \"node_modules/**\",\n \"dist/**\",\n \"dist-ssr/**\",\n \"**/.wrangler/**\",\n \"**/worker-configuration.d.ts\",\n \"**/migrations/**\",\n \"**/drizzle/migrations.js\",\n \"**/drizzle/meta/*.json\",\n] as const;\nexport const REACT_NATIVE_IGNORE_PATTERNS = [\"**/.expo/**\"] as const;\n\nexport const DEFAULT_STAGED_CHECK_GLOB = \"*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\";\nexport const DEFAULT_STAGED_CHECK_COMMAND = \"vp check --fix\";\nexport const DEFAULT_WRANGLER_CONFIG_PATH = \"./wrangler.jsonc\";\n","import type { UserConfig } from \"vite-plus\";\nimport { DEFAULT_IGNORE_PATTERNS, REACT_NATIVE_IGNORE_PATTERNS } from \"./constants.ts\";\n\ntype FmtConfig = NonNullable<UserConfig[\"fmt\"]>;\n\nexport const baseFmt: FmtConfig = {\n ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],\n sortImports: {\n internalPattern: [\"#\", \"@/\"],\n newlinesBetween: false,\n groups: [\n \"type-import\",\n [\"value-builtin\", \"value-external\"],\n \"type-internal\",\n \"value-internal\",\n [\"type-parent\", \"type-sibling\", \"type-index\"],\n [\"value-parent\", \"value-sibling\", \"value-index\"],\n \"unknown\",\n ],\n },\n};\n\nexport const reactFmt: FmtConfig = {\n sortTailwindcss: {\n attributes: [\"/.*ClassName/\"],\n functions: [\"tv\"],\n },\n};\n\nexport const reactNativeFmt: FmtConfig = {\n ...reactFmt,\n ignorePatterns: [...REACT_NATIVE_IGNORE_PATTERNS],\n};\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\ntype LintRules = NonNullable<LintConfig[\"rules\"]>;\n\nexport const reviewedBaseRules: LintRules = {\n \"accessor-pairs\": \"error\",\n \"array-callback-return\": \"error\",\n \"arrow-body-style\": \"error\",\n curly: [\"error\", \"multi-line\", \"consistent\"],\n \"default-case-last\": \"error\",\n \"default-param-last\": \"error\",\n eqeqeq: \"error\",\n \"func-name-matching\": \"error\",\n \"func-names\": \"error\",\n \"grouped-accessor-pairs\": [\"error\", \"getBeforeSet\"],\n \"guard-for-in\": \"error\",\n \"import/consistent-type-specifier-style\": \"error\",\n \"import/first\": \"error\",\n \"import/newline-after-import\": \"error\",\n \"import/no-duplicates\": \"error\",\n \"import/no-mutable-exports\": \"error\",\n \"import/no-named-default\": \"error\",\n \"logical-assignment-operators\": \"error\",\n \"max-depth\": [\"error\", { max: 3 }],\n \"max-nested-callbacks\": [\"error\", { max: 3 }],\n \"max-params\": [\"error\", { max: 3 }],\n \"no-array-constructor\": \"error\",\n \"no-await-in-loop\": \"error\",\n \"no-case-declarations\": \"error\",\n \"no-constructor-return\": \"error\",\n \"no-else-return\": \"error\",\n \"no-extra-label\": \"error\",\n \"no-fallthrough\": \"error\",\n \"no-implicit-coercion\": \"error\",\n \"no-inline-comments\": \"error\",\n \"no-inner-declarations\": \"error\",\n \"no-label-var\": \"error\",\n \"no-labels\": \"error\",\n \"no-lone-blocks\": \"error\",\n \"no-lonely-if\": \"error\",\n \"no-loop-func\": \"error\",\n \"no-multi-assign\": \"error\",\n \"no-multi-str\": \"error\",\n \"no-nested-ternary\": \"error\",\n \"no-new-func\": \"error\",\n \"no-new-wrappers\": \"error\",\n \"no-object-constructor\": \"error\",\n \"no-promise-executor-return\": \"error\",\n \"no-prototype-builtins\": \"error\",\n \"no-redeclare\": \"error\",\n \"no-return-assign\": \"error\",\n \"no-script-url\": \"error\",\n \"no-self-compare\": \"error\",\n \"no-template-curly-in-string\": \"error\",\n \"no-throw-literal\": \"error\",\n \"no-useless-call\": \"error\",\n \"no-useless-computed-key\": \"error\",\n \"no-useless-return\": \"error\",\n \"no-warning-comments\": \"error\",\n \"object-shorthand\": \"error\",\n \"operator-assignment\": \"error\",\n \"oxc/branches-sharing-code\": \"error\",\n \"oxc/no-accumulating-spread\": \"error\",\n \"oxc/no-map-spread\": \"error\",\n \"prefer-arrow-callback\": \"error\",\n \"prefer-const\": \"error\",\n \"prefer-destructuring\": \"error\",\n \"prefer-exponentiation-operator\": \"error\",\n \"prefer-named-capture-group\": \"error\",\n \"prefer-numeric-literals\": \"error\",\n \"prefer-object-has-own\": \"error\",\n \"prefer-object-spread\": \"error\",\n \"prefer-promise-reject-errors\": \"error\",\n \"prefer-regex-literals\": \"error\",\n \"prefer-rest-params\": \"error\",\n \"prefer-spread\": \"error\",\n \"prefer-template\": \"error\",\n \"promise/no-nesting\": \"error\",\n \"promise/no-return-wrap\": \"error\",\n \"promise/param-names\": \"error\",\n \"promise/prefer-await-to-then\": \"error\",\n \"promise/prefer-catch\": \"error\",\n radix: \"error\",\n \"symbol-description\": \"error\",\n \"typescript/adjacent-overload-signatures\": \"error\",\n \"typescript/array-type\": \"error\",\n \"typescript/ban-ts-comment\": [\"error\", { minimumDescriptionLength: 10 }],\n \"typescript/ban-tslint-comment\": \"error\",\n \"typescript/ban-types\": \"error\",\n \"typescript/class-literal-property-style\": \"error\",\n \"typescript/consistent-generic-constructors\": \"error\",\n \"typescript/consistent-indexed-object-style\": \"error\",\n \"typescript/consistent-type-assertions\": \"error\",\n \"typescript/consistent-type-exports\": \"error\",\n \"typescript/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\", fixStyle: \"separate-type-imports\" },\n ],\n \"typescript/dot-notation\": \"error\",\n \"typescript/method-signature-style\": \"error\",\n \"typescript/no-confusing-void-expression\": \"error\",\n \"typescript/no-deprecated\": \"error\",\n \"typescript/no-empty-interface\": \"error\",\n \"typescript/no-inferrable-types\": \"error\",\n \"typescript/no-misused-promises\": \"error\",\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unnecessary-qualifier\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/parameter-properties\": \"error\",\n \"typescript/prefer-enum-initializers\": \"error\",\n \"typescript/prefer-find\": \"error\",\n \"typescript/prefer-for-of\": \"error\",\n \"typescript/prefer-function-type\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": \"error\",\n \"typescript/prefer-promise-reject-errors\": \"error\",\n \"typescript/prefer-readonly\": \"error\",\n \"typescript/prefer-reduce-type-parameter\": \"error\",\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/prefer-return-this-type\": \"error\",\n \"typescript/prefer-string-starts-ends-with\": \"error\",\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/related-getter-setter-pairs\": \"error\",\n \"typescript/restrict-plus-operands\": \"error\",\n \"typescript/return-await\": \"error\",\n \"typescript/strict-boolean-expressions\": \"error\",\n \"typescript/strict-void-return\": \"error\",\n \"typescript/switch-exhaustiveness-check\": \"error\",\n \"typescript/unified-signatures\": \"error\",\n \"unicorn/catch-error-name\": \"error\",\n \"unicorn/consistent-assert\": \"error\",\n \"unicorn/consistent-date-clone\": \"error\",\n \"unicorn/consistent-empty-array-spread\": \"error\",\n \"unicorn/consistent-existence-index-check\": \"error\",\n \"unicorn/consistent-template-literal-escape\": \"error\",\n \"unicorn/custom-error-definition\": \"error\",\n \"unicorn/error-message\": \"error\",\n \"unicorn/escape-case\": \"error\",\n \"unicorn/explicit-length-check\": \"error\",\n \"unicorn/explicit-timer-delay\": \"error\",\n \"unicorn/filename-case\": [\"error\", { case: \"kebabCase\" }],\n \"unicorn/max-nested-calls\": [\"error\", { max: 5 }],\n \"unicorn/new-for-builtins\": \"error\",\n \"unicorn/no-array-callback-reference\": \"error\",\n \"unicorn/no-array-method-this-argument\": \"error\",\n \"unicorn/no-await-expression-member\": \"error\",\n \"unicorn/no-console-spaces\": \"error\",\n \"unicorn/no-hex-escape\": \"error\",\n \"unicorn/no-immediate-mutation\": \"error\",\n \"unicorn/no-instanceof-array\": \"error\",\n \"unicorn/no-negation-in-equality-check\": \"error\",\n \"unicorn/no-new-buffer\": \"error\",\n \"unicorn/no-static-only-class\": \"error\",\n \"unicorn/no-this-assignment\": \"error\",\n \"unicorn/no-typeof-undefined\": \"error\",\n \"unicorn/no-unnecessary-array-flat-depth\": \"error\",\n \"unicorn/no-unnecessary-array-splice-count\": \"error\",\n \"unicorn/no-unnecessary-slice-end\": \"error\",\n \"unicorn/no-unreadable-array-destructuring\": \"error\",\n \"unicorn/no-unreadable-iife\": \"error\",\n \"unicorn/no-useless-collection-argument\": \"error\",\n \"unicorn/no-useless-promise-resolve-reject\": \"error\",\n \"unicorn/no-useless-switch-case\": \"error\",\n \"unicorn/no-useless-undefined\": \"error\",\n \"unicorn/no-zero-fractions\": \"error\",\n \"unicorn/number-literal-case\": \"error\",\n \"unicorn/numeric-separators-style\": \"error\",\n \"unicorn/prefer-array-find\": \"error\",\n \"unicorn/prefer-array-flat\": \"error\",\n \"unicorn/prefer-array-flat-map\": \"error\",\n \"unicorn/prefer-array-index-of\": \"error\",\n \"unicorn/prefer-array-some\": \"error\",\n \"unicorn/prefer-at\": \"error\",\n \"unicorn/prefer-bigint-literals\": \"error\",\n \"unicorn/prefer-blob-reading-methods\": \"error\",\n \"unicorn/prefer-class-fields\": \"error\",\n \"unicorn/prefer-classlist-toggle\": \"error\",\n \"unicorn/prefer-code-point\": \"error\",\n \"unicorn/prefer-date-now\": \"error\",\n \"unicorn/prefer-default-parameters\": \"error\",\n \"unicorn/prefer-dom-node-append\": \"error\",\n \"unicorn/prefer-dom-node-dataset\": \"error\",\n \"unicorn/prefer-dom-node-remove\": \"error\",\n \"unicorn/prefer-dom-node-text-content\": \"error\",\n \"unicorn/prefer-export-from\": \"error\",\n \"unicorn/prefer-global-this\": \"error\",\n \"unicorn/prefer-import-meta-properties\": \"error\",\n \"unicorn/prefer-includes\": \"error\",\n \"unicorn/prefer-keyboard-event-key\": \"error\",\n \"unicorn/prefer-logical-operator-over-ternary\": \"error\",\n \"unicorn/prefer-math-min-max\": \"error\",\n \"unicorn/prefer-math-trunc\": \"error\",\n \"unicorn/prefer-modern-dom-apis\": \"error\",\n \"unicorn/prefer-native-coercion-functions\": \"error\",\n \"unicorn/prefer-negative-index\": \"error\",\n \"unicorn/prefer-number-coercion\": \"error\",\n \"unicorn/prefer-object-from-entries\": \"error\",\n \"unicorn/prefer-optional-catch-binding\": \"error\",\n \"unicorn/prefer-prototype-methods\": \"error\",\n \"unicorn/prefer-reflect-apply\": \"error\",\n \"unicorn/prefer-regexp-test\": \"error\",\n \"unicorn/prefer-response-static-json\": \"error\",\n \"unicorn/prefer-set-has\": \"error\",\n \"unicorn/prefer-single-call\": \"error\",\n \"unicorn/prefer-spread\": \"error\",\n \"unicorn/prefer-string-raw\": \"error\",\n \"unicorn/prefer-string-replace-all\": \"error\",\n \"unicorn/prefer-string-slice\": \"error\",\n \"unicorn/prefer-string-trim-start-end\": \"error\",\n \"unicorn/prefer-structured-clone\": \"error\",\n \"unicorn/prefer-ternary\": [\"error\", \"only-single-line\"],\n \"unicorn/prefer-type-error\": \"error\",\n \"unicorn/relative-url-style\": \"error\",\n \"unicorn/require-array-join-separator\": \"error\",\n \"unicorn/require-module-attributes\": \"error\",\n \"unicorn/require-number-to-fixed-digits-argument\": \"error\",\n \"unicorn/switch-case-braces\": \"error\",\n \"unicorn/switch-case-break-position\": \"error\",\n \"unicorn/text-encoding-identifier-case\": \"error\",\n \"unicorn/throw-new-error\": \"error\",\n yoda: \"error\",\n};\n\nexport const reviewedReactRules: LintRules = {\n \"react/checked-requires-onchange-or-readonly\": \"error\",\n \"react/display-name\": \"error\",\n \"react/function-component-definition\": [\n \"error\",\n {\n namedComponents: \"function-declaration\",\n unnamedComponents: [\"arrow-function\", \"function-expression\"],\n },\n ],\n \"react/hook-use-state\": \"error\",\n \"react/jsx-boolean-value\": \"error\",\n \"react/jsx-curly-brace-presence\": \"error\",\n \"react/jsx-fragments\": \"error\",\n \"react/jsx-max-depth\": [\"error\", { max: 6 }],\n \"react/jsx-no-constructed-context-values\": \"error\",\n \"react/jsx-no-target-blank\": \"error\",\n \"react/jsx-no-useless-fragment\": \"error\",\n \"react/jsx-pascal-case\": \"error\",\n \"react/no-array-index-key\": \"error\",\n \"react/no-object-type-as-default-prop\": \"error\",\n \"react/no-redundant-should-component-update\": \"error\",\n \"react/no-set-state\": \"error\",\n \"react/no-unescaped-entities\": \"error\",\n \"react/prefer-es6-class\": \"error\",\n \"react/rules-of-hooks\": \"error\",\n \"react/self-closing-comp\": \"error\",\n \"react/state-in-constructor\": \"error\",\n};\n\nexport const reviewedNodeRules: LintRules = {\n \"node/callback-return\": \"error\",\n \"node/exports-style\": \"error\",\n \"node/global-require\": \"error\",\n \"node/no-exports-assign\": \"error\",\n \"node/no-mixed-requires\": \"error\",\n};\n\nexport const reviewedVitestRules: LintRules = {\n \"vitest/consistent-each-for\": \"error\",\n \"vitest/consistent-test-it\": [\"error\", { fn: \"test\", withinDescribe: \"it\" }],\n \"vitest/consistent-vitest-vi\": \"error\",\n \"vitest/max-nested-describe\": [\"error\", { max: 3 }],\n \"vitest/no-alias-methods\": \"error\",\n \"vitest/no-duplicate-hooks\": \"error\",\n \"vitest/no-identical-title\": \"error\",\n \"vitest/no-import-node-test\": \"error\",\n \"vitest/no-interpolation-in-snapshots\": \"error\",\n \"vitest/no-large-snapshots\": \"error\",\n \"vitest/no-mocks-import\": \"error\",\n \"vitest/no-test-prefixes\": \"error\",\n \"vitest/no-test-return-statement\": \"error\",\n \"vitest/no-unneeded-async-expect-function\": \"error\",\n \"vitest/padding-around-after-all-blocks\": \"error\",\n \"vitest/padding-around-test-blocks\": \"error\",\n \"vitest/prefer-called-exactly-once-with\": \"error\",\n \"vitest/prefer-called-once\": \"error\",\n \"vitest/prefer-called-with\": \"error\",\n \"vitest/prefer-comparison-matcher\": \"error\",\n \"vitest/prefer-each\": \"error\",\n \"vitest/prefer-equality-matcher\": \"error\",\n \"vitest/prefer-expect-resolves\": \"error\",\n \"vitest/prefer-expect-type-of\": \"error\",\n \"vitest/prefer-hooks-in-order\": \"error\",\n \"vitest/prefer-hooks-on-top\": \"error\",\n \"vitest/prefer-import-in-mock\": \"error\",\n \"vitest/prefer-importing-vitest-globals\": \"error\",\n \"vitest/prefer-mock-promise-shorthand\": \"error\",\n \"vitest/prefer-mock-return-shorthand\": \"error\",\n \"vitest/prefer-spy-on\": \"error\",\n \"vitest/prefer-strict-boolean-matchers\": \"error\",\n \"vitest/prefer-strict-equal\": \"error\",\n \"vitest/prefer-to-be\": \"error\",\n \"vitest/prefer-to-be-object\": \"error\",\n \"vitest/prefer-to-contain\": \"error\",\n \"vitest/prefer-to-have-been-called-times\": \"error\",\n \"vitest/prefer-to-have-length\": \"error\",\n \"vitest/prefer-todo\": \"error\",\n};\n","import type { UserConfig } from \"vite-plus\";\nimport { DEFAULT_IGNORE_PATTERNS, REACT_NATIVE_IGNORE_PATTERNS } from \"./constants.ts\";\nimport {\n reviewedBaseRules,\n reviewedNodeRules,\n reviewedReactRules,\n reviewedVitestRules,\n} from \"./rule-policy.ts\";\n\nexport const BASE_LINT_PLUGINS = [\"typescript\", \"unicorn\", \"oxc\", \"import\", \"promise\"] as const;\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\ntype LintRules = NonNullable<LintConfig[\"rules\"]>;\n\nconst baseRules: LintRules = {\n ...reviewedBaseRules,\n\n complexity: [\"error\", { max: 20 }],\n \"getter-return\": \"error\",\n \"no-alert\": \"error\",\n \"no-bitwise\": \"error\",\n \"no-console\": [\"error\", { allow: [\"info\", \"warn\", \"error\"] }],\n \"no-param-reassign\": [\"error\", { props: true }],\n \"no-plusplus\": \"error\",\n \"no-undef\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n \"no-unreachable\": \"error\",\n \"no-useless-return\": \"error\",\n \"prefer-template\": \"error\",\n\n \"import/no-cycle\": \"error\",\n \"import/no-unassigned-import\": \"off\",\n\n \"oxc/bad-match-all-arg\": \"error\",\n\n \"typescript/consistent-return\": \"error\",\n \"typescript/consistent-type-exports\": \"error\",\n \"typescript/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\", fixStyle: \"separate-type-imports\" },\n ],\n \"typescript/dot-notation\": \"error\",\n \"typescript/explicit-module-boundary-types\": \"error\",\n \"typescript/no-confusing-void-expression\": \"error\",\n \"typescript/no-dynamic-delete\": \"error\",\n \"typescript/no-explicit-any\": \"error\",\n \"typescript/no-floating-promises\": \"error\",\n \"typescript/no-misused-promises\": \"error\",\n \"typescript/no-misused-spread\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/no-require-imports\": \"error\",\n \"typescript/no-unnecessary-condition\": \"error\",\n \"typescript/no-unnecessary-qualifier\": \"error\",\n \"typescript/no-unnecessary-type-arguments\": \"error\",\n \"typescript/no-unnecessary-type-assertion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/non-nullable-type-assertion-style\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-find\": \"error\",\n \"typescript/prefer-nullish-coalescing\": \"error\",\n \"typescript/prefer-optional-chain\": \"error\",\n \"typescript/prefer-readonly\": \"error\",\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/require-array-sort-compare\": \"error\",\n \"typescript/restrict-plus-operands\": \"error\",\n \"typescript/restrict-template-expressions\": \"error\",\n \"typescript/return-await\": \"error\",\n \"typescript/strict-boolean-expressions\": \"error\",\n \"typescript/strict-void-return\": \"error\",\n \"typescript/switch-exhaustiveness-check\": \"error\",\n \"typescript/unbound-method\": \"error\",\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n\n \"unicorn/no-abusive-eslint-disable\": \"error\",\n};\n\nconst baseLintConfig: LintConfig = {\n plugins: [...BASE_LINT_PLUGINS],\n ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],\n env: {\n serviceworker: true,\n worker: true,\n },\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n },\n rules: baseRules,\n overrides: [\n {\n files: [\"**/*.{cjs,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"typescript/no-require-imports\": \"off\",\n },\n },\n {\n files: [\"**/*.config.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"func-names\": \"off\",\n },\n },\n {\n files: [\"**/*.d.ts\"],\n rules: {\n \"typescript/no-empty-interface\": \"off\",\n },\n },\n {\n files: [\n \"**/test/**\",\n \"**/tests/**\",\n \"**/__tests__/**\",\n \"**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\",\n ],\n plugins: [...BASE_LINT_PLUGINS, \"vitest\"],\n env: {\n vitest: true,\n },\n rules: reviewedVitestRules,\n },\n ],\n};\n\nexport const baseLint: LintConfig = baseLintConfig;\n\nconst reactRules: LintRules = {\n ...reviewedReactRules,\n\n \"react/exhaustive-deps\": \"error\",\n \"react/react-compiler\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"react/jsx-key\": \"error\",\n \"react/jsx-no-constructed-context-values\": \"error\",\n \"react/jsx-no-duplicate-props\": \"error\",\n \"react/jsx-no-undef\": \"error\",\n \"react/no-array-index-key\": \"error\",\n \"react/no-children-prop\": \"error\",\n \"react/no-clone-element\": \"error\",\n \"react/no-danger\": \"error\",\n \"react/no-danger-with-children\": \"error\",\n \"react/no-direct-mutation-state\": \"error\",\n \"react/no-find-dom-node\": \"error\",\n \"react/no-react-children\": \"error\",\n \"react/no-string-refs\": \"error\",\n \"react/no-unsafe\": \"error\",\n \"react/no-unknown-property\": \"error\",\n \"react/style-prop-object\": \"off\",\n \"react/void-dom-elements-no-children\": \"error\",\n};\n\nconst reactLintConfig: LintConfig = {\n plugins: [\"react\", \"jsx-a11y\"],\n env: {\n browser: true,\n },\n rules: reactRules,\n};\n\nexport const reactLint: LintConfig = reactLintConfig;\n\nconst reactNativeLintConfig: LintConfig = {\n plugins: [\"react\"],\n ignorePatterns: [...REACT_NATIVE_IGNORE_PATTERNS],\n env: {\n browser: false,\n },\n globals: {\n __DEV__: \"readonly\",\n process: \"readonly\",\n },\n rules: {\n ...reactRules,\n \"react/no-unknown-property\": \"off\",\n \"react/no-unescaped-entities\": \"off\",\n \"react/no-unstable-nested-components\": [\"error\", { allowAsProps: true }],\n },\n};\n\nexport const reactNativeLint: LintConfig = reactNativeLintConfig;\n\nconst serverLintConfig: LintConfig = {\n plugins: [\"node\"],\n globals: {\n WebSocketPair: \"readonly\",\n },\n rules: reviewedNodeRules,\n};\n\nexport const serverLint: LintConfig = serverLintConfig;\n","import type { UserConfig } from \"vite-plus\";\nimport type { ConfigInput } from \"../shared/config.ts\";\nimport { createDefinedConfig } from \"../shared/config.ts\";\nimport {\n DEFAULT_STAGED_CHECK_COMMAND,\n DEFAULT_STAGED_CHECK_GLOB,\n DEFAULT_TEST_INCLUDE,\n} from \"../shared/constants.ts\";\nimport { baseFmt } from \"../shared/fmt.ts\";\nimport { baseLint } from \"../shared/lint.ts\";\n\nconst baseConfig: UserConfig = {\n fmt: baseFmt,\n lint: baseLint,\n test: {\n include: [...DEFAULT_TEST_INCLUDE],\n },\n staged: {\n [DEFAULT_STAGED_CHECK_GLOB]: DEFAULT_STAGED_CHECK_COMMAND,\n },\n};\n\nexport function createBaseConfig(overrides: ConfigInput = {}): UserConfig {\n return createDefinedConfig(baseConfig, overrides);\n}\n\nexport { createBaseConfig as createConfig };\n"],"mappings":";;AAgBA,SAAgB,uBACd,SACoC;CAEpC,OAAO,YAAY,OAAgB;AACrC;AAEA,SAAS,aAAa,QAAiC;CAErD,OAAO;AACT;AAEA,SAAS,oBAAoB,SAAqB,UAAmC;CACnF,MAAM,SAAS,aAAa,YAAoC,SAAS,aAAa,QAAQ,CAAC,CAAC;CAEhG,MAAM,QAAQ,SAAS,MAAM;CAE7B,IAAI,UAAU,KAAA,GACZ,OAAO;CAGT,OAAO;EACL,GAAG;EACH,MAAM;GACJ,GAAG,OAAO;GACV,OAAO;IACL,GAAG,QAAQ,MAAM;IACjB,GAAG;GACL;EACF;CACF;AACF;AAEA,SAAgB,qBAAqB,MAAmB,GAAG,WAAsC;CAC/F,IAAI,SAAS,oBAAoB,CAAC,GAAG,IAAI;CAEzC,KAAK,MAAM,YAAY,WACrB,SAAS,oBAAoB,QAAQ,QAAQ;CAG/C,OAAO;AACT;AAEA,SAAgB,oBAAoB,MAAmB,GAAG,WAAsC;CAC9F,OAAO,aAAa,qBAAqB,MAAM,GAAG,SAAS,CAAC;AAC9D;;;AC7DA,MAAa,uBAAuB,CAAC,mCAAmC;AACxE,MAAa,0BAA0B;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAa,+BAA+B,CAAC,aAAa;AAE1D,MAAa,4BAA4B;AACzC,MAAa,+BAA+B;AAC5C,MAAa,+BAA+B;;;ACV5C,MAAa,UAAqB;CAChC,gBAAgB,CAAC,GAAG,uBAAuB;CAC3C,aAAa;EACX,iBAAiB,CAAC,KAAK,IAAI;EAC3B,iBAAiB;EACjB,QAAQ;GACN;GACA,CAAC,iBAAiB,gBAAgB;GAClC;GACA;GACA;IAAC;IAAe;IAAgB;GAAY;GAC5C;IAAC;IAAgB;IAAiB;GA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AA+B;EAC/B,uCAAuC,CAAC,SAAS,EAAE,cAAc,KAAK,CAAC;CACzE;AAGyC;AAU3C,MAAa,aAAyB;CAPpC,SAAS,CAAC,MAAM;CAChB,SAAS,EACP,eAAe,WACjB;CACA,OAAO;AAG6B;;;AClMtC,MAAM,aAAyB;CAC7B,KAAK;CACL,MAAM;CACN,MAAM,EACJ,SAAS,CAAC,GAAG,oBAAoB,EACnC;CACA,QAAQ,GACL,4BAA4B,6BAC/B;AACF;AAEA,SAAgB,iBAAiB,YAAyB,CAAC,GAAe;CACxE,OAAO,oBAAoB,YAAY,SAAS;AAClD"}
@@ -1,2 +1,2 @@
1
- import { t as createBaseConfig } from "../../base-Xhg6v9Ct.mjs";
1
+ import { t as createBaseConfig } from "../../base-7cyIJaBC.mjs";
2
2
  export { createBaseConfig, createBaseConfig as createConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/cloudflare-workers/index.ts"],"mappings":";;;;KAQK,iCAAiC,QACpC,YAAY,kBAAkB,yBAC1B;UAGW,uCAAuC,KACtD;WAGS,SAAS;WACT;WACA,OAAO;WACP,WAAW;;iBAGN,8BACd,UAAS,iCACR"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/cloudflare-workers/index.ts"],"mappings":";;;;KAWK,iCAAiC,QACpC,YAAY,kBAAkB,yBAC1B;UAGW,uCAAuC,KACtD;WAGS,SAAS;WACT;WACA,OAAO;WACP,WAAW;;iBAGN,8BACd,UAAS,iCACR"}
@@ -1,17 +1,17 @@
1
- import { a as DEFAULT_WRANGLER_CONFIG_PATH, o as createDefinedConfig, s as mergeConfigFragments } from "../../base-Xhg6v9Ct.mjs";
1
+ import { c as createDefinedConfig, l as createLazyPluginInputs, s as DEFAULT_WRANGLER_CONFIG_PATH, u as mergeConfigFragments } from "../../base-7cyIJaBC.mjs";
2
2
  import { createConfig as createNodeConfig } from "../node/index.mjs";
3
- import { lazyPlugins } from "vite-plus";
4
3
  import { cloudflareTest } from "@cloudflare/vitest-pool-workers";
5
4
  //#region src/cloudflare-workers/index.ts
6
5
  function createCloudflareWorkersConfig(options = {}) {
7
6
  const { config = {}, include, test, wrangler, ...testPluginOptions } = options;
8
- return createNodeConfig(mergeConfigFragments(createDefinedConfig({ plugins: lazyPlugins(() => [cloudflareTest({
7
+ const cloudflareTestConfig = createDefinedConfig({ plugins: createLazyPluginInputs(() => [cloudflareTest({
9
8
  ...testPluginOptions,
10
9
  wrangler: {
11
10
  configPath: DEFAULT_WRANGLER_CONFIG_PATH,
12
11
  ...wrangler
13
12
  }
14
- })]) }, include === void 0 ? {} : { test: { include: [...include] } }, { test }), config));
13
+ })]) }, include === void 0 ? {} : { test: { include: [...include] } }, { test });
14
+ return createNodeConfig(mergeConfigFragments(cloudflareTestConfig, config));
15
15
  }
16
16
  //#endregion
17
17
  export { createCloudflareWorkersConfig, createCloudflareWorkersConfig as createConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/cloudflare-workers/index.ts"],"sourcesContent":["import type { UserConfig } from \"vite-plus\";\nimport { cloudflareTest } from \"@cloudflare/vitest-pool-workers\";\nimport { lazyPlugins } from \"vite-plus\";\nimport type { ConfigInput } from \"../shared/config.ts\";\nimport { createNodeConfig } from \"../node/index.ts\";\nimport { createDefinedConfig, mergeConfigFragments } from \"../shared/config.ts\";\nimport { DEFAULT_WRANGLER_CONFIG_PATH } from \"../shared/constants.ts\";\n\ntype CloudflareWorkersPluginOptions = Exclude<\n NonNullable<Parameters<typeof cloudflareTest>[0]>,\n (...args: readonly never[]) => unknown\n>;\n\nexport interface CloudflareWorkersConfigOptions extends Omit<\n CloudflareWorkersPluginOptions,\n \"wrangler\"\n> {\n readonly config?: ConfigInput;\n readonly include?: readonly string[];\n readonly test?: UserConfig[\"test\"];\n readonly wrangler?: CloudflareWorkersPluginOptions[\"wrangler\"];\n}\n\nexport function createCloudflareWorkersConfig(\n options: CloudflareWorkersConfigOptions = {},\n): UserConfig {\n const { config = {}, include, test, wrangler, ...testPluginOptions } = options;\n const cloudflareTestConfig = createDefinedConfig(\n {\n plugins: lazyPlugins(() => [\n cloudflareTest({\n ...testPluginOptions,\n wrangler: {\n configPath: DEFAULT_WRANGLER_CONFIG_PATH,\n ...wrangler,\n },\n }),\n ]),\n },\n include === undefined\n ? {}\n : {\n test: {\n include: [...include],\n },\n },\n {\n test,\n },\n );\n\n return createNodeConfig(mergeConfigFragments(cloudflareTestConfig, config));\n}\n\nexport { createCloudflareWorkersConfig as createConfig };\n"],"mappings":";;;;;AAuBA,SAAgB,8BACd,UAA0C,CAAC,GAC/B;CACZ,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,MAAM,UAAU,GAAG,sBAAsB;CAyBvE,OAAO,iBAAiB,qBAxBK,oBAC3B,EACE,SAAS,kBAAkB,CACzB,eAAe;EACb,GAAG;EACH,UAAU;GACR,YAAY;GACZ,GAAG;EACL;CACF,CAAC,CACH,CAAC,EACH,GACA,YAAY,KAAA,IACR,CAAC,IACD,EACE,MAAM,EACJ,SAAS,CAAC,GAAG,OAAO,EACtB,EACF,GACJ,EACE,KACF,CAG8D,GAAG,MAAM,CAAC;AAC5E"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/cloudflare-workers/index.ts"],"sourcesContent":["import type { UserConfig } from \"vite-plus\";\nimport { cloudflareTest } from \"@cloudflare/vitest-pool-workers\";\nimport type { ConfigInput } from \"../shared/config.ts\";\nimport { createNodeConfig } from \"../node/index.ts\";\nimport {\n createDefinedConfig,\n createLazyPluginInputs,\n mergeConfigFragments,\n} from \"../shared/config.ts\";\nimport { DEFAULT_WRANGLER_CONFIG_PATH } from \"../shared/constants.ts\";\n\ntype CloudflareWorkersPluginOptions = Exclude<\n NonNullable<Parameters<typeof cloudflareTest>[0]>,\n (...args: readonly never[]) => unknown\n>;\n\nexport interface CloudflareWorkersConfigOptions extends Omit<\n CloudflareWorkersPluginOptions,\n \"wrangler\"\n> {\n readonly config?: ConfigInput;\n readonly include?: readonly string[];\n readonly test?: UserConfig[\"test\"];\n readonly wrangler?: CloudflareWorkersPluginOptions[\"wrangler\"];\n}\n\nexport function createCloudflareWorkersConfig(\n options: CloudflareWorkersConfigOptions = {},\n): UserConfig {\n const { config = {}, include, test, wrangler, ...testPluginOptions } = options;\n const cloudflareTestConfig = createDefinedConfig(\n {\n plugins: createLazyPluginInputs(() => [\n cloudflareTest({\n ...testPluginOptions,\n wrangler: {\n configPath: DEFAULT_WRANGLER_CONFIG_PATH,\n ...wrangler,\n },\n }),\n ]),\n },\n include === undefined\n ? {}\n : {\n test: {\n include: [...include],\n },\n },\n {\n test,\n },\n );\n\n return createNodeConfig(mergeConfigFragments(cloudflareTestConfig, config));\n}\n\nexport { createCloudflareWorkersConfig as createConfig };\n"],"mappings":";;;;AA0BA,SAAgB,8BACd,UAA0C,CAAC,GAC/B;CACZ,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,MAAM,UAAU,GAAG,sBAAsB;CACvE,MAAM,uBAAuB,oBAC3B,EACE,SAAS,6BAA6B,CACpC,eAAe;EACb,GAAG;EACH,UAAU;GACR,YAAY;GACZ,GAAG;EACL;CACF,CAAC,CACH,CAAC,EACH,GACA,YAAY,KAAA,IACR,CAAC,IACD,EACE,MAAM,EACJ,SAAS,CAAC,GAAG,OAAO,EACtB,EACF,GACJ,EACE,KACF,CACF;CAEA,OAAO,iBAAiB,qBAAqB,sBAAsB,MAAM,CAAC;AAC5E"}
@@ -1,4 +1,4 @@
1
- import { o as createDefinedConfig, t as createBaseConfig } from "../../base-Xhg6v9Ct.mjs";
1
+ import { c as createDefinedConfig, t as createBaseConfig } from "../../base-7cyIJaBC.mjs";
2
2
  //#region src/library/index.ts
3
3
  const libraryConfig = { pack: {
4
4
  clean: true,
@@ -1,4 +1,4 @@
1
- import { o as createDefinedConfig, t as createBaseConfig } from "../../base-Xhg6v9Ct.mjs";
1
+ import { c as createDefinedConfig, t as createBaseConfig } from "../../base-7cyIJaBC.mjs";
2
2
  //#region src/monorepo/index.ts
3
3
  const monorepoConfig = { run: {
4
4
  cache: {
@@ -1,4 +1,4 @@
1
- import { o as createDefinedConfig, r as serverLint, t as createBaseConfig } from "../../base-Xhg6v9Ct.mjs";
1
+ import { c as createDefinedConfig, i as serverLint, t as createBaseConfig } from "../../base-7cyIJaBC.mjs";
2
2
  //#region src/node/index.ts
3
3
  const nodeConfig = { lint: serverLint };
4
4
  function createNodeConfig(overrides = {}) {
@@ -1,4 +1,4 @@
1
- import { i as reactFmt, n as reactLint, o as createDefinedConfig, t as createBaseConfig } from "../../base-Xhg6v9Ct.mjs";
1
+ import { a as reactFmt, c as createDefinedConfig, n as reactLint, t as createBaseConfig } from "../../base-7cyIJaBC.mjs";
2
2
  //#region src/react/index.ts
3
3
  const reactConfig = {
4
4
  fmt: reactFmt,
@@ -0,0 +1,7 @@
1
+ import { t as ConfigInput } from "../../config-Cxe-N0iS.mjs";
2
+ import { UserConfig } from "vite-plus";
3
+ //#region src/react-native/index.d.ts
4
+ declare function createReactNativeConfig(overrides?: ConfigInput): UserConfig;
5
+ //#endregion
6
+ export { createReactNativeConfig as createConfig, createReactNativeConfig };
7
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/react-native/index.ts"],"mappings":";;;iBAYgB,wBAAwB,YAAW,cAAmB"}
@@ -0,0 +1,13 @@
1
+ import { c as createDefinedConfig, o as reactNativeFmt, r as reactNativeLint, t as createBaseConfig } from "../../base-7cyIJaBC.mjs";
2
+ //#region src/react-native/index.ts
3
+ const reactNativeConfig = {
4
+ fmt: reactNativeFmt,
5
+ lint: reactNativeLint
6
+ };
7
+ function createReactNativeConfig(overrides = {}) {
8
+ return createDefinedConfig(createBaseConfig(), reactNativeConfig, overrides);
9
+ }
10
+ //#endregion
11
+ export { createReactNativeConfig as createConfig, createReactNativeConfig };
12
+
13
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/react-native/index.ts"],"sourcesContent":["import type { UserConfig } from \"vite-plus\";\nimport type { ConfigInput } from \"../shared/config.ts\";\nimport { createBaseConfig } from \"../base/index.ts\";\nimport { createDefinedConfig } from \"../shared/config.ts\";\nimport { reactNativeFmt } from \"../shared/fmt.ts\";\nimport { reactNativeLint } from \"../shared/lint.ts\";\n\nconst reactNativeConfig: UserConfig = {\n fmt: reactNativeFmt,\n lint: reactNativeLint,\n};\n\nexport function createReactNativeConfig(overrides: ConfigInput = {}): UserConfig {\n return createDefinedConfig(createBaseConfig(), reactNativeConfig, overrides);\n}\n\nexport { createReactNativeConfig as createConfig };\n"],"mappings":";;AAOA,MAAM,oBAAgC;CACpC,KAAK;CACL,MAAM;AACR;AAEA,SAAgB,wBAAwB,YAAyB,CAAC,GAAe;CAC/E,OAAO,oBAAoB,iBAAiB,GAAG,mBAAmB,SAAS;AAC7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kasoa/vite-plus-config",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Kasoa's Vite+ configurations",
5
5
  "keywords": [
6
6
  "config",
@@ -37,6 +37,10 @@
37
37
  "types": "./dist/src/react/index.d.mts",
38
38
  "import": "./dist/src/react/index.mjs"
39
39
  },
40
+ "./react-native": {
41
+ "types": "./dist/src/react-native/index.d.mts",
42
+ "import": "./dist/src/react-native/index.mjs"
43
+ },
40
44
  "./node": {
41
45
  "types": "./dist/src/node/index.d.mts",
42
46
  "import": "./dist/src/node/index.mjs"
@@ -57,24 +61,16 @@
57
61
  "publishConfig": {
58
62
  "access": "public"
59
63
  },
60
- "scripts": {
61
- "dev": "vp pack --watch",
62
- "build": "vp pack",
63
- "check": "vp check",
64
- "check:fix": "vp check --fix",
65
- "test": "vp test --passWithNoTests",
66
- "prepublishOnly": "pnpm build"
67
- },
68
64
  "devDependencies": {
69
- "@cloudflare/vitest-pool-workers": "^0.16.8",
70
- "@types/node": "^25.9.1",
65
+ "@cloudflare/vitest-pool-workers": "^0.20.2",
66
+ "@types/node": "^24.13.3",
71
67
  "typescript": "^7.0.2",
72
- "vite-plus": "^0.2.5",
73
- "wrangler": "^4.93.1"
68
+ "vite-plus": "^0.2.8",
69
+ "wrangler": "^4.119.0"
74
70
  },
75
71
  "peerDependencies": {
76
72
  "@cloudflare/vitest-pool-workers": ">=0.13.0 <1",
77
- "vite-plus": ">=0.2.1 <1",
73
+ "vite-plus": ">=0.2.8 <1",
78
74
  "wrangler": ">=4 <5"
79
75
  },
80
76
  "peerDependenciesMeta": {
@@ -86,6 +82,14 @@
86
82
  }
87
83
  },
88
84
  "engines": {
89
- "node": ">=24"
85
+ "node": ">=24.11.0"
86
+ },
87
+ "scripts": {
88
+ "dev": "vp pack --watch",
89
+ "build": "vp pack",
90
+ "check": "vp check",
91
+ "check:fix": "vp check --fix",
92
+ "test": "vp test --passWithNoTests",
93
+ "verify:package": "publint --pack pnpm --strict && attw --pack --profile esm-only"
90
94
  }
91
- }
95
+ }
@@ -1,287 +0,0 @@
1
- import { defineConfig, mergeConfig } from "vite-plus";
2
- //#region src/shared/config.ts
3
- function toUserConfig(config) {
4
- return config;
5
- }
6
- function mergeConfigFragment(current, fragment) {
7
- const merged = toUserConfig(mergeConfig(current, toUserConfig(fragment)));
8
- const rules = fragment.lint?.rules;
9
- if (rules === void 0) return merged;
10
- return {
11
- ...merged,
12
- lint: {
13
- ...merged.lint,
14
- rules: {
15
- ...current.lint?.rules,
16
- ...rules
17
- }
18
- }
19
- };
20
- }
21
- function mergeConfigFragments(base, ...overrides) {
22
- let result = mergeConfigFragment({}, base);
23
- for (const override of overrides) result = mergeConfigFragment(result, override);
24
- return result;
25
- }
26
- function createDefinedConfig(base, ...overrides) {
27
- return defineConfig(mergeConfigFragments(base, ...overrides));
28
- }
29
- //#endregion
30
- //#region src/shared/constants.ts
31
- const DEFAULT_TEST_INCLUDE = ["**/*.{test,spec}.{ts,tsx,mts,cts}"];
32
- const DEFAULT_IGNORE_PATTERNS = [
33
- "node_modules/**",
34
- "dist/**",
35
- "dist-ssr/**",
36
- "**/worker-configuration.d.ts",
37
- "**/migrations/**",
38
- "**/drizzle/migrations.js",
39
- "**/drizzle/meta/*.json"
40
- ];
41
- const DEFAULT_STAGED_CHECK_GLOB = "*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}";
42
- const DEFAULT_STAGED_CHECK_COMMAND = "vp check --fix";
43
- const DEFAULT_WRANGLER_CONFIG_PATH = "./wrangler.jsonc";
44
- //#endregion
45
- //#region src/shared/fmt.ts
46
- const baseFmt = {
47
- ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],
48
- sortImports: {
49
- internalPattern: ["#", "@/"],
50
- newlinesBetween: false,
51
- groups: [
52
- "type-import",
53
- ["value-builtin", "value-external"],
54
- "type-internal",
55
- "value-internal",
56
- [
57
- "type-parent",
58
- "type-sibling",
59
- "type-index"
60
- ],
61
- [
62
- "value-parent",
63
- "value-sibling",
64
- "value-index"
65
- ],
66
- "unknown"
67
- ]
68
- }
69
- };
70
- const reactFmt = { sortTailwindcss: {
71
- attributes: ["/.*ClassName/"],
72
- functions: ["tv"]
73
- } };
74
- //#endregion
75
- //#region src/shared/lint.ts
76
- const BASE_LINT_PLUGINS = [
77
- "typescript",
78
- "unicorn",
79
- "oxc",
80
- "import",
81
- "promise"
82
- ];
83
- const baseLint = {
84
- plugins: [...BASE_LINT_PLUGINS],
85
- ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],
86
- env: {
87
- serviceworker: true,
88
- worker: true
89
- },
90
- options: {
91
- reportUnusedDisableDirectives: "error",
92
- typeAware: true,
93
- typeCheck: true
94
- },
95
- categories: {
96
- correctness: "error",
97
- suspicious: "error",
98
- pedantic: "error",
99
- perf: "error",
100
- style: "error"
101
- },
102
- rules: {
103
- "capitalized-comments": "off",
104
- "func-style": "off",
105
- "id-length": "off",
106
- "init-declarations": "off",
107
- "max-classes-per-file": "off",
108
- "max-lines": "off",
109
- "max-lines-per-function": "off",
110
- "max-statements": "off",
111
- "no-continue": "off",
112
- "no-magic-numbers": "off",
113
- "no-ternary": "off",
114
- "require-await": "off",
115
- "sort-imports": "off",
116
- "sort-keys": "off",
117
- "vars-on-top": "off",
118
- complexity: ["error", { max: 20 }],
119
- curly: [
120
- "error",
121
- "multi-line",
122
- "consistent"
123
- ],
124
- "default-case-last": "error",
125
- eqeqeq: "error",
126
- "getter-return": "error",
127
- "grouped-accessor-pairs": ["error", "getBeforeSet"],
128
- "max-depth": ["error", { max: 3 }],
129
- "max-nested-callbacks": ["error", { max: 3 }],
130
- "max-params": ["error", { max: 3 }],
131
- "new-cap": "off",
132
- "no-alert": "error",
133
- "no-bitwise": "error",
134
- "no-console": ["error", { allow: [
135
- "info",
136
- "warn",
137
- "error"
138
- ] }],
139
- "no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
140
- "no-param-reassign": ["error", { props: true }],
141
- "no-plusplus": "error",
142
- "no-undef": "error",
143
- "no-unneeded-ternary": "error",
144
- "no-unreachable": "error",
145
- "no-useless-return": "error",
146
- "prefer-template": "error",
147
- "import/exports-last": "off",
148
- "import/group-exports": "off",
149
- "import/no-anonymous-default-export": "off",
150
- "import/no-named-export": "off",
151
- "import/no-namespace": "off",
152
- "import/no-nodejs-modules": "off",
153
- "import/no-unassigned-import": "off",
154
- "import/prefer-default-export": "off",
155
- "import/max-dependencies": "off",
156
- "import/no-cycle": "error",
157
- "promise/prefer-await-to-callbacks": "off",
158
- "typescript/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
159
- "typescript/consistent-type-definitions": "off",
160
- "typescript/consistent-return": "error",
161
- "typescript/consistent-type-exports": "error",
162
- "typescript/consistent-type-imports": ["error", {
163
- prefer: "type-imports",
164
- fixStyle: "separate-type-imports"
165
- }],
166
- "typescript/dot-notation": "error",
167
- "typescript/explicit-module-boundary-types": "error",
168
- "typescript/no-confusing-void-expression": "error",
169
- "typescript/no-dynamic-delete": "error",
170
- "typescript/no-explicit-any": "error",
171
- "typescript/no-floating-promises": "error",
172
- "typescript/no-misused-promises": "error",
173
- "typescript/no-misused-spread": "error",
174
- "typescript/no-non-null-assertion": "error",
175
- "typescript/no-require-imports": "error",
176
- "typescript/no-unnecessary-condition": "error",
177
- "typescript/no-unnecessary-qualifier": "error",
178
- "typescript/no-unnecessary-type-arguments": "error",
179
- "typescript/no-unnecessary-type-assertion": "error",
180
- "typescript/no-unnecessary-type-parameters": "error",
181
- "typescript/no-unsafe-argument": "error",
182
- "typescript/no-unsafe-assignment": "error",
183
- "typescript/no-unsafe-call": "error",
184
- "typescript/no-unsafe-member-access": "error",
185
- "typescript/no-unsafe-return": "error",
186
- "typescript/no-useless-default-assignment": "error",
187
- "typescript/non-nullable-type-assertion-style": "error",
188
- "typescript/only-throw-error": "error",
189
- "typescript/prefer-find": "error",
190
- "typescript/prefer-nullish-coalescing": "error",
191
- "typescript/prefer-optional-chain": "error",
192
- "typescript/prefer-readonly": "error",
193
- "typescript/prefer-readonly-parameter-types": "off",
194
- "typescript/prefer-regexp-exec": "error",
195
- "typescript/require-await": "off",
196
- "typescript/require-array-sort-compare": "error",
197
- "typescript/restrict-plus-operands": "error",
198
- "typescript/restrict-template-expressions": "error",
199
- "typescript/return-await": "error",
200
- "typescript/strict-boolean-expressions": "error",
201
- "typescript/strict-void-return": "error",
202
- "typescript/switch-exhaustiveness-check": "error",
203
- "typescript/unbound-method": "error",
204
- "typescript/use-unknown-in-catch-callback-variable": "error",
205
- "unicorn/no-null": "off",
206
- "unicorn/no-abusive-eslint-disable": "error",
207
- "unicorn/filename-case": ["error", { case: "kebabCase" }]
208
- },
209
- overrides: [
210
- {
211
- files: ["**/*.{cjs,cts}"],
212
- env: { node: true },
213
- rules: { "typescript/no-require-imports": "off" }
214
- },
215
- {
216
- files: ["**/*.config.{js,jsx,ts,tsx,mjs,cjs,mts,cts}"],
217
- env: { node: true },
218
- rules: { "func-names": "off" }
219
- },
220
- {
221
- files: ["**/*.d.ts"],
222
- rules: { "typescript/no-empty-interface": "off" }
223
- },
224
- {
225
- files: [
226
- "**/test/**",
227
- "**/tests/**",
228
- "**/__tests__/**",
229
- "**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}"
230
- ],
231
- plugins: [...BASE_LINT_PLUGINS, "vitest"],
232
- env: { vitest: true },
233
- rules: {
234
- "vitest/no-importing-vitest-globals": "off",
235
- "vitest/max-nested-describe": ["error", { max: 3 }]
236
- }
237
- }
238
- ]
239
- };
240
- const reactLint = {
241
- plugins: ["react", "jsx-a11y"],
242
- env: { browser: true },
243
- rules: {
244
- "jsx-a11y/alt-text": "error",
245
- "react/jsx-props-no-spreading": "off",
246
- "react/react-in-jsx-scope": "off",
247
- "react/exhaustive-deps": "error",
248
- "react/jsx-key": "error",
249
- "react/jsx-max-depth": ["error", { max: 4 }],
250
- "react/jsx-no-constructed-context-values": "error",
251
- "react/jsx-no-duplicate-props": "error",
252
- "react/jsx-no-undef": "error",
253
- "react/no-array-index-key": "error",
254
- "react/no-children-prop": "error",
255
- "react/no-clone-element": "error",
256
- "react/no-danger": "error",
257
- "react/no-danger-with-children": "error",
258
- "react/no-direct-mutation-state": "error",
259
- "react/no-find-dom-node": "error",
260
- "react/no-react-children": "error",
261
- "react/no-string-refs": "error",
262
- "react/style-prop-object": "off",
263
- "react/no-unsafe": "error",
264
- "react/no-unknown-property": "error",
265
- "react/void-dom-elements-no-children": "error"
266
- }
267
- };
268
- const serverLint = {
269
- plugins: ["node"],
270
- globals: { WebSocketPair: "readonly" },
271
- rules: { "node/no-exports-assign": "error" }
272
- };
273
- //#endregion
274
- //#region src/base/index.ts
275
- const baseConfig = {
276
- fmt: baseFmt,
277
- lint: baseLint,
278
- test: { include: [...DEFAULT_TEST_INCLUDE] },
279
- staged: { [DEFAULT_STAGED_CHECK_GLOB]: DEFAULT_STAGED_CHECK_COMMAND }
280
- };
281
- function createBaseConfig(overrides = {}) {
282
- return createDefinedConfig(baseConfig, overrides);
283
- }
284
- //#endregion
285
- export { DEFAULT_WRANGLER_CONFIG_PATH as a, reactFmt as i, reactLint as n, createDefinedConfig as o, serverLint as r, mergeConfigFragments as s, createBaseConfig as t };
286
-
287
- //# sourceMappingURL=base-Xhg6v9Ct.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-Xhg6v9Ct.mjs","names":[],"sources":["../src/shared/config.ts","../src/shared/constants.ts","../src/shared/fmt.ts","../src/shared/lint.ts","../src/base/index.ts"],"sourcesContent":["import type { UserConfig } from \"vite-plus\";\nimport { defineConfig, mergeConfig } from \"vite-plus\";\n\nexport type PluginInput = object | readonly object[] | false | null | undefined;\n\nexport type ConfigInput = Omit<UserConfig, \"plugins\"> & {\n /**\n * Vite plugins to merge into the config.\n *\n * This is intentionally typed structurally instead of as Vite's recursive\n * PluginOption type. Vite 8 plugin types from different Vite entrypoints can\n * trigger excessive stack-depth comparisons before the config reaches Vite.\n */\n readonly plugins?: readonly PluginInput[];\n};\n\nfunction toUserConfig(config: ConfigInput): UserConfig {\n // eslint-disable-next-line typescript/no-unsafe-type-assertion -- ConfigInput preserves UserConfig autocomplete but keeps plugin assignability shallow at our public boundary.\n return config as UserConfig;\n}\n\nfunction mergeConfigFragment(current: UserConfig, fragment: ConfigInput): UserConfig {\n const merged = toUserConfig(mergeConfig<UserConfig, UserConfig>(current, toUserConfig(fragment)));\n // Vite concatenates nested arrays, but an Oxlint rule tuple is one atomic value.\n const rules = fragment.lint?.rules;\n\n if (rules === undefined) {\n return merged;\n }\n\n return {\n ...merged,\n lint: {\n ...merged.lint,\n rules: {\n ...current.lint?.rules,\n ...rules,\n },\n },\n };\n}\n\nexport function mergeConfigFragments(base: ConfigInput, ...overrides: ConfigInput[]): UserConfig {\n let result = mergeConfigFragment({}, base);\n\n for (const override of overrides) {\n result = mergeConfigFragment(result, override);\n }\n\n return result;\n}\n\nexport function createDefinedConfig(base: ConfigInput, ...overrides: ConfigInput[]): UserConfig {\n return defineConfig(mergeConfigFragments(base, ...overrides));\n}\n","export const DEFAULT_TEST_INCLUDE = [\"**/*.{test,spec}.{ts,tsx,mts,cts}\"] as const;\nexport const DEFAULT_IGNORE_PATTERNS = [\n \"node_modules/**\",\n \"dist/**\",\n \"dist-ssr/**\",\n \"**/worker-configuration.d.ts\",\n \"**/migrations/**\",\n \"**/drizzle/migrations.js\",\n \"**/drizzle/meta/*.json\",\n] as const;\n\nexport const DEFAULT_STAGED_CHECK_GLOB = \"*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\";\nexport const DEFAULT_STAGED_CHECK_COMMAND = \"vp check --fix\";\nexport const DEFAULT_WRANGLER_CONFIG_PATH = \"./wrangler.jsonc\";\n","import type { UserConfig } from \"vite-plus\";\nimport { DEFAULT_IGNORE_PATTERNS } from \"./constants.ts\";\n\ntype FmtConfig = NonNullable<UserConfig[\"fmt\"]>;\n\nexport const baseFmt: FmtConfig = {\n ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],\n sortImports: {\n internalPattern: [\"#\", \"@/\"],\n newlinesBetween: false,\n groups: [\n \"type-import\",\n [\"value-builtin\", \"value-external\"],\n \"type-internal\",\n \"value-internal\",\n [\"type-parent\", \"type-sibling\", \"type-index\"],\n [\"value-parent\", \"value-sibling\", \"value-index\"],\n \"unknown\",\n ],\n },\n};\n\nexport const reactFmt: FmtConfig = {\n sortTailwindcss: {\n attributes: [\"/.*ClassName/\"],\n functions: [\"tv\"],\n },\n};\n","import type { UserConfig } from \"vite-plus\";\nimport { DEFAULT_IGNORE_PATTERNS } from \"./constants.ts\";\n\nexport const BASE_LINT_PLUGINS = [\"typescript\", \"unicorn\", \"oxc\", \"import\", \"promise\"] as const;\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst baseLintConfig: LintConfig = {\n plugins: [...BASE_LINT_PLUGINS],\n ignorePatterns: [...DEFAULT_IGNORE_PATTERNS],\n env: {\n serviceworker: true,\n worker: true,\n },\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n },\n rules: {\n \"capitalized-comments\": \"off\",\n \"func-style\": \"off\",\n \"id-length\": \"off\",\n \"init-declarations\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-continue\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-ternary\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n \"vars-on-top\": \"off\",\n\n complexity: [\"error\", { max: 20 }],\n curly: [\"error\", \"multi-line\", \"consistent\"],\n \"default-case-last\": \"error\",\n eqeqeq: \"error\",\n \"getter-return\": \"error\",\n \"grouped-accessor-pairs\": [\"error\", \"getBeforeSet\"],\n \"max-depth\": [\"error\", { max: 3 }],\n \"max-nested-callbacks\": [\"error\", { max: 3 }],\n \"max-params\": [\"error\", { max: 3 }],\n \"new-cap\": \"off\",\n \"no-alert\": \"error\",\n \"no-bitwise\": \"error\",\n \"no-console\": [\"error\", { allow: [\"info\", \"warn\", \"error\"] }],\n \"no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"no-param-reassign\": [\"error\", { props: true }],\n \"no-plusplus\": \"error\",\n \"no-undef\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n \"no-unreachable\": \"error\",\n \"no-useless-return\": \"error\",\n \"prefer-template\": \"error\",\n\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/no-anonymous-default-export\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-namespace\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/max-dependencies\": \"off\",\n \"import/no-cycle\": \"error\",\n\n \"promise/prefer-await-to-callbacks\": \"off\",\n\n \"typescript/ban-ts-comment\": [\"error\", { minimumDescriptionLength: 10 }],\n \"typescript/consistent-type-definitions\": \"off\",\n \"typescript/consistent-return\": \"error\",\n \"typescript/consistent-type-exports\": \"error\",\n \"typescript/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\", fixStyle: \"separate-type-imports\" },\n ],\n \"typescript/dot-notation\": \"error\",\n \"typescript/explicit-module-boundary-types\": \"error\",\n \"typescript/no-confusing-void-expression\": \"error\",\n \"typescript/no-dynamic-delete\": \"error\",\n \"typescript/no-explicit-any\": \"error\",\n \"typescript/no-floating-promises\": \"error\",\n \"typescript/no-misused-promises\": \"error\",\n \"typescript/no-misused-spread\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/no-require-imports\": \"error\",\n \"typescript/no-unnecessary-condition\": \"error\",\n \"typescript/no-unnecessary-qualifier\": \"error\",\n \"typescript/no-unnecessary-type-arguments\": \"error\",\n \"typescript/no-unnecessary-type-assertion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/non-nullable-type-assertion-style\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-find\": \"error\",\n \"typescript/prefer-nullish-coalescing\": \"error\",\n \"typescript/prefer-optional-chain\": \"error\",\n \"typescript/prefer-readonly\": \"error\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/require-await\": \"off\",\n \"typescript/require-array-sort-compare\": \"error\",\n \"typescript/restrict-plus-operands\": \"error\",\n \"typescript/restrict-template-expressions\": \"error\",\n \"typescript/return-await\": \"error\",\n \"typescript/strict-boolean-expressions\": \"error\",\n \"typescript/strict-void-return\": \"error\",\n \"typescript/switch-exhaustiveness-check\": \"error\",\n \"typescript/unbound-method\": \"error\",\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n\n \"unicorn/no-null\": \"off\",\n \"unicorn/no-abusive-eslint-disable\": \"error\",\n \"unicorn/filename-case\": [\"error\", { case: \"kebabCase\" }],\n },\n overrides: [\n {\n files: [\"**/*.{cjs,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"typescript/no-require-imports\": \"off\",\n },\n },\n {\n files: [\"**/*.config.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"func-names\": \"off\",\n },\n },\n {\n files: [\"**/*.d.ts\"],\n rules: {\n \"typescript/no-empty-interface\": \"off\",\n },\n },\n {\n files: [\n \"**/test/**\",\n \"**/tests/**\",\n \"**/__tests__/**\",\n \"**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\",\n ],\n plugins: [...BASE_LINT_PLUGINS, \"vitest\"],\n env: {\n vitest: true,\n },\n rules: {\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/max-nested-describe\": [\"error\", { max: 3 }],\n },\n },\n ],\n};\n\nexport const baseLint: LintConfig = baseLintConfig;\n\nconst reactLintConfig: LintConfig = {\n plugins: [\"react\", \"jsx-a11y\"],\n env: {\n browser: true,\n },\n rules: {\n \"jsx-a11y/alt-text\": \"error\",\n\n \"react/jsx-props-no-spreading\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n \"react/exhaustive-deps\": \"error\",\n \"react/jsx-key\": \"error\",\n \"react/jsx-max-depth\": [\"error\", { max: 4 }],\n \"react/jsx-no-constructed-context-values\": \"error\",\n \"react/jsx-no-duplicate-props\": \"error\",\n \"react/jsx-no-undef\": \"error\",\n \"react/no-array-index-key\": \"error\",\n \"react/no-children-prop\": \"error\",\n \"react/no-clone-element\": \"error\",\n \"react/no-danger\": \"error\",\n \"react/no-danger-with-children\": \"error\",\n \"react/no-direct-mutation-state\": \"error\",\n \"react/no-find-dom-node\": \"error\",\n \"react/no-react-children\": \"error\",\n \"react/no-string-refs\": \"error\",\n \"react/style-prop-object\": \"off\",\n \"react/no-unsafe\": \"error\",\n \"react/no-unknown-property\": \"error\",\n \"react/void-dom-elements-no-children\": \"error\",\n },\n};\n\nexport const reactLint: LintConfig = reactLintConfig;\n\nconst serverLintConfig: LintConfig = {\n plugins: [\"node\"],\n globals: {\n WebSocketPair: \"readonly\",\n },\n rules: {\n \"node/no-exports-assign\": \"error\",\n },\n};\n\nexport const serverLint: LintConfig = serverLintConfig;\n","import type { UserConfig } from \"vite-plus\";\nimport type { ConfigInput } from \"../shared/config.ts\";\nimport { createDefinedConfig } from \"../shared/config.ts\";\nimport {\n DEFAULT_STAGED_CHECK_COMMAND,\n DEFAULT_STAGED_CHECK_GLOB,\n DEFAULT_TEST_INCLUDE,\n} from \"../shared/constants.ts\";\nimport { baseFmt } from \"../shared/fmt.ts\";\nimport { baseLint } from \"../shared/lint.ts\";\n\nconst baseConfig: UserConfig = {\n fmt: baseFmt,\n lint: baseLint,\n test: {\n include: [...DEFAULT_TEST_INCLUDE],\n },\n staged: {\n [DEFAULT_STAGED_CHECK_GLOB]: DEFAULT_STAGED_CHECK_COMMAND,\n },\n};\n\nexport function createBaseConfig(overrides: ConfigInput = {}): UserConfig {\n return createDefinedConfig(baseConfig, overrides);\n}\n\nexport { createBaseConfig as createConfig };\n"],"mappings":";;AAgBA,SAAS,aAAa,QAAiC;CAErD,OAAO;AACT;AAEA,SAAS,oBAAoB,SAAqB,UAAmC;CACnF,MAAM,SAAS,aAAa,YAAoC,SAAS,aAAa,QAAQ,CAAC,CAAC;CAEhG,MAAM,QAAQ,SAAS,MAAM;CAE7B,IAAI,UAAU,KAAA,GACZ,OAAO;CAGT,OAAO;EACL,GAAG;EACH,MAAM;GACJ,GAAG,OAAO;GACV,OAAO;IACL,GAAG,QAAQ,MAAM;IACjB,GAAG;GACL;EACF;CACF;AACF;AAEA,SAAgB,qBAAqB,MAAmB,GA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