Skip to content

Commit

Permalink
chore: merge remote-tracking branch 'upstream/main' into allow-disabl…
Browse files Browse the repository at this point in the history
…ing-ws-completely
  • Loading branch information
danielroe committed Apr 1, 2021
2 parents 03571b2 + fa85749 commit 3750d6f
Show file tree
Hide file tree
Showing 208 changed files with 3,514 additions and 1,246 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ defaults: &defaults
step_restore_cache: &restore_cache
restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}-1
- v1-dependencies-
- v1-dependencies-{{ checksum "yarn.lock" }}-1
- v1-dependencies-

step_install_deps: &install_deps
run:
Expand Down
23 changes: 16 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
// @ts-check
const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
root: true,
extends: ['plugin:node/recommended'],
parser: '@typescript-eslint/parser',
Expand All @@ -11,16 +14,16 @@ module.exports = {
'node/no-missing-import': [
'error',
{
allowModules: ['types', 'estree', 'testUtils'],
tryExtensions: ['.ts', '.js', '.jsx', '.tsx']
allowModules: ['types', 'estree', 'testUtils', 'stylus'],
tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts']
}
],
'node/no-missing-require': [
'error',
{
// for try-catching yarn pnp
allowModules: ['pnpapi'],
tryExtensions: ['.ts', '.js', '.jsx', '.tsx']
tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts']
}
],
'node/no-restricted-require': [
Expand All @@ -31,7 +34,7 @@ module.exports = {
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 dep, use (await import('dep')).default instead.`
`lazy load a dependency, use (await import('dependency')).default instead.`
})
)
],
Expand All @@ -51,7 +54,13 @@ module.exports = {
'node/no-unpublished-import': 'off',
'node/no-unpublished-require': 'off',
'node/no-unsupported-features/es-syntax': 'off',
'no-process-exit': 'off'
'no-process-exit': 'off',
'prefer-const': [
'warn',
{
destructuring: 'all'
}
]
},
overrides: [
{
Expand All @@ -74,4 +83,4 @@ module.exports = {
}
}
]
}
})
64 changes: 44 additions & 20 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,63 @@
---
name: Bug report
about: Create a report to help us improve
name: "\U0001F41E Bug report"
about: Report an issue with Vite
title: ''
labels: 'bug: pending triage'
assignees: ''
---

<!-- 中文用户请注意:请仔细阅读以下模版,如果不遵循模版,issue 将会被直接关闭。 -->
<!--
中文用户请注意:请仔细阅读以下模版,如果不遵循模版,issue 将会被直接关闭。
!!! IMPORTANT !!!
Please do not ignore this template. If you do, your issue will be closed immediately.
-->

**⚠️ IMPORTANT ⚠️ Please do not ignore this template. If you do, your issue will be closed immediately.**
### Describe the bug

- [ ] Read [the docs](https://vitejs.dev/guide/).
- [ ] 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/vue-next instead.
- [ ] 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/).
<!-- 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! -->

### Reproduction

<!--
Please provide a link to a repo that can reproduce the problem you ran into.
## Describe the bug
A reproduction is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. 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.
-->

A clear and concise description of what the bug is.
### System Info

## Reproduction
Output of `npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers`:

Please provide a link to a repo that can reproduce the problem you ran into.
```node

A reproduction is **required** unless you are absolutely sure that the the problem is obvious and the information you provided is enough for us to understand what the problem is. If a report has only vague description (e.g. just a generic error message) and has no reproduction, it will receive "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
```

## System Info
Used package manager: <!-- npm | yarn | pnpm -->

- `vite` version:
- Operating System:
- Node version:
- Package manager (npm/yarn/pnpm) and version:
### Logs <!-- (Optional if provided reproduction) -->

## Logs (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.
1. Run `vite` or `vite build` with the `--debug` flag.
2. Provide the error log here.
`node` is used as highlight to improve some colors in stack-traces.
If it doesn't work quite well, try `console`.
-->

```node

```

---

### Before submitting the issue, please make sure you do the following

- [ ] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md).
- [ ] Read the [docs](https://vitejs.dev/guide).
- [ ] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [ ] Provide a description in this issue that describes the bug.
- [ ] 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/vue-next instead.
- [ ] 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/).
29 changes: 17 additions & 12 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
name: "\U0001F680 New feature proposal"
about: Propose a new feature to be added to Vite
title: ''
labels: ''
labels: 'enhancement: pending triage'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Clear and concise description of the problem

<!-- 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! -->

### Suggested solution

<!-- In module [xy] we could provide following implementation... -->

### Alternative

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
<!-- Clear and concise description of any alternative solutions or features you've considered. -->

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
### Additional context

**Additional context**
Add any other context or screenshots about the feature request here.
<!-- Any other context or screenshots about the feature request here. -->
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Thank you for contributing! -->

### Description

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->

### Additional context

<!-- e.g. is there anything you'd like reviewers to focus on? -->

---

### What is the purpose of this pull request? <!-- (put an "X" next to an item) -->

- [ ] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other

### Before submitting the PR, please make sure you do the following

- [ ] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md).
- [ ] Read the [Pull Request Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md#pull-request-guidelines) and follow the [Commit Convention](https://github.com/vitejs/vite/blob/main/.github/commit-convention.md).
- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
11 changes: 6 additions & 5 deletions .github/commit-convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

Messages must be matched by the following regex:

``` js
<!-- prettier-ignore -->
```js
/^(revert: )?(feat|fix|docs|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/
```

Expand Down Expand Up @@ -44,7 +45,7 @@ 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**:
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:

```
<type>(<scope>): <subject>
Expand Down Expand Up @@ -74,9 +75,9 @@ The scope could be anything specifying the place of the commit change. For examp

The subject contains a succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize the first letter
* no dot (.) at the end
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end

### Body

Expand Down
16 changes: 13 additions & 3 deletions .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ To development and test the core `vite` package:

2. Run `yarn link` in `packages/vite`. This links `vite` globally so that you can:

- Run `yarn link vite` in another Vite project to use the locally built Vite;
- Use the `vite` binary anywhere.
- Run `yarn link vite` in another Vite project to use the locally built Vite;
- Use the `vite` binary anywhere.

## Running Tests

Expand Down Expand Up @@ -54,7 +54,7 @@ Some common test helpers, e.g. `testDir`, `isBuild` or `editFile` are available

- If fixing bug:

- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.
- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
- Provide a detailed description of the bug in the PR. Live demo preferred.
- Add appropriate test coverage if applicable. You can check the coverage of your code addition by running `yarn test --coverage`.

Expand All @@ -70,6 +70,16 @@ Some common test helpers, e.g. `testDir`, `isBuild` or `editFile` are available

> The following section is mostly for maintainers who have commit access, but it's helpful to go through if you intend to make non-trivial contributions to the codebase.
### Issue Triaging Workflow

![issue-workflow](./issue-workflow.png)

### Pull Request Review Workflow

![issue-workflow](./pr-workflow.png)

## Notes on Dependencies

Vite aims to be lightweight, and this includes being aware of the number of npm dependencies and their size.

We use rollup to pre-bundle most dependencies before publishing! Therefore most dependencies, even used in src code, should be added under `devDependencies` by default. This also creates a number of constraints that we need to be aware of in the codebase:
Expand Down
Binary file added .github/issue-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/pr-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/issue-close-require.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Issue Close Require

on:
schedule:
- cron: "0 0 * * *"
- cron: '0 0 * * *'

jobs:
close-issues:
Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
docs/.vitepress/dist/
packages/vite/dist/
packages/plugin-vue/dist/
packages/*/CHANGELOG.md
LICENSE.md
.prettierrc
45 changes: 45 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Code Of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, political party, or sexual identity and orientation. Note, however, that religion, political party, or other ideological affiliation provide no exemptions for the behavior we outline as unacceptable in this Code of Conduct.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team by DM at [Vite Land](chat.vitejs.dev). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
21 changes: 21 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ module.exports = {
'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md'
}
]
},
{
text: 'Languages',
items: [
{
text: 'English',
link: 'https://vitejs.dev'
},
{
text: '简体中文',
link: 'https://cn.vitejs.dev'
}
]
}
],

Expand All @@ -81,6 +94,10 @@ module.exports = {
text: 'Features',
link: '/guide/features'
},
{
text: 'Using Plugins',
link: '/guide/using-plugins'
},
{
text: 'Dependency Pre-Bundling',
link: '/guide/dep-pre-bundling'
Expand All @@ -93,6 +110,10 @@ module.exports = {
text: 'Building for Production',
link: '/guide/build'
},
{
text: 'Deploying a Static Site',
link: '/guide/static-deploy'
},
{
text: 'Env Variables and Modes',
link: '/guide/env-and-mode'
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/sponsors.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
color: #999;
font-size: 1.2rem;
border: none;
}
}
Loading

0 comments on commit 3750d6f

Please sign in to comment.