Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix code typos #9033

Merged
merged 4 commits into from Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
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
2 changes: 1 addition & 1 deletion packages/plugin-vue/LICENSE
@@ -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
antfu marked this conversation as resolved.
Show resolved Hide resolved

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
Expand Up @@ -256,14 +256,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
Expand Up @@ -151,7 +151,7 @@ export interface DepOptimizationOptions {
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
10 changes: 5 additions & 5 deletions packages/vite/src/node/optimizer/optimizer.ts
Expand Up @@ -237,12 +237,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 @@ -388,7 +388,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 @@ -486,7 +486,7 @@ async function createDepsOptimizer(
): OptimizedDepInfo {
if (!isBuild && ssr) {
config.logger.error(
'Vite internal error: ssr dep registerd as a browser dep'
'Vite internal error: ssr dep registered as a browser dep'
)
}
const optimized = metadata.optimized[id]
Expand Down Expand Up @@ -531,7 +531,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
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)$/
bluwy marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Up @@ -223,9 +223,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
Expand Up @@ -306,7 +306,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
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
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
@@ -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
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
@@ -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
@@ -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
@@ -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
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
Expand Up @@ -211,7 +211,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