diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 93e84f9d..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "node": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest" - }, - "plugins": [ - "@typescript-eslint", - "simple-import-sort", - "import" - ], - "rules": { - "@typescript-eslint/no-explicit-any": "off", - "simple-import-sort/imports": "error", - "simple-import-sort/exports": "error", - "import/first": "error", - "import/newline-after-import": "error", - "import/no-duplicates": "error" - }, - "overrides": [ - { - "files": [ - "*.spec.ts" - ], - "env": { - "jest": true - }, - "rules": { - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "off", - "import/no-extraneous-dependencies": "off", - "prefer-object-has-own": "off" - } - } - ], - "ignorePatterns": [ - "dist", - "node_modules", - "example", - "vitest.config.ts", - "tsconfig.json" - ] -} \ No newline at end of file diff --git a/.github/renovate.json b/.github/renovate.json index a00b136f..a04988dc 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -9,4 +9,4 @@ "dependencyDashboard": false, "onboarding": false, "prConcurrentLimit": 5 -} \ No newline at end of file +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3b2dfe3..e73f105e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: current - cache: 'pnpm' + cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm test env: @@ -32,10 +32,9 @@ jobs: uses: actions/setup-node@v3 with: node-version: current - cache: 'pnpm' + cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm lint-fix - - run: pnpm prettier - name: Auto commit fixed code id: auto-commit-action uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 6bbb83f4..2aa1c06d 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -1,4 +1,4 @@ -name: 'good first issue' +name: good first issue on: [issues] jobs: diff --git a/.prettierignore b/.prettierignore index 61a92a3a..fa29cdff 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,8 +1 @@ -node_modules -dist -.npmignore -package-lock.json -.DS_Store -tsconfig.tsbuildinfo -example -vitest.config.ts \ No newline at end of file +** \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 0fea5603..00000000 --- a/.prettierrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trailingComma": "es5", - "printWidth": 120, - "singleQuote": true, - "arrowParens": "avoid" -} diff --git a/README.md b/README.md index 13d3d4a4..e5d1461c 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,7 @@ generates: constraint: minLength: min # Replace $1 with specified `startsWith` argument value of the constraint directive - startsWith: ["matches", "/^$1/"] + startsWith: [matches, /^$1/] format: email: email ``` @@ -249,7 +249,7 @@ Then generates yup validation schema like below. ```ts export function ExampleInputSchema(): yup.SchemaOf { return yup.object({ - email: yup.string().defined().required("Hello, World!").min(50).email(), + email: yup.string().defined().required('Hello, World!').min(50).email(), message: yup.string().defined().matches(/^Hello/) }) } @@ -277,7 +277,7 @@ generates: constraint: minLength: min # Replace $1 with specified `startsWith` argument value of the constraint directive - startsWith: ["regex", "/^$1/", "message"] + startsWith: [regex, /^$1/, message] format: email: email ``` @@ -288,7 +288,7 @@ Then generates zod validation schema like below. export function ExampleInputSchema(): z.ZodSchema { return z.object({ email: z.string().min(50).email(), - message: z.string().regex(/^Hello/, "message") + message: z.string().regex(/^Hello/, 'message') }) } ``` @@ -310,4 +310,4 @@ generates: preset: 'client', plugins: ... -``` \ No newline at end of file +``` diff --git a/codegen.yml b/codegen.yml index b35f9fd3..f3170225 100644 --- a/codegen.yml +++ b/codegen.yml @@ -1,5 +1,5 @@ overwrite: true -schema: './example/test.graphql' +schema: ./example/test.graphql generates: example/types.ts: plugins: @@ -21,11 +21,11 @@ generates: constraint: minLength: min # same as ['min', '$1'] maxLength: max - startsWith: ['matches', '/^$1/'] - endsWith: ['matches', '/$1$/'] - contains: ['matches', '/$1/'] - notContains: ['matches', '/^((?!$1).)*$/'] - pattern: ['matches', '/$1/'] + startsWith: [matches, /^$1/] + endsWith: [matches, /$1$/] + contains: [matches, /$1/] + notContains: [matches, '/^((?!$1).)*$/'] + pattern: [matches, /$1/] format: # For example, `@constraint(format: "uri")`. this case $1 will be "uri". # Therefore the generator generates yup schema `.url()` followed by `uri: 'url'` @@ -37,8 +37,8 @@ generates: # you need to add the logic using `yup.addMethod`. # see: https://github.com/jquense/yup#addmethodschematype-schema-name-string-method--schema-void ipv4: ipv4 - min: ['min', '$1 - 1'] - max: ['max', '$1 + 1'] + min: [min, $1 - 1] + max: [max, '$1 + 1'] exclusiveMin: min exclusiveMax: max scalars: @@ -61,7 +61,7 @@ generates: constraint: minLength: min # Replace $1 with specified `startsWith` argument value of the constraint directive - startsWith: ['regex', '/^$1/', 'message'] + startsWith: [regex, /^$1/, message] format: email: email scalars: @@ -76,7 +76,7 @@ generates: constraint: minLength: min # Replace $1 with specified `startsWith` argument value of the constraint directive - startsWith: ['pattern', '/^$1/'] + startsWith: [pattern, /^$1/] format: email: email scalars: diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..0fc48c7a --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,16 @@ +import antfu from '@antfu/eslint-config' + +export default antfu({ + typescript: true, + // `.eslintignore` is no longer supported in Flat config, use `ignores` instead + ignores: [ + 'dist/**', + 'node_modules/**', + 'example/**', + 'vitest.config.ts', + 'tsconfig.json', + 'README.md', + ], +}, { + rules: { 'style/semi': 'off' }, +}) diff --git a/package.json b/package.json index d5a9e36e..f61b8ad0 100644 --- a/package.json +++ b/package.json @@ -6,29 +6,10 @@ "type": "git", "url": "https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema.git" }, - "main": "dist/main/index.js", - "typings": "dist/main/index.d.ts", - "module": "dist/module/index.js", - "files": [ - "dist/**/*.{js,ts}", - "LICENSE", - "README.md" - ], - "scripts": { - "type-check": "tsc --noEmit", - "type-check:yup": "tsc --strict --noEmit example/yup/schemas.ts", - "type-check:zod": "tsc --strict --noEmit example/zod/schemas.ts", - "type-check:myzod": "tsc --strict --noEmit example/myzod/schemas.ts", - "test": "vitest run", - "build": "run-p build:*", - "build:main": "tsc -p tsconfig.main.json", - "build:module": "tsc -p tsconfig.module.json", - "lint": "eslint --ext .ts .", - "lint-fix": "eslint --fix --ext .ts .", - "prettier": "prettier --write --list-different \"**/*.{ts,graphql,yml}\"", - "prettier:check": "prettier --check \"**/*.{ts,graphql,yml}\"", - "generate": "run-p build:* && graphql-codegen", - "prepublish": "run-p build:*" + "author": "codehex", + "license": "MIT", + "bugs": { + "url": "https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues" }, "keywords": [ "gql", @@ -44,43 +25,64 @@ "types", "typings" ], - "author": "codehex", - "license": "MIT", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/module/index.js", + "require": "./dist/main/index.js" + } + }, + "main": "dist/main/index.js", + "typings": "dist/types/index.d.ts", + "module": "dist/module/index.js", + "files": [ + "!dist/**/*.tsbuildinfo", + "LICENSE", + "README.md", + "dist/**/*.{js,ts}" + ], + "scripts": { + "type-check": "tsc --noEmit", + "type-check:yup": "tsc --strict --skipLibCheck --noEmit example/yup/schemas.ts", + "type-check:zod": "tsc --strict --skipLibCheck --noEmit example/zod/schemas.ts", + "type-check:myzod": "tsc --strict --skipLibCheck --noEmit example/myzod/schemas.ts", + "test": "vitest run", + "build": "run-p build:*", + "build:main": "tsc -p tsconfig.main.json", + "build:module": "tsc -p tsconfig.module.json", + "build:types": "tsc -p tsconfig.types.json", + "lint": "eslint .", + "lint-fix": "eslint . --fix", + "generate": "run-p build:* && graphql-codegen", + "prepublish": "run-p build:*" + }, + "peerDependencies": { + "graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" + }, + "dependencies": { + "@graphql-codegen/plugin-helpers": "^5.0.0", + "@graphql-codegen/schema-ast": "4.0.2", + "@graphql-codegen/visitor-plugin-common": "^5.0.0", + "@graphql-tools/utils": "^10.0.0", + "graphlib": "^2.1.8", + "graphql": "^16.6.0" + }, "devDependencies": { + "@antfu/eslint-config": "^2.12.2", "@graphql-codegen/cli": "5.0.2", "@graphql-codegen/typescript": "^4.0.0", "@tsconfig/recommended": "1.0.6", "@types/graphlib": "^2.1.8", - "@types/jest": "29.5.12", "@types/node": "^20.0.0", - "@typescript-eslint/eslint-plugin": "7.5.0", - "@typescript-eslint/parser": "7.5.0", "eslint": "9.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-simple-import-sort": "^12.0.0", "jest": "29.7.0", "myzod": "1.11.0", "npm-run-all2": "6.1.2", - "prettier": "3.2.5", "ts-dedent": "^2.2.0", "ts-jest": "29.1.2", "typescript": "5.4.4", "vitest": "^1.0.0", "yup": "1.4.0", "zod": "3.22.4" - }, - "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.0", - "@graphql-codegen/schema-ast": "4.0.2", - "@graphql-codegen/visitor-plugin-common": "^5.0.0", - "@graphql-tools/utils": "^10.0.0", - "graphlib": "^2.1.8", - "graphql": "^16.6.0" - }, - "peerDependencies": { - "graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - }, - "bugs": { - "url": "https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f4d176c..58baae89 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,9 @@ dependencies: version: 16.8.1 devDependencies: + '@antfu/eslint-config': + specifier: ^2.12.2 + version: 2.12.2(@vue/compiler-sfc@3.4.21)(eslint@9.0.0)(typescript@5.4.4)(vitest@1.4.0) '@graphql-codegen/cli': specifier: 5.0.2 version: 5.0.2(@babel/core@7.24.4)(@types/node@20.12.5)(graphql@16.8.1) @@ -37,27 +40,12 @@ devDependencies: '@types/graphlib': specifier: ^2.1.8 version: 2.1.12 - '@types/jest': - specifier: 29.5.12 - version: 29.5.12 '@types/node': specifier: ^20.0.0 version: 20.12.5 - '@typescript-eslint/eslint-plugin': - specifier: 7.5.0 - version: 7.5.0(@typescript-eslint/parser@7.5.0)(eslint@9.0.0)(typescript@5.4.4) - '@typescript-eslint/parser': - specifier: 7.5.0 - version: 7.5.0(eslint@9.0.0)(typescript@5.4.4) eslint: specifier: 9.0.0 version: 9.0.0 - eslint-plugin-import: - specifier: ^2.27.5 - version: 2.29.1(@typescript-eslint/parser@7.5.0)(eslint@9.0.0) - eslint-plugin-simple-import-sort: - specifier: ^12.0.0 - version: 12.0.0(eslint@9.0.0) jest: specifier: 29.7.0 version: 29.7.0(@types/node@20.12.5) @@ -67,9 +55,6 @@ devDependencies: npm-run-all2: specifier: 6.1.2 version: 6.1.2 - prettier: - specifier: 3.2.5 - version: 3.2.5 ts-dedent: specifier: ^2.2.0 version: 2.2.0 @@ -111,6 +96,94 @@ packages: '@jridgewell/trace-mapping': 0.3.25 dev: true + /@antfu/eslint-config@2.12.2(@vue/compiler-sfc@3.4.21)(eslint@9.0.0)(typescript@5.4.4)(vitest@1.4.0): + resolution: {integrity: sha512-PfxkKKyFaXGyn9Z4OmuEUgrwM0oOAOjoP50SLNJ7EEE044O4WrblLre2HGROoc/y+Ljdu0E1ZEnBmR9d2UmhYA==} + hasBin: true + peerDependencies: + '@unocss/eslint-plugin': '>=0.50.0' + astro-eslint-parser: ^0.16.3 + eslint: '>=8.40.0' + eslint-plugin-astro: ^0.31.4 + eslint-plugin-format: '>=0.1.0' + eslint-plugin-react: ^7.33.2 + eslint-plugin-react-hooks: ^4.6.0 + eslint-plugin-react-refresh: ^0.4.4 + eslint-plugin-svelte: '>=2.35.1' + prettier-plugin-astro: ^0.13.0 + prettier-plugin-slidev: ^1.0.5 + svelte-eslint-parser: ^0.33.1 + peerDependenciesMeta: + '@unocss/eslint-plugin': + optional: true + astro-eslint-parser: + optional: true + eslint-plugin-astro: + optional: true + eslint-plugin-format: + optional: true + eslint-plugin-react: + optional: true + eslint-plugin-react-hooks: + optional: true + eslint-plugin-react-refresh: + optional: true + eslint-plugin-svelte: + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-slidev: + optional: true + svelte-eslint-parser: + optional: true + dependencies: + '@antfu/install-pkg': 0.3.2 + '@clack/prompts': 0.7.0 + '@stylistic/eslint-plugin': 1.7.0(eslint@9.0.0)(typescript@5.4.4) + '@typescript-eslint/eslint-plugin': 7.5.0(@typescript-eslint/parser@7.5.0)(eslint@9.0.0)(typescript@5.4.4) + '@typescript-eslint/parser': 7.5.0(eslint@9.0.0)(typescript@5.4.4) + eslint: 9.0.0 + eslint-config-flat-gitignore: 0.1.5 + eslint-flat-config-utils: 0.2.1 + eslint-merge-processors: 0.1.0(eslint@9.0.0) + eslint-plugin-antfu: 2.1.2(eslint@9.0.0) + eslint-plugin-eslint-comments: 3.2.0(eslint@9.0.0) + eslint-plugin-import-x: 0.5.0(eslint@9.0.0)(typescript@5.4.4) + eslint-plugin-jsdoc: 48.2.3(eslint@9.0.0) + eslint-plugin-jsonc: 2.15.0(eslint@9.0.0) + eslint-plugin-markdown: 4.0.1(eslint@9.0.0) + eslint-plugin-n: 16.6.2(eslint@9.0.0) + eslint-plugin-no-only-tests: 3.1.0 + eslint-plugin-perfectionist: 2.8.0(eslint@9.0.0)(typescript@5.4.4)(vue-eslint-parser@9.4.2) + eslint-plugin-toml: 0.11.0(eslint@9.0.0) + eslint-plugin-unicorn: 52.0.0(eslint@9.0.0) + eslint-plugin-unused-imports: 3.1.0(@typescript-eslint/eslint-plugin@7.5.0)(eslint@9.0.0) + eslint-plugin-vitest: 0.4.1(@typescript-eslint/eslint-plugin@7.5.0)(eslint@9.0.0)(typescript@5.4.4)(vitest@1.4.0) + eslint-plugin-vue: 9.24.0(eslint@9.0.0) + eslint-plugin-yml: 1.14.0(eslint@9.0.0) + eslint-processor-vue-blocks: 0.1.1(@vue/compiler-sfc@3.4.21)(eslint@9.0.0) + globals: 15.0.0 + jsonc-eslint-parser: 2.4.0 + local-pkg: 0.5.0 + parse-gitignore: 2.0.0 + picocolors: 1.0.0 + toml-eslint-parser: 0.9.3 + vue-eslint-parser: 9.4.2(eslint@9.0.0) + yaml-eslint-parser: 1.2.2 + yargs: 17.7.2 + transitivePeerDependencies: + - '@vue/compiler-sfc' + - supports-color + - svelte + - typescript + - vitest + dev: true + + /@antfu/install-pkg@0.3.2: + resolution: {integrity: sha512-FFYqME8+UHlPnRlX/vn+8cTD4Wo/nG/lzRxpABs3XANBmdJdNImVz3QvjNAE/W3PSCNbG387FOz8o5WelnWOlg==} + dependencies: + execa: 8.0.1 + dev: true + /@ardatan/relay-compiler@12.0.0(graphql@16.8.1): resolution: {integrity: sha512-9anThAaj1dQr6IGmzBMcfzOQKTa5artjuPmw8NYK/fiGEMjADbSguBY2FMDykt+QhilR3wc9VA/3yVju7JHg7Q==} hasBin: true @@ -1024,6 +1097,32 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@clack/core@0.3.4: + resolution: {integrity: sha512-H4hxZDXgHtWTwV3RAVenqcC4VbJZNegbBjlPvzOzCouXtS2y3sDvlO3IsbrPNWuLWPPlYVYPghQdSF64683Ldw==} + dependencies: + picocolors: 1.0.0 + sisteransi: 1.0.5 + dev: true + + /@clack/prompts@0.7.0: + resolution: {integrity: sha512-0MhX9/B4iL6Re04jPrttDm+BsP8y6mS7byuv0BvXgdXhbV5PdlsHt55dvNsuBCPZ7xq1oTAOOuotR9NFbQyMSA==} + dependencies: + '@clack/core': 0.3.4 + picocolors: 1.0.0 + sisteransi: 1.0.5 + dev: true + bundledDependencies: + - is-unicode-supported + + /@es-joy/jsdoccomment@0.42.0: + resolution: {integrity: sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==} + engines: {node: '>=16'} + dependencies: + comment-parser: 1.4.1 + esquery: 1.5.0 + jsdoc-type-pratt-parser: 4.0.0 + dev: true + /@esbuild/aix-ppc64@0.19.12: resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} engines: {node: '>=12'} @@ -1246,6 +1345,23 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true + /@eslint/eslintrc@2.1.4: + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + /@eslint/eslintrc@3.0.2: resolution: {integrity: sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2381,6 +2497,78 @@ packages: '@sinonjs/commons': 2.0.0 dev: true + /@stylistic/eslint-plugin-js@1.7.0(eslint@9.0.0): + resolution: {integrity: sha512-PN6On/+or63FGnhhMKSQfYcWutRlzOiYlVdLM6yN7lquoBTqUJHYnl4TA4MHwiAt46X5gRxDr1+xPZ1lOLcL+Q==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + dependencies: + '@types/eslint': 8.56.7 + acorn: 8.11.3 + escape-string-regexp: 4.0.0 + eslint: 9.0.0 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + dev: true + + /@stylistic/eslint-plugin-jsx@1.7.0(eslint@9.0.0): + resolution: {integrity: sha512-BACdBwXakQvjYIST5N2WWhRbvhRsIxa/F59BiZol+0IH4FSmDXhie7v/yaxDIIA9CbfElzOmIA5nWNYTVXcnwQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + dependencies: + '@stylistic/eslint-plugin-js': 1.7.0(eslint@9.0.0) + '@types/eslint': 8.56.7 + eslint: 9.0.0 + estraverse: 5.3.0 + picomatch: 4.0.2 + dev: true + + /@stylistic/eslint-plugin-plus@1.7.0(eslint@9.0.0)(typescript@5.4.4): + resolution: {integrity: sha512-AabDw8sXsc70Ydx3qnbeTlRHZnIwY6UKEenBPURPhY3bfYWX+/pDpZH40HkOu94v8D0DUrocPkeeEUxl4e0JDg==} + peerDependencies: + eslint: '*' + dependencies: + '@types/eslint': 8.56.7 + '@typescript-eslint/utils': 6.21.0(eslint@9.0.0)(typescript@5.4.4) + eslint: 9.0.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@stylistic/eslint-plugin-ts@1.7.0(eslint@9.0.0)(typescript@5.4.4): + resolution: {integrity: sha512-QsHv98mmW1xaucVYQTyLDgEpybPJ/6jPPxVBrIchntWWwj74xCWKUiw79hu+TpYj/Pbhd9rkqJYLNq3pQGYuyA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + dependencies: + '@stylistic/eslint-plugin-js': 1.7.0(eslint@9.0.0) + '@types/eslint': 8.56.7 + '@typescript-eslint/utils': 6.21.0(eslint@9.0.0)(typescript@5.4.4) + eslint: 9.0.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@stylistic/eslint-plugin@1.7.0(eslint@9.0.0)(typescript@5.4.4): + resolution: {integrity: sha512-ThMUjGIi/jeWYNvOdjZkoLw1EOVs0tEuKXDgWvTn8uWaEz55HuPlajKxjKLpv19C+qRDbKczJfzUODfCdME53A==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: '>=8.40.0' + dependencies: + '@stylistic/eslint-plugin-js': 1.7.0(eslint@9.0.0) + '@stylistic/eslint-plugin-jsx': 1.7.0(eslint@9.0.0) + '@stylistic/eslint-plugin-plus': 1.7.0(eslint@9.0.0)(typescript@5.4.4) + '@stylistic/eslint-plugin-ts': 1.7.0(eslint@9.0.0)(typescript@5.4.4) + '@types/eslint': 8.56.7 + eslint: 9.0.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@tsconfig/recommended@1.0.6: resolution: {integrity: sha512-0IKu9GHYF1NGTJiYgfWwqnOQSlnE9V9R7YohHNNf0/fj/SyOZWzdd06JFr0fLpg1Mqw0kGbYg8w5xdkSqLKM9g==} dev: true @@ -2414,6 +2602,13 @@ packages: '@babel/types': 7.22.5 dev: true + /@types/eslint@8.56.7: + resolution: {integrity: sha512-SjDvI/x3zsZnOkYZ3lCt9lOZWZLB2jIlNKz+LBgCtDurK0JZcwucxYHn1w2BJkD34dgX9Tjnak0txtq4WTggEA==} + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + dev: true + /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true @@ -2444,27 +2639,22 @@ packages: '@types/istanbul-lib-report': 3.0.0 dev: true - /@types/jest@29.5.12: - resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==} - dependencies: - expect: 29.7.0 - pretty-format: 29.7.0 - dev: true - /@types/js-yaml@4.0.5: resolution: {integrity: sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==} dev: true - /@types/json-schema@7.0.12: - resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} + /@types/json-schema@7.0.15: + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true /@types/json-stable-stringify@1.0.33: resolution: {integrity: sha512-qEWiQff6q2tA5gcJGWwzplQcXdJtm+0oy6IHGHzlOf3eFAkGE/FIPXZK9ofWgNSHVp8AFFI33PJJshS0ei3Gvw==} dev: true - /@types/json5@0.0.29: - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + /@types/mdast@3.0.15: + resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} + dependencies: + '@types/unist': 2.0.10 dev: true /@types/node@20.12.5: @@ -2473,14 +2663,22 @@ packages: undici-types: 5.26.5 dev: true - /@types/semver@7.5.0: - resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} + /@types/normalize-package-data@2.4.4: + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + dev: true + + /@types/semver@7.5.8: + resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true /@types/stack-utils@2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} dev: true + /@types/unist@2.0.10: + resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} + dev: true + /@types/ws@8.5.5: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: @@ -2520,7 +2718,7 @@ packages: ignore: 5.2.4 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.0.1(typescript@5.4.4) + ts-api-utils: 1.3.0(typescript@5.4.4) typescript: 5.4.4 transitivePeerDependencies: - supports-color @@ -2547,6 +2745,14 @@ packages: - supports-color dev: true + /@typescript-eslint/scope-manager@6.21.0: + resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + dev: true + /@typescript-eslint/scope-manager@7.5.0: resolution: {integrity: sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2569,17 +2775,44 @@ packages: '@typescript-eslint/utils': 7.5.0(eslint@9.0.0)(typescript@5.4.4) debug: 4.3.4 eslint: 9.0.0 - ts-api-utils: 1.0.1(typescript@5.4.4) + ts-api-utils: 1.3.0(typescript@5.4.4) typescript: 5.4.4 transitivePeerDependencies: - supports-color dev: true + /@typescript-eslint/types@6.21.0: + resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + /@typescript-eslint/types@7.5.0: resolution: {integrity: sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==} engines: {node: ^18.18.0 || >=20.0.0} dev: true + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.4): + resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.0 + ts-api-utils: 1.3.0(typescript@5.4.4) + typescript: 5.4.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/typescript-estree@7.5.0(typescript@5.4.4): resolution: {integrity: sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2596,12 +2829,31 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.0.1(typescript@5.4.4) + ts-api-utils: 1.3.0(typescript@5.4.4) typescript: 5.4.4 transitivePeerDependencies: - supports-color dev: true + /@typescript-eslint/utils@6.21.0(eslint@9.0.0)(typescript@5.4.4): + resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.4) + eslint: 9.0.0 + semver: 7.6.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/utils@7.5.0(eslint@9.0.0)(typescript@5.4.4): resolution: {integrity: sha512-3vZl9u0R+/FLQcpy2EHyRGNqAS/ofJ3Ji8aebilfJe+fobK8+LbIFmrHciLVDxjDoONmufDcnVSF38KwMEOjzw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2609,8 +2861,8 @@ packages: eslint: ^8.56.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) - '@types/json-schema': 7.0.12 - '@types/semver': 7.5.0 + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 7.5.0 '@typescript-eslint/types': 7.5.0 '@typescript-eslint/typescript-estree': 7.5.0(typescript@5.4.4) @@ -2621,6 +2873,14 @@ packages: - typescript dev: true + /@typescript-eslint/visitor-keys@6.21.0: + resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.21.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@typescript-eslint/visitor-keys@7.5.0: resolution: {integrity: sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2668,6 +2928,48 @@ packages: pretty-format: 29.7.0 dev: true + /@vue/compiler-core@3.4.21: + resolution: {integrity: sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==} + dependencies: + '@babel/parser': 7.24.4 + '@vue/shared': 3.4.21 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.0.2 + dev: true + + /@vue/compiler-dom@3.4.21: + resolution: {integrity: sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==} + dependencies: + '@vue/compiler-core': 3.4.21 + '@vue/shared': 3.4.21 + dev: true + + /@vue/compiler-sfc@3.4.21: + resolution: {integrity: sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==} + dependencies: + '@babel/parser': 7.24.4 + '@vue/compiler-core': 3.4.21 + '@vue/compiler-dom': 3.4.21 + '@vue/compiler-ssr': 3.4.21 + '@vue/shared': 3.4.21 + estree-walker: 2.0.2 + magic-string: 0.30.8 + postcss: 8.4.35 + source-map-js: 1.0.2 + dev: true + + /@vue/compiler-ssr@3.4.21: + resolution: {integrity: sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==} + dependencies: + '@vue/compiler-dom': 3.4.21 + '@vue/shared': 3.4.21 + dev: true + + /@vue/shared@3.4.21: + resolution: {integrity: sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==} + dev: true + /@whatwg-node/events@0.0.2: resolution: {integrity: sha512-WKj/lI4QjnLuPrim0cfO7i+HsDSXHxNv1y0CrJhdntuO3hxWZmnXCwNDnwOvry11OjRin6cgWNF+j/9Pn8TN4w==} dev: true @@ -2807,6 +3109,11 @@ packages: picomatch: 2.3.1 dev: true + /are-docs-informative@0.0.2: + resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} + engines: {node: '>=14'} + dev: true + /argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -2817,86 +3124,11 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true - /array-buffer-byte-length@1.0.1: - resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - is-array-buffer: 3.0.4 - dev: true - - /array-includes@3.1.7: - resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - get-intrinsic: 1.2.4 - is-string: 1.0.7 - dev: true - /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /array.prototype.filter@1.0.3: - resolution: {integrity: sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - es-array-method-boxes-properly: 1.0.0 - is-string: 1.0.7 - dev: true - - /array.prototype.findlastindex@1.2.4: - resolution: {integrity: sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - es-errors: 1.3.0 - es-shim-unscopables: 1.0.2 - dev: true - - /array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - es-shim-unscopables: 1.0.2 - dev: true - - /array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - es-shim-unscopables: 1.0.2 - dev: true - - /arraybuffer.prototype.slice@1.0.3: - resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 - dev: true - /asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} @@ -2922,13 +3154,6 @@ packages: resolution: {integrity: sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==} engines: {node: '>=8'} - /available-typed-arrays@1.0.7: - resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} - engines: {node: '>= 0.4'} - dependencies: - possible-typed-array-names: 1.0.0 - dev: true - /babel-jest@29.7.0(@babel/core@7.22.5): resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3053,6 +3278,10 @@ packages: readable-stream: 3.6.0 dev: true + /boolbase@1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + dev: true + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -3105,6 +3334,17 @@ packages: ieee754: 1.2.1 dev: true + /builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + dev: true + + /builtins@5.0.1: + resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} + dependencies: + semver: 7.6.0 + dev: true + /busboy@1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} @@ -3117,17 +3357,6 @@ packages: engines: {node: '>=8'} dev: true - /call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.1 - dev: true - /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -3221,6 +3450,18 @@ packages: engines: {node: '>=10'} dev: true + /character-entities-legacy@1.1.4: + resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} + dev: true + + /character-entities@1.2.4: + resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} + dev: true + + /character-reference-invalid@1.1.4: + resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} + dev: true + /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true @@ -3235,10 +3476,22 @@ packages: resolution: {integrity: sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==} dev: true + /ci-info@4.0.0: + resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} + engines: {node: '>=8'} + dev: true + /cjs-module-lexer@1.2.2: resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==} dev: true + /clean-regexp@1.0.0: + resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} + engines: {node: '>=4'} + dependencies: + escape-string-regexp: 1.0.5 + dev: true + /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -3284,6 +3537,15 @@ packages: wrap-ansi: 7.0.0 dev: true + /cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + /clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} @@ -3319,6 +3581,11 @@ packages: resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} dev: true + /comment-parser@1.4.1: + resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} + engines: {node: '>= 12.0.0'} + dev: true + /common-tags@1.8.2: resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} engines: {node: '>=4.0.0'} @@ -3340,6 +3607,12 @@ packages: /convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + /core-js-compat@3.36.1: + resolution: {integrity: sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==} + dependencies: + browserslist: 4.23.0 + dev: true + /cosmiconfig@8.1.3: resolution: {integrity: sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==} engines: {node: '>=14'} @@ -3391,6 +3664,12 @@ packages: which: 2.0.2 dev: true + /cssesc@3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + dev: true + /dataloader@2.2.2: resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} dev: true @@ -3407,7 +3686,7 @@ packages: supports-color: optional: true dependencies: - ms: 2.1.3 + ms: 2.1.2 dev: true /debug@4.3.4: @@ -3456,24 +3735,6 @@ packages: clone: 1.0.4 dev: true - /define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - dev: true - - /define-properties@1.2.1: - resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.4 - has-property-descriptors: 1.0.2 - object-keys: 1.1.1 - dev: true - /dependency-graph@0.11.0: resolution: {integrity: sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==} engines: {node: '>= 0.6.0'} @@ -3500,9 +3761,9 @@ packages: path-type: 4.0.0 dev: true - /doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} + /doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 dev: true @@ -3533,99 +3794,17 @@ packages: /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + /entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + dev: true + /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 dev: true - /es-abstract@1.22.4: - resolution: {integrity: sha512-vZYJlk2u6qHYxBOTjAeg7qUxHdNfih64Uu2J8QqWgXZ2cri0ZpJAkzDUK/q593+mvKwlxyaxr6F1Q+3LKoQRgg==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - es-define-property: 1.0.0 - es-errors: 1.3.0 - es-set-tostringtag: 2.0.3 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 - get-symbol-description: 1.0.2 - globalthis: 1.0.3 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.1 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 - is-callable: 1.2.7 - is-negative-zero: 2.0.3 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 - is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.1 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.0 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.8 - string.prototype.trimend: 1.0.7 - string.prototype.trimstart: 1.0.7 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.5 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.14 - dev: true - - /es-array-method-boxes-properly@1.0.0: - resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} - dev: true - - /es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.4 - dev: true - - /es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - dev: true - - /es-set-tostringtag@2.0.3: - resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.4 - has-tostringtag: 1.0.2 - hasown: 2.0.1 - dev: true - - /es-shim-unscopables@1.0.2: - resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} - dependencies: - hasown: 2.0.1 - dev: true - - /es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} - engines: {node: '>= 0.4'} - dependencies: - is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 - dev: true - /esbuild@0.19.12: resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} engines: {node: '>=12'} @@ -3680,6 +3859,30 @@ packages: engines: {node: '>=10'} dev: true + /eslint-compat-utils@0.5.0(eslint@9.0.0): + resolution: {integrity: sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + eslint: 9.0.0 + semver: 7.6.0 + dev: true + + /eslint-config-flat-gitignore@0.1.5: + resolution: {integrity: sha512-hEZLwuZjDBGDERA49c2q7vxc8sCGv8EdBp6PQYzGOMcHIgrfG9YOM6s/4jx24zhD+wnK9AI8mgN5RxSss5nClQ==} + dependencies: + find-up: 7.0.0 + parse-gitignore: 2.0.0 + dev: true + + /eslint-flat-config-utils@0.2.1: + resolution: {integrity: sha512-SKnSr4YdPD7xxynNpaad/IlJYfeDmtWvZ0UEmHEA0+eTOcZFPt1075KO87LIWN30jXGCREG2qcCqdAnRoCiAWQ==} + dependencies: + '@types/eslint': 8.56.7 + pathe: 1.1.2 + dev: true + /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} dependencies: @@ -3690,78 +3893,303 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.5.0)(eslint-import-resolver-node@0.3.9)(eslint@9.0.0): - resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} - engines: {node: '>=4'} + /eslint-merge-processors@0.1.0(eslint@9.0.0): + resolution: {integrity: sha512-IvRXXtEajLeyssvW4wJcZ2etxkR9mUf4zpNwgI+m/Uac9RfXHskuJefkHUcawVzePnd6xp24enp5jfgdHzjRdQ==} + peerDependencies: + eslint: '*' + dependencies: + eslint: 9.0.0 + dev: true + + /eslint-plugin-antfu@2.1.2(eslint@9.0.0): + resolution: {integrity: sha512-s7ZTOM3uq0iqpp6gF0UEotnvup7f2PHBUftCytLZX0+6C9j9KadKZQh6bVVngAyFgsmeD9+gcBopOYLClb2oDg==} peerDependencies: - '@typescript-eslint/parser': '*' eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' + dependencies: + eslint: 9.0.0 + dev: true + + /eslint-plugin-es-x@7.6.0(eslint@9.0.0): + resolution: {integrity: sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '>=8' + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + '@eslint-community/regexpp': 4.6.2 + eslint: 9.0.0 + eslint-compat-utils: 0.5.0(eslint@9.0.0) + dev: true + + /eslint-plugin-eslint-comments@3.2.0(eslint@9.0.0): + resolution: {integrity: sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==} + engines: {node: '>=6.5.0'} + peerDependencies: + eslint: '>=4.19.1' + dependencies: + escape-string-regexp: 1.0.5 + eslint: 9.0.0 + ignore: 5.2.4 + dev: true + + /eslint-plugin-import-x@0.5.0(eslint@9.0.0)(typescript@5.4.4): + resolution: {integrity: sha512-C7R8Z4IzxmsoOPMtSzwuOBW5FH6iRlxHR6iTks+MzVlrk3r3TUxokkWTx3ypdj9nGOEP+CG/5e6ebZzHbxgbbQ==} + engines: {node: '>=16'} + peerDependencies: + eslint: ^8.56.0 || ^9.0.0-0 + dependencies: + '@typescript-eslint/utils': 7.5.0(eslint@9.0.0)(typescript@5.4.4) + debug: 4.3.4 + doctrine: 3.0.0 + eslint: 9.0.0 + eslint-import-resolver-node: 0.3.9 + get-tsconfig: 4.7.3 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /eslint-plugin-jsdoc@48.2.3(eslint@9.0.0): + resolution: {integrity: sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + dependencies: + '@es-joy/jsdoccomment': 0.42.0 + are-docs-informative: 0.0.2 + comment-parser: 1.4.1 + debug: 4.3.4 + escape-string-regexp: 4.0.0 + eslint: 9.0.0 + esquery: 1.5.0 + is-builtin-module: 3.2.1 + semver: 7.6.0 + spdx-expression-parse: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-jsonc@2.15.0(eslint@9.0.0): + resolution: {integrity: sha512-wAphMVgTQPAKAYV8d/QEkEYDg8uer9nMQ85N17IUiJcAWLxJs83/Exe59dEH9yKUpvpLf46H+wR7/U7lZ3/NpQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + eslint: 9.0.0 + eslint-compat-utils: 0.5.0(eslint@9.0.0) + espree: 9.6.1 + graphemer: 1.4.0 + jsonc-eslint-parser: 2.4.0 + natural-compare: 1.4.0 + synckit: 0.6.2 + dev: true + + /eslint-plugin-markdown@4.0.1(eslint@9.0.0): + resolution: {integrity: sha512-5/MnGvYU0i8MbHH5cg8S+Vl3DL+bqRNYshk1xUO86DilNBaxtTkhH+5FD0/yO03AmlI6+lfNFdk2yOw72EPzpA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: '>=8' + dependencies: + eslint: 9.0.0 + mdast-util-from-markdown: 0.8.5 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-n@16.6.2(eslint@9.0.0): + resolution: {integrity: sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + eslint: '>=7.0.0' + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + builtins: 5.0.1 + eslint: 9.0.0 + eslint-plugin-es-x: 7.6.0(eslint@9.0.0) + get-tsconfig: 4.7.3 + globals: 13.24.0 + ignore: 5.2.4 + is-builtin-module: 3.2.1 + is-core-module: 2.13.1 + minimatch: 3.1.2 + resolve: 1.22.3 + semver: 7.6.0 + dev: true + + /eslint-plugin-no-only-tests@3.1.0: + resolution: {integrity: sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==} + engines: {node: '>=5.0.0'} + dev: true + + /eslint-plugin-perfectionist@2.8.0(eslint@9.0.0)(typescript@5.4.4)(vue-eslint-parser@9.4.2): + resolution: {integrity: sha512-XBjQ4ctU1rOzQ4bFJoUowe8XdsIIz42JqNrouFlae1TO78HjoyYBaRP8+gAHDDQCSdHY10pbChyzlJeBA6D51w==} + peerDependencies: + astro-eslint-parser: ^0.16.0 + eslint: '>=8.0.0' + svelte: '>=3.0.0' + svelte-eslint-parser: ^0.33.0 + vue-eslint-parser: '>=9.0.0' peerDependenciesMeta: - '@typescript-eslint/parser': + astro-eslint-parser: optional: true - eslint: + svelte: optional: true - eslint-import-resolver-node: + svelte-eslint-parser: optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: + vue-eslint-parser: optional: true dependencies: - '@typescript-eslint/parser': 7.5.0(eslint@9.0.0)(typescript@5.4.4) - debug: 3.2.7 + '@typescript-eslint/utils': 6.21.0(eslint@9.0.0)(typescript@5.4.4) eslint: 9.0.0 - eslint-import-resolver-node: 0.3.9 + minimatch: 9.0.3 + natural-compare-lite: 1.4.0 + vue-eslint-parser: 9.4.2(eslint@9.0.0) transitivePeerDependencies: - supports-color + - typescript dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.5.0)(eslint@9.0.0): - resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} - engines: {node: '>=4'} + /eslint-plugin-toml@0.11.0(eslint@9.0.0): + resolution: {integrity: sha512-sau+YvPU4fWTjB+qtBt3n8WS87aoDCs+BVbSUAemGaIsRNbvR9uEk+Tt892iLHTGvp/DPWYoCX4/8DoyAbB+sQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + debug: 4.3.4 + eslint: 9.0.0 + eslint-compat-utils: 0.5.0(eslint@9.0.0) + lodash: 4.17.21 + toml-eslint-parser: 0.9.3 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-unicorn@52.0.0(eslint@9.0.0): + resolution: {integrity: sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==} + engines: {node: '>=16'} + peerDependencies: + eslint: '>=8.56.0' + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + '@eslint/eslintrc': 2.1.4 + ci-info: 4.0.0 + clean-regexp: 1.0.0 + core-js-compat: 3.36.1 + eslint: 9.0.0 + esquery: 1.5.0 + indent-string: 4.0.0 + is-builtin-module: 3.2.1 + jsesc: 3.0.2 + pluralize: 8.0.0 + read-pkg-up: 7.0.1 + regexp-tree: 0.1.27 + regjsparser: 0.10.0 + semver: 7.6.0 + strip-indent: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-unused-imports@3.1.0(@typescript-eslint/eslint-plugin@7.5.0)(eslint@9.0.0): + resolution: {integrity: sha512-9l1YFCzXKkw1qtAru1RWUtG2EVDZY0a0eChKXcL+EZ5jitG7qxdctu4RnvhOJHv4xfmUf7h+JJPINlVpGhZMrw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + '@typescript-eslint/eslint-plugin': 6 - 7 + eslint: '8' peerDependenciesMeta: - '@typescript-eslint/parser': + '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/parser': 7.5.0(eslint@9.0.0)(typescript@5.4.4) - array-includes: 3.1.7 - array.prototype.findlastindex: 1.2.4 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 - debug: 3.2.7 - doctrine: 2.1.0 + '@typescript-eslint/eslint-plugin': 7.5.0(@typescript-eslint/parser@7.5.0)(eslint@9.0.0)(typescript@5.4.4) eslint: 9.0.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.5.0)(eslint-import-resolver-node@0.3.9)(eslint@9.0.0) - hasown: 2.0.1 - is-core-module: 2.13.1 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.7 - object.groupby: 1.0.2 - object.values: 1.1.7 - semver: 6.3.1 - tsconfig-paths: 3.15.0 + eslint-rule-composer: 0.3.0 + dev: true + + /eslint-plugin-vitest@0.4.1(@typescript-eslint/eslint-plugin@7.5.0)(eslint@9.0.0)(typescript@5.4.4)(vitest@1.4.0): + resolution: {integrity: sha512-+PnZ2u/BS+f5FiuHXz4zKsHPcMKHie+K+1Uvu/x91ovkCMEOJqEI8E9Tw1Wzx2QRz4MHOBHYf1ypO8N1K0aNAA==} + engines: {node: ^18.0.0 || >= 20.0.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': '*' + eslint: '>=8.0.0' + vitest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + vitest: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 7.5.0(@typescript-eslint/parser@7.5.0)(eslint@9.0.0)(typescript@5.4.4) + '@typescript-eslint/utils': 7.5.0(eslint@9.0.0)(typescript@5.4.4) + eslint: 9.0.0 + vitest: 1.4.0(@types/node@20.12.5) + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /eslint-plugin-vue@9.24.0(eslint@9.0.0): + resolution: {integrity: sha512-9SkJMvF8NGMT9aQCwFc5rj8Wo1XWSMSHk36i7ZwdI614BU7sIOR28ZjuFPKp8YGymZN12BSEbiSwa7qikp+PBw==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) + eslint: 9.0.0 + globals: 13.24.0 + natural-compare: 1.4.0 + nth-check: 2.1.1 + postcss-selector-parser: 6.0.16 + semver: 7.6.0 + vue-eslint-parser: 9.4.2(eslint@9.0.0) + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-yml@1.14.0(eslint@9.0.0): + resolution: {integrity: sha512-ESUpgYPOcAYQO9czugcX5OqRvn/ydDVwGCPXY4YjPqc09rHaUVUA6IE6HLQys4rXk/S+qx3EwTd1wHCwam/OWQ==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + debug: 4.3.4 + eslint: 9.0.0 + eslint-compat-utils: 0.5.0(eslint@9.0.0) + lodash: 4.17.21 + natural-compare: 1.4.0 + yaml-eslint-parser: 1.2.2 transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - supports-color dev: true - /eslint-plugin-simple-import-sort@12.0.0(eslint@9.0.0): - resolution: {integrity: sha512-8o0dVEdAkYap0Cn5kNeklaKcT1nUsa3LITWEuFk3nJifOoD+5JQGoyDUW2W/iPWwBsNBJpyJS9y4je/BgxLcyQ==} + /eslint-processor-vue-blocks@0.1.1(@vue/compiler-sfc@3.4.21)(eslint@9.0.0): + resolution: {integrity: sha512-9+dU5lU881log570oBwpelaJmOfOzSniben7IWEDRYQPPWwlvaV7NhOtsTuUWDqpYT+dtKKWPsgz4OkOi+aZnA==} peerDependencies: - eslint: '>=5.0.0' + '@vue/compiler-sfc': ^3.3.0 + eslint: ^8.50.0 dependencies: + '@vue/compiler-sfc': 3.4.21 eslint: 9.0.0 dev: true + /eslint-rule-composer@0.3.0: + resolution: {integrity: sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==} + engines: {node: '>=4.0.0'} + dev: true + + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + /eslint-scope@8.0.1: resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3832,6 +4260,15 @@ packages: eslint-visitor-keys: 4.0.0 dev: true + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.11.3 + acorn-jsx: 5.3.2(acorn@8.11.3) + eslint-visitor-keys: 3.4.3 + dev: true + /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} @@ -3845,6 +4282,13 @@ packages: estraverse: 5.3.0 dev: true + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} @@ -3857,6 +4301,10 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + dev: true + /estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: @@ -4030,6 +4478,15 @@ packages: path-exists: 4.0.0 dev: true + /find-up@7.0.0: + resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==} + engines: {node: '>=18'} + dependencies: + locate-path: 7.2.0 + path-exists: 5.0.0 + unicorn-magic: 0.1.0 + dev: true + /flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -4042,12 +4499,6 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true - /for-each@0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - dependencies: - is-callable: 1.2.7 - dev: true - /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -4063,20 +4514,6 @@ packages: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} dev: true - /function.prototype.name@1.1.6: - resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - functions-have-names: 1.2.3 - dev: true - - /functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true - /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -4089,17 +4526,6 @@ packages: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true - /get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.1 - dev: true - /get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} @@ -4115,13 +4541,10 @@ packages: engines: {node: '>=16'} dev: true - /get-symbol-description@1.0.2: - resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} - engines: {node: '>= 0.4'} + /get-tsconfig@4.7.3: + resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 + resolve-pkg-maps: 1.0.0 dev: true /glob-parent@5.1.2: @@ -4152,16 +4575,21 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + /globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} dev: true - /globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} - engines: {node: '>= 0.4'} - dependencies: - define-properties: 1.2.1 + /globals@15.0.0: + resolution: {integrity: sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==} + engines: {node: '>=18'} dev: true /globby@11.1.0: @@ -4176,12 +4604,6 @@ packages: slash: 3.0.0 dev: true - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.2.4 - dev: true - /graceful-fs@4.2.9: resolution: {integrity: sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==} dev: true @@ -4259,10 +4681,6 @@ packages: resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} - /has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: true - /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -4271,29 +4689,6 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - /has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - dependencies: - es-define-property: 1.0.0 - dev: true - - /has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - dev: true - - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: true - - /has-tostringtag@1.0.2: - resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - /hasown@2.0.1: resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} engines: {node: '>= 0.4'} @@ -4307,6 +4702,10 @@ packages: capital-case: 1.0.4 tslib: 2.6.2 + /hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true + /html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true @@ -4421,15 +4820,6 @@ packages: through: 2.3.8 dev: true - /internal-slot@1.0.7: - resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} - engines: {node: '>= 0.4'} - dependencies: - es-errors: 1.3.0 - hasown: 2.0.1 - side-channel: 1.0.5 - dev: true - /invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} dependencies: @@ -4442,35 +4832,26 @@ packages: is-relative: 1.0.0 is-windows: 1.0.2 - /is-array-buffer@3.0.4: - resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} - engines: {node: '>= 0.4'} + /is-alphabetical@1.0.4: + resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} + dev: true + + /is-alphanumerical@1.0.4: + resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + is-alphabetical: 1.0.4 + is-decimal: 1.0.4 dev: true /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - dependencies: - has-bigints: 1.0.2 - dev: true - - /is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} - engines: {node: '>= 0.4'} + /is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} dependencies: - call-bind: 1.0.7 - has-tostringtag: 1.0.2 - dev: true - - /is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} + builtin-modules: 3.3.0 dev: true /is-core-module@2.13.1: @@ -4479,11 +4860,8 @@ packages: hasown: 2.0.1 dev: true - /is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.2 + /is-decimal@1.0.4: + resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} dev: true /is-extglob@2.1.1: @@ -4507,6 +4885,10 @@ packages: is-extglob: 2.1.1 dev: true + /is-hexadecimal@1.0.4: + resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} + dev: true + /is-interactive@1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} @@ -4517,18 +4899,6 @@ packages: dependencies: tslib: 2.6.2 - /is-negative-zero@2.0.3: - resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} - engines: {node: '>= 0.4'} - dev: true - - /is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.2 - dev: true - /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -4539,27 +4909,12 @@ packages: engines: {node: '>=8'} dev: true - /is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - has-tostringtag: 1.0.2 - dev: true - /is-relative@1.0.0: resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} engines: {node: '>=0.10.0'} dependencies: is-unc-path: 1.0.0 - /is-shared-array-buffer@1.0.3: - resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - dev: true - /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -4570,27 +4925,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.2 - dev: true - - /is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - - /is-typed-array@1.1.13: - resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} - engines: {node: '>= 0.4'} - dependencies: - which-typed-array: 1.1.14 - dev: true - /is-unc-path@1.0.0: resolution: {integrity: sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==} engines: {node: '>=0.10.0'} @@ -4607,20 +4941,10 @@ packages: dependencies: tslib: 2.6.2 - /is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} - dependencies: - call-bind: 1.0.7 - dev: true - /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} - /isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - dev: true - /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -5133,11 +5457,27 @@ packages: argparse: 2.0.1 dev: true + /jsdoc-type-pratt-parser@4.0.0: + resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} + engines: {node: '>=12.0.0'} + dev: true + + /jsesc@0.5.0: + resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} + hasBin: true + dev: true + /jsesc@2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} hasBin: true + /jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} + hasBin: true + dev: true + /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} dev: true @@ -5173,18 +5513,21 @@ packages: remove-trailing-spaces: 1.0.8 dev: true - /json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true - dependencies: - minimist: 1.2.8 - dev: true - /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true + /jsonc-eslint-parser@2.4.0: + resolution: {integrity: sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.11.3 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + semver: 7.6.0 + dev: true + /jsonc-parser@3.2.1: resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} dev: true @@ -5261,6 +5604,13 @@ packages: p-locate: 5.0.0 dev: true + /locate-path@7.2.0: + resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + p-locate: 6.0.0 + dev: true + /lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} dev: true @@ -5356,6 +5706,22 @@ packages: resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} engines: {node: '>=0.10.0'} + /mdast-util-from-markdown@0.8.5: + resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} + dependencies: + '@types/mdast': 3.0.15 + mdast-util-to-string: 2.0.0 + micromark: 2.11.4 + parse-entities: 2.0.0 + unist-util-stringify-position: 2.0.3 + transitivePeerDependencies: + - supports-color + dev: true + + /mdast-util-to-string@2.0.0: + resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} + dev: true + /memorystream@0.3.1: resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} engines: {node: '>= 0.10.0'} @@ -5382,6 +5748,15 @@ packages: '@types/node': 20.12.5 dev: true + /micromark@2.11.4: + resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} + dependencies: + debug: 4.3.4 + parse-entities: 2.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -5400,6 +5775,11 @@ packages: engines: {node: '>=12'} dev: true + /min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + dev: true + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -5419,10 +5799,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: true - /mlly@1.6.1: resolution: {integrity: sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==} dependencies: @@ -5435,10 +5811,6 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true - /mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} dev: true @@ -5453,6 +5825,10 @@ packages: hasBin: true dev: true + /natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + dev: true + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true @@ -5492,6 +5868,15 @@ packages: /node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} + /normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.3 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + dev: true + /normalize-path@2.1.1: resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} engines: {node: '>=0.10.0'} @@ -5537,6 +5922,12 @@ packages: path-key: 4.0.0 dev: true + /nth-check@2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + dependencies: + boolbase: 1.0.0 + dev: true + /nullthrows@1.1.1: resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} @@ -5544,53 +5935,6 @@ packages: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - /object-inspect@1.13.1: - resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} - dev: true - - /object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - dev: true - - /object.assign@4.1.5: - resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - has-symbols: 1.0.3 - object-keys: 1.1.1 - dev: true - - /object.fromentries@2.0.7: - resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - dev: true - - /object.groupby@1.0.2: - resolution: {integrity: sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==} - dependencies: - array.prototype.filter: 1.0.3 - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - es-errors: 1.3.0 - dev: true - - /object.values@1.1.7: - resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - dev: true - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -5655,6 +5999,13 @@ packages: yocto-queue: 0.1.0 dev: true + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-limit@5.0.0: resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} engines: {node: '>=18'} @@ -5675,6 +6026,13 @@ packages: p-limit: 3.1.0 dev: true + /p-locate@6.0.0: + resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + p-limit: 4.0.0 + dev: true + /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} @@ -5699,6 +6057,17 @@ packages: callsites: 3.1.0 dev: true + /parse-entities@2.0.0: + resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} + dependencies: + character-entities: 1.2.4 + character-entities-legacy: 1.1.4 + character-reference-invalid: 1.1.4 + is-alphanumerical: 1.0.4 + is-decimal: 1.0.4 + is-hexadecimal: 1.0.4 + dev: true + /parse-filepath@1.0.2: resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} engines: {node: '>=0.8'} @@ -5707,6 +6076,11 @@ packages: map-cache: 0.2.2 path-root: 0.1.1 + /parse-gitignore@2.0.0: + resolution: {integrity: sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==} + engines: {node: '>=14'} + dev: true + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -5733,6 +6107,11 @@ packages: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + /path-exists@5.0.0: + resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -5782,6 +6161,11 @@ packages: engines: {node: '>=8.6'} dev: true + /picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + dev: true + /pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} engines: {node: '>=0.10'} @@ -5808,9 +6192,17 @@ packages: pathe: 1.1.2 dev: true - /possible-typed-array-names@1.0.0: - resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} - engines: {node: '>= 0.4'} + /pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + dev: true + + /postcss-selector-parser@6.0.16: + resolution: {integrity: sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==} + engines: {node: '>=4'} + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 dev: true /postcss@8.4.35: @@ -5827,12 +6219,6 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} - engines: {node: '>=14'} - hasBin: true - dev: true - /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5899,6 +6285,25 @@ packages: npm-normalize-package-bin: 3.0.1 dev: true + /read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + dev: true + + /read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + dev: true + /readable-stream@3.6.0: resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==} engines: {node: '>= 6'} @@ -5911,14 +6316,16 @@ packages: /regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - /regexp.prototype.flags@1.5.2: - resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} - engines: {node: '>= 0.4'} + /regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + dev: true + + /regjsparser@0.10.0: + resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} + hasBin: true dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-errors: 1.3.0 - set-function-name: 2.0.2 + jsesc: 0.5.0 dev: true /relay-runtime@12.0.0: @@ -5966,6 +6373,10 @@ packages: engines: {node: '>=8'} dev: true + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + /resolve.exports@2.0.0: resolution: {integrity: sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg==} engines: {node: '>=10'} @@ -6046,29 +6457,10 @@ packages: tslib: 2.6.1 dev: true - /safe-array-concat@1.1.0: - resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} - engines: {node: '>=0.4'} - dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 - isarray: 2.0.5 - dev: true - /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true - /safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-regex: 1.1.4 - dev: true - /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true @@ -6077,6 +6469,11 @@ packages: resolution: {integrity: sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg==} dev: true + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + dev: true + /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -6107,28 +6504,6 @@ packages: /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - /set-function-length@1.2.1: - resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - dev: true - - /set-function-name@2.0.2: - resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - functions-have-names: 1.2.3 - has-property-descriptors: 1.0.2 - dev: true - /setimmediate@1.0.5: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} @@ -6148,16 +6523,6 @@ packages: resolution: {integrity: sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==} dev: true - /side-channel@1.0.5: - resolution: {integrity: sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - object-inspect: 1.13.1 - dev: true - /siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} dev: true @@ -6224,6 +6589,35 @@ packages: engines: {node: '>=0.10.0'} dev: true + /spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.17 + dev: true + + /spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + dev: true + + /spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.17 + dev: true + + /spdx-expression-parse@4.0.0: + resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.17 + dev: true + + /spdx-license-ids@3.0.17: + resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} + dev: true + /sponge-case@1.0.1: resolution: {integrity: sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA==} dependencies: @@ -6273,31 +6667,6 @@ packages: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - /string.prototype.trim@1.2.8: - resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - dev: true - - /string.prototype.trimend@1.0.7: - resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - dev: true - - /string.prototype.trimstart@1.0.7: - resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.4 - dev: true - /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: @@ -6310,11 +6679,6 @@ packages: dependencies: ansi-regex: 5.0.1 - /strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - dev: true - /strip-bom@4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} @@ -6330,6 +6694,13 @@ packages: engines: {node: '>=12'} dev: true + /strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + dependencies: + min-indent: 1.0.1 + dev: true + /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -6370,6 +6741,13 @@ packages: dependencies: tslib: 2.6.2 + /synckit@0.6.2: + resolution: {integrity: sha512-Vhf+bUa//YSTYKseDiiEuQmhGCoIF3CVBhunm3r/DQnYiGT4JssmnKQc44BIyOZRK2pKjXXAgbhfmbeoC9CJpA==} + engines: {node: '>=12.20'} + dependencies: + tslib: 2.6.2 + dev: true + /test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} @@ -6432,6 +6810,13 @@ packages: is-number: 7.0.0 dev: true + /toml-eslint-parser@0.9.3: + resolution: {integrity: sha512-moYoCvkNUAPCxSW9jmHmRElhm4tVJpHL8ItC/+uYD0EpPSFXbck7yREz9tNdJVTSpHVod8+HoipcpbQ0oE6gsw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + eslint-visitor-keys: 3.4.3 + dev: true + /toposort@2.0.2: resolution: {integrity: sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==} dev: true @@ -6439,9 +6824,9 @@ packages: /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - /ts-api-utils@1.0.1(typescript@5.4.4): - resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==} - engines: {node: '>=16.13.0'} + /ts-api-utils@1.3.0(typescript@5.4.4): + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: @@ -6491,15 +6876,6 @@ packages: resolution: {integrity: sha512-DEQrfv6l7IvN2jlzc/VTdZJYsWUnQNCsueYjMkC/iXoEoi5fNan6MjeDqkvhfzbmHgdz9UxDUluX3V5HdjTydQ==} dev: true - /tsconfig-paths@3.15.0: - resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 - dev: true - /tslib@2.6.1: resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} @@ -6518,58 +6894,29 @@ packages: engines: {node: '>=4'} dev: true - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} dev: true - /type-fest@2.19.0: - resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} - engines: {node: '>=12.20'} - dev: true - - /typed-array-buffer@1.0.2: - resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-typed-array: 1.1.13 + /type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} dev: true - /typed-array-byte-length@1.0.1: - resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 + /type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} dev: true - /typed-array-byte-offset@1.0.2: - resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 + /type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} dev: true - /typed-array-length@1.0.5: - resolution: {integrity: sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - possible-typed-array-names: 1.0.0 + /type-fest@2.19.0: + resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} + engines: {node: '>=12.20'} dev: true /typescript@5.4.4: @@ -6585,15 +6932,6 @@ packages: resolution: {integrity: sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==} dev: true - /unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - dependencies: - call-bind: 1.0.7 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - dev: true - /unc-path-regex@0.1.2: resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} engines: {node: '>=0.10.0'} @@ -6602,6 +6940,17 @@ packages: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: true + /unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + dev: true + + /unist-util-stringify-position@2.0.3: + resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + dependencies: + '@types/unist': 2.0.10 + dev: true + /unixify@1.0.0: resolution: {integrity: sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==} engines: {node: '>=0.10.0'} @@ -6658,6 +7007,13 @@ packages: convert-source-map: 1.9.0 dev: true + /validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + dev: true + /value-or-promise@1.0.12: resolution: {integrity: sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==} engines: {node: '>=12'} @@ -6776,6 +7132,24 @@ packages: - terser dev: true + /vue-eslint-parser@9.4.2(eslint@9.0.0): + resolution: {integrity: sha512-Ry9oiGmCAK91HrKMtCrKFWmSFWvYkpGglCeFAIqDdr9zdXmMMpJOmUJS7WWsW7fX81h6mwHmUZCQQ1E0PkSwYQ==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + debug: 4.3.4 + eslint: 9.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.4.2 + lodash: 4.17.21 + semver: 7.6.0 + transitivePeerDependencies: + - supports-color + dev: true + /walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} dependencies: @@ -6812,30 +7186,9 @@ packages: tr46: 0.0.3 webidl-conversions: 3.0.1 - /which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 - dev: true - /which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - /which-typed-array@1.1.14: - resolution: {integrity: sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.2 - dev: true - /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -6894,6 +7247,11 @@ packages: optional: true dev: true + /xml-name-validator@4.0.0: + resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} + engines: {node: '>=12'} + dev: true + /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} @@ -6913,6 +7271,15 @@ packages: resolution: {integrity: sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==} dev: true + /yaml-eslint-parser@1.2.2: + resolution: {integrity: sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==} + engines: {node: ^14.17.0 || >=16.0.0} + dependencies: + eslint-visitor-keys: 3.4.3 + lodash: 4.17.21 + yaml: 2.3.1 + dev: true + /yaml@2.3.1: resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} engines: {node: '>= 14'} @@ -6930,6 +7297,11 @@ packages: engines: {node: '>=12'} dev: true + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + /yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} @@ -6959,6 +7331,19 @@ packages: yargs-parser: 21.0.1 dev: true + /yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} diff --git a/src/config.ts b/src/config.ts index 04c1af45..6475f9fc 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,20 +1,20 @@ -import { TypeScriptPluginConfig } from '@graphql-codegen/typescript'; +import type { TypeScriptPluginConfig } from '@graphql-codegen/typescript'; export type ValidationSchema = 'yup' | 'zod' | 'myzod'; export type ValidationSchemaExportType = 'function' | 'const'; export interface DirectiveConfig { [directive: string]: { - [argument: string]: string | string[] | DirectiveObjectArguments; - }; + [argument: string]: string | string[] | DirectiveObjectArguments + } } export interface DirectiveObjectArguments { - [matched: string]: string | string[]; + [matched: string]: string | string[] } interface ScalarSchemas { - [name: string]: string; + [name: string]: string } export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { @@ -33,7 +33,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * schema: yup * ``` */ - schema?: ValidationSchema; + schema?: ValidationSchema /** * @description import types from generated typescript type path * if not given, omit import statement. @@ -52,7 +52,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * importFrom: ./path/to/types * ``` */ - importFrom?: string; + importFrom?: string /** * @description Will use `import type {}` rather than `import {}` when importing generated typescript types. * This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option @@ -74,7 +74,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * useTypeImports: true * ``` */ - useTypeImports?: boolean; + useTypeImports?: boolean /** * @description Prefixes all import types from generated typescript type. * @default "" @@ -93,7 +93,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * importFrom: ./path/to/types * ``` */ - typesPrefix?: string; + typesPrefix?: string /** * @description Suffixes all import types from generated typescript type. * @default "" @@ -112,7 +112,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * importFrom: ./path/to/types * ``` */ - typesSuffix?: string; + typesSuffix?: string /** * @description Generates validation schema for enum as TypeScript `type` * @default false @@ -137,7 +137,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * enumsAsTypes: true * ``` */ - enumsAsTypes?: boolean; + enumsAsTypes?: boolean /** * @description Generates validation string schema as do not allow empty characters by default. * @default false @@ -152,7 +152,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * notAllowEmptyString: true * ``` */ - notAllowEmptyString?: boolean; + notAllowEmptyString?: boolean /** * @description Extends or overrides validation schema for the built-in scalars and custom GraphQL scalars. * @@ -174,7 +174,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * Email: z.string().email() * ``` */ - scalarSchemas?: ScalarSchemas; + scalarSchemas?: ScalarSchemas /** * @description Generates validation schema with GraphQL type objects. * but excludes "Query", "Mutation", "Subscription" objects. @@ -193,7 +193,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * withObjectType: true * ``` */ - withObjectType?: boolean; + withObjectType?: boolean /** * @description Specify validation schema export type. * @default function @@ -209,7 +209,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * validationSchemaExportType: const * ``` */ - validationSchemaExportType?: ValidationSchemaExportType; + validationSchemaExportType?: ValidationSchemaExportType /** * @description Generates validation schema with more API based on directive schema. * @exampleMarkdown @@ -250,5 +250,5 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * exclusiveMax: max * ``` */ - directives?: DirectiveConfig; + directives?: DirectiveConfig } diff --git a/src/directive.ts b/src/directive.ts index a85efb10..25efdb1d 100644 --- a/src/directive.ts +++ b/src/directive.ts @@ -1,23 +1,24 @@ -import { ConstArgumentNode, ConstDirectiveNode, ConstValueNode, Kind, valueFromASTUntyped } from 'graphql'; +import type { ConstArgumentNode, ConstDirectiveNode, ConstValueNode } from 'graphql'; +import { Kind, valueFromASTUntyped } from 'graphql'; -import { DirectiveConfig, DirectiveObjectArguments } from './config'; +import type { DirectiveConfig, DirectiveObjectArguments } from './config'; import { isConvertableRegexp } from './regexp'; export interface FormattedDirectiveConfig { - [directive: string]: FormattedDirectiveArguments; + [directive: string]: FormattedDirectiveArguments } export interface FormattedDirectiveArguments { - [argument: string]: string[] | FormattedDirectiveObjectArguments | undefined; + [argument: string]: string[] | FormattedDirectiveObjectArguments | undefined } export interface FormattedDirectiveObjectArguments { - [matched: string]: string[] | undefined; + [matched: string]: string[] | undefined } -const isFormattedDirectiveObjectArguments = ( - arg: FormattedDirectiveArguments[keyof FormattedDirectiveArguments] -): arg is FormattedDirectiveObjectArguments => arg !== undefined && !Array.isArray(arg); +function isFormattedDirectiveObjectArguments(arg: FormattedDirectiveArguments[keyof FormattedDirectiveArguments]): arg is FormattedDirectiveObjectArguments { + return arg !== undefined && !Array.isArray(arg) +} // ```yml // directives: @@ -43,24 +44,24 @@ const isFormattedDirectiveObjectArguments = ( // } // } // } -export const formatDirectiveConfig = (config: DirectiveConfig): FormattedDirectiveConfig => { +export function formatDirectiveConfig(config: DirectiveConfig): FormattedDirectiveConfig { return Object.fromEntries( Object.entries(config).map(([directive, arg]) => { const formatted = Object.fromEntries( Object.entries(arg).map(([arg, val]) => { - if (Array.isArray(val)) { + if (Array.isArray(val)) return [arg, val]; - } - if (typeof val === 'string') { + + if (typeof val === 'string') return [arg, [val, '$1']]; - } + return [arg, formatDirectiveObjectArguments(val)]; - }) + }), ); return [directive, formatted]; - }) + }), ); -}; +} // ```yml // format: @@ -76,15 +77,15 @@ export const formatDirectiveConfig = (config: DirectiveConfig): FormattedDirecti // 'uri': ['url', '$2'], // 'email': ['email'], // } -export const formatDirectiveObjectArguments = (args: DirectiveObjectArguments): FormattedDirectiveObjectArguments => { +export function formatDirectiveObjectArguments(args: DirectiveObjectArguments): FormattedDirectiveObjectArguments { const formatted = Object.entries(args).map(([arg, val]) => { - if (Array.isArray(val)) { + if (Array.isArray(val)) return [arg, val]; - } + return [arg, [val, '$2']]; }); return Object.fromEntries(formatted); -}; +} // This function generates `.required("message").min(100).email()` // @@ -108,101 +109,95 @@ export const formatDirectiveObjectArguments = (args: DirectiveObjectArguments): // email: String! @required(msg: "message") @constraint(minLength: 100, format: "email") // } // ``` -export const buildApi = (config: FormattedDirectiveConfig, directives: ReadonlyArray): string => - directives +export function buildApi(config: FormattedDirectiveConfig, directives: ReadonlyArray): string { + return directives .filter(directive => config[directive.name.value] !== undefined) - .map(directive => { + .map((directive) => { const directiveName = directive.name.value; const argsConfig = config[directiveName]; return buildApiFromDirectiveArguments(argsConfig, directive.arguments ?? []); }) - .join(''); + .join('') +} -const buildApiSchema = (validationSchema: string[] | undefined, argValue: ConstValueNode): string => { - if (!validationSchema) { +function buildApiSchema(validationSchema: string[] | undefined, argValue: ConstValueNode): string { + if (!validationSchema) return ''; - } + const schemaApi = validationSchema[0]; - const schemaApiArgs = validationSchema.slice(1).map(templateArg => { + const schemaApiArgs = validationSchema.slice(1).map((templateArg) => { const gqlSchemaArgs = apiArgsFromConstValueNode(argValue); return applyArgToApiSchemaTemplate(templateArg, gqlSchemaArgs); }); return `.${schemaApi}(${schemaApiArgs.join(', ')})`; -}; +} -const buildApiFromDirectiveArguments = ( - config: FormattedDirectiveArguments, - args: ReadonlyArray -): string => { +function buildApiFromDirectiveArguments(config: FormattedDirectiveArguments, args: ReadonlyArray): string { return args - .map(arg => { + .map((arg) => { const argName = arg.name.value; const validationSchema = config[argName]; - if (isFormattedDirectiveObjectArguments(validationSchema)) { + if (isFormattedDirectiveObjectArguments(validationSchema)) return buildApiFromDirectiveObjectArguments(validationSchema, arg.value); - } + return buildApiSchema(validationSchema, arg.value); }) .join(''); -}; +} -const buildApiFromDirectiveObjectArguments = ( - config: FormattedDirectiveObjectArguments, - argValue: ConstValueNode -): string => { - if (argValue.kind !== Kind.STRING) { +function buildApiFromDirectiveObjectArguments(config: FormattedDirectiveObjectArguments, argValue: ConstValueNode): string { + if (argValue.kind !== Kind.STRING) return ''; - } + const validationSchema = config[argValue.value]; return buildApiSchema(validationSchema, argValue); -}; +} -const applyArgToApiSchemaTemplate = (template: string, apiArgs: any[]): string => { +function applyArgToApiSchemaTemplate(template: string, apiArgs: any[]): string { const matches = template.matchAll(/[$](\d+)/g); for (const match of matches) { const placeholder = match[0]; // `$1` - const idx = parseInt(match[1], 10) - 1; // start with `1 - 1` + const idx = Number.parseInt(match[1], 10) - 1; // start with `1 - 1` const apiArg = apiArgs[idx]; if (apiArg === undefined) { template = template.replace(placeholder, ''); continue; } - if (template === placeholder) { + if (template === placeholder) return stringify(apiArg); - } + template = template.replace(placeholder, apiArg); } - if (template !== '') { + if (template !== '') return stringify(template, true); - } + return template; -}; +} -const stringify = (arg: any, quoteString?: boolean): string => { - if (Array.isArray(arg)) { +function stringify(arg: any, quoteString?: boolean): string { + if (Array.isArray(arg)) return arg.map(v => stringify(v, true)).join(','); - } + if (typeof arg === 'string') { - if (isConvertableRegexp(arg)) { + if (isConvertableRegexp(arg)) return arg; - } - if (quoteString) { + + if (quoteString) return JSON.stringify(arg); - } } - if (typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'bigint') { + if (typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'bigint') return `${arg}`; - } + return JSON.stringify(arg); -}; +} -const apiArgsFromConstValueNode = (value: ConstValueNode): any[] => { +function apiArgsFromConstValueNode(value: ConstValueNode): any[] { const val = valueFromASTUntyped(value); - if (Array.isArray(val)) { + if (Array.isArray(val)) return val; - } + return [val]; -}; +} export const exportedForTesting = { applyArgToApiSchemaTemplate, diff --git a/src/graphql.ts b/src/graphql.ts index 58b3b922..694b9b64 100644 --- a/src/graphql.ts +++ b/src/graphql.ts @@ -1,16 +1,18 @@ import { Graph } from 'graphlib'; -import { +import type { ASTNode, DefinitionNode, DocumentNode, GraphQLSchema, - isSpecifiedScalarType, ListTypeNode, - NamedTypeNode, NameNode, + NamedTypeNode, NonNullTypeNode, ObjectTypeDefinitionNode, TypeNode, +} from 'graphql'; +import { + isSpecifiedScalarType, visit, } from 'graphql'; @@ -22,20 +24,18 @@ export const isInput = (kind: string) => kind.includes('Input'); type ObjectTypeDefinitionFn = (node: ObjectTypeDefinitionNode) => any; -export const ObjectTypeDefinitionBuilder = ( - useObjectTypes: boolean | undefined, - callback: ObjectTypeDefinitionFn -): ObjectTypeDefinitionFn | undefined => { - if (!useObjectTypes) return undefined; - return node => { - if (/^(Query|Mutation|Subscription)$/.test(node.name.value)) { +export function ObjectTypeDefinitionBuilder(useObjectTypes: boolean | undefined, callback: ObjectTypeDefinitionFn): ObjectTypeDefinitionFn | undefined { + if (!useObjectTypes) + return undefined; + return (node) => { + if (/^(Query|Mutation|Subscription)$/.test(node.name.value)) return; - } + return callback(node); }; -}; +} -export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): DocumentNode => { +export function topologicalSortAST(schema: GraphQLSchema, ast: DocumentNode): DocumentNode { const dependencyGraph = new Graph(); const targetKinds = [ 'ObjectTypeDefinition', @@ -46,7 +46,7 @@ export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): Do ]; visit(ast, { - enter: node => { + enter: (node) => { switch (node.kind) { case 'ObjectTypeDefinition': case 'InputObjectTypeDefinition': { @@ -54,16 +54,16 @@ export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): Do dependencyGraph.setNode(typeName); if (node.fields) { - node.fields.forEach(field => { + node.fields.forEach((field) => { if (field.type.kind === 'NamedType') { const dependency = field.type.name.value; const typ = schema.getType(dependency); - if (typ?.astNode?.kind === undefined || !targetKinds.includes(typ.astNode.kind)) { + if (typ?.astNode?.kind === undefined || !targetKinds.includes(typ.astNode.kind)) return; - } - if (!dependencyGraph.hasNode(dependency)) { + + if (!dependencyGraph.hasNode(dependency)) dependencyGraph.setNode(dependency); - } + dependencyGraph.setEdge(typeName, dependency); } }); @@ -77,15 +77,15 @@ export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): Do } case 'UnionTypeDefinition': { const dependency = node.name.value; - if (!dependencyGraph.hasNode(dependency)) { + if (!dependencyGraph.hasNode(dependency)) dependencyGraph.setNode(dependency); - } - node.types?.forEach(type => { + + node.types?.forEach((type) => { const dependency = type.name.value; const typ = schema.getType(dependency); - if (typ?.astNode?.kind === undefined || !targetKinds.includes(typ.astNode.kind)) { + if (typ?.astNode?.kind === undefined || !targetKinds.includes(typ.astNode.kind)) return; - } + dependencyGraph.setEdge(node.name.value, dependency); }); break; @@ -105,10 +105,9 @@ export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): Do // https://spec.graphql.org/October2021/#sec-Schema const astDefinitions = ast.definitions.filter(def => def.kind !== 'SchemaDefinition'); - astDefinitions.forEach(definition => { - if (hasNameField(definition) && definition.name) { + astDefinitions.forEach((definition) => { + if (hasNameField(definition) && definition.name) definitionsMap.set(definition.name.value, definition); - } }); // Two arrays to store sorted and not sorted definitions. @@ -116,7 +115,7 @@ export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): Do const notSortedDefinitions: DefinitionNode[] = []; // Iterate over sorted type names and retrieve their corresponding definitions. - sorted.forEach(sortedType => { + sorted.forEach((sortedType) => { const definition = definitionsMap.get(sortedType); if (definition) { sortedDefinitions.push(definition); @@ -132,7 +131,7 @@ export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): Do if (newDefinitions.length !== astDefinitions.length) { throw new Error( - `unexpected definition length after sorted: want ${astDefinitions.length} but got ${newDefinitions.length}` + `unexpected definition length after sorted: want ${astDefinitions.length} but got ${newDefinitions.length}`, ); } @@ -140,15 +139,15 @@ export const topologicalSortAST = (schema: GraphQLSchema, ast: DocumentNode): Do ...ast, definitions: newDefinitions as ReadonlyArray, }; -}; +} -const hasNameField = (node: ASTNode): node is DefinitionNode & { name?: NameNode } => { +function hasNameField(node: ASTNode): node is DefinitionNode & { name?: NameNode } { return 'name' in node; -}; +} // Re-implemented w/o CycleException version // https://github.com/dagrejs/graphlib/blob/8d27cb89029081c72eb89dde652602805bdd0a34/lib/alg/topsort.js -export const topsort = (g: Graph): string[] => { +export function topsort(g: Graph): string[] { const visited: Record = {}; const stack: Record = {}; const results: any[] = []; @@ -158,9 +157,9 @@ export const topsort = (g: Graph): string[] => { stack[node] = true; visited[node] = true; const predecessors = g.predecessors(node); - if (Array.isArray(predecessors)) { + if (Array.isArray(predecessors)) predecessors.forEach(node => visit(node)); - } + delete stack[node]; results.push(node); } @@ -169,9 +168,10 @@ export const topsort = (g: Graph): string[] => { g.sinks().forEach(node => visit(node)); return results.reverse(); -}; +} -export const isGeneratedByIntrospection = (schema: GraphQLSchema): boolean => - Object.entries(schema.getTypeMap()) +export function isGeneratedByIntrospection(schema: GraphQLSchema): boolean { + return Object.entries(schema.getTypeMap()) .filter(([name, type]) => !name.startsWith('__') && !isSpecifiedScalarType(type)) - .every(([, type]) => type.astNode === undefined); + .every(([, type]) => type.astNode === undefined) +} diff --git a/src/index.ts b/src/index.ts index c4f6ff24..4bd6008a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,26 +1,25 @@ -import { PluginFunction, Types } from '@graphql-codegen/plugin-helpers'; +import type { PluginFunction, Types } from '@graphql-codegen/plugin-helpers'; import { transformSchemaAST } from '@graphql-codegen/schema-ast'; -import { buildSchema, GraphQLSchema, printSchema, visit } from 'graphql'; +import type { GraphQLSchema } from 'graphql'; +import { buildSchema, printSchema, visit } from 'graphql'; -import { ValidationSchemaPluginConfig } from './config'; +import type { ValidationSchemaPluginConfig } from './config'; import { isGeneratedByIntrospection, topologicalSortAST } from './graphql'; import { MyZodSchemaVisitor } from './myzod/index'; -import { SchemaVisitor } from './types'; +import type { SchemaVisitor } from './types'; import { YupSchemaVisitor } from './yup/index'; import { ZodSchemaVisitor } from './zod/index'; export const plugin: PluginFunction = ( schema: GraphQLSchema, _documents: Types.DocumentFile[], - config: ValidationSchemaPluginConfig + config: ValidationSchemaPluginConfig, ): Types.ComplexPluginOutput => { const { schema: _schema, ast } = _transformSchemaAST(schema, config); const visitor = schemaVisitor(_schema, config); const result = visit(ast, visitor); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore const generated = result.definitions.filter(def => typeof def === 'string'); return { @@ -29,16 +28,16 @@ export const plugin: PluginFunction { - if (config?.schema === 'zod') { +function schemaVisitor(schema: GraphQLSchema, config: ValidationSchemaPluginConfig): SchemaVisitor { + if (config?.schema === 'zod') return new ZodSchemaVisitor(schema, config); - } else if (config?.schema === 'myzod') { + else if (config?.schema === 'myzod') return new MyZodSchemaVisitor(schema, config); - } + return new YupSchemaVisitor(schema, config); -}; +} -const _transformSchemaAST = (schema: GraphQLSchema, config: ValidationSchemaPluginConfig) => { +function _transformSchemaAST(schema: GraphQLSchema, config: ValidationSchemaPluginConfig) { const { schema: _schema, ast } = transformSchemaAST(schema, config); // See: https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues/394 @@ -56,4 +55,4 @@ const _transformSchemaAST = (schema: GraphQLSchema, config: ValidationSchemaPlug schema: __schema, ast, }; -}; +} diff --git a/src/myzod/index.ts b/src/myzod/index.ts index 067caf58..4c2fc3b8 100644 --- a/src/myzod/index.ts +++ b/src/myzod/index.ts @@ -1,22 +1,24 @@ import { DeclarationBlock, indent } from '@graphql-codegen/visitor-plugin-common'; -import { +import type { EnumTypeDefinitionNode, FieldDefinitionNode, GraphQLSchema, InputObjectTypeDefinitionNode, InputValueDefinitionNode, - Kind, NameNode, ObjectTypeDefinitionNode, TypeNode, UnionTypeDefinitionNode, } from 'graphql'; +import { + Kind, +} from 'graphql'; -import { ValidationSchemaPluginConfig } from '../config'; +import type { ValidationSchemaPluginConfig } from '../config'; import { buildApi, formatDirectiveConfig } from '../directive'; import { BaseSchemaVisitor } from '../schema_visitor'; -import { Visitor } from '../visitor'; -import { isInput, isListType, isNamedType, isNonNullType, ObjectTypeDefinitionBuilder } from './../graphql'; +import type { Visitor } from '../visitor'; +import { ObjectTypeDefinitionBuilder, isInput, isListType, isNamedType, isNonNullType } from './../graphql'; const anySchema = `definedNonNullAnySchema`; @@ -31,12 +33,12 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { initialEmit(): string { return ( - '\n' + + `\n${ [ new DeclarationBlock({}).export().asKind('const').withName(`${anySchema}`).withContent(`myzod.object({})`) .string, ...this.enumDeclarations, - ].join('\n') + ].join('\n')}` ); } @@ -60,7 +62,7 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { // Building schema for field arguments. const argumentBlocks = this.buildObjectTypeDefinitionArguments(node, visitor); - const appendArguments = argumentBlocks ? '\n' + argumentBlocks : ''; + const appendArguments = argumentBlocks ? `\n${argumentBlocks}` : ''; // Building schema for fields. const shape = node.fields?.map(field => generateFieldMyZodSchema(this.config, visitor, field, 2)).join(',\n'); @@ -78,7 +80,7 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { indent(`__typename: myzod.literal('${node.name.value}').optional(),`, 2), shape, '})', - ].join('\n') + ].join('\n'), ).string + appendArguments ); @@ -95,7 +97,7 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { indent(`__typename: myzod.literal('${node.name.value}').optional(),`, 2), shape, indent('})'), - ].join('\n') + ].join('\n'), ).string + appendArguments ); } @@ -114,17 +116,17 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { this.enumDeclarations.push( this.config.enumsAsTypes ? new DeclarationBlock({}) - .export() - .asKind('type') - .withName(`${enumname}Schema`) - .withContent( - `myzod.literals(${node.values?.map(enumOption => `'${enumOption.name.value}'`).join(', ')})` - ).string + .export() + .asKind('type') + .withName(`${enumname}Schema`) + .withContent( + `myzod.literals(${node.values?.map(enumOption => `'${enumOption.name.value}'`).join(', ')})`, + ).string : new DeclarationBlock({}) - .export() - .asKind('const') - .withName(`${enumname}Schema`) - .withContent(`myzod.enum(${enumname})`).string + .export() + .asKind('const') + .withName(`${enumname}Schema`) + .withContent(`myzod.enum(${enumname})`).string, ); }, }; @@ -133,18 +135,19 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { get UnionTypeDefinition() { return { leave: (node: UnionTypeDefinitionNode) => { - if (!node.types || !this.config.withObjectType) return; + if (!node.types || !this.config.withObjectType) + return; const visitor = this.createVisitor('output'); const unionName = visitor.convertName(node.name.value); const unionElements = node.types - ?.map(t => { + ?.map((t) => { const element = visitor.convertName(t.name.value); const typ = visitor.getType(t.name.value); - if (typ?.astNode?.kind === 'EnumTypeDefinition') { + if (typ?.astNode?.kind === 'EnumTypeDefinition') return `${element}Schema`; - } + switch (this.config.validationSchemaExportType) { case 'const': return `${element}Schema`; @@ -177,7 +180,7 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { protected buildInputFields( fields: readonly (FieldDefinitionNode | InputValueDefinitionNode)[], visitor: Visitor, - name: string + name: string, ) { const shape = fields.map(field => generateFieldMyZodSchema(this.config, visitor, field, 2)).join(',\n'); @@ -200,23 +203,12 @@ export class MyZodSchemaVisitor extends BaseSchemaVisitor { } } -const generateFieldMyZodSchema = ( - config: ValidationSchemaPluginConfig, - visitor: Visitor, - field: InputValueDefinitionNode | FieldDefinitionNode, - indentCount: number -): string => { +function generateFieldMyZodSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, field: InputValueDefinitionNode | FieldDefinitionNode, indentCount: number): string { const gen = generateFieldTypeMyZodSchema(config, visitor, field, field.type); return indent(`${field.name.value}: ${maybeLazy(field.type, gen)}`, indentCount); -}; - -const generateFieldTypeMyZodSchema = ( - config: ValidationSchemaPluginConfig, - visitor: Visitor, - field: InputValueDefinitionNode | FieldDefinitionNode, - type: TypeNode, - parentType?: TypeNode -): string => { +} + +function generateFieldTypeMyZodSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, field: InputValueDefinitionNode | FieldDefinitionNode, type: TypeNode, parentType?: TypeNode): string { if (isListType(type)) { const gen = generateFieldTypeMyZodSchema(config, visitor, field, type.type, type); if (!isNonNullType(parentType)) { @@ -232,54 +224,45 @@ const generateFieldTypeMyZodSchema = ( } if (isNamedType(type)) { const gen = generateNameNodeMyZodSchema(config, visitor, type.name); - if (isListType(parentType)) { + if (isListType(parentType)) return `${gen}.nullable()`; - } + let appliedDirectivesGen = applyDirectives(config, field, gen); if (field.kind === Kind.INPUT_VALUE_DEFINITION) { const { defaultValue } = field; - if (defaultValue?.kind === Kind.INT || defaultValue?.kind === Kind.FLOAT || defaultValue?.kind === Kind.BOOLEAN) { + if (defaultValue?.kind === Kind.INT || defaultValue?.kind === Kind.FLOAT || defaultValue?.kind === Kind.BOOLEAN) appliedDirectivesGen = `${appliedDirectivesGen}.default(${defaultValue.value})`; - } - if (defaultValue?.kind === Kind.STRING || defaultValue?.kind === Kind.ENUM) { + + if (defaultValue?.kind === Kind.STRING || defaultValue?.kind === Kind.ENUM) appliedDirectivesGen = `${appliedDirectivesGen}.default("${defaultValue.value}")`; - } } if (isNonNullType(parentType)) { - if (visitor.shouldEmitAsNotAllowEmptyString(type.name.value)) { + if (visitor.shouldEmitAsNotAllowEmptyString(type.name.value)) return `${gen}.min(1)`; - } + return appliedDirectivesGen; } - if (isListType(parentType)) { + if (isListType(parentType)) return `${appliedDirectivesGen}.nullable()`; - } + return `${appliedDirectivesGen}.optional().nullable()`; } console.warn('unhandled type:', type); return ''; -}; +} -const applyDirectives = ( - config: ValidationSchemaPluginConfig, - field: InputValueDefinitionNode | FieldDefinitionNode, - gen: string -): string => { +function applyDirectives(config: ValidationSchemaPluginConfig, field: InputValueDefinitionNode | FieldDefinitionNode, gen: string): string { if (config.directives && field.directives) { const formatted = formatDirectiveConfig(config.directives); return gen + buildApi(formatted, field.directives); } return gen; -}; +} -const generateNameNodeMyZodSchema = ( - config: ValidationSchemaPluginConfig, - visitor: Visitor, - node: NameNode -): string => { +function generateNameNodeMyZodSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, node: NameNode): string { const converter = visitor.getNameNodeConverter(node); switch (converter?.targetKind) { @@ -299,19 +282,19 @@ const generateNameNodeMyZodSchema = ( default: return myzod4Scalar(config, visitor, node.value); } -}; +} -const maybeLazy = (type: TypeNode, schema: string): string => { - if (isNamedType(type) && isInput(type.name.value)) { +function maybeLazy(type: TypeNode, schema: string): string { + if (isNamedType(type) && isInput(type.name.value)) return `myzod.lazy(() => ${schema})`; - } + return schema; -}; +} -const myzod4Scalar = (config: ValidationSchemaPluginConfig, visitor: Visitor, scalarName: string): string => { - if (config.scalarSchemas?.[scalarName]) { +function myzod4Scalar(config: ValidationSchemaPluginConfig, visitor: Visitor, scalarName: string): string { + if (config.scalarSchemas?.[scalarName]) return config.scalarSchemas[scalarName]; - } + const tsType = visitor.getScalarType(scalarName); switch (tsType) { case 'string': @@ -323,4 +306,4 @@ const myzod4Scalar = (config: ValidationSchemaPluginConfig, visitor: Visitor, sc } console.warn('unhandled name:', scalarName); return anySchema; -}; +} diff --git a/src/schema_visitor.ts b/src/schema_visitor.ts index 686ca7d9..988a3f0d 100644 --- a/src/schema_visitor.ts +++ b/src/schema_visitor.ts @@ -1,7 +1,7 @@ -import { FieldDefinitionNode, GraphQLSchema, InputValueDefinitionNode, ObjectTypeDefinitionNode } from 'graphql'; +import type { FieldDefinitionNode, GraphQLSchema, InputValueDefinitionNode, ObjectTypeDefinitionNode } from 'graphql'; -import { ValidationSchemaPluginConfig } from './config'; -import { SchemaVisitor } from './types'; +import type { ValidationSchemaPluginConfig } from './config'; +import type { SchemaVisitor } from './types'; import { Visitor } from './visitor'; export abstract class BaseSchemaVisitor implements SchemaVisitor { @@ -10,7 +10,7 @@ export abstract class BaseSchemaVisitor implements SchemaVisitor { constructor( protected schema: GraphQLSchema, - protected config: ValidationSchemaPluginConfig + protected config: ValidationSchemaPluginConfig, ) {} abstract importValidationSchema(): string; diff --git a/src/types.ts b/src/types.ts index 4fe8df9f..6c73e870 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,12 +1,12 @@ -import { ASTNode, ASTVisitFn } from 'graphql'; +import type { ASTNode, ASTVisitFn } from 'graphql'; export type NewVisitor = Partial<{ readonly [NodeT in ASTNode as NodeT['kind']]?: { - leave?: ASTVisitFn; + leave?: ASTVisitFn }; }>; export interface SchemaVisitor extends NewVisitor { - buildImports: () => string[]; - initialEmit: () => string; + buildImports: () => string[] + initialEmit: () => string } diff --git a/src/visitor.ts b/src/visitor.ts index cc06e829..ea72c962 100644 --- a/src/visitor.ts +++ b/src/visitor.ts @@ -1,13 +1,14 @@ import { TsVisitor } from '@graphql-codegen/typescript'; -import { FieldDefinitionNode, GraphQLSchema, NameNode, ObjectTypeDefinitionNode, specifiedScalarTypes } from 'graphql'; +import type { FieldDefinitionNode, GraphQLSchema, NameNode, ObjectTypeDefinitionNode } from 'graphql'; +import { specifiedScalarTypes } from 'graphql'; -import { ValidationSchemaPluginConfig } from './config'; +import type { ValidationSchemaPluginConfig } from './config'; export class Visitor extends TsVisitor { constructor( private scalarDirection: 'input' | 'output' | 'both', private schema: GraphQLSchema, - private pluginConfig: ValidationSchemaPluginConfig + private pluginConfig: ValidationSchemaPluginConfig, ) { super(schema, pluginConfig); } @@ -23,9 +24,9 @@ export class Visitor extends TsVisitor { public getNameNodeConverter(node: NameNode) { const typ = this.schema.getType(node.value); const astNode = typ?.astNode; - if (astNode === undefined || astNode === null) { + if (astNode === undefined || astNode === null) return undefined; - } + return { targetKind: astNode.kind, convertName: () => this.convertName(astNode.name.value), @@ -33,42 +34,42 @@ export class Visitor extends TsVisitor { } public getScalarType(scalarName: string): string | null { - if (this.scalarDirection === 'both') { + if (this.scalarDirection === 'both') return null; - } + return this.scalars[scalarName][this.scalarDirection]; } public shouldEmitAsNotAllowEmptyString(name: string): boolean { - if (this.pluginConfig.notAllowEmptyString !== true) { + if (this.pluginConfig.notAllowEmptyString !== true) return false; - } + const typ = this.getType(name); - if (typ?.astNode?.kind !== 'ScalarTypeDefinition' && !this.isSpecifiedScalarName(name)) { + if (typ?.astNode?.kind !== 'ScalarTypeDefinition' && !this.isSpecifiedScalarName(name)) return false; - } + const tsType = this.getScalarType(name); return tsType === 'string'; } public buildArgumentsSchemaBlock( node: ObjectTypeDefinitionNode, - callback: (typeName: string, field: FieldDefinitionNode) => string + callback: (typeName: string, field: FieldDefinitionNode) => string, ) { const fieldsWithArguments = node.fields?.filter(field => field.arguments && field.arguments.length > 0) ?? []; - if (fieldsWithArguments.length === 0) { + if (fieldsWithArguments.length === 0) return undefined; - } + return fieldsWithArguments - .map(field => { - const name = - node.name.value + - (this.config.addUnderscoreToArgsType ? '_' : '') + - this.convertName(field, { + .map((field) => { + const name + = `${node.name.value + + (this.config.addUnderscoreToArgsType ? '_' : '') + + this.convertName(field, { useTypesPrefix: false, useTypesSuffix: false, - }) + - 'Args'; + }) + }Args`; return callback(name, field); }) diff --git a/src/yup/index.ts b/src/yup/index.ts index 2d923822..f6e0afaa 100644 --- a/src/yup/index.ts +++ b/src/yup/index.ts @@ -1,22 +1,24 @@ import { DeclarationBlock, indent } from '@graphql-codegen/visitor-plugin-common'; -import { +import type { EnumTypeDefinitionNode, FieldDefinitionNode, GraphQLSchema, InputObjectTypeDefinitionNode, InputValueDefinitionNode, - Kind, NameNode, ObjectTypeDefinitionNode, TypeNode, UnionTypeDefinitionNode, } from 'graphql'; +import { + Kind, +} from 'graphql'; -import { ValidationSchemaPluginConfig } from '../config'; +import type { ValidationSchemaPluginConfig } from '../config'; import { buildApi, formatDirectiveConfig } from '../directive'; import { BaseSchemaVisitor } from '../schema_visitor'; -import { Visitor } from '../visitor'; -import { isInput, isListType, isNamedType, isNonNullType, ObjectTypeDefinitionBuilder } from './../graphql'; +import type { Visitor } from '../visitor'; +import { ObjectTypeDefinitionBuilder, isInput, isListType, isNamedType, isNonNullType } from './../graphql'; export class YupSchemaVisitor extends BaseSchemaVisitor { constructor(schema: GraphQLSchema, config: ValidationSchemaPluginConfig) { @@ -28,11 +30,12 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { } initialEmit(): string { - if (!this.config.withObjectType) return '\n' + this.enumDeclarations.join('\n'); + if (!this.config.withObjectType) + return `\n${this.enumDeclarations.join('\n')}`; return ( - '\n' + - this.enumDeclarations.join('\n') + - '\n' + + `\n${ + this.enumDeclarations.join('\n') + }\n${ new DeclarationBlock({}) .asKind('function') .withName('union(...schemas: ReadonlyArray>): yup.MixedSchema') @@ -41,8 +44,8 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { indent('return yup.mixed().test({'), indent('test: (value) => schemas.some((schema) => schema.isValidSync(value))', 2), indent('}).defined()'), - ].join('\n') - ).string + ].join('\n'), + ).string}` ); } @@ -66,7 +69,7 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { // Building schema for field arguments. const argumentBlocks = this.buildObjectTypeDefinitionArguments(node, visitor); - const appendArguments = argumentBlocks ? '\n' + argumentBlocks : ''; + const appendArguments = argumentBlocks ? `\n${argumentBlocks}` : ''; // Building schema for fields. const shape = shapeFields(node.fields, this.config, visitor); @@ -84,7 +87,7 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { indent(`__typename: yup.string<'${node.name.value}'>().optional(),`, 2), shape, '})', - ].join('\n') + ].join('\n'), ).string + appendArguments ); @@ -101,7 +104,7 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { indent(`__typename: yup.string<'${node.name.value}'>().optional(),`, 2), shape, indent('})'), - ].join('\n') + ].join('\n'), ).string + appendArguments ); } @@ -125,15 +128,16 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { .export() .asKind('const') .withName(`${enumname}Schema`) - .withContent(`yup.string().oneOf([${enums?.join(', ')}]).defined()`).string + .withContent(`yup.string().oneOf([${enums?.join(', ')}]).defined()`).string, ); - } else { + } + else { this.enumDeclarations.push( new DeclarationBlock({}) .export() .asKind('const') .withName(`${enumname}Schema`) - .withContent(`yup.string<${enumname}>().oneOf(Object.values(${enumname})).defined()`).string + .withContent(`yup.string<${enumname}>().oneOf(Object.values(${enumname})).defined()`).string, ); } }, @@ -143,19 +147,20 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { get UnionTypeDefinition() { return { leave: (node: UnionTypeDefinitionNode) => { - if (!node.types || !this.config.withObjectType) return; + if (!node.types || !this.config.withObjectType) + return; const visitor = this.createVisitor('output'); const unionName = visitor.convertName(node.name.value); this.importTypes.push(unionName); const unionElements = node.types - ?.map(t => { + ?.map((t) => { const element = visitor.convertName(t.name.value); const typ = visitor.getType(t.name.value); - if (typ?.astNode?.kind === 'EnumTypeDefinition') { + if (typ?.astNode?.kind === 'EnumTypeDefinition') return `${element}Schema`; - } + switch (this.config.validationSchemaExportType) { case 'const': return `${element}Schema`; @@ -188,7 +193,7 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { protected buildInputFields( fields: readonly (FieldDefinitionNode | InputValueDefinitionNode)[], visitor: Visitor, - name: string + name: string, ) { const shape = shapeFields(fields, this.config, visitor); @@ -211,64 +216,48 @@ export class YupSchemaVisitor extends BaseSchemaVisitor { } } -const shapeFields = ( - fields: readonly (FieldDefinitionNode | InputValueDefinitionNode)[] | undefined, - config: ValidationSchemaPluginConfig, - visitor: Visitor -) => { +function shapeFields(fields: readonly (FieldDefinitionNode | InputValueDefinitionNode)[] | undefined, config: ValidationSchemaPluginConfig, visitor: Visitor) { return fields - ?.map(field => { + ?.map((field) => { let fieldSchema = generateFieldYupSchema(config, visitor, field, 2); if (field.kind === Kind.INPUT_VALUE_DEFINITION) { const { defaultValue } = field; if ( - defaultValue?.kind === Kind.INT || - defaultValue?.kind === Kind.FLOAT || - defaultValue?.kind === Kind.BOOLEAN - ) { + defaultValue?.kind === Kind.INT + || defaultValue?.kind === Kind.FLOAT + || defaultValue?.kind === Kind.BOOLEAN + ) fieldSchema = `${fieldSchema}.default(${defaultValue.value})`; - } - if (defaultValue?.kind === Kind.STRING || defaultValue?.kind === Kind.ENUM) { + + if (defaultValue?.kind === Kind.STRING || defaultValue?.kind === Kind.ENUM) fieldSchema = `${fieldSchema}.default("${defaultValue.value}")`; - } } - if (isNonNullType(field.type)) { + if (isNonNullType(field.type)) return fieldSchema; - } return `${fieldSchema}.optional()`; }) .join(',\n'); -}; - -const generateFieldYupSchema = ( - config: ValidationSchemaPluginConfig, - visitor: Visitor, - field: InputValueDefinitionNode | FieldDefinitionNode, - indentCount: number -): string => { +} + +function generateFieldYupSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, field: InputValueDefinitionNode | FieldDefinitionNode, indentCount: number): string { let gen = generateFieldTypeYupSchema(config, visitor, field.type); if (config.directives && field.directives) { const formatted = formatDirectiveConfig(config.directives); gen += buildApi(formatted, field.directives); } return indent(`${field.name.value}: ${maybeLazy(field.type, gen)}`, indentCount); -}; - -const generateFieldTypeYupSchema = ( - config: ValidationSchemaPluginConfig, - visitor: Visitor, - type: TypeNode, - parentType?: TypeNode -): string => { +} + +function generateFieldTypeYupSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, type: TypeNode, parentType?: TypeNode): string { if (isListType(type)) { const gen = generateFieldTypeYupSchema(config, visitor, type.type, type); - if (!isNonNullType(parentType)) { + if (!isNonNullType(parentType)) return `yup.array(${maybeLazy(type.type, gen)}).defined().nullable()`; - } + return `yup.array(${maybeLazy(type.type, gen)}).defined()`; } if (isNonNullType(type)) { @@ -278,22 +267,22 @@ const generateFieldTypeYupSchema = ( if (isNamedType(type)) { const gen = generateNameNodeYupSchema(config, visitor, type.name); if (isNonNullType(parentType)) { - if (visitor.shouldEmitAsNotAllowEmptyString(type.name.value)) { + if (visitor.shouldEmitAsNotAllowEmptyString(type.name.value)) return `${gen}.required()`; - } + return `${gen}.nonNullable()`; } const typ = visitor.getType(type.name.value); - if (typ?.astNode?.kind === 'InputObjectTypeDefinition') { + if (typ?.astNode?.kind === 'InputObjectTypeDefinition') return `${gen}`; - } + return `${gen}.nullable()`; } console.warn('unhandled type:', type); return ''; -}; +} -const generateNameNodeYupSchema = (config: ValidationSchemaPluginConfig, visitor: Visitor, node: NameNode): string => { +function generateNameNodeYupSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, node: NameNode): string { const converter = visitor.getNameNodeConverter(node); switch (converter?.targetKind) { @@ -313,20 +302,20 @@ const generateNameNodeYupSchema = (config: ValidationSchemaPluginConfig, visitor default: return yup4Scalar(config, visitor, node.value); } -}; +} -const maybeLazy = (type: TypeNode, schema: string): string => { +function maybeLazy(type: TypeNode, schema: string): string { if (isNamedType(type) && isInput(type.name.value)) { // https://github.com/jquense/yup/issues/1283#issuecomment-786559444 return `yup.lazy(() => ${schema})`; } return schema; -}; +} -const yup4Scalar = (config: ValidationSchemaPluginConfig, visitor: Visitor, scalarName: string): string => { - if (config.scalarSchemas?.[scalarName]) { +function yup4Scalar(config: ValidationSchemaPluginConfig, visitor: Visitor, scalarName: string): string { + if (config.scalarSchemas?.[scalarName]) return `${config.scalarSchemas[scalarName]}.defined()`; - } + const tsType = visitor.getScalarType(scalarName); switch (tsType) { case 'string': @@ -338,4 +327,4 @@ const yup4Scalar = (config: ValidationSchemaPluginConfig, visitor: Visitor, scal } console.warn('unhandled name:', scalarName); return `yup.mixed()`; -}; +} diff --git a/src/zod/index.ts b/src/zod/index.ts index 71b69da7..eacbfe77 100644 --- a/src/zod/index.ts +++ b/src/zod/index.ts @@ -1,22 +1,24 @@ import { DeclarationBlock, indent } from '@graphql-codegen/visitor-plugin-common'; -import { +import type { EnumTypeDefinitionNode, FieldDefinitionNode, GraphQLSchema, InputObjectTypeDefinitionNode, InputValueDefinitionNode, - Kind, NameNode, ObjectTypeDefinitionNode, TypeNode, UnionTypeDefinitionNode, } from 'graphql'; +import { + Kind, +} from 'graphql'; -import { ValidationSchemaPluginConfig } from '../config'; +import type { ValidationSchemaPluginConfig } from '../config'; import { buildApi, formatDirectiveConfig } from '../directive'; import { BaseSchemaVisitor } from '../schema_visitor'; -import { Visitor } from '../visitor'; -import { isInput, isListType, isNamedType, isNonNullType, ObjectTypeDefinitionBuilder } from './../graphql'; +import type { Visitor } from '../visitor'; +import { ObjectTypeDefinitionBuilder, isInput, isListType, isNamedType, isNonNullType } from './../graphql'; const anySchema = `definedNonNullAnySchema`; @@ -31,7 +33,7 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { initialEmit(): string { return ( - '\n' + + `\n${ [ new DeclarationBlock({}) .asKind('type') @@ -52,7 +54,7 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { .withName(`${anySchema}`) .withContent(`z.any().refine((v) => isDefinedNonNullAny(v))`).string, ...this.enumDeclarations, - ].join('\n') + ].join('\n')}` ); } @@ -76,7 +78,7 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { // Building schema for field arguments. const argumentBlocks = this.buildObjectTypeDefinitionArguments(node, visitor); - const appendArguments = argumentBlocks ? '\n' + argumentBlocks : ''; + const appendArguments = argumentBlocks ? `\n${argumentBlocks}` : ''; // Building schema for fields. const shape = node.fields?.map(field => generateFieldZodSchema(this.config, visitor, field, 2)).join(',\n'); @@ -94,7 +96,7 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { indent(`__typename: z.literal('${node.name.value}').optional(),`, 2), shape, '})', - ].join('\n') + ].join('\n'), ).string + appendArguments ); @@ -111,7 +113,7 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { indent(`__typename: z.literal('${node.name.value}').optional(),`, 2), shape, indent('})'), - ].join('\n') + ].join('\n'), ).string + appendArguments ); } @@ -130,16 +132,16 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { this.enumDeclarations.push( this.config.enumsAsTypes ? new DeclarationBlock({}) - .export() - .asKind('const') - .withName(`${enumname}Schema`) - .withContent(`z.enum([${node.values?.map(enumOption => `'${enumOption.name.value}'`).join(', ')}])`) - .string + .export() + .asKind('const') + .withName(`${enumname}Schema`) + .withContent(`z.enum([${node.values?.map(enumOption => `'${enumOption.name.value}'`).join(', ')}])`) + .string : new DeclarationBlock({}) - .export() - .asKind('const') - .withName(`${enumname}Schema`) - .withContent(`z.nativeEnum(${enumname})`).string + .export() + .asKind('const') + .withName(`${enumname}Schema`) + .withContent(`z.nativeEnum(${enumname})`).string, ); }, }; @@ -148,16 +150,17 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { get UnionTypeDefinition() { return { leave: (node: UnionTypeDefinitionNode) => { - if (!node.types || !this.config.withObjectType) return; + if (!node.types || !this.config.withObjectType) + return; const visitor = this.createVisitor('output'); const unionName = visitor.convertName(node.name.value); const unionElements = node.types - .map(t => { + .map((t) => { const element = visitor.convertName(t.name.value); const typ = visitor.getType(t.name.value); - if (typ?.astNode?.kind === 'EnumTypeDefinition') { + if (typ?.astNode?.kind === 'EnumTypeDefinition') return `${element}Schema`; - } + switch (this.config.validationSchemaExportType) { case 'const': return `${element}Schema`; @@ -190,7 +193,7 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { protected buildInputFields( fields: readonly (FieldDefinitionNode | InputValueDefinitionNode)[], visitor: Visitor, - name: string + name: string, ) { const shape = fields.map(field => generateFieldZodSchema(this.config, visitor, field, 2)).join(',\n'); @@ -213,23 +216,12 @@ export class ZodSchemaVisitor extends BaseSchemaVisitor { } } -const generateFieldZodSchema = ( - config: ValidationSchemaPluginConfig, - visitor: Visitor, - field: InputValueDefinitionNode | FieldDefinitionNode, - indentCount: number -): string => { +function generateFieldZodSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, field: InputValueDefinitionNode | FieldDefinitionNode, indentCount: number): string { const gen = generateFieldTypeZodSchema(config, visitor, field, field.type); return indent(`${field.name.value}: ${maybeLazy(field.type, gen)}`, indentCount); -}; - -const generateFieldTypeZodSchema = ( - config: ValidationSchemaPluginConfig, - visitor: Visitor, - field: InputValueDefinitionNode | FieldDefinitionNode, - type: TypeNode, - parentType?: TypeNode -): string => { +} + +function generateFieldTypeZodSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, field: InputValueDefinitionNode | FieldDefinitionNode, type: TypeNode, parentType?: TypeNode): string { if (isListType(type)) { const gen = generateFieldTypeZodSchema(config, visitor, field, type.type, type); if (!isNonNullType(parentType)) { @@ -245,50 +237,45 @@ const generateFieldTypeZodSchema = ( } if (isNamedType(type)) { const gen = generateNameNodeZodSchema(config, visitor, type.name); - if (isListType(parentType)) { + if (isListType(parentType)) return `${gen}.nullable()`; - } + let appliedDirectivesGen = applyDirectives(config, field, gen); if (field.kind === Kind.INPUT_VALUE_DEFINITION) { const { defaultValue } = field; - if (defaultValue?.kind === Kind.INT || defaultValue?.kind === Kind.FLOAT || defaultValue?.kind === Kind.BOOLEAN) { + if (defaultValue?.kind === Kind.INT || defaultValue?.kind === Kind.FLOAT || defaultValue?.kind === Kind.BOOLEAN) appliedDirectivesGen = `${appliedDirectivesGen}.default(${defaultValue.value})`; - } - if (defaultValue?.kind === Kind.STRING || defaultValue?.kind === Kind.ENUM) { + + if (defaultValue?.kind === Kind.STRING || defaultValue?.kind === Kind.ENUM) appliedDirectivesGen = `${appliedDirectivesGen}.default("${defaultValue.value}")`; - } } if (isNonNullType(parentType)) { - if (visitor.shouldEmitAsNotAllowEmptyString(type.name.value)) { + if (visitor.shouldEmitAsNotAllowEmptyString(type.name.value)) return `${appliedDirectivesGen}.min(1)`; - } + return appliedDirectivesGen; } - if (isListType(parentType)) { + if (isListType(parentType)) return `${appliedDirectivesGen}.nullable()`; - } + return `${appliedDirectivesGen}.nullish()`; } console.warn('unhandled type:', type); return ''; -}; +} -const applyDirectives = ( - config: ValidationSchemaPluginConfig, - field: InputValueDefinitionNode | FieldDefinitionNode, - gen: string -): string => { +function applyDirectives(config: ValidationSchemaPluginConfig, field: InputValueDefinitionNode | FieldDefinitionNode, gen: string): string { if (config.directives && field.directives) { const formatted = formatDirectiveConfig(config.directives); return gen + buildApi(formatted, field.directives); } return gen; -}; +} -const generateNameNodeZodSchema = (config: ValidationSchemaPluginConfig, visitor: Visitor, node: NameNode): string => { +function generateNameNodeZodSchema(config: ValidationSchemaPluginConfig, visitor: Visitor, node: NameNode): string { const converter = visitor.getNameNodeConverter(node); switch (converter?.targetKind) { @@ -308,19 +295,19 @@ const generateNameNodeZodSchema = (config: ValidationSchemaPluginConfig, visitor default: return zod4Scalar(config, visitor, node.value); } -}; +} -const maybeLazy = (type: TypeNode, schema: string): string => { - if (isNamedType(type) && isInput(type.name.value)) { +function maybeLazy(type: TypeNode, schema: string): string { + if (isNamedType(type) && isInput(type.name.value)) return `z.lazy(() => ${schema})`; - } + return schema; -}; +} -const zod4Scalar = (config: ValidationSchemaPluginConfig, visitor: Visitor, scalarName: string): string => { - if (config.scalarSchemas?.[scalarName]) { +function zod4Scalar(config: ValidationSchemaPluginConfig, visitor: Visitor, scalarName: string): string { + if (config.scalarSchemas?.[scalarName]) return config.scalarSchemas[scalarName]; - } + const tsType = visitor.getScalarType(scalarName); switch (tsType) { case 'string': @@ -332,4 +319,4 @@ const zod4Scalar = (config: ValidationSchemaPluginConfig, visitor: Visitor, scal } console.warn('unhandled scalar name:', scalarName); return anySchema; -}; +} diff --git a/tests/directive.spec.ts b/tests/directive.spec.ts index 7ccea4fa..dfd76345 100644 --- a/tests/directive.spec.ts +++ b/tests/directive.spec.ts @@ -1,45 +1,53 @@ -import { ConstArgumentNode, ConstDirectiveNode, ConstValueNode, Kind, NameNode, parseConstValue } from 'graphql'; +import type { ConstArgumentNode, ConstDirectiveNode, ConstValueNode, NameNode } from 'graphql'; +import { Kind, parseConstValue } from 'graphql'; -import { DirectiveConfig, DirectiveObjectArguments } from '../src/config'; +import type { DirectiveConfig, DirectiveObjectArguments } from '../src/config'; +import type { + FormattedDirectiveArguments, + FormattedDirectiveConfig, + FormattedDirectiveObjectArguments, +} from '../src/directive'; import { buildApi, exportedForTesting, formatDirectiveConfig, formatDirectiveObjectArguments, - FormattedDirectiveArguments, - FormattedDirectiveConfig, - FormattedDirectiveObjectArguments, } from '../src/directive'; -const { applyArgToApiSchemaTemplate, buildApiFromDirectiveObjectArguments, buildApiFromDirectiveArguments } = - exportedForTesting; +const { applyArgToApiSchemaTemplate, buildApiFromDirectiveObjectArguments, buildApiFromDirectiveArguments } + = exportedForTesting; -const buildNameNode = (name: string): NameNode => ({ - kind: Kind.NAME, - value: name, -}); +function buildNameNode(name: string): NameNode { + return { + kind: Kind.NAME, + value: name, + } +} -const buildConstArgumentNodes = (args: Record): ConstArgumentNode[] => - Object.entries(args).map( +function buildConstArgumentNodes(args: Record): ConstArgumentNode[] { + return Object.entries(args).map( ([argName, argValue]): ConstArgumentNode => ({ kind: Kind.ARGUMENT, name: buildNameNode(argName), value: parseConstValue(argValue), - }) - ); + }), + ) +} -const buildConstDirectiveNodes = (name: string, args: Record): ConstDirectiveNode => ({ - kind: Kind.DIRECTIVE, - name: buildNameNode(name), - arguments: buildConstArgumentNodes(args), -}); +function buildConstDirectiveNodes(name: string, args: Record): ConstDirectiveNode { + return { + kind: Kind.DIRECTIVE, + name: buildNameNode(name), + arguments: buildConstArgumentNodes(args), + } +} describe('format directive config', () => { describe('formatDirectiveObjectArguments', () => { const cases: { - name: string; - arg: DirectiveObjectArguments; - want: FormattedDirectiveObjectArguments; + name: string + arg: DirectiveObjectArguments + want: FormattedDirectiveObjectArguments }[] = [ { name: 'normal', @@ -65,7 +73,7 @@ describe('format directive config', () => { }, ]; for (const tc of cases) { - test(tc.name, () => { + it(tc.name, () => { const got = formatDirectiveObjectArguments(tc.arg); expect(got).toStrictEqual(tc.want); }); @@ -74,9 +82,9 @@ describe('format directive config', () => { describe('formatDirectiveConfig', () => { const cases: { - name: string; - arg: DirectiveConfig; - want: FormattedDirectiveConfig; + name: string + arg: DirectiveConfig + want: FormattedDirectiveConfig }[] = [ { name: 'normal', @@ -134,7 +142,7 @@ describe('format directive config', () => { }, ]; for (const tc of cases) { - test(tc.name, () => { + it(tc.name, () => { const got = formatDirectiveConfig(tc.arg); expect(got).toStrictEqual(tc.want); }); @@ -143,12 +151,12 @@ describe('format directive config', () => { describe('applyArgToApiSchemaTemplate', () => { const cases: { - name: string; + name: string args: { - template: string; - apiArgs: any[]; - }; - want: string; + template: string + apiArgs: any[] + } + want: string }[] = [ { name: 'string', @@ -232,7 +240,7 @@ describe('format directive config', () => { }, ]; for (const tc of cases) { - test(tc.name, () => { + it(tc.name, () => { const { template, apiArgs } = tc.args; const got = applyArgToApiSchemaTemplate(template, apiArgs); expect(got).toBe(tc.want); @@ -242,12 +250,12 @@ describe('format directive config', () => { describe('buildApiFromDirectiveObjectArguments', () => { const cases: { - name: string; + name: string args: { - config: FormattedDirectiveObjectArguments; - argValue: ConstValueNode; - }; - want: string; + config: FormattedDirectiveObjectArguments + argValue: ConstValueNode + } + want: string }[] = [ { name: 'contains in config', @@ -281,7 +289,7 @@ describe('format directive config', () => { }, ]; for (const tc of cases) { - test(tc.name, () => { + it(tc.name, () => { const { config, argValue } = tc.args; const got = buildApiFromDirectiveObjectArguments(config, argValue); expect(got).toBe(tc.want); @@ -291,12 +299,12 @@ describe('format directive config', () => { describe('buildApiFromDirectiveArguments', () => { const cases: { - name: string; + name: string args: { - config: FormattedDirectiveArguments; - args: ReadonlyArray; - }; - want: string; + config: FormattedDirectiveArguments + args: ReadonlyArray + } + want: string }[] = [ { name: 'string', @@ -426,7 +434,7 @@ describe('format directive config', () => { want: `.url()`, }, { - name: "argument matched argument but doesn't match api", + name: 'argument matched argument but doesn\'t match api', args: { config: { format: { @@ -473,7 +481,7 @@ describe('format directive config', () => { }, ]; for (const tc of cases) { - test(tc.name, () => { + it(tc.name, () => { const { config, args } = tc.args; const got = buildApiFromDirectiveArguments(config, args); expect(got).toStrictEqual(tc.want); @@ -483,12 +491,12 @@ describe('format directive config', () => { describe('buildApi', () => { const cases: { - name: string; + name: string args: { - config: FormattedDirectiveConfig; - args: ReadonlyArray; - }; - want: string; + config: FormattedDirectiveConfig + args: ReadonlyArray + } + want: string }[] = [ { name: 'valid', @@ -521,7 +529,7 @@ describe('format directive config', () => { }, ]; for (const tc of cases) { - test(tc.name, () => { + it(tc.name, () => { const { config, args } = tc.args; const got = buildApi(config, args); expect(got).toStrictEqual(tc.want); diff --git a/tests/graphql.spec.ts b/tests/graphql.spec.ts index 4e34ebcb..5f65ff39 100644 --- a/tests/graphql.spec.ts +++ b/tests/graphql.spec.ts @@ -1,21 +1,23 @@ import { Graph } from 'graphlib'; +import type { + ObjectTypeDefinitionNode, +} from 'graphql'; import { + Kind, buildClientSchema, buildSchema, introspectionFromSchema, - Kind, - ObjectTypeDefinitionNode, parse, print, } from 'graphql'; import dedent from 'ts-dedent'; -import { isGeneratedByIntrospection, ObjectTypeDefinitionBuilder, topologicalSortAST, topsort } from '../src/graphql'; +import { ObjectTypeDefinitionBuilder, isGeneratedByIntrospection, topologicalSortAST, topsort } from '../src/graphql'; describe('graphql', () => { - describe('ObjectTypeDefinitionBuilder', () => { + describe('objectTypeDefinitionBuilder', () => { describe('useObjectTypes === true', () => { - test.each([ + it.each([ ['Query', false], ['Mutation', false], ['Subscription', false], @@ -26,7 +28,7 @@ describe('graphql', () => { ['FooMutation', true], ['FooSubscription', true], ['Foo', true], - ])(`A node with a name of "%s" should be matched? %s`, (nodeName, nodeIsMatched) => { + ])(`a node with a name of "%s" should be matched? %s`, (nodeName, nodeIsMatched) => { const node: ObjectTypeDefinitionNode = { name: { kind: Kind.NAME, @@ -39,16 +41,15 @@ describe('graphql', () => { expect(objectTypeDefFn).toBeDefined(); - if (nodeIsMatched) { + if (nodeIsMatched) expect(objectTypeDefFn?.(node)).toBe(node); - } else { + else expect(objectTypeDefFn?.(node)).toBeUndefined(); - } }); }); describe('useObjectTypes === false', () => { - test('should not return an ObjectTypeDefinitionFn', () => { + it('should not return an ObjectTypeDefinitionFn', () => { const objectTypeDefFn = ObjectTypeDefinitionBuilder(false, (n: ObjectTypeDefinitionNode) => n); expect(objectTypeDefFn).toBeUndefined(); }); @@ -133,7 +134,7 @@ describe('topologicalSortAST', () => { const sortedSchema = getSortedSchema(schema); - const expectedSortedSchema = dedent/* GraphQL */ ` + const expectedSortedSchema = dedent/* GraphQL */` input C { d: String } @@ -173,7 +174,7 @@ describe('topologicalSortAST', () => { const sortedSchema = getSortedSchema(schema); - const expectedSortedSchema = dedent/* GraphQL */ ` + const expectedSortedSchema = dedent/* GraphQL */` type C { d: String } @@ -208,7 +209,7 @@ describe('topologicalSortAST', () => { `; const sortedSchema = getSortedSchema(schema); - const expectedSortedSchema = dedent/* GraphQL */ ` + const expectedSortedSchema = dedent/* GraphQL */` input A { b: B } @@ -233,7 +234,7 @@ describe('topologicalSortAST', () => { `; const sortedSchema = getSortedSchema(schema); - const expectedSortedSchema = dedent/* GraphQL */ ` + const expectedSortedSchema = dedent/* GraphQL */` input A { a: A } @@ -284,12 +285,12 @@ describe('isGeneratedByIntrospection function', () => { } `; - test('returns false for a schema not generated by introspection', () => { + it('returns false for a schema not generated by introspection', () => { const schema = buildSchema(schemaDefinition); expect(isGeneratedByIntrospection(schema)).toBe(false); }); - test('returns true for a schema generated by introspection', () => { + it('returns true for a schema generated by introspection', () => { const schema = buildSchema(schemaDefinition); const query = introspectionFromSchema(schema); const clientSchema = buildClientSchema(query); diff --git a/tests/myzod.spec.ts b/tests/myzod.spec.ts index 5242a383..ed631755 100644 --- a/tests/myzod.spec.ts +++ b/tests/myzod.spec.ts @@ -4,7 +4,7 @@ import dedent from 'ts-dedent'; import { plugin } from '../src/index'; describe('myzod', () => { - test.each([ + it.each([ [ 'non-null and defined', { @@ -172,11 +172,10 @@ describe('myzod', () => { ])('%s', async (_, { textSchema, wantContains, scalars }) => { const schema = buildSchema(textSchema); const result = await plugin(schema, [], { schema: 'myzod', scalars }, {}); - expect(result.prepend).toContain("import * as myzod from 'myzod'"); + expect(result.prepend).toContain('import * as myzod from \'myzod\''); - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with scalars', async () => { @@ -199,7 +198,7 @@ describe('myzod', () => { Count: 'number', }, }, - {} + {}, ); expect(result.content).toContain('phrase: myzod.string()'); expect(result.content).toContain('times: myzod.number()'); @@ -218,9 +217,9 @@ describe('myzod', () => { schema: 'myzod', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { Say } from './types'"); + expect(result.prepend).toContain('import { Say } from \'./types\''); expect(result.content).toContain('phrase: myzod.string()'); }); @@ -238,9 +237,9 @@ describe('myzod', () => { importFrom: './types', useTypeImports: true, }, - {} + {}, ); - expect(result.prepend).toContain("import type { Say } from './types'"); + expect(result.prepend).toContain('import type { Say } from \'./types\''); expect(result.content).toContain('phrase: myzod.string()'); }); @@ -258,9 +257,9 @@ describe('myzod', () => { schema: 'myzod', enumsAsTypes: true, }, - {} + {}, ); - expect(result.content).toContain("export type PageTypeSchema = myzod.literals('PUBLIC', 'BASIC_AUTH')"); + expect(result.content).toContain('export type PageTypeSchema = myzod.literals(\'PUBLIC\', \'BASIC_AUTH\')'); }); it('with notAllowEmptyString', async () => { @@ -283,7 +282,7 @@ describe('myzod', () => { ID: 'string', }, }, - {} + {}, ); const wantContains = [ 'export function PrimitiveInputSchema(): myzod.Type {', @@ -293,9 +292,8 @@ describe('myzod', () => { 'd: myzod.number(),', 'e: myzod.number()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with notAllowEmptyString issue #386', async () => { @@ -318,7 +316,7 @@ describe('myzod', () => { ID: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function InputNestedSchema(): myzod.Type { @@ -349,7 +347,7 @@ describe('myzod', () => { Email: 'myzod.string()', // generate the basic type. User can later extend it using `withPredicate(fn: (val: string) => boolean), errMsg?: string }` }, }, - {} + {}, ); const wantContains = [ 'export function ScalarsInputSchema(): myzod.Type {', @@ -357,9 +355,8 @@ describe('myzod', () => { 'email: myzod.string()', // TODO: Test implementation 'str: myzod.string()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with typesPrefix', async () => { const schema = buildSchema(/* GraphQL */ ` @@ -375,9 +372,9 @@ describe('myzod', () => { typesPrefix: 'I', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { ISay } from './types'"); + expect(result.prepend).toContain('import { ISay } from \'./types\''); expect(result.content).toContain('export function ISaySchema(): myzod.Type {'); }); it('with typesSuffix', async () => { @@ -394,9 +391,9 @@ describe('myzod', () => { typesSuffix: 'I', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { SayI } from './types'"); + expect(result.prepend).toContain('import { SayI } from \'./types\''); expect(result.content).toContain('export function SayISchema(): myzod.Type {'); }); describe('issues #19', () => { @@ -420,15 +417,14 @@ describe('myzod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): myzod.Type {', 'profile: myzod.string().min(1, "Please input more than 1").max(5000, "Please input less than 5000").optional().nullable()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('not null field', async () => { const schema = buildSchema(/* GraphQL */ ` @@ -450,15 +446,14 @@ describe('myzod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): myzod.Type {', 'profile: myzod.string().min(1, "Please input more than 1").max(5000, "Please input less than 5000")', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('list field', async () => { const schema = buildSchema(/* GraphQL */ ` @@ -480,15 +475,14 @@ describe('myzod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): myzod.Type {', 'profile: myzod.array(myzod.string().nullable()).min(1, "Please input more than 1").max(5000, "Please input less than 5000").optional().nullable()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); }); @@ -506,7 +500,7 @@ describe('myzod', () => { { schema: 'myzod', }, - {} + {}, ); expect(result.content).not.toContain('export function UserSchema(): myzod.Type {'); }); @@ -530,26 +524,24 @@ describe('myzod', () => { schema: 'myzod', withObjectType: true, }, - {} + {}, ); const wantContains = [ 'export function AuthorSchema(): myzod.Type {', - "__typename: myzod.literal('Author').optional(),", + '__typename: myzod.literal(\'Author\').optional(),', 'books: myzod.array(BookSchema().nullable()).optional().nullable(),', 'name: myzod.string().optional().nullable()', 'export function BookSchema(): myzod.Type {', - "__typename: myzod.literal('Book').optional(),", + '__typename: myzod.literal(\'Book\').optional(),', 'author: AuthorSchema().optional().nullable(),', 'title: myzod.string().optional().nullable()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('generate both input & type', async () => { @@ -603,7 +595,7 @@ describe('myzod', () => { }, }, }, - {} + {}, ); const wantContains = [ // User Create Input @@ -617,7 +609,7 @@ describe('myzod', () => { 'updateName: myzod.string()', // User 'export function UserSchema(): myzod.Type {', - "__typename: myzod.literal('User').optional(),", + '__typename: myzod.literal(\'User\').optional(),', 'id: myzod.string(),', 'name: myzod.string().optional().nullable(),', 'age: myzod.number().optional().nullable(),', @@ -625,13 +617,11 @@ describe('myzod', () => { 'isMember: myzod.boolean().optional().nullable(),', 'createdAt: myzod.date()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('generate union types', async () => { @@ -652,7 +642,7 @@ describe('myzod', () => { schema: 'myzod', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -661,9 +651,8 @@ describe('myzod', () => { 'return myzod.union([CircleSchema(), SquareSchema()])', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate union types with single element', async () => { @@ -688,19 +677,18 @@ describe('myzod', () => { schema: 'myzod', withObjectType: true, }, - {} + {}, ); const wantContains = [ 'export function GeometrySchema(): myzod.Type {', 'return myzod.object({', - "__typename: myzod.literal('Geometry').optional(),", + '__typename: myzod.literal(\'Geometry\').optional(),', 'shape: ShapeSchema().optional().nullable()', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('correctly reference generated union types', async () => { @@ -718,7 +706,7 @@ describe('myzod', () => { schema: 'myzod', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -727,9 +715,8 @@ describe('myzod', () => { 'return CircleSchema()', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate enum union types', async () => { @@ -754,7 +741,7 @@ describe('myzod', () => { schema: 'myzod', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -762,9 +749,8 @@ describe('myzod', () => { 'return myzod.union([PageTypeSchema, MethodTypeSchema])', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate union types with single element, export as const', async () => { @@ -790,18 +776,17 @@ describe('myzod', () => { withObjectType: true, validationSchemaExportType: 'const', }, - {} + {}, ); const wantContains = [ 'export const GeometrySchema: myzod.Type = myzod.object({', - "__typename: myzod.literal('Geometry').optional(),", + '__typename: myzod.literal(\'Geometry\').optional(),', 'shape: ShapeSchema.optional().nullable()', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with object arguments', async () => { @@ -821,7 +806,7 @@ describe('myzod', () => { Text: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function MyTypeFooArgsSchema(): myzod.Type { @@ -858,7 +843,7 @@ describe('myzod', () => { }, }, }, - {} + {}, ); const wantContains = [ // User Create Input @@ -866,9 +851,8 @@ describe('myzod', () => { 'name: myzod.string().pattern(/^Sir/),', 'age: myzod.number().min(0).max(100)', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('exports as const instead of func', async () => { @@ -884,7 +868,7 @@ describe('myzod', () => { schema: 'myzod', validationSchemaExportType: 'const', }, - {} + {}, ); expect(result.content).toContain('export const SaySchema: myzod.Type = myzod.object({'); }); @@ -928,7 +912,7 @@ describe('myzod', () => { }, validationSchemaExportType: 'const', }, - {} + {}, ); const wantContains = [ // User Create Input @@ -938,7 +922,7 @@ describe('myzod', () => { 'email: myzod.string().email()', // User 'export const UserSchema: myzod.Type = myzod.object({', - "__typename: myzod.literal('User').optional(),", + '__typename: myzod.literal(\'User\').optional(),', 'id: myzod.string(),', 'name: myzod.string().optional().nullable(),', 'age: myzod.number().optional().nullable(),', @@ -946,13 +930,11 @@ describe('myzod', () => { 'isMember: myzod.boolean().optional().nullable(),', 'createdAt: myzod.date()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('issue #394', async () => { @@ -981,7 +963,7 @@ describe('myzod', () => { ID: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function QueryInputSchema(): myzod.Type { @@ -1013,7 +995,7 @@ describe('myzod', () => { schema: 'myzod', importFrom: './types', }, - {} + {}, ); expect(result.content).toContain('export const PageTypeSchema = myzod.enum(PageType)'); diff --git a/tests/regexp.spec.ts b/tests/regexp.spec.ts index e3ed075d..e9998d50 100644 --- a/tests/regexp.spec.ts +++ b/tests/regexp.spec.ts @@ -2,7 +2,7 @@ import { isConvertableRegexp } from '../src/regexp'; describe('isConvertableRegexp', () => { describe('match', () => { - test.each([ + it.each([ '//', '/hello/', '/hello/d', @@ -14,20 +14,20 @@ describe('isConvertableRegexp', () => { '/hello/y', '/hello/dgimsuy', `/\\w+\\s/g`, - // eslint-disable-next-line no-useless-escape + `/^[a-z]+:[\\\/]$/i`, - // eslint-disable-next-line no-useless-escape + `/^(?:\d{3}|\(\d{3}\))([-\/\.])\d{3}\\1\d{4}$/`, - ])('%s', maybeRegexp => { + ])('%s', (maybeRegexp) => { expect(isConvertableRegexp(maybeRegexp)).toBeTruthy(); }); }); describe('does not match', () => { - test.each(['hello', '/world', 'world/', 'https://example.com/', ' /hello/', '/hello/d ', '/hello/dgimsuy '])( + it.each(['hello', '/world', 'world/', 'https://example.com/', ' /hello/', '/hello/d ', '/hello/dgimsuy '])( '%s', - maybeRegexp => { + (maybeRegexp) => { expect(isConvertableRegexp(maybeRegexp)).toBeFalsy(); - } + }, ); }); }); diff --git a/tests/yup.spec.ts b/tests/yup.spec.ts index 7e1f93a2..5f2caf04 100644 --- a/tests/yup.spec.ts +++ b/tests/yup.spec.ts @@ -4,7 +4,7 @@ import dedent from 'ts-dedent'; import { plugin } from '../src/index'; describe('yup', () => { - test.each([ + it.each([ [ 'defined', { @@ -172,11 +172,10 @@ describe('yup', () => { ])('%s', async (_, { textSchema, wantContains, scalars }) => { const schema = buildSchema(textSchema); const result = await plugin(schema, [], { scalars }, {}); - expect(result.prepend).toContain("import * as yup from 'yup'"); + expect(result.prepend).toContain('import * as yup from \'yup\''); - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with scalars', async () => { @@ -198,7 +197,7 @@ describe('yup', () => { Count: 'number', }, }, - {} + {}, ); expect(result.content).toContain('phrase: yup.string().defined()'); expect(result.content).toContain('times: yup.number().defined()'); @@ -216,9 +215,9 @@ describe('yup', () => { { importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { Say } from './types'"); + expect(result.prepend).toContain('import { Say } from \'./types\''); expect(result.content).toContain('phrase: yup.string().defined()'); }); @@ -235,9 +234,9 @@ describe('yup', () => { importFrom: './types', useTypeImports: true, }, - {} + {}, ); - expect(result.prepend).toContain("import type { Say } from './types'"); + expect(result.prepend).toContain('import type { Say } from \'./types\''); expect(result.content).toContain('phrase: yup.string().defined()'); }); @@ -254,10 +253,10 @@ describe('yup', () => { { enumsAsTypes: true, }, - {} + {}, ); expect(result.content).toContain( - "export const PageTypeSchema = yup.string().oneOf(['PUBLIC', 'BASIC_AUTH']).defined();" + 'export const PageTypeSchema = yup.string().oneOf([\'PUBLIC\', \'BASIC_AUTH\']).defined();', ); }); @@ -280,7 +279,7 @@ describe('yup', () => { ID: 'string', }, }, - {} + {}, ); const wantContains = [ 'export function PrimitiveInputSchema(): yup.ObjectSchema', @@ -290,9 +289,8 @@ describe('yup', () => { 'd: yup.number().defined().nonNullable(),', 'e: yup.number().defined().nonNullable()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with notAllowEmptyString issue #386', async () => { @@ -315,7 +313,7 @@ describe('yup', () => { ID: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function InputNestedSchema(): yup.ObjectSchema { @@ -345,7 +343,7 @@ describe('yup', () => { Email: 'yup.string().email()', }, }, - {} + {}, ); const wantContains = [ 'export function ScalarsInputSchema(): yup.ObjectSchema', @@ -353,9 +351,8 @@ describe('yup', () => { 'email: yup.string().email().defined().nullable().optional(),', 'str: yup.string().defined().nonNullable()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with typesPrefix', async () => { @@ -371,9 +368,9 @@ describe('yup', () => { typesPrefix: 'I', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { ISay } from './types'"); + expect(result.prepend).toContain('import { ISay } from \'./types\''); expect(result.content).toContain('export function ISaySchema(): yup.ObjectSchema {'); }); @@ -390,9 +387,9 @@ describe('yup', () => { typesSuffix: 'I', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { SayI } from './types'"); + expect(result.prepend).toContain('import { SayI } from \'./types\''); expect(result.content).toContain('export function SayISchema(): yup.ObjectSchema {'); }); describe('with withObjectType', () => { @@ -409,7 +406,7 @@ describe('yup', () => { { schema: 'yup', }, - {} + {}, ); expect(result.content).not.toContain('export function UserSchema(): yup.ObjectSchema {'); }); @@ -438,31 +435,29 @@ describe('yup', () => { schema: 'yup', withObjectType: true, }, - {} + {}, ); const wantContains = [ 'export function AuthorSchema(): yup.ObjectSchema {', - "__typename: yup.string<'Author'>().optional(),", + '__typename: yup.string<\'Author\'>().optional(),', 'books: yup.array(BookSchema().nullable()).defined().nullable().optional(),', 'name: yup.string().defined().nullable().optional()', 'export function BookSchema(): yup.ObjectSchema {', - "__typename: yup.string<'Book'>().optional(),", + '__typename: yup.string<\'Book\'>().optional(),', 'author: AuthorSchema().nullable().optional(),', 'title: yup.string().defined().nonNullable()', 'export function Book2Schema(): yup.ObjectSchema {', - "__typename: yup.string<'Book2'>().optional(),", + '__typename: yup.string<\'Book2\'>().optional(),', 'author: AuthorSchema().nonNullable(),', 'title: yup.string().defined().nullable().optional()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('generate both input & type if withObjectType true', async () => { @@ -517,7 +512,7 @@ describe('yup', () => { }, }, }, - {} + {}, ); const wantContains = [ // User Create Input @@ -531,7 +526,7 @@ describe('yup', () => { 'updateName: yup.string().defined().nonNullable()', // User 'export function UserSchema(): yup.ObjectSchema {', - "__typename: yup.string<'User'>().optional(),", + '__typename: yup.string<\'User\'>().optional(),', 'id: yup.string().defined().nonNullable(),', 'name: yup.string().defined().nullable().optional(),', 'age: yup.number().defined().nullable().optional(),', @@ -539,13 +534,11 @@ describe('yup', () => { 'email: yup.string().email().defined().nullable().optional(),', 'createdAt: yup.date().defined().nonNullable()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('generate union types', async () => { @@ -566,7 +559,7 @@ describe('yup', () => { schema: 'yup', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -575,9 +568,8 @@ describe('yup', () => { 'union(CircleSchema(), SquareSchema())', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate union types with single element', async () => { @@ -602,19 +594,18 @@ describe('yup', () => { schema: 'yup', withObjectType: true, }, - {} + {}, ); const wantContains = [ 'export function GeometrySchema(): yup.ObjectSchema {', 'return yup.object({', - "__typename: yup.string<'Geometry'>().optional(),", + '__typename: yup.string<\'Geometry\'>().optional(),', 'shape: ShapeSchema().nullable().optional()', '})', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('correctly reference generated union types', async () => { @@ -632,7 +623,7 @@ describe('yup', () => { schema: 'yup', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -641,9 +632,8 @@ describe('yup', () => { 'return union(CircleSchema())', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate enum union types', async () => { @@ -668,7 +658,7 @@ describe('yup', () => { schema: 'yup', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -676,9 +666,8 @@ describe('yup', () => { 'union(PageTypeSchema, MethodTypeSchema)', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate union types with single element, export as const', async () => { @@ -704,18 +693,17 @@ describe('yup', () => { withObjectType: true, validationSchemaExportType: 'const', }, - {} + {}, ); const wantContains = [ 'export const GeometrySchema: yup.ObjectSchema = yup.object({', - "__typename: yup.string<'Geometry'>().optional(),", + '__typename: yup.string<\'Geometry\'>().optional(),', 'shape: ShapeSchema.nullable().optional()', '})', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with object arguments', async () => { @@ -735,7 +723,7 @@ describe('yup', () => { Text: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function MyTypeFooArgsSchema(): yup.ObjectSchema { @@ -772,7 +760,7 @@ describe('yup', () => { }, }, }, - {} + {}, ); const wantContains = [ // User Create Input @@ -780,9 +768,8 @@ describe('yup', () => { 'name: yup.string().defined().nonNullable().matches(/^Sir/),', 'age: yup.number().defined().nonNullable().min(0).max(100)', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('exports as const instead of func', async () => { @@ -798,7 +785,7 @@ describe('yup', () => { schema: 'yup', validationSchemaExportType: 'const', }, - {} + {}, ); expect(result.content).toContain('export const SaySchema: yup.ObjectSchema = yup.object({'); }); @@ -842,7 +829,7 @@ describe('yup', () => { }, validationSchemaExportType: 'const', }, - {} + {}, ); const wantContains = [ // User Create Input @@ -852,7 +839,7 @@ describe('yup', () => { 'email: yup.string().email().defined().nonNullable()', // User 'export const UserSchema: yup.ObjectSchema = yup.object({', - "__typename: yup.string<'User'>().optional(),", + '__typename: yup.string<\'User\'>().optional(),', 'id: yup.string().defined().nonNullable(),', 'name: yup.string().defined().nullable().optional(),', 'age: yup.number().defined().nullable().optional(),', @@ -860,13 +847,11 @@ describe('yup', () => { 'isMember: yup.boolean().defined().nullable().optional(),', 'createdAt: yup.date().defined().nonNullable()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('issue #394', async () => { @@ -895,7 +880,7 @@ describe('yup', () => { ID: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function QueryInputSchema(): yup.ObjectSchema { @@ -927,11 +912,11 @@ describe('yup', () => { schema: 'yup', importFrom: './types', }, - {} + {}, ); expect(result.content).toContain( - 'export const PageTypeSchema = yup.string().oneOf(Object.values(PageType)).defined()' + 'export const PageTypeSchema = yup.string().oneOf(Object.values(PageType)).defined()', ); expect(result.content).toContain('export function PageInputSchema(): yup.ObjectSchema'); diff --git a/tests/zod.spec.ts b/tests/zod.spec.ts index 16d7324b..2dfe6473 100644 --- a/tests/zod.spec.ts +++ b/tests/zod.spec.ts @@ -1,11 +1,10 @@ -import { getCachedDocumentNodeFromSchema } from '@graphql-codegen/plugin-helpers'; -import { buildClientSchema, buildSchema, introspectionFromSchema, isSpecifiedScalarType } from 'graphql'; +import { buildClientSchema, buildSchema, introspectionFromSchema } from 'graphql'; import { dedent } from 'ts-dedent'; import { plugin } from '../src/index'; describe('zod', () => { - test.each([ + it.each([ [ 'non-null and defined', { @@ -173,11 +172,10 @@ describe('zod', () => { ])('%s', async (_, { textSchema, wantContains, scalars }) => { const schema = buildSchema(textSchema); const result = await plugin(schema, [], { schema: 'zod', scalars }, {}); - expect(result.prepend).toContain("import { z } from 'zod'"); + expect(result.prepend).toContain('import { z } from \'zod\''); - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with scalars', async () => { @@ -200,7 +198,7 @@ describe('zod', () => { Count: 'number', }, }, - {} + {}, ); expect(result.content).toContain('phrase: z.string()'); expect(result.content).toContain('times: z.number()'); @@ -219,9 +217,9 @@ describe('zod', () => { schema: 'zod', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { Say } from './types'"); + expect(result.prepend).toContain('import { Say } from \'./types\''); expect(result.content).toContain('phrase: z.string()'); }); @@ -239,9 +237,9 @@ describe('zod', () => { importFrom: './types', useTypeImports: true, }, - {} + {}, ); - expect(result.prepend).toContain("import type { Say } from './types'"); + expect(result.prepend).toContain('import type { Say } from \'./types\''); expect(result.content).toContain('phrase: z.string()'); }); @@ -259,9 +257,9 @@ describe('zod', () => { schema: 'zod', enumsAsTypes: true, }, - {} + {}, ); - expect(result.content).toContain("export const PageTypeSchema = z.enum(['PUBLIC', 'BASIC_AUTH'])"); + expect(result.content).toContain('export const PageTypeSchema = z.enum([\'PUBLIC\', \'BASIC_AUTH\'])'); }); it('with notAllowEmptyString', async () => { @@ -284,7 +282,7 @@ describe('zod', () => { ID: 'string', }, }, - {} + {}, ); const wantContains = [ 'export function PrimitiveInputSchema(): z.ZodObject>', @@ -294,9 +292,8 @@ describe('zod', () => { 'd: z.number(),', 'e: z.number()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with notAllowEmptyString issue #386', async () => { @@ -319,7 +316,7 @@ describe('zod', () => { ID: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function InputNestedSchema(): z.ZodObject> { @@ -350,7 +347,7 @@ describe('zod', () => { Email: 'z.string().email()', }, }, - {} + {}, ); const wantContains = [ 'export function ScalarsInputSchema(): z.ZodObject>', @@ -358,9 +355,8 @@ describe('zod', () => { 'email: z.string().email().nullish(),', 'str: z.string()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with typesPrefix', async () => { @@ -377,9 +373,9 @@ describe('zod', () => { typesPrefix: 'I', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { ISay } from './types'"); + expect(result.prepend).toContain('import { ISay } from \'./types\''); expect(result.content).toContain('export function ISaySchema(): z.ZodObject> {'); }); @@ -397,9 +393,9 @@ describe('zod', () => { typesSuffix: 'I', importFrom: './types', }, - {} + {}, ); - expect(result.prepend).toContain("import { SayI } from './types'"); + expect(result.prepend).toContain('import { SayI } from \'./types\''); expect(result.content).toContain('export function SayISchema(): z.ZodObject> {'); }); @@ -424,7 +420,7 @@ describe('zod', () => { schema: 'zod', importFrom: './types', }, - {} + {}, ); expect(result.content).toContain('export const PageTypeSchema = z.nativeEnum(PageType)'); @@ -458,15 +454,14 @@ describe('zod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): z.ZodObject>', 'profile: z.string().min(1, "Please input more than 1").max(5000, "Please input less than 5000").nullish()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('not null field', async () => { @@ -489,15 +484,14 @@ describe('zod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): z.ZodObject>', 'profile: z.string().min(1, "Please input more than 1").max(5000, "Please input less than 5000")', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('list field', async () => { @@ -520,19 +514,18 @@ describe('zod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): z.ZodObject>', 'profile: z.array(z.string().nullable()).min(1, "Please input more than 1").max(5000, "Please input less than 5000").nullish()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); }); - describe('PR #112', () => { + describe('pR #112', () => { it('with notAllowEmptyString', async () => { const schema = buildSchema(/* GraphQL */ ` input UserCreateInput { @@ -554,15 +547,14 @@ describe('zod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): z.ZodObject>', 'profile: z.string().max(5000, "Please input less than 5000").min(1),', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('without notAllowEmptyString', async () => { @@ -585,15 +577,14 @@ describe('zod', () => { }, }, }, - {} + {}, ); const wantContains = [ 'export function UserCreateInputSchema(): z.ZodObject>', 'profile: z.string().max(5000, "Please input less than 5000"),', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); }); @@ -611,7 +602,7 @@ describe('zod', () => { { schema: 'zod', }, - {} + {}, ); expect(result.content).not.toContain('export function UserSchema(): z.ZodObject>'); }); @@ -635,26 +626,24 @@ describe('zod', () => { schema: 'zod', withObjectType: true, }, - {} + {}, ); const wantContains = [ 'export function AuthorSchema(): z.ZodObject> {', - "__typename: z.literal('Author').optional(),", + '__typename: z.literal(\'Author\').optional(),', 'books: z.array(BookSchema().nullable()).nullish(),', 'name: z.string().nullish()', 'export function BookSchema(): z.ZodObject> {', - "__typename: z.literal('Book').optional(),", + '__typename: z.literal(\'Book\').optional(),', 'author: AuthorSchema().nullish(),', 'title: z.string().nullish()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('generate both input & type', async () => { @@ -708,7 +697,7 @@ describe('zod', () => { }, }, }, - {} + {}, ); const wantContains = [ // User Create Input @@ -722,7 +711,7 @@ describe('zod', () => { 'updateName: z.string()', // User 'export function UserSchema(): z.ZodObject> {', - "__typename: z.literal('User').optional()", + '__typename: z.literal(\'User\').optional()', 'id: z.string(),', 'name: z.string().nullish(),', 'age: z.number().nullish(),', @@ -730,13 +719,11 @@ describe('zod', () => { 'email: z.string().email().nullish(),', 'createdAt: z.date()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('generate union types', async () => { @@ -757,7 +744,7 @@ describe('zod', () => { schema: 'zod', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -766,9 +753,8 @@ describe('zod', () => { 'return z.union([CircleSchema(), SquareSchema()])', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate union types with single element', async () => { @@ -793,17 +779,16 @@ describe('zod', () => { schema: 'zod', withObjectType: true, }, - {} + {}, ); const wantContains = [ 'export function GeometrySchema(): z.ZodObject> {', - "__typename: z.literal('Geometry').optional(),", + '__typename: z.literal(\'Geometry\').optional(),', 'shape: ShapeSchema().nullish()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('correctly reference generated union types', async () => { @@ -821,7 +806,7 @@ describe('zod', () => { schema: 'zod', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -830,9 +815,8 @@ describe('zod', () => { 'return CircleSchema()', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate enum union types', async () => { @@ -857,7 +841,7 @@ describe('zod', () => { schema: 'zod', withObjectType: true, }, - {} + {}, ); const wantContains = [ @@ -865,9 +849,8 @@ describe('zod', () => { 'return z.union([PageTypeSchema, MethodTypeSchema])', '}', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('generate union types with single element, export as const', async () => { @@ -893,17 +876,16 @@ describe('zod', () => { withObjectType: true, validationSchemaExportType: 'const', }, - {} + {}, ); const wantContains = [ 'export const GeometrySchema: z.ZodObject> = z.object({', - "__typename: z.literal('Geometry').optional(),", + '__typename: z.literal(\'Geometry\').optional(),', 'shape: ShapeSchema.nullish()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('with object arguments', async () => { @@ -923,7 +905,7 @@ describe('zod', () => { Text: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function MyTypeFooArgsSchema(): z.ZodObject> { @@ -960,7 +942,7 @@ describe('zod', () => { }, }, }, - {} + {}, ); const wantContains = [ // User Create Input @@ -968,9 +950,8 @@ describe('zod', () => { 'name: z.string().regex(/^Sir/),', 'age: z.number().min(0).max(100)', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } }); it('exports as const instead of func', async () => { @@ -986,7 +967,7 @@ describe('zod', () => { schema: 'zod', validationSchemaExportType: 'const', }, - {} + {}, ); expect(result.content).toContain('export const SaySchema: z.ZodObject> = z.object({'); }); @@ -1030,7 +1011,7 @@ describe('zod', () => { }, validationSchemaExportType: 'const', }, - {} + {}, ); const wantContains = [ // User Create Input @@ -1040,7 +1021,7 @@ describe('zod', () => { 'email: z.string().email()', // User 'export const UserSchema: z.ZodObject> = z.object({', - "__typename: z.literal('User').optional()", + '__typename: z.literal(\'User\').optional()', 'id: z.string(),', 'name: z.string().nullish(),', 'age: z.number().nullish(),', @@ -1048,13 +1029,11 @@ describe('zod', () => { 'email: z.string().email().nullish(),', 'createdAt: z.date()', ]; - for (const wantContain of wantContains) { + for (const wantContain of wantContains) expect(result.content).toContain(wantContain); - } - for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) { + for (const wantNotContain of ['Query', 'Mutation', 'Subscription']) expect(result.content).not.toContain(wantNotContain); - } }); it('issue #394', async () => { @@ -1083,7 +1062,7 @@ describe('zod', () => { ID: 'string', }, }, - {} + {}, ); const wantContain = dedent` export function QueryInputSchema(): z.ZodObject> { diff --git a/tsconfig.json b/tsconfig.json index 85db1042..d500d855 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,18 @@ { "extends": "@tsconfig/recommended/tsconfig.json", "compilerOptions": { + "target": "ES2022", "incremental": true, "declaration": true, "noEmit": false, "outDir": "dist", "baseUrl": ".", - "paths": {} + "paths": {}, + "types": ["node", "vitest/globals"] }, "include": [ "src", + "tests", "example" ], "exclude": [ diff --git a/tsconfig.main.json b/tsconfig.main.json index c33d0b44..f3ddb2d2 100644 --- a/tsconfig.main.json +++ b/tsconfig.main.json @@ -1,13 +1,14 @@ { "extends": "./tsconfig", "compilerOptions": { + "incremental": false, "rootDir": "src", - "outDir": "dist/main", - "types": [ - "node" - ] + "types": ["node"], + "declaration": false, + "outDir": "dist/main" }, "exclude": [ - "example" + "example", + "tests" ] -} \ No newline at end of file +} diff --git a/tsconfig.module.json b/tsconfig.module.json index 5fad3c03..6581aaf6 100644 --- a/tsconfig.module.json +++ b/tsconfig.module.json @@ -1,19 +1,19 @@ { "extends": "./tsconfig", "compilerOptions": { + "incremental": false, "target": "esnext", + "rootDir": "src", "module": "esnext", - "declaration": false, "moduleResolution": "node", "resolveJsonModule": true, - "rootDir": "src", - "outDir": "dist/module", - "types": [ - "node" - ] + "types": ["node"], + "declaration": false, + "outDir": "dist/module" }, "exclude": [ "node_modules/**", - "example" + "example", + "tests" ] -} \ No newline at end of file +} diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100644 index 00000000..cc439819 --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "rootDir": "src", + "types": ["node"], + "declarationDir": "dist/types", + "emitDeclarationOnly": true, + "outDir": "dist/types" + }, + "exclude": [ + "example", + "tests" + ] +} diff --git a/vitest.config.ts b/vitest.config.ts index e318f5d7..2d88d4f2 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -3,10 +3,8 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { globals: true, - singleThread: true, environment: 'node', reporters: ['default'], - cache: { dir: 'node_modules/.vitest' }, // default include: ['tests/*.spec.ts'], exclude: ['node_modules', 'dist', 'example', '.idea', '.git', '.cache', '.github'], server: {