Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Jun 26, 2022
2 parents 549036e + 3f689a4 commit 34d53fe
Show file tree
Hide file tree
Showing 62 changed files with 1,065 additions and 903 deletions.
Binary file added .github/issue-workflow-dark.png
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-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -180,11 +180,17 @@ You can set the `DEBUG` environment variable to turn on debugging logs. E.g. `DE
### Issue Triaging Workflow

![issue-workflow](./.github/issue-workflow.png)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./.github/issue-workflow-dark.png">
<img src="./.github/issue-workflow.png">
</picture>

### Pull Request Review Workflow

![issue-workflow](./.github/pr-workflow.png)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./.github/pr-workflow-dark.png">
<img src="./.github/pr-workflow.png">
</picture>

## Notes on Dependencies

Expand Down
3 changes: 2 additions & 1 deletion docs/.vitepress/config.ts
Expand Up @@ -57,7 +57,8 @@ export default defineConfig({
text: 'English',
items: [
{ text: '简体中文', link: 'https://cn.vitejs.dev' },
{ text: '日本語', link: 'https://ja.vitejs.dev' }
{ text: '日本語', link: 'https://ja.vitejs.dev' },
{ text: 'Español', link: 'https://es.vitejs.dev' }
]
},

Expand Down
2 changes: 1 addition & 1 deletion docs/config/build-options.md
Expand Up @@ -145,7 +145,7 @@ Produce SSR-oriented build. The value can be a string to directly specify the SS

Set to `false` to disable minification, or specify the minifier to use. The default is [esbuild](https://github.com/evanw/esbuild) which is 20 ~ 40x faster than terser and only 1 ~ 2% worse compression. [Benchmarks](https://github.com/privatenumber/minification-benchmarks)

Note the `build.minify` option is not available when using the `'es'` format in lib mode.
Note the `build.minify` option does not minify whitespaces when using the `'es'` format in lib mode, as it removes pure annotations and break tree-shaking.

Terser must be installed when it is set to `'terser'`.

Expand Down
2 changes: 1 addition & 1 deletion docs/config/preview-options.md
Expand Up @@ -42,7 +42,7 @@ export default defineConfig({
- **Type:** `boolean`
- **Default:** [`server.strictPort`](./server-options#server-strictport)

Set to `true` to exit if port is already in use, instead of automatically try the next available port.
Set to `true` to exit if port is already in use, instead of automatically trying the next available port.

## preview.https

Expand Down
2 changes: 1 addition & 1 deletion docs/config/server-options.md
Expand Up @@ -45,7 +45,7 @@ Specify server port. Note if the port is already being used, Vite will automatic

- **Type:** `boolean`

Set to `true` to exit if port is already in use, instead of automatically try the next available port.
Set to `true` to exit if port is already in use, instead of automatically trying the next available port.

## server.https

Expand Down
2 changes: 2 additions & 0 deletions docs/config/shared-options.md
Expand Up @@ -280,6 +280,8 @@ export default defineConfig({
})
```

When [`build.minify`](./build-options.md#build-minify) is `true`, you can configure to only minify [certain aspects](https://esbuild.github.io/api/#minify) of the code by setting either of `esbuild.minifyIdentifiers`, `esbuild.minifySyntax`, and `esbuild.minifyWhitespace` to `true`. Note the `esbuild.minify` option can't be used to override `build.minify`.

Set to `false` to disable esbuild transforms.

## assetsInclude
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Expand Up @@ -74,7 +74,7 @@ npm create vite@latest my-vue-app -- --template vue
yarn create vite my-vue-app --template vue

# pnpm
pnpm create vite my-vue-app -- --template vue
pnpm create vite my-vue-app --template vue
```

See [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) for more details on each supported template: `vanilla`, `vanilla-ts`, `vue`, `vue-ts`, `react`, `react-ts`, `preact`, `preact-ts`, `lit`, `lit-ts`, `svelte`, `svelte-ts`.
Expand Down
3 changes: 2 additions & 1 deletion netlify.toml
Expand Up @@ -3,4 +3,5 @@
NPM_FLAGS = "--version" # prevent Netlify npm install
[build]
publish = "docs/.vitepress/dist"
command = "npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npm run ci-docs"
command = "npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npm run ci-docs"
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF docs package.json pnpm-lock.yaml netlify.toml"
10 changes: 6 additions & 4 deletions package.json
Expand Up @@ -14,12 +14,14 @@
],
"scripts": {
"preinstall": "npx only-allow pnpm",
"postinstall": "simple-git-hooks",
"format": "prettier --write --cache .",
"lint": "eslint --cache packages/*/{src,types,__tests__}/** playground/**/__tests__/**/*.ts scripts/**",
"typecheck": "tsc -p scripts --noEmit && tsc -p playground --noEmit",
"test": "run-s test-unit test-serve test-build",
"test-serve": "vitest run -c vitest.config.e2e.ts",
"test-build": "cross-env VITE_TEST_BUILD=1 vitest run -c vitest.config.e2e.ts",
"test-build-legacy-cjs": "cross-env VITE_TEST_LEGACY_CJS_PLUGIN=1 pnpm test-build",
"test-unit": "vitest run",
"test-docs": "pnpm run docs-build",
"debug-serve": "cross-env VITE_DEBUG_SERVE=1 vitest run -c vitest.config.e2e.ts",
Expand All @@ -29,8 +31,8 @@
"docs-serve": "vitepress serve docs",
"build": "pnpm -r --filter=./packages/* run build",
"dev": "pnpm -r --parallel --filter=./packages/* run dev",
"release": "esno scripts/release.ts",
"ci-publish": "esno scripts/publishCI.ts",
"release": "tsx scripts/release.ts",
"ci-publish": "tsx scripts/publishCI.ts",
"ci-docs": "run-s build docs-build"
},
"devDependencies": {
Expand Down Expand Up @@ -66,7 +68,6 @@
"eslint-define-config": "^1.5.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"esno": "^0.16.3",
"execa": "^6.1.0",
"fs-extra": "^10.1.0",
"kill-port": "^1.6.1",
Expand All @@ -85,6 +86,7 @@
"simple-git-hooks": "^2.8.0",
"sirv": "^2.0.2",
"tslib": "^2.4.0",
"tsx": "^3.6.0",
"typescript": "^4.6.4",
"unbuild": "^0.7.4",
"vite": "workspace:*",
Expand All @@ -94,7 +96,7 @@
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false",
"commit-msg": "pnpm exec esno scripts/verifyCommit.ts $1"
"commit-msg": "pnpm exec tsx scripts/verifyCommit.ts $1"
},
"lint-staged": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/README.md
Expand Up @@ -38,7 +38,7 @@ npm create vite@latest my-vue-app -- --template vue
yarn create vite my-vue-app --template vue

# pnpm
pnpm create vite my-vue-app -- --template vue
pnpm create vite my-vue-app --template vue
```

Currently supported template presets include:
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-legacy/package.json
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs",
"patch-cjs": "esno ../../scripts/patchCJS.ts",
"patch-cjs": "tsx ../../scripts/patchCJS.ts",
"prepublishOnly": "npm run build"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-react/package.json
Expand Up @@ -23,7 +23,7 @@
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs",
"patch-cjs": "esno ../../scripts/patchCJS.ts",
"patch-cjs": "tsx ../../scripts/patchCJS.ts",
"prepublishOnly": "npm run build"
},
"engines": {
Expand Down
5 changes: 4 additions & 1 deletion packages/plugin-react/src/index.ts
Expand Up @@ -276,7 +276,10 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
!(isProjectFile && babelOptions.babelrc)

if (shouldSkip) {
return // Avoid parsing if no plugins exist.
// Avoid parsing if no plugins exist.
return {
code
}
}

const parserPlugins: typeof babelOptions.parserOpts.plugins = [
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue-jsx/package.json
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs",
"patch-cjs": "esno ../../scripts/patchCJS.ts",
"patch-cjs": "tsx ../../scripts/patchCJS.ts",
"prepublishOnly": "npm run build"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/package.json
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs",
"patch-cjs": "esno ../../scripts/patchCJS.ts",
"patch-cjs": "tsx ../../scripts/patchCJS.ts",
"prepublishOnly": "npm run build"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/helper.ts
@@ -1,4 +1,4 @@
export const EXPORT_HELPER_ID = 'plugin-vue:export-helper'
export const EXPORT_HELPER_ID = '\0plugin-vue:export-helper'

export const helperCode = `
export default (sfc, props) => {
Expand Down
46 changes: 30 additions & 16 deletions packages/vite/CHANGELOG.md
@@ -1,3 +1,17 @@
## 3.0.0-beta.2 (2022-06-24)

* feat: enable tree-shaking for lib es (#8737) ([5dc0f72](https://github.com/vitejs/vite/commit/5dc0f72)), closes [#8737](https://github.com/vitejs/vite/issues/8737)
* feat: supports cts and mts config (#8729) ([c2b09db](https://github.com/vitejs/vite/commit/c2b09db)), closes [#8729](https://github.com/vitejs/vite/issues/8729)
* fix: avoid type mismatch with Rollup (fix #7843) (#8701) ([87e51f7](https://github.com/vitejs/vite/commit/87e51f7)), closes [#7843](https://github.com/vitejs/vite/issues/7843) [#8701](https://github.com/vitejs/vite/issues/8701)
* fix: optimizeDeps.entries transformRequest url (fix #8719) (#8748) ([9208c3b](https://github.com/vitejs/vite/commit/9208c3b)), closes [#8719](https://github.com/vitejs/vite/issues/8719) [#8748](https://github.com/vitejs/vite/issues/8748)
* fix(hmr): __HMR_PORT__ should not be `'undefined'` (#8761) ([3271266](https://github.com/vitejs/vite/commit/3271266)), closes [#8761](https://github.com/vitejs/vite/issues/8761)
* perf(lib): improve helper inject regex (#8741) ([19fc7e5](https://github.com/vitejs/vite/commit/19fc7e5)), closes [#8741](https://github.com/vitejs/vite/issues/8741)
* refactor: remove unnecessary condition (#8742) ([2ae269e](https://github.com/vitejs/vite/commit/2ae269e)), closes [#8742](https://github.com/vitejs/vite/issues/8742)
* docs: fix alpha changelog links (#8736) ([31348b5](https://github.com/vitejs/vite/commit/31348b5)), closes [#8736](https://github.com/vitejs/vite/issues/8736)
* chore: v3 beta release notes (#8718) ([7e899d0](https://github.com/vitejs/vite/commit/7e899d0)), closes [#8718](https://github.com/vitejs/vite/issues/8718)



## 3.0.0-beta.1 (2022-06-22)

### Main Changes
Expand Down Expand Up @@ -166,81 +180,81 @@

#### [3.0.0-beta.0](https://github.com/vitejs/vite/compare/v2.9.12...v3.0.0-beta.0) (2022-06-21)

See [3.0.0-beta.0 changelog](https://github.com/vitejs/vite/blob/3.0.0-beta.0/packages/vite/CHANGELOG.md)
See [3.0.0-beta.0 changelog](https://github.com/vitejs/vite/blob/v3.0.0-beta.0/packages/vite/CHANGELOG.md)

#### [3.0.0-alpha.14](https://github.com/vitejs/vite/compare/v3.0.0-alpha.13...v3.0.0-alpha.14) (2022-06-20)

See [3.0.0-alpha.14 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.14/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.14 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.14/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.13](https://github.com/vitejs/vite/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2022-06-19)

See [3.0.0-alpha.13 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.13/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.13 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.13/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.12](https://github.com/vitejs/vite/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2022-06-16)

See [3.0.0-alpha.12 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.12/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.12 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.12/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.11](https://github.com/vitejs/vite/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2022-06-14)

See [3.0.0-alpha.11 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.11/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.11 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.11/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.10](https://github.com/vitejs/vite/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2022-06-10)

See [3.0.0-alpha.10 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.10/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.10 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.10/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.9](https://github.com/vitejs/vite/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2022-06-01)

See [3.0.0-alpha.9 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.9/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.9 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.9/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.8](https://github.com/vitejs/vite/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2022-05-31)

See [3.0.0-alpha.8 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.8/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.8 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.8/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.7](https://github.com/vitejs/vite/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2022-05-27)

See [3.0.0-alpha.7 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.7/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.7 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.7/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.6](https://github.com/vitejs/vite/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2022-05-27)

See [3.0.0-alpha.6 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.6/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.6 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.6/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.5](https://github.com/vitejs/vite/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2022-05-26)

See [3.0.0-alpha.5 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.5/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.5 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.5/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.4](https://github.com/vitejs/vite/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2022-05-25)

See [3.0.0-alpha.4 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.4/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.4 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.4/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.3](https://github.com/vitejs/vite/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2022-05-25)

See [3.0.0-alpha.3 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.3/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.3 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.3/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.2](https://github.com/vitejs/vite/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2022-05-23)

See [3.0.0-alpha.2 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.2/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.2 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.2/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.1](https://github.com/vitejs/vite/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2022-05-18)

See [3.0.0-alpha.1 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.1/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.1 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.1/packages/vite/CHANGELOG.md)


#### [3.0.0-alpha.0](https://github.com/vitejs/vite/compare/v2.9.12...v3.0.0-alpha.0) (2022-05-13)

See [3.0.0-alpha.0 changelog](https://github.com/vitejs/vite/blob/3.0.0-alpha.0/packages/vite/CHANGELOG.md)
See [3.0.0-alpha.0 changelog](https://github.com/vitejs/vite/blob/v3.0.0-alpha.0/packages/vite/CHANGELOG.md)



Expand Down
7 changes: 3 additions & 4 deletions packages/vite/package.json
@@ -1,6 +1,6 @@
{
"name": "vite",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"type": "module",
"license": "MIT",
"author": "Evan You",
Expand Down Expand Up @@ -48,7 +48,7 @@
"build-bundle": "rollup --config rollup.config.ts --configPlugin typescript",
"build-types": "run-s build-temp-types patch-types roll-types check-dist-types",
"build-temp-types": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
"patch-types": "esno scripts/patchTypes.ts",
"patch-types": "tsx scripts/patchTypes.ts",
"roll-types": "api-extractor run && rimraf temp",
"check-dist-types": "tsc --project tsconfig.check.json",
"lint": "eslint --cache --ext .ts src/**",
Expand All @@ -71,7 +71,7 @@
"@babel/types": "^7.18.4",
"@jridgewell/trace-mapping": "^0.3.13",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-dynamic-import-vars": "^1.4.3",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
Expand All @@ -90,7 +90,6 @@
"dotenv": "^14.3.2",
"dotenv-expand": "^5.1.0",
"es-module-lexer": "^0.10.5",
"esno": "^0.16.3",
"estree-walker": "^3.0.1",
"etag": "^1.8.1",
"fast-glob": "^3.2.11",
Expand Down
10 changes: 3 additions & 7 deletions packages/vite/rollup.config.ts
Expand Up @@ -134,15 +134,11 @@ function createNodePlugins(
},
// postcss-load-config calls require after register ts-node
'postcss-load-config/src/index.js': {
src: `require(configFile)`,
replacement: `__require(configFile)`
},
// @rollup/plugin-commonjs uses incorrect esm
'@rollup/plugin-commonjs/dist/index.es.js': {
src: `import { sync } from 'resolve';`,
replacement: `import __resolve from 'resolve';const sync = __resolve.sync;`
pattern: /require(?=\((configFile|'ts-node')\))/g,
replacement: `eval('require')`
}
}),

commonjs({
extensions: ['.js'],
// Optional peer deps of ws. Native deps that are mostly for performance.
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/client/client.ts
Expand Up @@ -9,7 +9,7 @@ import '@vite/env'
declare const __BASE__: string
declare const __HMR_PROTOCOL__: string | null
declare const __HMR_HOSTNAME__: string | null
declare const __HMR_PORT__: string | null
declare const __HMR_PORT__: number | null
declare const __HMR_DIRECT_TARGET__: string
declare const __HMR_BASE__: string
declare const __HMR_TIMEOUT__: number
Expand Down

0 comments on commit 34d53fe

Please sign in to comment.