Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed May 14, 2022
2 parents f27204f + 7752b56 commit bdb93a2
Show file tree
Hide file tree
Showing 89 changed files with 1,275 additions and 664 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
playground-temp
temp

2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = defineConfig({
}
},
{
files: ['packages/create-vite/template-*/**'],
files: ['packages/create-vite/template-*/**', '**/build.config.ts'],
rules: {
'node/no-missing-import': 'off'
}
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,11 @@ jobs:
os: [ubuntu-latest]
node_version: [14, 16, 18]
include:
# Active LTS + other OS
- os: macos-latest
node_version: 16
- os: macos-latest
node_version: 18
- os: windows-latest
node_version: 16
# Maybe bug with jest on windows and node-v18
# - os: windows-latest
# node_version: 18
fail-fast: false

env:
Expand All @@ -66,14 +62,8 @@ jobs:
- name: Install Playwright
run: pnpm playwright install

- name: Build vite
run: pnpm run ci-build-vite

- name: Build plugin-vue
run: pnpm run build-plugin-vue

- name: Build plugin-react
run: pnpm run build-plugin-react
- name: Build
run: pnpm run build

- name: Test unit
run: pnpm run test-unit
Expand Down Expand Up @@ -107,11 +97,8 @@ jobs:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"

- name: Prepare
run: |
pnpm run ci-build-vite
pnpm run build-plugin-vue
pnpm run build-plugin-react
- name: Build
run: pnpm run build

- name: Lint
run: pnpm run lint
Expand Down
8 changes: 2 additions & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
docs/.vitepress/dist/
packages/vite/dist/
packages/vite/temp/
packages/plugin-react/dist/
packages/plugin-vue/dist/
packages/*/CHANGELOG.md
playground-temp/
dist/
temp/
LICENSE.md
.prettierignore
pnpm-lock.yaml
pnpm-workspace.yaml
playground/tsconfig-json-load-error/has-error/tsconfig.json
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@ In addition, Vite is highly extensible via its [Plugin API](https://vitejs.dev/g

[Read the Docs to Learn More](https://vitejs.dev).

## Packages
## v3.0

Current Status: **Alpha** (for internal testing, not recommended for production)

The `main` branch is now for v3.0, if you are looking for current stable releases, check the [`v2` branch](https://github.com/vitejs/vite/tree/v2) branch instead.

> This branch is for the upcoming v3.0, if you are looking for current stable releases, check the [`v2` branch](https://github.com/vitejs/vite/tree/v2) instead.
We will start drafting release notes and migration guide for v3.0 when we enter the beta stage. Before that you can check:

- [v3.0 Milestone](https://github.com/vitejs/vite/milestone/5)
- [Breaking Change List](https://github.com/vitejs/vite/issues?q=label%3A%22breaking+change%22+is%3Aclosed+milestone%3A3.0)

## Packages

| Package | Version (click for changelogs) |
| ------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export default defineConfig(({ command, mode }) => {
### server.port

- **Type:** `number`
- **Default:** `3000`
- **Default:** `5173`

Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on.

Expand Down Expand Up @@ -551,7 +551,7 @@ export default defineConfig(({ command, mode }) => {
},
// Proxying websockets or socket.io
'/socket.io': {
target: 'ws://localhost:3000',
target: 'ws://localhost:5173',
ws: true
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/api-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Vite strives to offer established patterns out of the box, so before creating a
When creating a plugin, you can inline it in your `vite.config.js`. There is no need to create a new package for it. Once you see that a plugin was useful in your projects, consider sharing it to help others [in the ecosystem](https://chat.vitejs.dev).

::: tip
When learning, debugging, or authoring plugins we suggest including [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect) in your project. It allows you to inspect the intermediate state of Vite plugins. After installing, you can visit `localhost:3000/__inspect/` to inspect the modules and transformation stack of your project. Check out install instructions in the [vite-plugin-inspect docs](https://github.com/antfu/vite-plugin-inspect).
When learning, debugging, or authoring plugins we suggest including [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect) in your project. It allows you to inspect the intermediate state of Vite plugins. After installing, you can visit `localhost:5173/__inspect/` to inspect the modules and transformation stack of your project. Check out install instructions in the [vite-plugin-inspect docs](https://github.com/antfu/vite-plugin-inspect).
![vite-plugin-inspect](/images/vite-plugin-inspect.png)
:::

Expand Down
6 changes: 3 additions & 3 deletions docs/guide/backend-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ If you need a custom integration, you can follow the steps in this guide to conf
import 'vite/modulepreload-polyfill'
```

2. For development, inject the following in your server's HTML template (substitute `http://localhost:3000` with the local URL Vite is running at):
2. For development, inject the following in your server's HTML template (substitute `http://localhost:5173` with the local URL Vite is running at):

```html
<!-- if development -->
<script type="module" src="http://localhost:3000/main.js"></script>
<script type="module" src="http://localhost:5173/main.js"></script>
```

In order to properly serve assets, you have two options:
Expand All @@ -47,7 +47,7 @@ If you need a custom integration, you can follow the steps in this guide to conf

```html
<script type="module">
import RefreshRuntime from 'http://localhost:3000/@react-refresh'
import RefreshRuntime from 'http://localhost:5173/@react-refresh'
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async function createServer() {
// serve index.html - we will tackle this next
})

app.listen(3000)
app.listen(5173)
}

createServer()
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/static-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $ npm run preview

The `vite preview` command will boot up local static web server that serves the files from `dist` at `http://localhost:4173`. It's an easy way to check if the production build looks OK in your local environment.

You may configure the port of the server py passing `--port` flag as an argument.
You may configure the port of the server by passing `--port` flag as an argument.

```json
{
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,26 @@
"preinstall": "npx only-allow pnpm",
"format": "prettier --write .",
"lint": "eslint packages/*/{src,types}/** playground/**/__tests__/** 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-unit": "vitest run",
"debug-serve": "cross-env VITE_DEBUG_SERVE=1 vitest run -c vitest.config.e2e.ts",
"debug-build": "cross-env VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 vitest run -c vitest.config.e2e.ts",
"docs": "vitepress dev docs",
"build-docs": "vitepress build docs",
"serve-docs": "vitepress serve docs",
"docs-build": "vitepress build docs",
"docs-serve": "vitepress serve docs",
"build": "pnpm -r --filter=./packages/* run build",
"dev": "pnpm -r --parallel --filter=./packages/* run dev",
"release": "ts-node scripts/release.ts",
"ci-publish": "ts-node scripts/publishCI.ts",
"typecheck": "tsc -p scripts --noEmit && tsc -p playground --noEmit",
"build": "run-s build-vite build-plugin-vue build-plugin-react",
"build-vite": "cd packages/vite && npm run build",
"build-plugin-vue": "cd packages/plugin-vue && npm run build",
"build-plugin-react": "cd packages/plugin-react && npm run build",
"ci-build-vite": "cd packages/vite && npm run ci-build",
"ci-docs": "run-s build-vite build-plugin-vue build-docs"
"ci-docs": "run-s build docs-build"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.23.1",
"@types/babel__core": "^7.1.19",
"@types/babel__standalone": "^7.1.4",
"@types/convert-source-map": "^1.5.2",
"@types/cross-spawn": "^6.0.2",
"@types/debug": "^4.1.7",
Expand Down Expand Up @@ -83,6 +81,7 @@
"sirv": "^2.0.2",
"ts-node": "^10.7.0",
"typescript": "^4.6.4",
"unbuild": "^0.7.4",
"vite": "workspace:*",
"vitepress": "^0.22.4",
"vitest": "^0.12.4",
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-legacy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 2.0.0-alpha.0 (2022-05-13)

* chore: bump minors and rebuild lock (#8074) ([aeb5b74](https://github.com/vitejs/vite/commit/aeb5b74)), closes [#8074](https://github.com/vitejs/vite/issues/8074)
* chore: revert vitejs/vite#8152 (#8161) ([85b8b55](https://github.com/vitejs/vite/commit/85b8b55)), closes [vitejs/vite#8152](https://github.com/vitejs/vite/issues/8152) [#8161](https://github.com/vitejs/vite/issues/8161)
* chore: update plugins peer deps ([d57c23c](https://github.com/vitejs/vite/commit/d57c23c))
* chore: use `unbuild` to bundle plugins (#8139) ([638b168](https://github.com/vitejs/vite/commit/638b168)), closes [#8139](https://github.com/vitejs/vite/issues/8139)
* chore(deps): use `esno` to replace `ts-node` (#8152) ([2363bd3](https://github.com/vitejs/vite/commit/2363bd3)), closes [#8152](https://github.com/vitejs/vite/issues/8152)
* build!: remove node v12 support (#7833) ([eeac2d2](https://github.com/vitejs/vite/commit/eeac2d2)), closes [#7833](https://github.com/vitejs/vite/issues/7833)
* docs(plugin-legacy): remove regenerator-runtime note (#8007) ([834efe9](https://github.com/vitejs/vite/commit/834efe9)), closes [#8007](https://github.com/vitejs/vite/issues/8007)



## <small>1.8.2 (2022-05-02)</small>

* chore(deps): update all non-major dependencies (#7780) ([eba9d05](https://github.com/vitejs/vite/commit/eba9d05)), closes [#7780](https://github.com/vitejs/vite/issues/7780)
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-legacy/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: ['src/index'],
clean: true,
declaration: true,
rollup: {
emitCJS: true
}
})
29 changes: 23 additions & 6 deletions packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
{
"name": "@vitejs/plugin-legacy",
"version": "1.8.2",
"version": "2.0.0-alpha.0",
"license": "MIT",
"author": "Evan You",
"files": [
"index.js",
"index.d.ts"
"dist"
],
"main": "index.js",
"types": "index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs",
"patch-cjs": "ts-node ../../scripts/patchCJS.ts",
"prepublishOnly": "npm run build"
},
"engines": {
"node": ">=14.6.0"
},
Expand All @@ -29,6 +42,10 @@
"systemjs": "^6.12.1"
},
"peerDependencies": {
"vite": "^2.8.0"
"vite": "^3.0.0-alpha"
},
"devDependencies": {
"vite": "workspace:*",
"@babel/core": "^7.17.10"
}
}
Loading

0 comments on commit bdb93a2

Please sign in to comment.