Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Mar 26, 2023
2 parents 87796f9 + 276725f commit 35d1389
Show file tree
Hide file tree
Showing 116 changed files with 2,830 additions and 2,057 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@04124efe7560d15e11ea2ba96c0df2989f68f1f4 # v35.6.1
uses: tj-actions/changed-files@9328bab880abf4acc377d77718d28c6ac167f154 # v35.7.2
with:
files: |
docs/**
Expand Down
4 changes: 0 additions & 4 deletions docs/.vitepress/config.ts
Expand Up @@ -94,10 +94,6 @@ export default defineConfig({
pt: { label: 'Português', link: 'https://pt.vitejs.dev' },
},

vue: {
reactivityTransform: true,
},

themeConfig: {
logo: '/logo.svg',

Expand Down
2 changes: 1 addition & 1 deletion docs/config/build-options.md
Expand Up @@ -10,7 +10,7 @@ Browser compatibility target for the final bundle. The default value is a Vite s

Another special value is `'esnext'` - which assumes native dynamic imports support and will transpile as little as possible:

- If the [`build.minify`](#build-minify) option is `'terser'`, `'esnext'` will be forced down to `'es2021'`.
- If the [`build.minify`](#build-minify) option is `'terser'` and the installed Terser version is below 5.16.0, `'esnext'` will be forced down to `'es2021'`.
- In other cases, it will perform no transpilation at all.

The transform is performed with esbuild and the value should be a valid [esbuild target option](https://esbuild.github.io/api/#target). Custom targets can either be an ES version (e.g. `es2015`), a browser with version (e.g. `chrome58`), or an array of multiple target strings.
Expand Down
40 changes: 40 additions & 0 deletions docs/guide/api-javascript.md
Expand Up @@ -198,6 +198,46 @@ import { preview } from 'vite'
})()
```

## `PreviewServer`

```ts
interface PreviewServer extends PreviewServerForHook {
resolvedUrls: ResolvedServerUrls
}
```

## `PreviewServerForHook`

```ts
interface PreviewServerForHook {
/**
* The resolved vite config object
*/
config: ResolvedConfig
/**
* A connect app instance.
* - Can be used to attach custom middlewares to the preview server.
* - Can also be used as the handler function of a custom http server
* or as a middleware in any connect-style Node.js frameworks
*
* https://github.com/senchalabs/connect#use-middleware
*/
middlewares: Connect.Server
/**
* native Node http server instance
*/
httpServer: http.Server
/**
* The resolved urls Vite prints on the CLI
*/
resolvedUrls: ResolvedServerUrls | null
/**
* Print server urls
*/
printUrls(): void
}
```

## `resolveConfig`

**Type Signature:**
Expand Down
5 changes: 3 additions & 2 deletions docs/guide/api-plugin.md
Expand Up @@ -309,10 +309,11 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo

### `configurePreviewServer`

- **Type:** `(server: { middlewares: Connect.Server, httpServer: http.Server }) => (() => void) | void | Promise<(() => void) | void>`
- **Type:** `(server: PreviewServerForHook) => (() => void) | void | Promise<(() => void) | void>`
- **Kind:** `async`, `sequential`
- **See also:** [PreviewServerForHook](./api-javascript#previewserverforhook)

Same as [`configureServer`](/guide/api-plugin.html#configureserver) but for the preview server. It provides the [connect](https://github.com/senchalabs/connect) server and its underlying [http server](https://nodejs.org/api/http.html). Similarly to `configureServer`, the `configurePreviewServer` hook is called before other middlewares are installed. If you want to inject a middleware **after** other middlewares, you can return a function from `configurePreviewServer`, which will be called after internal middlewares are installed:
Same as [`configureServer`](/guide/api-plugin.html#configureserver) but for the preview server. Similarly to `configureServer`, the `configurePreviewServer` hook is called before other middlewares are installed. If you want to inject a middleware **after** other middlewares, you can return a function from `configurePreviewServer`, which will be called after internal middlewares are installed:

```js
const myPlugin = () => ({
Expand Down
37 changes: 19 additions & 18 deletions package.json
Expand Up @@ -36,7 +36,7 @@
"ci-docs": "run-s build docs-build"
},
"devDependencies": {
"@babel/types": "^7.21.2",
"@babel/types": "^7.21.3",
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-typescript": "^11.0.0",
"@types/babel__core": "^7.20.0",
Expand All @@ -51,44 +51,44 @@
"@types/less": "^3.0.3",
"@types/micromatch": "^4.0.2",
"@types/minimist": "^1.2.2",
"@types/node": "^18.14.6",
"@types/node": "^18.15.5",
"@types/picomatch": "^2.3.0",
"@types/prompts": "^2.4.2",
"@types/prompts": "2.4.2",
"@types/resolve": "^1.20.2",
"@types/sass": "~1.43.1",
"@types/semver": "^7.3.13",
"@types/stylus": "^0.48.38",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.35.0",
"eslint-define-config": "^1.15.0",
"eslint": "^8.36.0",
"eslint-define-config": "^1.17.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-regexp": "^1.12.0",
"execa": "^7.0.0",
"eslint-plugin-regexp": "^1.13.0",
"execa": "^7.1.1",
"fast-glob": "^3.2.12",
"fs-extra": "^11.1.0",
"lint-staged": "^13.1.2",
"fs-extra": "^11.1.1",
"lint-staged": "^13.2.0",
"minimist": "^1.2.8",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.31.2",
"prettier": "2.8.5",
"prompts": "^2.4.2",
"resolve": "^1.22.1",
"rimraf": "^4.1.2",
"rollup": "^3.18.0",
"rimraf": "^4.4.0",
"rollup": "^3.20.0",
"semver": "^7.3.8",
"simple-git-hooks": "^2.8.1",
"tslib": "^2.5.0",
"tsx": "^3.12.3",
"tsx": "^3.12.6",
"typescript": "^5.0.2",
"unbuild": "^1.1.2",
"vite": "workspace:*",
"vitepress": "^1.0.0-alpha.49",
"vitest": "^0.29.2",
"vitepress": "^1.0.0-alpha.61",
"vitest": "^0.29.7",
"vue": "^3.2.47"
},
"simple-git-hooks": {
Expand All @@ -108,7 +108,7 @@
"eslint --cache --fix"
]
},
"packageManager": "pnpm@7.29.0",
"packageManager": "pnpm@7.30.0",
"pnpm": {
"overrides": {
"vite": "workspace:*"
Expand All @@ -127,7 +127,8 @@
},
"patchedDependencies": {
"dotenv-expand@9.0.0": "patches/dotenv-expand@9.0.0.patch",
"sirv@2.0.2": "patches/sirv@2.0.2.patch"
"sirv@2.0.2": "patches/sirv@2.0.2.patch",
"chokidar@3.5.3": "patches/chokidar@3.5.3.patch"
}
},
"stackblitz": {
Expand Down
14 changes: 3 additions & 11 deletions packages/create-vite/template-lit-ts/package.json
Expand Up @@ -3,24 +3,16 @@
"private": true,
"version": "0.0.0",
"type": "module",
"main": "dist/my-element.es.js",
"exports": {
".": "./dist/my-element.es.js"
},
"types": "types/my-element.d.ts",
"files": [
"dist",
"types"
],
"scripts": {
"dev": "vite",
"build": "tsc && vite build"
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"lit": "^2.6.1"
},
"devDependencies": {
"typescript": "^5.0.2",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
7 changes: 2 additions & 5 deletions packages/create-vite/template-lit-ts/tsconfig.json
Expand Up @@ -2,9 +2,7 @@
"compilerOptions": {
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./types",
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand All @@ -16,6 +14,5 @@
"useDefineForClassFields": false,
"skipLibCheck": true
},
"include": ["src/**/*.ts"],
"references": [{ "path": "./tsconfig.node.json" }]
"include": ["src"]
}
9 changes: 0 additions & 9 deletions packages/create-vite/template-lit-ts/tsconfig.node.json

This file was deleted.

14 changes: 0 additions & 14 deletions packages/create-vite/template-lit-ts/vite.config.ts

This file was deleted.

12 changes: 3 additions & 9 deletions packages/create-vite/template-lit/package.json
Expand Up @@ -3,21 +3,15 @@
"private": true,
"version": "0.0.0",
"type": "module",
"main": "dist/my-element.es.js",
"exports": {
".": "./dist/my-element.es.js"
},
"files": [
"dist"
],
"scripts": {
"dev": "vite",
"build": "vite build"
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"lit": "^2.6.1"
},
"devDependencies": {
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
14 changes: 0 additions & 14 deletions packages/create-vite/template-lit/vite.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/create-vite/template-preact-ts/package.json
Expand Up @@ -9,11 +9,11 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.13.0"
"preact": "^10.13.1"
},
"devDependencies": {
"@preact/preset-vite": "^2.5.0",
"typescript": "^5.0.2",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-preact/package.json
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.13.0"
"preact": "^10.13.1"
},
"devDependencies": {
"@preact/preset-vite": "^2.5.0",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-react-ts/package.json
Expand Up @@ -17,6 +17,6 @@
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"typescript": "^5.0.2",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-react/package.json
Expand Up @@ -16,6 +16,6 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-svelte-ts/package.json
Expand Up @@ -12,10 +12,10 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.0.3",
"@tsconfig/svelte": "^3.0.0",
"svelte": "^3.55.1",
"svelte": "^3.57.0",
"svelte-check": "^2.10.3",
"tslib": "^2.5.0",
"typescript": "^5.0.2",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-svelte/package.json
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.0.3",
"svelte": "^3.55.1",
"vite": "^4.2.0"
"svelte": "^3.57.0",
"vite": "^4.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla-ts/package.json
Expand Up @@ -10,6 +10,6 @@
},
"devDependencies": {
"typescript": "^5.0.2",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla/package.json
Expand Up @@ -9,6 +9,6 @@
"preview": "vite preview"
},
"devDependencies": {
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vue-ts/package.json
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@vitejs/plugin-vue": "^4.1.0",
"typescript": "^5.0.2",
"vite": "^4.2.0",
"vite": "^4.2.1",
"vue-tsc": "^1.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vue/package.json
Expand Up @@ -13,6 +13,6 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.1.0",
"vite": "^4.2.0"
"vite": "^4.2.1"
}
}

0 comments on commit 35d1389

Please sign in to comment.