diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 48a0bd7773b0d7..00000000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,137 +0,0 @@ -// @ts-check -const { defineConfig } = require('eslint-define-config') - -module.exports = defineConfig({ - root: true, - extends: [ - 'eslint:recommended', - 'plugin:node/recommended', - 'plugin:@typescript-eslint/recommended' - ], - parser: '@typescript-eslint/parser', - parserOptions: { - sourceType: 'module', - ecmaVersion: 2021 - }, - rules: { - eqeqeq: ['warn', 'always', { null: 'never' }], - 'no-debugger': ['error'], - 'no-empty': ['warn', { allowEmptyCatch: true }], - 'no-process-exit': 'off', - 'no-useless-escape': 'off', - 'prefer-const': [ - 'warn', - { - destructuring: 'all' - } - ], - - 'node/no-missing-import': [ - 'error', - { - allowModules: [ - 'types', - 'estree', - 'testUtils', - 'less', - 'sass', - 'stylus' - ], - tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'] - } - ], - 'node/no-missing-require': [ - 'error', - { - // for try-catching yarn pnp - allowModules: ['pnpapi', 'vite'], - tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'] - } - ], - 'node/no-restricted-require': [ - 'error', - Object.keys(require('./packages/vite/package.json').devDependencies).map( - (d) => ({ - name: d, - message: - `devDependencies can only be imported using ESM syntax so ` + - `that they are included in the rollup bundle. If you are trying to ` + - `lazy load a dependency, use (await import('dependency')).default instead.` - }) - ) - ], - 'node/no-extraneous-import': [ - 'error', - { - allowModules: ['vite', 'less', 'sass'] - } - ], - 'node/no-extraneous-require': [ - 'error', - { - allowModules: ['vite'] - } - ], - 'node/no-deprecated-api': 'off', - 'node/no-unpublished-import': 'off', - 'node/no-unpublished-require': 'off', - 'node/no-unsupported-features/es-syntax': 'off', - - '@typescript-eslint/ban-ts-comment': 'off', // TODO: we should turn this on in a new PR - '@typescript-eslint/ban-types': 'off', // TODO: we should turn this on in a new PR - '@typescript-eslint/no-empty-function': [ - 'error', - { allow: ['arrowFunctions'] } - ], - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-explicit-any': 'off', // maybe we should turn this on in a new PR - '@typescript-eslint/no-extra-semi': 'off', // conflicts with prettier - '@typescript-eslint/no-inferrable-types': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', // maybe we should turn this on in a new PR - '@typescript-eslint/no-unused-vars': 'off', // maybe we should turn this on in a new PR - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/consistent-type-imports': [ - 'error', - { prefer: 'type-imports' } - ] - }, - overrides: [ - { - files: ['packages/vite/src/node/**'], - rules: { - 'no-console': ['error'] - } - }, - { - files: ['packages/vite/types/**'], - rules: { - 'node/no-extraneous-import': 'off' - } - }, - { - files: ['packages/playground/**'], - rules: { - 'node/no-extraneous-import': 'off', - 'node/no-extraneous-require': 'off' - } - }, - { - files: ['packages/create-vite/template-*/**'], - rules: { - 'node/no-missing-import': 'off' - } - }, - { - files: ['*.js'], - rules: { - '@typescript-eslint/explicit-module-boundary-types': 'off' - } - }, - { - files: ['*.d.ts'], - rules: { - '@typescript-eslint/triple-slash-reference': 'off' - } - } - ] -}) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000000000..a4c31afed65932 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,4 @@ +# chore: enable prettier trailing commas (#11167) +134ce6817984bad0f5fb043481502531fee9b1db +# chore: rename test packages (#11172) +5170e44920458090b8b43ee9cfe5010c25dfe22b diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 301b795e15fb5e..4e09ca1dd13b0e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,7 @@ name: "\U0001F41E Bug report" description: Report an issue with Vite labels: [pending triage] +type: Bug body: - type: markdown attributes: @@ -11,22 +12,28 @@ body: attributes: label: Describe the bug description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks! - placeholder: Bug description + placeholder: I am doing ... What I expect is ... What actually happening is ... validations: required: true - type: input id: reproduction attributes: label: Reproduction - description: Please provide a link via [vite.new](https://vite.new/) or a link to a repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed. - placeholder: Reproduction + description: Please provide a link via [vite.new](https://vite.new/) or a link to a repo that can reproduce the problem you ran into. `npm create vite@latest` and `npm create vite-extra@latest` (for SSR or library repros) can be used as a starter template. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required ([Why?](https://antfu.me/posts/why-reproductions-are-required)). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "needs reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed. + placeholder: Reproduction URL validations: required: true + - type: textarea + id: reproduction-steps + attributes: + label: Steps to reproduce + description: Please provide any reproduction steps that may need to be described. E.g. if it happens only when running the dev or build script make sure it's clear which one to use. + placeholder: Run `npm install` followed by `npm run dev` - type: textarea id: system-info attributes: label: System Info - description: Output of `npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers` + description: Output of `npx envinfo --system --npmPackages '{vite,@vitejs/*,rollup}' --binaries --browsers` render: shell placeholder: System, Binaries, Browsers validations: @@ -40,6 +47,7 @@ body: - npm - yarn - pnpm + - bun validations: required: true - type: textarea @@ -50,8 +58,17 @@ body: Optional if provided reproduction. Please try not to insert an image but copy paste the log text. 1. Run `vite` or `vite build` with the `--debug` flag. - 2. Provide the error log here. - render: shell + 2. Provide the error log here in the format below. + + ```` +
+ Click to expand! + + ```shell + // paste the log text here + ``` +
+ ```` - type: checkboxes id: checkboxes attributes: @@ -62,13 +79,13 @@ body: required: true - label: Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md). required: true - - label: Read the [docs](https://vitejs.dev/guide). + - label: Read the [docs](https://vite.dev/guide). required: true - label: Check that there isn't [already an issue](https://github.com/vitejs/vite/issues) that reports the same bug to avoid creating a duplicate. required: true - - label: Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead. + - label: Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to [vuejs/core](https://github.com/vuejs/core) instead. required: true - - label: Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/). + - label: Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vite.dev/). required: true - label: The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug. required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index c504c325f08040..e36d5d53edcd7f 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,13 @@ blank_issues_enabled: false contact_links: + - name: Vite Plugin React Issues + url: https://github.com/vitejs/vite-plugin-react/issues/new/choose + about: React related issues should be reported on the vite-plugin-react repository. + - name: Vite Plugin Vue Issues + url: https://github.com/vitejs/vite-plugin-vue/issues/new/choose + about: Vue related issues should be reported on the vite-plugin-vue repository. - name: Discord Chat - url: https://chat.vitejs.dev + url: https://chat.vite.dev about: Ask questions and discuss with other Vite users in real time. - name: Questions & Discussions url: https://github.com/vitejs/vite/discussions diff --git a/.github/ISSUE_TEMPLATE/docs.yml b/.github/ISSUE_TEMPLATE/docs.yml new file mode 100644 index 00000000000000..ef629b96596663 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/docs.yml @@ -0,0 +1,43 @@ +name: "\U0001F4DA Documentation" +description: Suggest a change or new page to be added to vite.dev +labels: [documentation] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this issue! + - type: checkboxes + id: documentation_is + attributes: + label: Documentation is + options: + - label: Missing + - label: Outdated + - label: Confusing + - label: Not sure? + - type: textarea + id: description + attributes: + label: Explain in Detail + description: A clear and concise description of your suggestion. If you intend to submit a PR for this issue, tell us in the description. Thanks! + placeholder: The description of ... page is not clear. I thought it meant ... but it wasn't. + validations: + required: true + - type: textarea + id: suggestion + attributes: + label: Your Suggestion for Changes + validations: + required: true + - type: input + id: reproduction + attributes: + label: Reproduction + description: If you have a reproduction, please provide a link via [vite.new](https://vite.new/) or a link to a repo that can reproduce the problem you ran into. `npm create vite@latest` and `npm create vite-extra@latest` (for SSR or library repros) can be used as a starter template. + placeholder: Reproduction URL + - type: textarea + id: reproduction-steps + attributes: + label: Steps to reproduce + description: Please provide any reproduction steps that may need to be described. E.g. if it happens only when running the dev or build script make sure it's clear which one to use. + placeholder: Run `npm install` followed by `npm run dev` diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index f35a724afcd42b..0563374253b6f3 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,6 +1,7 @@ name: "\U0001F680 New feature proposal" description: Propose a new feature to be added to Vite -labels: ["enhancement: pending triage"] +labels: ["pending triage"] +type: Feature body: - type: markdown attributes: @@ -9,8 +10,9 @@ body: - type: textarea id: feature-description attributes: - label: Clear and concise description of the problem - description: "As a developer using Vite I want [goal / wish] so that [benefit]. If you intend to submit a PR for this issue, tell us in the description. Thanks!" + label: Description + description: "Clear and concise description of the problem. Please make the reason and usecases as detailed as possible. If you intend to submit a PR for this issue, tell us in the description. Thanks!" + placeholder: As a developer using Vite I want [goal / wish] so that [benefit]. validations: required: true - type: textarea @@ -40,7 +42,7 @@ body: required: true - label: Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md). required: true - - label: Read the [docs](https://vitejs.dev/guide). + - label: Read the [docs](https://vite.dev/guide). required: true - label: Check that there isn't already an issue that request the same feature to avoid creating a duplicate. required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 946e6aa9bedb9f..2734afc421a080 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,26 +1,14 @@ - - ### Description - - -### Additional context - - - ---- - -### What is the purpose of this pull request? + -- [ ] Bug fix -- [ ] New Feature -- [ ] Documentation update -- [ ] Other + diff --git a/.github/commit-convention.md b/.github/commit-convention.md index baa447479e9c39..4971cff4547fce 100644 --- a/.github/commit-convention.md +++ b/.github/commit-convention.md @@ -8,64 +8,21 @@ Messages must be matched by the following regex: ```js -/^(revert: )?(feat|fix|docs|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/ +/^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\(.+\))?!?: .{1,50}/ ``` #### Examples -Appears under "Features" header, `dev` subheader: - ``` feat(dev): add 'comments' option -``` - -Appears under "Bug Fixes" header, `dev` subheader, with a link to issue #28: - -``` fix(dev): fix dev error - -close #28 -``` - -Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: - -``` -perf(build): remove 'foo' option - -BREAKING CHANGE: The 'foo' option has been removed. -``` - -The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. - -``` +perf(build)!: remove 'foo' option revert: feat(compiler): add 'comments' option - -This reverts commit 667ecc1654a317a13331b17617d973392f415f02. -``` - -### Full Message Format - -A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: - -``` -(): - - - -