chore: fix code typos (#9033)

This commit is contained in:
那里好脏不可以 2022-07-22 19:28:41 +08:00 committed by GitHub
parent ea2770106e
commit ed0286186b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 46 additions and 25 deletions

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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
*/

View File

@ -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
*/

View File

@ -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
@ -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()
@ -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,

View File

@ -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 =

View File

@ -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
}

View File

@ -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

View File

@ -100,13 +100,13 @@
<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>

View File

@ -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(

View File

@ -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}`)

View File

@ -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)

View File

@ -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 ''

View File

@ -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 ''

View File

@ -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'

View File

@ -3,7 +3,7 @@ import Page from './views/Page.vue'
const history = createWebHistory()
const routeur = createRouter({
const router = createRouter({
history: history,
routes: [
{
@ -13,4 +13,4 @@ const routeur = createRouter({
]
})
export default routeur
export default router

View File

@ -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')