Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: format with prettier #2768

Merged
merged 4 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
4 changes: 2 additions & 2 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
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
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

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
[homepage]: https://www.contributor-covenant.org
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;
}
}
2 changes: 1 addition & 1 deletion docs/guide/api-hmr.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ For now, calling `import.meta.hot.invalidate()` simply reloads the page.

## `hot.on(event, cb)`

Listen to a custom HMR event. Custom HMR events can be sent from plugins. See [handleHotUpdate](./api-plugin#handlehotupdate) for more details.
Listen to a custom HMR event. Custom HMR events can be sent from plugins. See [handleHotUpdate](./api-plugin#handlehotupdate) for more details.
2 changes: 1 addition & 1 deletion docs/guide/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import shaderString from './shader.glsl?raw'

### Importing Script as a Worker

Scripts can be imported as web workers with the `?worker` suffix.
Scripts can be imported as web workers with the `?worker` suffix.

```js
// Separate chunk in the production build
Expand Down
5 changes: 2 additions & 3 deletions docs/guide/backend-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Or you can follow these steps to configure it manually:

```html
<script type="module">
import RefreshRuntime from "http://localhost:3000/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window)
import RefreshRuntime from 'http://localhost:3000/@react-refresh'
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
Expand Down Expand Up @@ -85,4 +85,3 @@ Or you can follow these steps to configure it manually:
<link rel="stylesheet" href="/assets/{{ manifest['main.js'].css }}" />
<script type="module" src="/assets/{{ manifest['main.js'].file }}"></script>
```

198 changes: 99 additions & 99 deletions docs/guide/static-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,33 @@ Now the `preview` method will launch the server at http://localhost:8080.

2. Inside your project, create `deploy.sh` with the following content (with highlighted lines uncommented appropriately), and run it to deploy:

```bash{13,20,23}
#!/usr/bin/env sh
```bash{13,20,23}
#!/usr/bin/env sh

# abort on errors
set -e
# abort on errors
set -e

# build
npm run build
# build
npm run build

# navigate into the build output directory
cd dist
# navigate into the build output directory
cd dist

# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy'
git init
git add -A
git commit -m 'deploy'

# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master

# if you are deploying to https://<USERNAME>.github.io/<REPO>
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
# if you are deploying to https://<USERNAME>.github.io/<REPO>
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages

cd -
```
cd -
```

::: tip
You can also run the above script in your CI setup to enable automatic deployment on each push.
Expand All @@ -110,60 +110,60 @@ You can also run the above script in your CI setup to enable automatic deploymen

4. Use the GitHub Pages deploy provider template, and follow the [Travis CI documentation](https://docs.travis-ci.com/user/deployment/pages/).

```yaml
language: node_js
node_js:
- lts/*
install:
- npm ci
script:
- npm run build
deploy:
provider: pages
skip_cleanup: true
local_dir: dist
# A token generated on GitHub allowing Travis to push code on you repository.
# Set in the Travis settings page of your repository, as a secure variable.
github_token: $GITHUB_TOKEN
keep_history: true
on:
branch: master
```
```yaml
language: node_js
node_js:
- lts/*
install:
- npm ci
script:
- npm run build
deploy:
provider: pages
skip_cleanup: true
local_dir: dist
# A token generated on GitHub allowing Travis to push code on you repository.
# Set in the Travis settings page of your repository, as a secure variable.
github_token: $GITHUB_TOKEN
keep_history: true
on:
branch: master
```

## GitLab Pages and GitLab CI

1. Set the correct `base` in `vite.config.js`.

If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/`, you can omit `base` as it defaults to `'/'`.
If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/`, you can omit `base` as it defaults to `'/'`.

If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/<REPO>/`, for example your repository is at `https://gitlab.com/<USERNAME>/<REPO>`, then set `base` to `'/<REPO>/'`.
If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/<REPO>/`, for example your repository is at `https://gitlab.com/<USERNAME>/<REPO>`, then set `base` to `'/<REPO>/'`.

2. Set `build.outDir` in `vite.config.js` to `public`.

3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content:

```yaml
image: node:10.22.0
pages:
cache:
paths:
- node_modules/
script:
- npm install
- npm run build
artifacts:
paths:
- public
only:
- master
```
```yaml
image: node:10.22.0
pages:
cache:
paths:
- node_modules/
script:
- npm install
- npm run build
artifacts:
paths:
- public
only:
- master
```

## Netlify

1. On [Netlify](https://netlify.com), setup up a new project from GitHub with the following settings:

- **Build Command:** `vite build` or `npm run build`
- **Publish directory:** `dist`
- **Build Command:** `vite build` or `npm run build`
- **Publish directory:** `dist`

2. Hit the deploy button.

Expand All @@ -173,26 +173,26 @@ pages:

2. Create `firebase.json` and `.firebaserc` at the root of your project with the following content:

`firebase.json`:
`firebase.json`:

```json
{
"hosting": {
"public": "dist",
"ignore": []
}
}
```
```json
{
"hosting": {
"public": "dist",
"ignore": []
}
}
```

`.firebaserc`:
`.firebaserc`:

```js
{
"projects": {
"default": "<YOUR_FIREBASE_ID>"
```js
{
"projects": {
"default": "<YOUR_FIREBASE_ID>"
}
}
}
```
```

3. After running `npm run build`, deploy using the command `firebase deploy`.

Expand All @@ -214,46 +214,46 @@ You can also deploy to a [custom domain](http://surge.sh/help/adding-a-custom-do

3. Run `heroku login` and fill in your Heroku credentials:

```bash
$ heroku login
```
```bash
$ heroku login
```

4. Create a file called `static.json` in the root of your project with the below content:

`static.json`:
`static.json`:

```json
{
"root": "./dist"
}
```
```json
{
"root": "./dist"
}
```

This is the configuration of your site; read more at [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static).
This is the configuration of your site; read more at [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static).

5. Set up your Heroku git remote:

```bash
# version change
$ git init
$ git add .
$ git commit -m "My site ready for deployment."
```bash
# version change
$ git init
$ git add .
$ git commit -m "My site ready for deployment."

# creates a new app with a specified name
$ heroku apps:create example
# creates a new app with a specified name
$ heroku apps:create example

# set buildpack for static sites
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git
```
# set buildpack for static sites
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git
```

6. Deploy your site:

```bash
# publish site
$ git push heroku master
```bash
# publish site
$ git push heroku master

# opens a browser to view the Dashboard version of Heroku CI
$ heroku open
```
# opens a browser to view the Dashboard version of Heroku CI
$ heroku open
```

## Vercel

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Check out [awesome-vite](https://github.com/vitejs/awesome-vite) - you can also

## Rollup Plugins

[Vite plugins](../guide/api-plugin) are an extension of Rollup's plugin interface. Check out the [Rollup Plugin Compatibility section](../guide/api-plugin#rollup-plugin-compatibility) for more information.
[Vite plugins](../guide/api-plugin) are an extension of Rollup's plugin interface. Check out the [Rollup Plugin Compatibility section](../guide/api-plugin#rollup-plugin-compatibility) for more information.
2 changes: 1 addition & 1 deletion packages/create-app/template-lit-element-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"vite": "^2.1.3",
"typescript": "^4.1.3"
}
}
}
Loading