Skip to content

Commit

Permalink
chore: fix code typos (#9033)
Browse files Browse the repository at this point in the history
  • Loading branch information
那里好脏不可以 authored Jul 22, 2022
1 parent ea27701 commit ed02861
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}

- name: Install Playwright
# does not need to explictly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
run: pnpm playwright install chromium

- name: Build
Expand Down
21 changes: 21 additions & 0 deletions packages/plugin-legacy/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion packages/plugin-vue/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-present, Yuxi (Evan) You and contributors
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ export interface UserConfig {

export interface ExperimentalOptions {
/**
* Append fake `&lang.(ext)` when queries are specified, to preseve the file extension for following plugins to process.
* Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
*
* @experimental
* @default false
*/
importGlobRestoreExtension?: boolean
/**
* Allow finegrain contol over assets and public files paths
* Allow finegrain control over assets and public files paths
*
* @experimental
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export type DepOptimizationOptions = DepOptimizationConfig & {
export interface DepOptimizationResult {
metadata: DepOptimizationMetadata
/**
* When doing a re-run, if there are newly discovered dependendencies
* When doing a re-run, if there are newly discovered dependencies
* the page reload will be delayed until the next rerun so we need
* to be able to discard the result
*/
Expand Down
8 changes: 4 additions & 4 deletions packages/vite/src/node/optimizer/optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ async function createDepsOptimizer(
depOptimizationProcessingQueue.push(depOptimizationProcessing)

// Create a new promise for the next rerun, discovered missing
// dependencies will be asigned this promise from this point
// dependencies will be assigned this promise from this point
depOptimizationProcessing = newDepOptimizationProcessing()
}

async function optimizeNewDeps() {
// a succesful completion of the optimizeDeps rerun will end up
// a successful completion of the optimizeDeps rerun will end up
// creating new bundled version of all current and discovered deps
// in the cache dir and a new metadata info object assigned
// to _metadata. A fullReload is only issued if the previous bundled
Expand Down Expand Up @@ -391,7 +391,7 @@ async function createDepsOptimizer(
} else {
if (newDepsDiscovered) {
// There are newly discovered deps, and another rerun is about to be
// excecuted. Avoid the current full reload discarding this rerun result
// executed. Avoid the current full reload discarding this rerun result
// We don't resolve the processing promise, as they will be resolved
// once a rerun is committed
processingResult.cancel()
Expand Down Expand Up @@ -528,7 +528,7 @@ async function createDepsOptimizer(
src: resolved,
// Assing a browserHash to this missing dependency that is unique to
// the current state of known + missing deps. If its optimizeDeps run
// doesn't alter the bundled files of previous known dependendencies,
// doesn't alter the bundled files of previous known dependencies,
// we don't need a full reload and this browserHash will be kept
browserHash: getDiscoveredBrowserHash(
metadata.hash,
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface ScriptAssetsUrl {
url: string
}

const htmlProxyRE = /\?html-proxy=?[&inline\-css]*&index=(\d+)\.(js|css)$/
const htmlProxyRE = /\?html-proxy=?(?:&inline-css)?&index=(\d+)\.(js|css)$/
const inlineCSSRE = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g
// Do not allow preceding '.', but do allow preceding '...' for spread operations
const inlineImportRE =
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/server/middlewares/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ export function transformMiddleware(
}
// We don't need to log an error in this case, the request
// is outdated because new dependencies were discovered and
// the new pre-bundle dependendencies have changed.
// the new pre-bundle dependencies have changed.
// A full-page reload has been issued, and these old requests
// can't be properly fullfilled. This isn't an unexpected
// can't be properly fulfilled. This isn't an unexpected
// error but a normal part of the missing deps discovery flow
return
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/ssr/ssrModuleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ async function nodeImport(

// rollup-style default import interop for cjs
function proxyESM(mod: any) {
// This is the only sensible option when the exports object is a primitve
// This is the only sensible option when the exports object is a primitive
if (isPrimitive(mod)) return { default: mod }

let defaultExport = 'default' in mod ? mod.default : mod
Expand Down
6 changes: 3 additions & 3 deletions playground/css/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ <h1>CSS</h1>
<pre class="charset-css"></pre>

<p class="css-dep">
@import dependency w/ style enrtrypoints: this should be purple
@import dependency w/ style entrypoints: this should be purple
</p>
<p class="css-dep-sass">
@import dependency w/ sass enrtrypoints: this should be orange
@import dependency w/ sass entrypoints: this should be orange
</p>
<p class="css-dep-stylus">
@import dependency w/ styl enrtrypoints: this should be red
@import dependency w/ styl entrypoints: this should be red
</p>

<p class="dir-dep">PostCSS dir-dependency: this should be grey</p>
Expand Down
2 changes: 1 addition & 1 deletion playground/define/__tests__/define.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test('string', async () => {
)
expect(await page.textContent('.no-identifier-substring')).toBe(String(true))
expect(await page.textContent('.no-property')).toBe(String(true))
// html would't need to define replacement
// html wouldn't need to define replacement
expect(await page.textContent('.exp-define')).toBe('__EXP__')
expect(await page.textContent('.import-json')).toBe('__EXP__')
expect(await page.textContent('.define-in-dep')).toBe(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import def, { a } from './target'
import { x } from './callback'

// we don't want to polute other checks' logs...
// we don't want to pollute other checks' logs...
if (0 > 1) console.log(x)

console.log(`>>>>>> ${a} ${def}`)
2 changes: 1 addition & 1 deletion playground/legacy/__tests__/legacy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe.runIf(isBuild)('build', () => {
test('should minify legacy chunks with terser', async () => {
// This is a ghetto heuristic, but terser output seems to reliably start
// with one of the following, and non-terser output (including unminified or
// ebuild-minified) does not!
// esbuild-minified) does not!
const terserPattern = /^(?:!function|System.register)/

expect(findAssetFile(/chunk-async-legacy/)).toMatch(terserPattern)
Expand Down
2 changes: 1 addition & 1 deletion playground/resolve/browser-field/no-ext-index/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import jsdom from 'jsdom' // should be redireted to empty module
import jsdom from 'jsdom' // should be redirected to empty module
export default ''
2 changes: 1 addition & 1 deletion playground/resolve/browser-field/no-ext.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import jsdom from 'jsdom' // should be redireted to empty module
import jsdom from 'jsdom' // should be redirected to empty module
export default ''
2 changes: 1 addition & 1 deletion playground/resolve/browser-field/out/esm.browser.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import jsdom from 'jsdom' // should be redireted to empty module
import jsdom from 'jsdom' // should be redirected to empty module
export default '[success] resolve browser field'
4 changes: 2 additions & 2 deletions playground/tailwind/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Page from './views/Page.vue'

const history = createWebHistory()

const routeur = createRouter({
const router = createRouter({
history: history,
routes: [
{
Expand All @@ -13,4 +13,4 @@ const routeur = createRouter({
]
})

export default routeur
export default router
2 changes: 1 addition & 1 deletion playground/vue/__tests__/vue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('src imports', () => {
await untilUpdated(() => getColor(el), 'red')
})

test('tempalte src import hmr', async () => {
test('template src import hmr', async () => {
const el = await page.$('.src-imports-style')
editFile('src-import/template.html', (code) =>
code.replace('should be tan', 'should be red')
Expand Down

0 comments on commit ed02861

Please sign in to comment.