From 4da1a33b8b0a6264923eb072a8aa247ceee443cf Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Sun, 13 Oct 2024 00:42:53 +0800 Subject: [PATCH] feat: simplified the `*-type-checked` configurations by providing a meaningful and performant default --- README.md | 8 +- examples/type-checked/.editorconfig | 6 + examples/type-checked/.gitignore | 30 + examples/type-checked/.prettierrc.json | 7 + examples/type-checked/.vscode/extensions.json | 8 + examples/type-checked/README.md | 61 ++ examples/type-checked/cypress.config.ts | 8 + .../type-checked/cypress/e2e/example.cy.ts | 8 + .../type-checked/cypress/e2e/tsconfig.json | 8 + .../cypress/fixtures/example.json | 5 + .../type-checked/cypress/support/commands.ts | 39 ++ examples/type-checked/cypress/support/e2e.ts | 20 + examples/type-checked/env.d.ts | 1 + examples/type-checked/eslint.config.js | 34 ++ examples/type-checked/index.html | 13 + examples/type-checked/package.json | 48 ++ examples/type-checked/public/favicon.ico | Bin 0 -> 4286 bytes examples/type-checked/src/App.vue | 85 +++ examples/type-checked/src/assets/base.css | 86 +++ examples/type-checked/src/assets/logo.svg | 1 + examples/type-checked/src/assets/main.css | 35 ++ .../src/components/HelloWorld.vue | 41 ++ .../src/components/TheWelcome.vue | 88 +++ .../src/components/WelcomeItem.vue | 87 +++ .../components/__tests__/HelloWorld.spec.ts | 11 + .../src/components/icons/IconCommunity.vue | 7 + .../components/icons/IconDocumentation.vue | 7 + .../src/components/icons/IconEcosystem.vue | 7 + .../src/components/icons/IconSupport.vue | 7 + .../src/components/icons/IconTooling.vue | 19 + examples/type-checked/src/main.ts | 14 + examples/type-checked/src/router/index.ts | 24 + examples/type-checked/src/stores/counter.ts | 12 + examples/type-checked/src/views/AboutView.vue | 15 + examples/type-checked/src/views/HomeView.vue | 9 + examples/type-checked/tsconfig.app.json | 14 + examples/type-checked/tsconfig.json | 17 + examples/type-checked/tsconfig.node.json | 19 + examples/type-checked/tsconfig.vitest.json | 11 + examples/type-checked/vite.config.ts | 20 + examples/type-checked/vitest.config.ts | 14 + package.json | 2 +- pnpm-lock.yaml | 557 +++++++++++++++++- src/index.ts | 123 +++- 44 files changed, 1589 insertions(+), 47 deletions(-) create mode 100644 examples/type-checked/.editorconfig create mode 100644 examples/type-checked/.gitignore create mode 100644 examples/type-checked/.prettierrc.json create mode 100644 examples/type-checked/.vscode/extensions.json create mode 100644 examples/type-checked/README.md create mode 100644 examples/type-checked/cypress.config.ts create mode 100644 examples/type-checked/cypress/e2e/example.cy.ts create mode 100644 examples/type-checked/cypress/e2e/tsconfig.json create mode 100644 examples/type-checked/cypress/fixtures/example.json create mode 100644 examples/type-checked/cypress/support/commands.ts create mode 100644 examples/type-checked/cypress/support/e2e.ts create mode 100644 examples/type-checked/env.d.ts create mode 100644 examples/type-checked/eslint.config.js create mode 100644 examples/type-checked/index.html create mode 100644 examples/type-checked/package.json create mode 100644 examples/type-checked/public/favicon.ico create mode 100644 examples/type-checked/src/App.vue create mode 100644 examples/type-checked/src/assets/base.css create mode 100644 examples/type-checked/src/assets/logo.svg create mode 100644 examples/type-checked/src/assets/main.css create mode 100644 examples/type-checked/src/components/HelloWorld.vue create mode 100644 examples/type-checked/src/components/TheWelcome.vue create mode 100644 examples/type-checked/src/components/WelcomeItem.vue create mode 100644 examples/type-checked/src/components/__tests__/HelloWorld.spec.ts create mode 100644 examples/type-checked/src/components/icons/IconCommunity.vue create mode 100644 examples/type-checked/src/components/icons/IconDocumentation.vue create mode 100644 examples/type-checked/src/components/icons/IconEcosystem.vue create mode 100644 examples/type-checked/src/components/icons/IconSupport.vue create mode 100644 examples/type-checked/src/components/icons/IconTooling.vue create mode 100644 examples/type-checked/src/main.ts create mode 100644 examples/type-checked/src/router/index.ts create mode 100644 examples/type-checked/src/stores/counter.ts create mode 100644 examples/type-checked/src/views/AboutView.vue create mode 100644 examples/type-checked/src/views/HomeView.vue create mode 100644 examples/type-checked/tsconfig.app.json create mode 100644 examples/type-checked/tsconfig.json create mode 100644 examples/type-checked/tsconfig.node.json create mode 100644 examples/type-checked/tsconfig.vitest.json create mode 100644 examples/type-checked/vite.config.ts create mode 100644 examples/type-checked/vitest.config.ts diff --git a/README.md b/README.md index 854c39b..4146215 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,6 @@ export default [ // You can also manually enable the stylistic rules. // "stylistic", - // [!NOTE] The ones with `-type-checked` are not yet tested. - // Other utility configurations, such as `eslint-recommended`, // are also extendable here. But we don't recommend using them directly. ], @@ -92,15 +90,13 @@ export default [ jsx: false, }, - // [!NOT YET IMPLEMENTED] // // Optional: the root directory to resolve the `.vue` files, defaults to `process.cwd()`. - // + // You may need to set this to the root directory of your project if you have a monorepo. // This is useful when you allow any other languages than `ts` in `.vue` files. // Our config helper would resolve and parse all the `.vue` files under `rootDir`, // and only apply the loosened rules to the files that do need them. - // - // rootDir: __dirname, + rootDir: import.meta.dirname, }) ] ``` diff --git a/examples/type-checked/.editorconfig b/examples/type-checked/.editorconfig new file mode 100644 index 0000000..ecea360 --- /dev/null +++ b/examples/type-checked/.editorconfig @@ -0,0 +1,6 @@ +[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/examples/type-checked/.gitignore b/examples/type-checked/.gitignore new file mode 100644 index 0000000..8ee54e8 --- /dev/null +++ b/examples/type-checked/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo diff --git a/examples/type-checked/.prettierrc.json b/examples/type-checked/.prettierrc.json new file mode 100644 index 0000000..effc164 --- /dev/null +++ b/examples/type-checked/.prettierrc.json @@ -0,0 +1,7 @@ + +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": false, + "singleQuote": true, + "arrowParens": "avoid" +} diff --git a/examples/type-checked/.vscode/extensions.json b/examples/type-checked/.vscode/extensions.json new file mode 100644 index 0000000..de51a0a --- /dev/null +++ b/examples/type-checked/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "Vue.volar", + "vitest.explorer", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ] +} diff --git a/examples/type-checked/README.md b/examples/type-checked/README.md new file mode 100644 index 0000000..1f3dd9e --- /dev/null +++ b/examples/type-checked/README.md @@ -0,0 +1,61 @@ +# type-checked + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. + +## Customize configuration + +See [Vite Configuration Reference](https://vite.dev/config/). + +## Project Setup + +```sh +npm install +``` + +### Compile and Hot-Reload for Development + +```sh +npm run dev +``` + +### Type-Check, Compile and Minify for Production + +```sh +npm run build +``` + +### Run Unit Tests with [Vitest](https://vitest.dev/) + +```sh +npm run test:unit +``` + +### Run End-to-End Tests with [Cypress](https://www.cypress.io/) + +```sh +npm run test:e2e:dev +``` + +This runs the end-to-end tests against the Vite development server. +It is much faster than the production build. + +But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments): + +```sh +npm run build +npm run test:e2e +``` + +### Lint with [ESLint](https://eslint.org/) + +```sh +npm run lint +``` diff --git a/examples/type-checked/cypress.config.ts b/examples/type-checked/cypress.config.ts new file mode 100644 index 0000000..0f66080 --- /dev/null +++ b/examples/type-checked/cypress.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'cypress' + +export default defineConfig({ + e2e: { + specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}', + baseUrl: 'http://localhost:4173' + } +}) diff --git a/examples/type-checked/cypress/e2e/example.cy.ts b/examples/type-checked/cypress/e2e/example.cy.ts new file mode 100644 index 0000000..7554c35 --- /dev/null +++ b/examples/type-checked/cypress/e2e/example.cy.ts @@ -0,0 +1,8 @@ +// https://on.cypress.io/api + +describe('My First Test', () => { + it('visits the app root url', () => { + cy.visit('/') + cy.contains('h1', 'You did it!') + }) +}) diff --git a/examples/type-checked/cypress/e2e/tsconfig.json b/examples/type-checked/cypress/e2e/tsconfig.json new file mode 100644 index 0000000..c94f1d4 --- /dev/null +++ b/examples/type-checked/cypress/e2e/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "include": ["./**/*", "../support/**/*"], + "compilerOptions": { + "isolatedModules": false, + "types": ["cypress"] + } +} diff --git a/examples/type-checked/cypress/fixtures/example.json b/examples/type-checked/cypress/fixtures/example.json new file mode 100644 index 0000000..02e4254 --- /dev/null +++ b/examples/type-checked/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/examples/type-checked/cypress/support/commands.ts b/examples/type-checked/cypress/support/commands.ts new file mode 100644 index 0000000..9b7bb8e --- /dev/null +++ b/examples/type-checked/cypress/support/commands.ts @@ -0,0 +1,39 @@ +/// +// *********************************************** +// This example commands.ts shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add('login', (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) +// +// declare global { +// namespace Cypress { +// interface Chainable { +// login(email: string, password: string): Chainable +// drag(subject: string, options?: Partial): Chainable +// dismiss(subject: string, options?: Partial): Chainable +// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable +// } +// } +// } + +export {} diff --git a/examples/type-checked/cypress/support/e2e.ts b/examples/type-checked/cypress/support/e2e.ts new file mode 100644 index 0000000..d68db96 --- /dev/null +++ b/examples/type-checked/cypress/support/e2e.ts @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/examples/type-checked/env.d.ts b/examples/type-checked/env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/examples/type-checked/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/type-checked/eslint.config.js b/examples/type-checked/eslint.config.js new file mode 100644 index 0000000..6fe3f0a --- /dev/null +++ b/examples/type-checked/eslint.config.js @@ -0,0 +1,34 @@ +import pluginVue from 'eslint-plugin-vue' +import vueTsEslintConfig from '@vue/eslint-config-typescript' +import pluginVitest from '@vitest/eslint-plugin' +import pluginCypress from 'eslint-plugin-cypress/flat' +import skipFormatting from '@vue/eslint-config-prettier/skip-formatting' + +export default [ + { + name: 'app/files-to-lint', + files: ['**/*.{ts,mts,tsx,vue}'], + }, + + { + name: 'app/files-to-ignore', + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], + }, + + ...pluginVue.configs['flat/essential'], + ...vueTsEslintConfig({ extends: ['recommendedTypeChecked'] }), + + { + ...pluginVitest.configs.recommended, + files: ['src/**/__tests__/*'], + }, + + { + ...pluginCypress.configs.recommended, + files: [ + 'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}', + 'cypress/support/**/*.{js,ts,jsx,tsx}' + ], + }, + skipFormatting, +] diff --git a/examples/type-checked/index.html b/examples/type-checked/index.html new file mode 100644 index 0000000..a888544 --- /dev/null +++ b/examples/type-checked/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/examples/type-checked/package.json b/examples/type-checked/package.json new file mode 100644 index 0000000..652981f --- /dev/null +++ b/examples/type-checked/package.json @@ -0,0 +1,48 @@ +{ + "name": "type-checked", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "run-p type-check \"build-only {@}\" --", + "preview": "vite preview", + "test:unit": "vitest", + "test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'", + "test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'", + "build-only": "vite build", + "type-check": "vue-tsc --build --force", + "lint": "eslint . --fix", + "format": "prettier --write src/" + }, + "dependencies": { + "pinia": "^2.2.4", + "vue": "^3.5.11", + "vue-router": "^4.4.5" + }, + "devDependencies": { + "@tsconfig/node20": "^20.1.4", + "@types/jsdom": "^21.1.7", + "@types/node": "^20.16.11", + "@vitejs/plugin-vue": "^5.1.4", + "@vitejs/plugin-vue-jsx": "^4.0.1", + "@vitest/eslint-plugin": "1.1.7", + "@vue/eslint-config-prettier": "^10.0.0", + "@vue/eslint-config-typescript": "workspace:*", + "@vue/test-utils": "^2.4.6", + "@vue/tsconfig": "^0.5.1", + "cypress": "^13.15.0", + "eslint": "^9.12.0", + "eslint-plugin-cypress": "^3.5.0", + "eslint-plugin-vue": "^9.28.0", + "jsdom": "^25.0.1", + "npm-run-all2": "^6.2.3", + "prettier": "^3.3.3", + "start-server-and-test": "^2.0.8", + "typescript": "~5.5.4", + "vite": "^5.4.8", + "vite-plugin-vue-devtools": "^7.4.6", + "vitest": "^2.1.2", + "vue-tsc": "^2.1.6" + } +} diff --git a/examples/type-checked/public/favicon.ico b/examples/type-checked/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S literal 0 HcmV?d00001 diff --git a/examples/type-checked/src/App.vue b/examples/type-checked/src/App.vue new file mode 100644 index 0000000..7905b05 --- /dev/null +++ b/examples/type-checked/src/App.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/examples/type-checked/src/assets/base.css b/examples/type-checked/src/assets/base.css new file mode 100644 index 0000000..8816868 --- /dev/null +++ b/examples/type-checked/src/assets/base.css @@ -0,0 +1,86 @@ +/* color palette from */ +:root { + --vt-c-white: #ffffff; + --vt-c-white-soft: #f8f8f8; + --vt-c-white-mute: #f2f2f2; + + --vt-c-black: #181818; + --vt-c-black-soft: #222222; + --vt-c-black-mute: #282828; + + --vt-c-indigo: #2c3e50; + + --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); + --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); + --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); + --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); + + --vt-c-text-light-1: var(--vt-c-indigo); + --vt-c-text-light-2: rgba(60, 60, 60, 0.66); + --vt-c-text-dark-1: var(--vt-c-white); + --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); +} + +/* semantic color variables for this project */ +:root { + --color-background: var(--vt-c-white); + --color-background-soft: var(--vt-c-white-soft); + --color-background-mute: var(--vt-c-white-mute); + + --color-border: var(--vt-c-divider-light-2); + --color-border-hover: var(--vt-c-divider-light-1); + + --color-heading: var(--vt-c-text-light-1); + --color-text: var(--vt-c-text-light-1); + + --section-gap: 160px; +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--vt-c-black); + --color-background-soft: var(--vt-c-black-soft); + --color-background-mute: var(--vt-c-black-mute); + + --color-border: var(--vt-c-divider-dark-2); + --color-border-hover: var(--vt-c-divider-dark-1); + + --color-heading: var(--vt-c-text-dark-1); + --color-text: var(--vt-c-text-dark-2); + } +} + +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + font-weight: normal; +} + +body { + min-height: 100vh; + color: var(--color-text); + background: var(--color-background); + transition: + color 0.5s, + background-color 0.5s; + line-height: 1.6; + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Oxygen, + Ubuntu, + Cantarell, + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + sans-serif; + font-size: 15px; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} diff --git a/examples/type-checked/src/assets/logo.svg b/examples/type-checked/src/assets/logo.svg new file mode 100644 index 0000000..7565660 --- /dev/null +++ b/examples/type-checked/src/assets/logo.svg @@ -0,0 +1 @@ + diff --git a/examples/type-checked/src/assets/main.css b/examples/type-checked/src/assets/main.css new file mode 100644 index 0000000..36fb845 --- /dev/null +++ b/examples/type-checked/src/assets/main.css @@ -0,0 +1,35 @@ +@import './base.css'; + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + font-weight: normal; +} + +a, +.green { + text-decoration: none; + color: hsla(160, 100%, 37%, 1); + transition: 0.4s; + padding: 3px; +} + +@media (hover: hover) { + a:hover { + background-color: hsla(160, 100%, 37%, 0.2); + } +} + +@media (min-width: 1024px) { + body { + display: flex; + place-items: center; + } + + #app { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0 2rem; + } +} diff --git a/examples/type-checked/src/components/HelloWorld.vue b/examples/type-checked/src/components/HelloWorld.vue new file mode 100644 index 0000000..d174cf8 --- /dev/null +++ b/examples/type-checked/src/components/HelloWorld.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/examples/type-checked/src/components/TheWelcome.vue b/examples/type-checked/src/components/TheWelcome.vue new file mode 100644 index 0000000..e65a66b --- /dev/null +++ b/examples/type-checked/src/components/TheWelcome.vue @@ -0,0 +1,88 @@ + + + diff --git a/examples/type-checked/src/components/WelcomeItem.vue b/examples/type-checked/src/components/WelcomeItem.vue new file mode 100644 index 0000000..6d7086a --- /dev/null +++ b/examples/type-checked/src/components/WelcomeItem.vue @@ -0,0 +1,87 @@ + + + diff --git a/examples/type-checked/src/components/__tests__/HelloWorld.spec.ts b/examples/type-checked/src/components/__tests__/HelloWorld.spec.ts new file mode 100644 index 0000000..2533202 --- /dev/null +++ b/examples/type-checked/src/components/__tests__/HelloWorld.spec.ts @@ -0,0 +1,11 @@ +import { describe, it, expect } from 'vitest' + +import { mount } from '@vue/test-utils' +import HelloWorld from '../HelloWorld.vue' + +describe('HelloWorld', () => { + it('renders properly', () => { + const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } }) + expect(wrapper.text()).toContain('Hello Vitest') + }) +}) diff --git a/examples/type-checked/src/components/icons/IconCommunity.vue b/examples/type-checked/src/components/icons/IconCommunity.vue new file mode 100644 index 0000000..2dc8b05 --- /dev/null +++ b/examples/type-checked/src/components/icons/IconCommunity.vue @@ -0,0 +1,7 @@ + diff --git a/examples/type-checked/src/components/icons/IconDocumentation.vue b/examples/type-checked/src/components/icons/IconDocumentation.vue new file mode 100644 index 0000000..6d4791c --- /dev/null +++ b/examples/type-checked/src/components/icons/IconDocumentation.vue @@ -0,0 +1,7 @@ + diff --git a/examples/type-checked/src/components/icons/IconEcosystem.vue b/examples/type-checked/src/components/icons/IconEcosystem.vue new file mode 100644 index 0000000..c3a4f07 --- /dev/null +++ b/examples/type-checked/src/components/icons/IconEcosystem.vue @@ -0,0 +1,7 @@ + diff --git a/examples/type-checked/src/components/icons/IconSupport.vue b/examples/type-checked/src/components/icons/IconSupport.vue new file mode 100644 index 0000000..7452834 --- /dev/null +++ b/examples/type-checked/src/components/icons/IconSupport.vue @@ -0,0 +1,7 @@ + diff --git a/examples/type-checked/src/components/icons/IconTooling.vue b/examples/type-checked/src/components/icons/IconTooling.vue new file mode 100644 index 0000000..660598d --- /dev/null +++ b/examples/type-checked/src/components/icons/IconTooling.vue @@ -0,0 +1,19 @@ + + diff --git a/examples/type-checked/src/main.ts b/examples/type-checked/src/main.ts new file mode 100644 index 0000000..5dcad83 --- /dev/null +++ b/examples/type-checked/src/main.ts @@ -0,0 +1,14 @@ +import './assets/main.css' + +import { createApp } from 'vue' +import { createPinia } from 'pinia' + +import App from './App.vue' +import router from './router' + +const app = createApp(App) + +app.use(createPinia()) +app.use(router) + +app.mount('#app') diff --git a/examples/type-checked/src/router/index.ts b/examples/type-checked/src/router/index.ts new file mode 100644 index 0000000..ce51fcf --- /dev/null +++ b/examples/type-checked/src/router/index.ts @@ -0,0 +1,24 @@ +import { createRouter, createWebHistory } from 'vue-router' +import HomeView from '../views/HomeView.vue' +import type { Component } from 'vue' + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes: [ + { + path: '/', + name: 'home', + component: HomeView + }, + { + path: '/about', + name: 'about', + // route level code-splitting + // this generates a separate chunk (About.[hash].js) for this route + // which is lazy-loaded when the route is visited. + component: async (): Promise<{ default: Component }> => import('../views/AboutView.vue') + } + ] +}) + +export default router diff --git a/examples/type-checked/src/stores/counter.ts b/examples/type-checked/src/stores/counter.ts new file mode 100644 index 0000000..b6757ba --- /dev/null +++ b/examples/type-checked/src/stores/counter.ts @@ -0,0 +1,12 @@ +import { ref, computed } from 'vue' +import { defineStore } from 'pinia' + +export const useCounterStore = defineStore('counter', () => { + const count = ref(0) + const doubleCount = computed(() => count.value * 2) + function increment() { + count.value++ + } + + return { count, doubleCount, increment } +}) diff --git a/examples/type-checked/src/views/AboutView.vue b/examples/type-checked/src/views/AboutView.vue new file mode 100644 index 0000000..756ad2a --- /dev/null +++ b/examples/type-checked/src/views/AboutView.vue @@ -0,0 +1,15 @@ + + + diff --git a/examples/type-checked/src/views/HomeView.vue b/examples/type-checked/src/views/HomeView.vue new file mode 100644 index 0000000..d5c0217 --- /dev/null +++ b/examples/type-checked/src/views/HomeView.vue @@ -0,0 +1,9 @@ + + + diff --git a/examples/type-checked/tsconfig.app.json b/examples/type-checked/tsconfig.app.json new file mode 100644 index 0000000..e14c754 --- /dev/null +++ b/examples/type-checked/tsconfig.app.json @@ -0,0 +1,14 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"], + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/examples/type-checked/tsconfig.json b/examples/type-checked/tsconfig.json new file mode 100644 index 0000000..5304731 --- /dev/null +++ b/examples/type-checked/tsconfig.json @@ -0,0 +1,17 @@ +{ + "files": [], + "references": [ + { + "path": "./tsconfig.node.json" + }, + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.vitest.json" + } + ], + "compilerOptions": { + "module": "NodeNext" + } +} diff --git a/examples/type-checked/tsconfig.node.json b/examples/type-checked/tsconfig.node.json new file mode 100644 index 0000000..f094063 --- /dev/null +++ b/examples/type-checked/tsconfig.node.json @@ -0,0 +1,19 @@ +{ + "extends": "@tsconfig/node20/tsconfig.json", + "include": [ + "vite.config.*", + "vitest.config.*", + "cypress.config.*", + "nightwatch.conf.*", + "playwright.config.*" + ], + "compilerOptions": { + "composite": true, + "noEmit": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + + "module": "ESNext", + "moduleResolution": "Bundler", + "types": ["node"] + } +} diff --git a/examples/type-checked/tsconfig.vitest.json b/examples/type-checked/tsconfig.vitest.json new file mode 100644 index 0000000..571995d --- /dev/null +++ b/examples/type-checked/tsconfig.vitest.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.app.json", + "exclude": [], + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo", + + "lib": [], + "types": ["node", "jsdom"] + } +} diff --git a/examples/type-checked/vite.config.ts b/examples/type-checked/vite.config.ts new file mode 100644 index 0000000..c036b6f --- /dev/null +++ b/examples/type-checked/vite.config.ts @@ -0,0 +1,20 @@ +import { fileURLToPath, URL } from 'node:url' + +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' +import vueDevTools from 'vite-plugin-vue-devtools' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + vue(), + vueJsx(), + vueDevTools(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + } +}) diff --git a/examples/type-checked/vitest.config.ts b/examples/type-checked/vitest.config.ts new file mode 100644 index 0000000..4b1c897 --- /dev/null +++ b/examples/type-checked/vitest.config.ts @@ -0,0 +1,14 @@ +import { fileURLToPath } from 'node:url' +import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' +import viteConfig from './vite.config' + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'e2e/**'], + root: fileURLToPath(new URL('./', import.meta.url)) + } + }) +) diff --git a/package.json b/package.json index 5d0af1c..3fad959 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ }, "dependencies": { "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", + "fast-glob": "^3.3.2", "typescript-eslint": "^8.8.1", "vue-eslint-parser": "^9.4.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fec776c..c695078 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,9 +11,9 @@ importers: '@typescript-eslint/eslint-plugin': specifier: ^8.8.1 version: 8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.5.4))(eslint@9.12.0)(typescript@5.5.4) - '@typescript-eslint/parser': - specifier: ^8.8.1 - version: 8.8.1(eslint@9.12.0)(typescript@5.5.4) + fast-glob: + specifier: ^3.3.2 + version: 3.3.2 typescript-eslint: specifier: ^8.8.1 version: 8.8.1(eslint@9.12.0)(typescript@5.5.4) @@ -135,6 +135,88 @@ importers: specifier: ^2.1.6 version: 2.1.6(typescript@5.5.4) + examples/type-checked: + dependencies: + pinia: + specifier: ^2.2.4 + version: 2.2.4(typescript@5.5.4)(vue@3.5.11(typescript@5.5.4)) + vue: + specifier: ^3.5.11 + version: 3.5.11(typescript@5.5.4) + vue-router: + specifier: ^4.4.5 + version: 4.4.5(vue@3.5.11(typescript@5.5.4)) + devDependencies: + '@tsconfig/node20': + specifier: ^20.1.4 + version: 20.1.4 + '@types/jsdom': + specifier: ^21.1.7 + version: 21.1.7 + '@types/node': + specifier: ^20.16.11 + version: 20.16.11 + '@vitejs/plugin-vue': + specifier: ^5.1.4 + version: 5.1.4(vite@5.4.8(@types/node@20.16.11))(vue@3.5.11(typescript@5.5.4)) + '@vitejs/plugin-vue-jsx': + specifier: ^4.0.1 + version: 4.0.1(vite@5.4.8(@types/node@20.16.11))(vue@3.5.11(typescript@5.5.4)) + '@vitest/eslint-plugin': + specifier: 1.1.7 + version: 1.1.7(@typescript-eslint/utils@8.8.1(eslint@9.12.0)(typescript@5.5.4))(eslint@9.12.0)(typescript@5.5.4)(vitest@2.1.2(@types/node@20.16.11)(jsdom@25.0.1)) + '@vue/eslint-config-prettier': + specifier: ^10.0.0 + version: 10.0.0(eslint@9.12.0)(prettier@3.3.3) + '@vue/eslint-config-typescript': + specifier: workspace:* + version: link:../.. + '@vue/test-utils': + specifier: ^2.4.6 + version: 2.4.6 + '@vue/tsconfig': + specifier: ^0.5.1 + version: 0.5.1 + cypress: + specifier: ^13.15.0 + version: 13.15.0 + eslint: + specifier: ^9.12.0 + version: 9.12.0 + eslint-plugin-cypress: + specifier: ^3.5.0 + version: 3.5.0(eslint@9.12.0) + eslint-plugin-vue: + specifier: ^9.28.0 + version: 9.28.0(eslint@9.12.0) + jsdom: + specifier: ^25.0.1 + version: 25.0.1 + npm-run-all2: + specifier: ^6.2.3 + version: 6.2.3 + prettier: + specifier: ^3.3.3 + version: 3.3.3 + start-server-and-test: + specifier: ^2.0.8 + version: 2.0.8 + typescript: + specifier: ~5.5.4 + version: 5.5.4 + vite: + specifier: ^5.4.8 + version: 5.4.8(@types/node@20.16.11) + vite-plugin-vue-devtools: + specifier: ^7.4.6 + version: 7.4.6(rollup@4.24.0)(vite@5.4.8(@types/node@20.16.11))(vue@3.5.11(typescript@5.5.4)) + vitest: + specifier: ^2.1.2 + version: 2.1.2(@types/node@20.16.11)(jsdom@25.0.1) + vue-tsc: + specifier: ^2.1.6 + version: 2.1.6(typescript@5.5.4) + examples/with-cypress: dependencies: vue: @@ -613,6 +695,9 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@antfu/utils@0.7.10': + resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + '@babel/code-frame@7.25.7': resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} engines: {node: '>=6.9.0'} @@ -704,6 +789,29 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/plugin-proposal-decorators@7.25.7': + resolution: {integrity: sha512-q1mqqqH0e1lhmsEQHV5U8OmdueBC2y0RFr2oUzZoFRtN3MvPmt2fsFRcNQAoGLTSNdHBFUYGnlgcRFhkBbKjPw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-decorators@7.25.7': + resolution: {integrity: sha512-oXduHo642ZhstLVYTe2z2GSJIruU0c/W3/Ghr6A5yGMsVrvdnxO1z+3pbTcT7f3/Clnt+1z8D/w1r1f1SHaCHw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-attributes@7.25.7': + resolution: {integrity: sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-meta@7.10.4': + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-jsx@7.25.7': resolution: {integrity: sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==} engines: {node: '>=6.9.0'} @@ -1413,6 +1521,9 @@ packages: engines: {node: '>=18'} hasBin: true + '@polka/url@1.0.0-next.28': + resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} + '@rollup/plugin-alias@5.1.1': resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} @@ -1829,6 +1940,20 @@ packages: '@vue/compiler-vue2@2.7.16': resolution: {integrity: sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==} + '@vue/devtools-api@6.6.4': + resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==} + + '@vue/devtools-core@7.4.6': + resolution: {integrity: sha512-7ATNPEbVqThOOAp2bg/YUIm9MqqgimbSk24D05hdXUp89JlXX12aTzdrWd9xZRwS78hDR+wCToHl1C/8sopBrg==} + peerDependencies: + vue: ^3.0.0 + + '@vue/devtools-kit@7.4.6': + resolution: {integrity: sha512-NbYBwPWgEic1AOd9bWExz9weBzFdjiIfov0yRn4DrRfR+EQJCI9dn4I0XS7IxYGdkmUJi8mFW42LLk18WsGqew==} + + '@vue/devtools-shared@7.4.6': + resolution: {integrity: sha512-rPeSBzElnHYMB05Cc056BQiJpgocQjY8XVulgni+O9a9Gr9tNXgPteSzFFD+fT/iWMxNuUgGKs9CuW5DZewfIg==} + '@vue/eslint-config-prettier@10.0.0': resolution: {integrity: sha512-iDEjsfT+UXQTJfe+4mstb/B5BSZ5RpL6FO3F97XxElIXdD04gkH+F7PR4fBMEVyJi4892G4LQVPQ8oXxVyp8Dw==} peerDependencies: @@ -2066,6 +2191,9 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + birpc@0.2.19: + resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -2106,6 +2234,10 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + bundle-name@4.1.0: + resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} + engines: {node: '>=18'} + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -2274,6 +2406,10 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + copy-anything@3.0.5: + resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} + engines: {node: '>=12.13'} + core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} @@ -2404,6 +2540,14 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + default-browser-id@5.0.0: + resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} + engines: {node: '>=18'} + + default-browser@5.2.1: + resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} + engines: {node: '>=18'} + defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} @@ -2415,6 +2559,10 @@ packages: resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} engines: {node: '>=8'} + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + define-properties@1.2.1: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} @@ -2503,6 +2651,9 @@ packages: engines: {node: '>=4'} hasBin: true + error-stack-parser-es@0.1.5: + resolution: {integrity: sha512-xHku1X40RO+fO8yJ8Wh2f2rZWVjqyhb1zgq1yZ8aZRQkv6OOKhKWRUaht3eSCUbAOBaKIgM+ykwFLE+QUxgGeg==} + es-define-property@1.0.0: resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} engines: {node: '>= 0.4'} @@ -3067,6 +3218,9 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + html-encoding-sniffer@4.0.0: resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==} engines: {node: '>=18'} @@ -3195,6 +3349,11 @@ packages: engines: {node: '>=8'} hasBin: true + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -3207,6 +3366,11 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + is-installed-globally@0.4.0: resolution: {integrity: sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==} engines: {node: '>=10'} @@ -3302,10 +3466,18 @@ packages: resolution: {integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==} engines: {node: '>= 0.4'} + is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} + engines: {node: '>=12.13'} + is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} + is-wsl@3.1.0: + resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} + engines: {node: '>=16'} + is2@2.0.9: resolution: {integrity: sha512-rZkHeBn9Zzq52sd9IUIV3a5mfwBY+o2HePMh0wkGBM4z4qjvy2GwVxQ6nNXSfw6MmVP6gf1QIlWjiOavhM3x5g==} engines: {node: '>=v0.10.0'} @@ -3425,6 +3597,9 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + kolorist@1.8.0: + resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + lazy-ass@1.6.0: resolution: {integrity: sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==} engines: {node: '> 0.8'} @@ -3591,6 +3766,9 @@ packages: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + mkdirp@2.1.6: resolution: {integrity: sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==} engines: {node: '>=10'} @@ -3604,6 +3782,10 @@ packages: engines: {node: '>= 14.0.0'} hasBin: true + mrmime@2.0.0: + resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} + engines: {node: '>=10'} + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -3721,6 +3903,10 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} + open@10.1.0: + resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==} + engines: {node: '>=18'} + open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} @@ -3822,6 +4008,9 @@ packages: pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} @@ -3841,6 +4030,18 @@ packages: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} + pinia@2.2.4: + resolution: {integrity: sha512-K7ZhpMY9iJ9ShTC0cR2+PnxdQRuwVIsXDO/WIEV/RnMC/vmSoKDTKW/exNQYPI+4ij10UjXqdNiEHwn47McANQ==} + peerDependencies: + '@vue/composition-api': ^1.4.0 + typescript: '>=4.4.4' + vue: ^2.6.14 || ^3.3.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + typescript: + optional: true + piscina@4.7.0: resolution: {integrity: sha512-b8hvkpp9zS0zsfa939b/jXbe64Z2gZv0Ha7FYPNUiDIB1y2AtxcOZdfP8xN8HFjUaqQiT9gRlfjAsoL8vdJ1Iw==} @@ -4025,6 +4226,10 @@ packages: rrweb-cssom@0.7.1: resolution: {integrity: sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==} + run-applescript@7.0.0: + resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} + engines: {node: '>=18'} + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -4104,6 +4309,10 @@ packages: sinon@17.0.1: resolution: {integrity: sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==} + sirv@2.0.4: + resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} + engines: {node: '>= 10'} + slice-ansi@3.0.0: resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} engines: {node: '>=8'} @@ -4132,6 +4341,10 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + speakingurl@14.0.1: + resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==} + engines: {node: '>=0.10.0'} + split@0.3.3: resolution: {integrity: sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==} @@ -4209,6 +4422,10 @@ packages: strip-literal@2.1.0: resolution: {integrity: sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==} + superjson@2.2.1: + resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==} + engines: {node: '>=16'} + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -4305,6 +4522,10 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + totalist@3.0.1: + resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} + engines: {node: '>=6'} + tough-cookie@4.1.4: resolution: {integrity: sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==} engines: {node: '>=6'} @@ -4437,6 +4658,11 @@ packages: resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} engines: {'0': node >=0.6.0} + vite-hot-client@0.2.3: + resolution: {integrity: sha512-rOGAV7rUlUHX89fP2p2v0A2WWvV3QMX2UYq0fRqsWSvFvev4atHWqjwGoKaZT1VTKyLGk533ecu3eyd0o59CAg==} + peerDependencies: + vite: ^2.6.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-0 + vite-node@1.6.0: resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} engines: {node: ^18.0.0 || >=20.0.0} @@ -4447,9 +4673,30 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite-plugin-inspect@0.8.7: + resolution: {integrity: sha512-/XXou3MVc13A5O9/2Nd6xczjrUwt7ZyI9h8pTnUMkr5SshLcb0PJUOVq2V+XVkdeU4njsqAtmK87THZuO2coGA==} + engines: {node: '>=14'} + peerDependencies: + '@nuxt/kit': '*' + vite: ^3.1.0 || ^4.0.0 || ^5.0.0-0 + peerDependenciesMeta: + '@nuxt/kit': + optional: true + vite-plugin-nightwatch@0.4.6: resolution: {integrity: sha512-7mxANgh3KA2c/xGJU35T8z1Xj9akWQ4FuyB1PN3nwinqxqYBAx44sW9Z87a2x6efj5TD4lU0Tbuvvgous6F1+Q==} + vite-plugin-vue-devtools@7.4.6: + resolution: {integrity: sha512-lOKur3qovCB3BQStL0qfHEoIusqya1ngfxfWuqn9DTa6h9rlw6+S3PV4geOP5YBGYQ4NW1hRX70OD8I+sYr1dA==} + engines: {node: '>=v14.21.3'} + peerDependencies: + vite: ^3.1.0 || ^4.0.0-0 || ^5.0.0-0 + + vite-plugin-vue-inspector@5.2.0: + resolution: {integrity: sha512-wWxyb9XAtaIvV/Lr7cqB1HIzmHZFVUJsTNm3yAxkS87dgh/Ky4qr2wDEWNxF23fdhVa3jQ8MZREpr4XyiuaRqA==} + peerDependencies: + vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 + vite@4.5.5: resolution: {integrity: sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==} engines: {node: ^14.18.0 || >=16.0.0} @@ -4565,12 +4812,28 @@ packages: vue-component-type-helpers@2.1.6: resolution: {integrity: sha512-ng11B8B/ZADUMMOsRbqv0arc442q7lifSubD0v8oDXIFoMg/mXwAPUunrroIDkY+mcD0dHKccdaznSVp8EoX3w==} + vue-demi@0.14.10: + resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} + engines: {node: '>=12'} + hasBin: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue-eslint-parser@9.4.3: resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' + vue-router@4.4.5: + resolution: {integrity: sha512-4fKZygS8cH1yCyuabAXGUAsyi1b2/o/OKgu/RUb+znIYOxPRxdkytJEx+0wGcpBE1pX6vUgh5jwWOKRGvuA/7Q==} + peerDependencies: + vue: ^3.2.0 + vue-tsc@2.1.6: resolution: {integrity: sha512-f98dyZp5FOukcYmbFpuSCJ4Z0vHSOSmxGttZJCsFeX0M4w/Rsq0s4uKXjcSRsZqsRgQa6z7SfuO+y0HVICE57Q==} hasBin: true @@ -4744,6 +5007,8 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + '@antfu/utils@0.7.10': {} + '@babel/code-frame@7.25.7': dependencies: '@babel/highlight': 7.25.7 @@ -4878,6 +5143,30 @@ snapshots: dependencies: '@babel/types': 7.25.8 + '@babel/plugin-proposal-decorators@7.25.7(@babel/core@7.25.8)': + dependencies: + '@babel/core': 7.25.8 + '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.8) + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-decorators': 7.25.7(@babel/core@7.25.8) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-syntax-decorators@7.25.7(@babel/core@7.25.8)': + dependencies: + '@babel/core': 7.25.8 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-syntax-import-attributes@7.25.7(@babel/core@7.25.8)': + dependencies: + '@babel/core': 7.25.8 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.25.8)': + dependencies: + '@babel/core': 7.25.8 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-jsx@7.25.7(@babel/core@7.25.8)': dependencies: '@babel/core': 7.25.8 @@ -5186,7 +5475,7 @@ snapshots: '@eslint/config-array@0.18.0': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -5196,7 +5485,7 @@ snapshots: '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 espree: 10.2.0 globals: 14.0.0 ignore: 5.3.2 @@ -5404,6 +5693,8 @@ snapshots: dependencies: playwright: 1.48.0 + '@polka/url@1.0.0-next.28': {} + '@rollup/plugin-alias@5.1.1(rollup@4.24.0)': optionalDependencies: rollup: 4.24.0 @@ -5558,7 +5849,7 @@ snapshots: '@types/jsdom@21.1.7': dependencies: - '@types/node': 20.16.11 + '@types/node': 22.7.5 '@types/tough-cookie': 4.0.5 parse5: 7.1.2 @@ -5625,7 +5916,7 @@ snapshots: '@typescript-eslint/types': 8.8.1 '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.8.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 eslint: 9.12.0 optionalDependencies: typescript: 5.5.4 @@ -5641,7 +5932,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.5.4) '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.5.4) - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 @@ -5655,7 +5946,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.8.1 '@typescript-eslint/visitor-keys': 8.8.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 @@ -5710,6 +6001,14 @@ snapshots: typescript: 5.5.4 vitest: 1.6.0(@types/node@20.16.11)(jsdom@25.0.1) + '@vitest/eslint-plugin@1.1.7(@typescript-eslint/utils@8.8.1(eslint@9.12.0)(typescript@5.5.4))(eslint@9.12.0)(typescript@5.5.4)(vitest@2.1.2(@types/node@20.16.11)(jsdom@25.0.1))': + dependencies: + '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.5.4) + eslint: 9.12.0 + optionalDependencies: + typescript: 5.5.4 + vitest: 2.1.2(@types/node@20.16.11)(jsdom@25.0.1) + '@vitest/expect@1.6.0': dependencies: '@vitest/spy': 1.6.0 @@ -5723,6 +6022,14 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 + '@vitest/mocker@2.1.2(@vitest/spy@2.1.2)(vite@5.4.8(@types/node@20.16.11))': + dependencies: + '@vitest/spy': 2.1.2 + estree-walker: 3.0.3 + magic-string: 0.30.11 + optionalDependencies: + vite: 5.4.8(@types/node@20.16.11) + '@vitest/mocker@2.1.2(@vitest/spy@2.1.2)(vite@5.4.8(@types/node@22.7.5))': dependencies: '@vitest/spy': 2.1.2 @@ -5856,6 +6163,34 @@ snapshots: de-indent: 1.0.2 he: 1.2.0 + '@vue/devtools-api@6.6.4': {} + + '@vue/devtools-core@7.4.6(vite@5.4.8(@types/node@20.16.11))(vue@3.5.11(typescript@5.5.4))': + dependencies: + '@vue/devtools-kit': 7.4.6 + '@vue/devtools-shared': 7.4.6 + mitt: 3.0.1 + nanoid: 3.3.7 + pathe: 1.1.2 + vite-hot-client: 0.2.3(vite@5.4.8(@types/node@20.16.11)) + vue: 3.5.11(typescript@5.5.4) + transitivePeerDependencies: + - vite + + '@vue/devtools-kit@7.4.6': + dependencies: + '@vue/devtools-shared': 7.4.6 + birpc: 0.2.19 + hookable: 5.5.3 + mitt: 3.0.1 + perfect-debounce: 1.0.0 + speakingurl: 14.0.1 + superjson: 2.2.1 + + '@vue/devtools-shared@7.4.6': + dependencies: + rfdc: 1.4.1 + '@vue/eslint-config-prettier@10.0.0(eslint@9.12.0)(prettier@3.3.3)': dependencies: eslint: 9.12.0 @@ -5932,7 +6267,7 @@ snapshots: agent-base@7.1.1: dependencies: - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -6116,6 +6451,8 @@ snapshots: binary-extensions@2.3.0: {} + birpc@0.2.19: {} + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -6168,6 +6505,10 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + bundle-name@4.1.0: + dependencies: + run-applescript: 7.0.0 + cac@6.7.14: {} cachedir@2.4.0: {} @@ -6339,6 +6680,10 @@ snapshots: convert-source-map@2.0.0: {} + copy-anything@3.0.5: + dependencies: + is-what: 4.1.16 + core-util-is@1.0.2: {} core-util-is@1.0.3: {} @@ -6444,6 +6789,10 @@ snapshots: optionalDependencies: supports-color: 8.1.1 + debug@4.3.7: + dependencies: + ms: 2.1.3 + debug@4.3.7(supports-color@8.1.1): dependencies: ms: 2.1.3 @@ -6491,6 +6840,13 @@ snapshots: deepmerge@4.3.1: {} + default-browser-id@5.0.0: {} + + default-browser@5.2.1: + dependencies: + bundle-name: 4.1.0 + default-browser-id: 5.0.0 + defaults@1.0.4: dependencies: clone: 1.0.4 @@ -6503,6 +6859,8 @@ snapshots: define-lazy-prop@2.0.0: {} + define-lazy-prop@3.0.0: {} + define-properties@1.2.1: dependencies: define-data-property: 1.1.4 @@ -6574,6 +6932,8 @@ snapshots: envinfo@7.11.0: {} + error-stack-parser-es@0.1.5: {} + es-define-property@1.0.0: dependencies: get-intrinsic: 1.2.4 @@ -6837,7 +7197,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 escape-string-regexp: 4.0.0 eslint-scope: 8.1.0 eslint-visitor-keys: 4.1.0 @@ -7233,6 +7593,8 @@ snapshots: he@1.2.0: {} + hookable@5.5.3: {} + html-encoding-sniffer@4.0.0: dependencies: whatwg-encoding: 3.1.1 @@ -7242,7 +7604,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -7255,7 +7617,7 @@ snapshots: https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -7349,6 +7711,8 @@ snapshots: is-docker@2.2.1: {} + is-docker@3.0.0: {} + is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -7357,6 +7721,10 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + is-installed-globally@0.4.0: dependencies: global-dirs: 3.0.1 @@ -7426,10 +7794,16 @@ snapshots: call-bind: 1.0.7 get-intrinsic: 1.2.4 + is-what@4.1.16: {} + is-wsl@2.2.0: dependencies: is-docker: 2.2.1 + is-wsl@3.1.0: + dependencies: + is-inside-container: 1.0.0 + is2@2.0.9: dependencies: deep-is: 0.1.4 @@ -7587,6 +7961,8 @@ snapshots: dependencies: json-buffer: 3.0.1 + kolorist@1.8.0: {} + lazy-ass@1.6.0: {} lazystream@1.0.1: @@ -7733,6 +8109,8 @@ snapshots: minipass@7.1.2: {} + mitt@3.0.1: {} + mkdirp@2.1.6: {} mlly@1.7.2: @@ -7765,6 +8143,8 @@ snapshots: yargs-parser: 20.2.4 yargs-unparser: 2.0.0 + mrmime@2.0.0: {} + ms@2.1.2: {} ms@2.1.3: {} @@ -7909,6 +8289,13 @@ snapshots: dependencies: mimic-fn: 4.0.0 + open@10.1.0: + dependencies: + default-browser: 5.2.1 + define-lazy-prop: 3.0.0 + is-inside-container: 1.0.0 + is-wsl: 3.1.0 + open@8.4.2: dependencies: define-lazy-prop: 2.0.0 @@ -8017,6 +8404,8 @@ snapshots: pend@1.2.0: {} + perfect-debounce@1.0.0: {} + performance-now@2.1.0: {} picocolors@1.1.0: {} @@ -8027,6 +8416,14 @@ snapshots: pify@2.3.0: {} + pinia@2.2.4(typescript@5.5.4)(vue@3.5.11(typescript@5.5.4)): + dependencies: + '@vue/devtools-api': 6.6.4 + vue: 3.5.11(typescript@5.5.4) + vue-demi: 0.14.10(vue@3.5.11(typescript@5.5.4)) + optionalDependencies: + typescript: 5.5.4 + piscina@4.7.0: optionalDependencies: '@napi-rs/nice': 1.0.1 @@ -8236,6 +8633,8 @@ snapshots: rrweb-cssom@0.7.1: {} + run-applescript@7.0.0: {} + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 @@ -8324,6 +8723,12 @@ snapshots: nise: 5.1.9 supports-color: 7.2.0 + sirv@2.0.4: + dependencies: + '@polka/url': 1.0.0-next.28 + mrmime: 2.0.0 + totalist: 3.0.1 + slice-ansi@3.0.0: dependencies: ansi-styles: 4.3.0 @@ -8356,6 +8761,8 @@ snapshots: source-map@0.6.1: optional: true + speakingurl@14.0.1: {} + split@0.3.3: dependencies: through: 2.3.8 @@ -8451,6 +8858,10 @@ snapshots: dependencies: js-tokens: 9.0.0 + superjson@2.2.1: + dependencies: + copy-anything: 3.0.5 + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -8541,6 +8952,8 @@ snapshots: dependencies: is-number: 7.0.0 + totalist@3.0.1: {} + tough-cookie@4.1.4: dependencies: psl: 1.9.0 @@ -8659,6 +9072,10 @@ snapshots: core-util-is: 1.0.2 extsprintf: 1.3.0 + vite-hot-client@0.2.3(vite@5.4.8(@types/node@20.16.11)): + dependencies: + vite: 5.4.8(@types/node@20.16.11) + vite-node@1.6.0(@types/node@20.16.11): dependencies: cac: 6.7.14 @@ -8677,11 +9094,28 @@ snapshots: - supports-color - terser - vite-node@2.1.2(@types/node@22.7.5): + vite-node@2.1.2(@types/node@20.16.11): dependencies: cac: 6.7.14 debug: 4.3.7(supports-color@8.1.1) pathe: 1.1.2 + vite: 5.4.8(@types/node@20.16.11) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + vite-node@2.1.2(@types/node@22.7.5): + dependencies: + cac: 6.7.14 + debug: 4.3.7 + pathe: 1.1.2 vite: 5.4.8(@types/node@22.7.5) transitivePeerDependencies: - '@types/node' @@ -8694,6 +9128,22 @@ snapshots: - supports-color - terser + vite-plugin-inspect@0.8.7(rollup@4.24.0)(vite@5.4.8(@types/node@20.16.11)): + dependencies: + '@antfu/utils': 0.7.10 + '@rollup/pluginutils': 5.1.2(rollup@4.24.0) + debug: 4.3.7(supports-color@8.1.1) + error-stack-parser-es: 0.1.5 + fs-extra: 11.2.0 + open: 10.1.0 + perfect-debounce: 1.0.0 + picocolors: 1.1.0 + sirv: 2.0.4 + vite: 5.4.8(@types/node@20.16.11) + transitivePeerDependencies: + - rollup + - supports-color + vite-plugin-nightwatch@0.4.6: dependencies: '@nightwatch/esbuild-utils': 0.2.1 @@ -8708,6 +9158,37 @@ snapshots: - supports-color - utf-8-validate + vite-plugin-vue-devtools@7.4.6(rollup@4.24.0)(vite@5.4.8(@types/node@20.16.11))(vue@3.5.11(typescript@5.5.4)): + dependencies: + '@vue/devtools-core': 7.4.6(vite@5.4.8(@types/node@20.16.11))(vue@3.5.11(typescript@5.5.4)) + '@vue/devtools-kit': 7.4.6 + '@vue/devtools-shared': 7.4.6 + execa: 8.0.1 + sirv: 2.0.4 + vite: 5.4.8(@types/node@20.16.11) + vite-plugin-inspect: 0.8.7(rollup@4.24.0)(vite@5.4.8(@types/node@20.16.11)) + vite-plugin-vue-inspector: 5.2.0(vite@5.4.8(@types/node@20.16.11)) + transitivePeerDependencies: + - '@nuxt/kit' + - rollup + - supports-color + - vue + + vite-plugin-vue-inspector@5.2.0(vite@5.4.8(@types/node@20.16.11)): + dependencies: + '@babel/core': 7.25.8 + '@babel/plugin-proposal-decorators': 7.25.7(@babel/core@7.25.8) + '@babel/plugin-syntax-import-attributes': 7.25.7(@babel/core@7.25.8) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.25.8) + '@babel/plugin-transform-typescript': 7.25.7(@babel/core@7.25.8) + '@vue/babel-plugin-jsx': 1.2.5(@babel/core@7.25.8) + '@vue/compiler-dom': 3.5.11 + kolorist: 1.8.0 + magic-string: 0.30.11 + vite: 5.4.8(@types/node@20.16.11) + transitivePeerDependencies: + - supports-color + vite@4.5.5(@types/node@20.16.11): dependencies: esbuild: 0.18.20 @@ -8770,6 +9251,41 @@ snapshots: - supports-color - terser + vitest@2.1.2(@types/node@20.16.11)(jsdom@25.0.1): + dependencies: + '@vitest/expect': 2.1.2 + '@vitest/mocker': 2.1.2(@vitest/spy@2.1.2)(vite@5.4.8(@types/node@20.16.11)) + '@vitest/pretty-format': 2.1.2 + '@vitest/runner': 2.1.2 + '@vitest/snapshot': 2.1.2 + '@vitest/spy': 2.1.2 + '@vitest/utils': 2.1.2 + chai: 5.1.1 + debug: 4.3.7(supports-color@8.1.1) + magic-string: 0.30.11 + pathe: 1.1.2 + std-env: 3.7.0 + tinybench: 2.9.0 + tinyexec: 0.3.0 + tinypool: 1.0.1 + tinyrainbow: 1.2.0 + vite: 5.4.8(@types/node@20.16.11) + vite-node: 2.1.2(@types/node@20.16.11) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.16.11 + jsdom: 25.0.1 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@2.1.2(@types/node@22.7.5)(jsdom@25.0.1): dependencies: '@vitest/expect': 2.1.2 @@ -8780,7 +9296,7 @@ snapshots: '@vitest/spy': 2.1.2 '@vitest/utils': 2.1.2 chai: 5.1.1 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 magic-string: 0.30.11 pathe: 1.1.2 std-env: 3.7.0 @@ -8809,9 +9325,13 @@ snapshots: vue-component-type-helpers@2.1.6: {} + vue-demi@0.14.10(vue@3.5.11(typescript@5.5.4)): + dependencies: + vue: 3.5.11(typescript@5.5.4) + vue-eslint-parser@9.4.3(eslint@9.12.0): dependencies: - debug: 4.3.7(supports-color@8.1.1) + debug: 4.3.7 eslint: 9.12.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 @@ -8822,6 +9342,11 @@ snapshots: transitivePeerDependencies: - supports-color + vue-router@4.4.5(vue@3.5.11(typescript@5.5.4)): + dependencies: + '@vue/devtools-api': 6.6.4 + vue: 3.5.11(typescript@5.5.4) + vue-tsc@2.1.6(typescript@5.5.4): dependencies: '@volar/typescript': 2.4.6 diff --git a/src/index.ts b/src/index.ts index 7a0748f..812037d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,50 +1,124 @@ +import fs from 'node:fs' +import process from 'node:process' + import * as tseslint from 'typescript-eslint' -import * as tseslintParser from '@typescript-eslint/parser' +import vueParser from 'vue-eslint-parser' import pluginVue from 'eslint-plugin-vue' +import fg from 'fast-glob' + type ExtendableConfigName = keyof typeof tseslint.configs type ScriptLang = 'ts' | 'tsx' | 'js' | 'jsx' type ConfigOptions = { extends?: Array supportedScriptLangs?: Record + rootDir?: string } type ConfigArray = ReturnType +// https://typescript-eslint.io/troubleshooting/typed-linting/performance#changes-to-extrafileextensions-with-projectservice +const extraFileExtensions = ['.vue'] + export default function createConfig({ extends: configNamesToExtend = ['recommended'], supportedScriptLangs = { ts: true, tsx: false, js: false, jsx: false }, + rootDir = process.cwd(), }: ConfigOptions = {}): ConfigArray { + // Only `.vue` files with `