From 7143d3968205c24511844126698b6cfbf4f5b250 Mon Sep 17 00:00:00 2001 From: Gao Sheng Date: Wed, 17 Aug 2022 14:52:52 +0800 Subject: [PATCH 1/4] fix(*): Typo --- packages/plugin-react/src/jsx-runtime/babel-restore-jsx.ts | 4 ++-- packages/plugin-vue/src/main.ts | 2 +- packages/vite/src/node/plugins/resolve.ts | 2 +- packages/vite/src/node/plugins/worker.ts | 4 ++-- packages/vite/src/node/server/middlewares/base.ts | 4 ++-- packages/vite/src/node/server/ws.ts | 4 ++-- packages/vite/types/chokidar.d.ts | 2 +- playground/vue/PreProcessors.vue | 2 +- playground/wasm/vite.config.ts | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/plugin-react/src/jsx-runtime/babel-restore-jsx.ts b/packages/plugin-react/src/jsx-runtime/babel-restore-jsx.ts index 91b4db5411bf26..44a81e474b6c02 100644 --- a/packages/plugin-react/src/jsx-runtime/babel-restore-jsx.ts +++ b/packages/plugin-react/src/jsx-runtime/babel-restore-jsx.ts @@ -76,7 +76,7 @@ export default function ( /** * Get a JSXIdentifier or JSXMemberExpression from a Node of known type. - * Returns null if a unknown node type, null or undefined is passed. + * Returns null if an unknown node type, null or undefined is passed. */ function getJSXName(node: any): any { if (node == null) { @@ -100,7 +100,7 @@ export default function ( } /** - * Get a array of JSX(Spread)Attribute from a props ObjectExpression. + * Get an array of JSX(Spread)Attribute from a props ObjectExpression. * Handles the _extends Expression babel creates from SpreadElement nodes. * Returns null if a validation error occurs. */ diff --git a/packages/plugin-vue/src/main.ts b/packages/plugin-vue/src/main.ts index 37de21de004442..bdb846ab4abcfd 100644 --- a/packages/plugin-vue/src/main.ts +++ b/packages/plugin-vue/src/main.ts @@ -162,7 +162,7 @@ export async function transformMain( if (options.sourceMap) { if (scriptMap && templateMap) { // if the template is inlined into the main module (indicated by the presence - // of templateMap, we need to concatenate the two source maps. + // of templateMap), we need to concatenate the two source maps. const gen = fromMap( // version property of result.map is declared as string diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 13ac18ae384371..7868540748a6ef 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -394,7 +394,7 @@ function tryFsResolve( let res: string | undefined - // if we fould postfix exist, we should first try resolving file with postfix. details see #4703. + // if we found postfix exist, we should first try resolving file with postfix. details see #4703. if ( postfix && (res = tryResolveFile( diff --git a/packages/vite/src/node/plugins/worker.ts b/packages/vite/src/node/plugins/worker.ts index 25aa49d38a966a..e87a4b8f54650c 100644 --- a/packages/vite/src/node/plugins/worker.ts +++ b/packages/vite/src/node/plugins/worker.ts @@ -14,7 +14,7 @@ interface WorkerCache { // save worker all emit chunk avoid rollup make the same asset unique. assets: Map - // worker bundle don't deps on any more worker runtime info an id only had an result. + // worker bundle don't deps on any more worker runtime info an id only had a result. // save worker bundled file id to avoid repeated execution of bundles // bundle: Map @@ -217,7 +217,7 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin { const ssr = options?.ssr === true const query = parseRequest(id) if (query && query[WORKER_FILE_ID] != null) { - // if import worker by worker constructor will had query.type + // if import worker by worker constructor will have query.type // other type will be import worker by esm const workerType = query['type']! as WorkerType let injectEnv = '' diff --git a/packages/vite/src/node/server/middlewares/base.ts b/packages/vite/src/node/server/middlewares/base.ts index fb41591a151efb..37a983e1ffe3b4 100644 --- a/packages/vite/src/node/server/middlewares/base.ts +++ b/packages/vite/src/node/server/middlewares/base.ts @@ -11,11 +11,11 @@ export function baseMiddleware({ // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...` return function viteBaseMiddleware(req, res, next) { const url = req.url! - const parsed = new URL(url, 'http://vitejs.dev') + const parsed = new URL(url, 'https://vitejs.dev') const path = parsed.pathname || '/' if (path.startsWith(devBase)) { - // rewrite url to remove base.. this ensures that other middleware does + // rewrite url to remove base. this ensures that other middleware does // not need to consider base being prepended or not req.url = url.replace(devBase, '/') return next() diff --git a/packages/vite/src/node/server/ws.ts b/packages/vite/src/node/server/ws.ts index 0d787a79157d6b..b633f2e194c439 100644 --- a/packages/vite/src/node/server/ws.ts +++ b/packages/vite/src/node/server/ws.ts @@ -25,7 +25,7 @@ export interface WebSocketServer { */ clients: Set /** - * Boardcast events to all clients + * Broadcast events to all clients */ send(payload: HMRPayload): void /** @@ -108,7 +108,7 @@ export function createWebSocketServer( const port = hmrPort || 24678 const host = (hmr && hmr.host) || undefined if (httpsOptions) { - // if we're serving the middlewares over https, the ws library doesn't support automatically creating an https server, so we need to do it ourselves + // if we're serving the middlewares over https, the ws library doesn't support automatically creating a https server, so we need to do it ourselves // create an inline https server and mount the websocket server to it httpsServer = createHttpsServer(httpsOptions, (req, res) => { const statusCode = 426 diff --git a/packages/vite/types/chokidar.d.ts b/packages/vite/types/chokidar.d.ts index 51ac89b8e98d1f..0dc4bec1013643 100644 --- a/packages/vite/types/chokidar.d.ts +++ b/packages/vite/types/chokidar.d.ts @@ -194,7 +194,7 @@ export interface WatchOptions { ignorePermissionErrors?: boolean /** - * `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts + * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts * that occur when using editors that use "atomic writes" instead of writing directly to the * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change` * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you, diff --git a/playground/vue/PreProcessors.vue b/playground/vue/PreProcessors.vue index ddb636678e8cdd..c210448d332456 100644 --- a/playground/vue/PreProcessors.vue +++ b/playground/vue/PreProcessors.vue @@ -2,7 +2,7 @@ h2.pre-processors Pre-Processors p.pug | This is rendered from <template lang="pug"> - | and styled with <style lang="sass">. It should be megenta. + | and styled with <style lang="sass">. It should be magenta. p.pug-less | This is rendered from <template lang="pug"> | and styled with <style lang="less">. It should be green. diff --git a/playground/wasm/vite.config.ts b/playground/wasm/vite.config.ts index 43833d2f95d302..1ba3cd55da2ff9 100644 --- a/playground/wasm/vite.config.ts +++ b/playground/wasm/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' export default defineConfig({ build: { - // make can no emit light.wasm + // make can not emit light.wasm // and emit add.wasm assetsInlineLimit: 80 } From 302f424689eace7159d7d917a646d74b5f873463 Mon Sep 17 00:00:00 2001 From: Gao Sheng Date: Wed, 17 Aug 2022 14:53:16 +0800 Subject: [PATCH 2/4] fix(*): Typo --- playground/resolve/__tests__/resolve.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/resolve/__tests__/resolve.spec.ts b/playground/resolve/__tests__/resolve.spec.ts index 784e0a4de32cea..81de949d4bdae5 100644 --- a/playground/resolve/__tests__/resolve.spec.ts +++ b/playground/resolve/__tests__/resolve.spec.ts @@ -18,7 +18,7 @@ test('deep import with exports field', async () => { }) test('deep import with query with exports field', async () => { - // since it is imported with `?url` it should return a url + // since it is imported with `?url` it should return an url expect(await page.textContent('.exports-deep-query')).toMatch( isBuild ? /base64/ : '/exports-path/deep.json' ) From b42f7481b94f613e9baf74f11e34fd82370dc369 Mon Sep 17 00:00:00 2001 From: Gao Sheng Date: Fri, 26 Aug 2022 15:50:47 +0800 Subject: [PATCH 3/4] fix(*): Typo --- packages/vite/src/node/plugins/resolve.ts | 2 +- packages/vite/src/node/server/ws.ts | 2 +- playground/resolve/__tests__/resolve.spec.ts | 2 +- playground/wasm/vite.config.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 7868540748a6ef..6344fd2ff2339b 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -394,7 +394,7 @@ function tryFsResolve( let res: string | undefined - // if we found postfix exist, we should first try resolving file with postfix. details see #4703. + // if a postfix exists, we should first try resolving file with postfix. details see #4703. if ( postfix && (res = tryResolveFile( diff --git a/packages/vite/src/node/server/ws.ts b/packages/vite/src/node/server/ws.ts index b633f2e194c439..54eaa21e94de45 100644 --- a/packages/vite/src/node/server/ws.ts +++ b/packages/vite/src/node/server/ws.ts @@ -108,7 +108,7 @@ export function createWebSocketServer( const port = hmrPort || 24678 const host = (hmr && hmr.host) || undefined if (httpsOptions) { - // if we're serving the middlewares over https, the ws library doesn't support automatically creating a https server, so we need to do it ourselves + // if we're serving the middlewares over https, the ws library doesn't support automatically creating an https server, so we need to do it ourselves // create an inline https server and mount the websocket server to it httpsServer = createHttpsServer(httpsOptions, (req, res) => { const statusCode = 426 diff --git a/playground/resolve/__tests__/resolve.spec.ts b/playground/resolve/__tests__/resolve.spec.ts index 81de949d4bdae5..6d7a9b6efb1907 100644 --- a/playground/resolve/__tests__/resolve.spec.ts +++ b/playground/resolve/__tests__/resolve.spec.ts @@ -18,7 +18,7 @@ test('deep import with exports field', async () => { }) test('deep import with query with exports field', async () => { - // since it is imported with `?url` it should return an url + // since it is imported with `?url` it should return a URL expect(await page.textContent('.exports-deep-query')).toMatch( isBuild ? /base64/ : '/exports-path/deep.json' ) diff --git a/playground/wasm/vite.config.ts b/playground/wasm/vite.config.ts index 1ba3cd55da2ff9..e52df8dc66c386 100644 --- a/playground/wasm/vite.config.ts +++ b/playground/wasm/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' export default defineConfig({ build: { - // make can not emit light.wasm + // make cannot emit light.wasm // and emit add.wasm assetsInlineLimit: 80 } From 6d4f2e4eea17126868281f90310f2755d2bf52c7 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 29 Aug 2022 21:16:09 +0800 Subject: [PATCH 4/4] chore: use http --- packages/vite/src/node/server/middlewares/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/server/middlewares/base.ts b/packages/vite/src/node/server/middlewares/base.ts index 37a983e1ffe3b4..002ec111335128 100644 --- a/packages/vite/src/node/server/middlewares/base.ts +++ b/packages/vite/src/node/server/middlewares/base.ts @@ -11,7 +11,7 @@ export function baseMiddleware({ // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...` return function viteBaseMiddleware(req, res, next) { const url = req.url! - const parsed = new URL(url, 'https://vitejs.dev') + const parsed = new URL(url, 'http://vitejs.dev') const path = parsed.pathname || '/' if (path.startsWith(devBase)) {