mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 14:48:41 +00:00
chore: fix code typos (#9033)
This commit is contained in:
parent
ea2770106e
commit
ed0286186b
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
21
packages/plugin-legacy/LICENSE
Normal file
21
packages/plugin-legacy/LICENSE
Normal 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.
|
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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,
|
||||
|
@ -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 =
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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(
|
||||
|
@ -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}`)
|
||||
|
@ -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)
|
||||
|
@ -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 ''
|
||||
|
@ -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 ''
|
||||
|
@ -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'
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user