Skip to content

Commit

Permalink
Merge branch 'main' into bug/4501-waitForSuccessfulPing
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Dec 30, 2021
2 parents a53974f + 8bdb184 commit ad027a5
Show file tree
Hide file tree
Showing 308 changed files with 10,298 additions and 4,949 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js → .eslintrc.cjs
Expand Up @@ -89,7 +89,11 @@ module.exports = defineConfig({
'@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/no-var-requires': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' }
]
},
overrides: [
{
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Expand Up @@ -14,11 +14,11 @@ body:
placeholder: Bug description
validations:
required: true
- type: textarea
- type: input
id: reproduction
attributes:
label: Reproduction
description: Please provide 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 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.
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
validations:
required: true
Expand Down
16 changes: 8 additions & 8 deletions .github/renovate.json5
Expand Up @@ -24,14 +24,14 @@
"typescript",

// breaking changes
"source-map",
"react-refresh",
"cac", // `cac:v6.7.10+` has breaking changes
"react-router", // `react-router:v6.0.0+` has breaking changes
"react-router-dom", // `react-router-dom:v6.0.0+` has breaking changes
"source-map", // `source-map:v0.7.0+` needs more investigation

// breaks since "3.0.1", needs futher investigate
"postcss-load-config",

// ESM Only
"strip-ansi",
"periscopic"
// ESM Only => https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm
"node-fetch",
"periscopic",
"strip-ansi"
]
}
27 changes: 17 additions & 10 deletions .github/workflows/ci.yml
Expand Up @@ -14,18 +14,22 @@ on:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [12, 14, 16]
node_version: [12, 14, 16, 17]
include:
- os: macos-latest
node_version: 14
node_version: 16
- os: windows-latest
node_version: 14
node_version: 16
fail-fast: false

name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
Expand All @@ -34,9 +38,9 @@ jobs:
uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: 6.15.1
version: 6

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v2
Expand Down Expand Up @@ -64,21 +68,21 @@ jobs:

lint:
runs-on: ubuntu-latest
name: "Lint: node-14, ubuntu-latest"
name: "Lint: node-16, ubuntu-latest"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: 6.15.1
version: 6

- name: Set node version to 14
- name: Set node version to 16
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
cache: "pnpm"

- name: Install deps
Expand All @@ -91,3 +95,6 @@ jobs:
- name: Lint
run: pnpm run lint

- name: Check formatting
run: pnpm prettier --check .
2 changes: 1 addition & 1 deletion .github/workflows/issue-close-require.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: need reproduction
uses: actions-cool/issues-helper@v2.4.3
uses: actions-cool/issues-helper@v2
with:
actions: "close-issues"
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-labeled.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: contribution welcome
if: github.event.label.name == 'contribution welcome' || github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v2.4.3
uses: actions-cool/issues-helper@v2
with:
actions: "create-comment, remove-labels"
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -21,7 +21,7 @@ jobs:

- name: remove pending
if: github.event.label.name == 'enhancement' || github.event.label.name == 'bug' || (contains(github.event.label.name, 'pending triage') == false && startsWith(github.event.label.name, 'bug:') == true)
uses: actions-cool/issues-helper@v2.4.3
uses: actions-cool/issues-helper@v2
with:
actions: "remove-labels"
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -30,7 +30,7 @@ jobs:

- name: need reproduction
if: github.event.label.name == 'need reproduction'
uses: actions-cool/issues-helper@v2.4.3
uses: actions-cool/issues-helper@v2
with:
actions: "create-comment, remove-labels"
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release-tag.yml
@@ -0,0 +1,40 @@
name: release

on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
- "plugin-*" # Push events to matching plugin-*, i.e. plugin-(vue|vue-jsx|react|legacy)@1.0.0
- "create-vite*" # # Push events to matching create-vite*, i.e. create-vite@1.0.0

# $GITHUB_REF_NAME - https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get pkgName for tag
id: tag
run: |
# matching v2.0.0 / v2.0.0-beta.8 etc
if [[ $GITHUB_REF_NAME =~ ^v.+ ]]; then
pkgName="vite"
else
# `%@*` truncates @ and version number from the right side.
# https://stackoverflow.com/questions/9532654/expression-after-last-specific-character
pkgName=${GITHUB_REF_NAME%@*}
fi
echo "::set-output name=pkgName::$pkgName"
- name: Create Release for Tag
id: release_tag
uses: yyx990803/release-tag@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
body: |
Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/${{ github.ref_name }}/packages/${{ steps.tag.outputs.pkgName }}/CHANGELOG.md) for details.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -10,4 +10,4 @@ explorations
*.local
/packages/vite/LICENSE
*.cpuprofile
/.vscode/
/.vscode/
1 change: 1 addition & 0 deletions .prettierignore
Expand Up @@ -9,3 +9,4 @@ LICENSE.md
pnpm-lock.yaml
pnpm-workspace.yaml
packages/playground/tsconfig-json-load-error/has-error/tsconfig.json
packages/playground/html/invalid.html
38 changes: 21 additions & 17 deletions CONTRIBUTING.md
Expand Up @@ -6,28 +6,32 @@ Hi! We are really excited that you are interested in contributing to Vite. Befor

The Vite repo is a monorepo using pnpm workspaces. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/).

To development and test the core `vite` package:
To develop and test the core `vite` package:

1. Go to `packages/vite` and run `pnpm run dev`. This starts `rollup` in watch mode.
1. Run `pnpm i` in Vite's root folder

2. Run `pnpm link` in `packages/vite`. This links `vite` globally so that you can:
2. Go to `packages/vite` and run `pnpm run dev`. This starts `rollup` in watch mode.

- Run `pnpm link vite` in another Vite project to use the locally built Vite;
- Use the `vite` binary anywhere.
You can alternatively use [Vite.js Docker Dev](https://github.com/nystudio107/vitejs-docker-dev) for a containerized Docker setup for Vite.js development.

If your project has `vite` as a nested dependency, you can customize the dependency resolution instead depending on the package manager used. For pnpm, add this in your project's root `package.json`:
## Testing Vite against external packages

```json
{
"pnpm": {
"overrides": {
"vite": "link:../path/to/vite/packages/vite"
}
}
}
```
You may wish to test your locally-modified copy of Vite against another package that is built with Vite. For pnpm, after building Vite, you can use [`pnpm.overrides`](https://pnpm.io/package_json#pnpmoverrides). Please note that `pnpm.overrides` must be specified in the root `package.json` and you must first list the package as a dependency in the root `package.json`:

And re-run `pnpm install` to link the package.
```json
{
"dependencies": {
"vite": "^2.0.0"
},
"pnpm": {
"overrides": {
"vite": "link:../path/to/vite/packages/vite"
}
}
}
```

And re-run `pnpm install` to link the package.

## Running Tests

Expand Down Expand Up @@ -98,7 +102,7 @@ To work around this, playground packages that uses the `file:` protocol should a
```jsonc
"scripts": {
//...
"postinstall": "node ../../../scripts/patchFileDeps"
"postinstall": "ts-node ../../../scripts/patchFileDeps.ts"
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/index.js
Expand Up @@ -9,7 +9,7 @@ export default {
Layout() {
return h(Theme.Layout, null, {
'sidebar-bottom': () =>
h('div', { class: 'sponsors' }, [
h('div', { class: 'sponsors sidebar' }, [
h(
'a',
{
Expand Down
30 changes: 25 additions & 5 deletions docs/.vitepress/theme/sponsors.css
Expand Up @@ -5,13 +5,13 @@

.sponsors a {
color: #999;
margin: 1em;
display: block;
}

.sponsors img {
max-width: 200px;
height: 40px;
display: block;
margin: 1.25rem 0;
max-width: 160px;
max-height: 40px;
}

.sponsors.frontpage {
Expand All @@ -21,7 +21,6 @@
.sponsors.frontpage img {
display: inline-block;
vertical-align: middle;
margin: 0 1rem 1.25rem 1rem;
}

.sponsors.frontpage h2 {
Expand All @@ -30,7 +29,28 @@
border: none;
}

.sponsors.sidebar a img {
max-height: 36px;
}

.platinum-sponsors {
margin-bottom: 1.5em;
}

.platinum-sponsors a img {
max-width: 240px;
max-height: 60px;
}

.gold-sponsors {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
align-items: center;
}

/* special cases */
#sponsor-mux {
padding: 5px 0;
min-height: 36px;
}
19 changes: 19 additions & 0 deletions docs/.vitepress/theme/sponsors.json
@@ -1,4 +1,11 @@
[
{
"id": "stackblitz",
"name": "StackBlitz",
"href": "https://stackblitz.com/",
"src": "/stackblitz.svg",
"tier": "platinum"
},
{
"id": "tailwind",
"name": "Tailwind Labs",
Expand All @@ -22,5 +29,17 @@
"name": "Plaid Inc.",
"href": "https://plaid.co.jp/",
"src": "/plaid.svg"
},
{
"id": "divriots",
"name": "divriots",
"href": "https://divriots.com/",
"src": "/divriots.png"
},
{
"id": "finclip",
"name": "FinClip",
"href": "https://finclip.com/?from=vite",
"src": "/finclip.png"
}
]

0 comments on commit ad027a5

Please sign in to comment.