Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Mar 19, 2022
2 parents f15c779 + e682863 commit 07a01b5
Show file tree
Hide file tree
Showing 18 changed files with 702 additions and 592 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
runs-on: ubuntu-latest
name: "Lint: node-16, ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lock-closed-issues.yml
Expand Up @@ -11,11 +11,11 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-inactive-days: "14"
#issue-lock-comment: |
issue-inactive-days: "14"
#issue-comment: |
# This issue has been locked since it has been closed for more than 14 days.
#
# If you have found a concrete bug or regression related to it, please open a new [bug report](https://github.com/vitejs/vite/issues/new/choose) with a reproduction against the latest Vite version. If you have any other comments you should join the chat at [Vite Land](https://chat.vitejs.dev) or create a new [discussion](https://github.com/vitejs/vite/discussions).
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
environment: Release
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-tag.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get pkgName for tag
id: tag
Expand Down
26 changes: 13 additions & 13 deletions package.json
Expand Up @@ -34,30 +34,30 @@
"ci-docs": "run-s build-vite build-plugin-vue build-docs"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.19.4",
"@microsoft/api-extractor": "^7.19.5",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.4.0",
"@types/node": "^16.11.22",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.26",
"@types/prompts": "^2.0.14",
"@types/semver": "^7.3.9",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"@typescript-eslint/eslint-plugin": "^5.15.0",
"@typescript-eslint/parser": "^5.15.0",
"conventional-changelog-cli": "^2.2.2",
"cross-env": "^7.0.3",
"esbuild": "^0.14.27",
"eslint": "^8.8.0",
"eslint-define-config": "^1.2.4",
"eslint": "^8.11.0",
"eslint-define-config": "^1.3.0",
"eslint-plugin-node": "^11.1.0",
"execa": "^5.1.1",
"fs-extra": "^10.0.0",
"fs-extra": "^10.0.1",
"jest": "^27.5.1",
"lint-staged": "^12.3.3",
"lint-staged": "^12.3.6",
"minimist": "^1.2.5",
"node-fetch": "^2.6.6",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.18.1",
"prettier": "2.5.1",
"playwright-chromium": "^1.20.0",
"prettier": "2.6.0",
"prompts": "^2.4.2",
"rimraf": "^3.0.2",
"rollup": "^2.59.0",
Expand All @@ -68,7 +68,7 @@
"ts-node": "^10.4.0",
"typescript": "~4.5.4",
"vite": "workspace:*",
"vitepress": "^0.21.6"
"vitepress": "^0.22.3"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false",
Expand All @@ -85,7 +85,7 @@
"eslint --ext .ts"
]
},
"packageManager": "pnpm@6.30.0",
"packageManager": "pnpm@6.32.3",
"pnpm": {
"overrides": {
"vite": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-legacy/package.json
Expand Up @@ -22,9 +22,9 @@
},
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme",
"dependencies": {
"@babel/standalone": "^7.17.2",
"core-js": "^3.21.0",
"magic-string": "^0.25.7",
"@babel/standalone": "^7.17.7",
"core-js": "^3.21.1",
"magic-string": "^0.26.1",
"regenerator-runtime": "^0.13.9",
"systemjs": "^6.12.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-react/package.json
Expand Up @@ -33,12 +33,12 @@
},
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-react#readme",
"dependencies": {
"@babel/core": "^7.17.2",
"@babel/plugin-transform-react-jsx": "^7.16.7",
"@babel/core": "^7.17.7",
"@babel/plugin-transform-react-jsx": "^7.17.3",
"@babel/plugin-transform-react-jsx-development": "^7.16.7",
"@babel/plugin-transform-react-jsx-self": "^7.16.7",
"@babel/plugin-transform-react-jsx-source": "^7.16.7",
"@rollup/pluginutils": "^4.1.2",
"@rollup/pluginutils": "^4.2.0",
"react-refresh": "^0.11.0",
"resolve": "^1.22.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-vue-jsx/package.json
Expand Up @@ -22,10 +22,10 @@
},
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx#readme",
"dependencies": {
"@babel/core": "^7.17.2",
"@babel/core": "^7.17.7",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.16.8",
"@rollup/pluginutils": "^4.1.2",
"@rollup/pluginutils": "^4.2.0",
"@vue/babel-plugin-jsx": "^1.1.1",
"hash-sum": "^2.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-vue/package.json
Expand Up @@ -35,13 +35,13 @@
"vue": "^3.2.25"
},
"devDependencies": {
"@rollup/pluginutils": "^4.1.2",
"@rollup/pluginutils": "^4.2.0",
"@types/hash-sum": "^1.0.0",
"debug": "^4.3.3",
"hash-sum": "^2.0.0",
"rollup": "^2.59.0",
"slash": "^4.0.0",
"source-map": "^0.6.1",
"vue": "^3.2.30"
"vue": "^3.2.31"
}
}
2 changes: 1 addition & 1 deletion packages/vite/LICENSE.md
Expand Up @@ -1210,7 +1210,7 @@ Repository: git+https://github.com/guybedford/es-module-lexer.git
> MIT License
> -----------
>
> Copyright (C) 2018-2021 Guy Bedford
> Copyright (C) 2018-2022 Guy Bedford
>
> 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:
>
Expand Down
28 changes: 14 additions & 14 deletions packages/vite/package.json
Expand Up @@ -44,25 +44,25 @@
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
"dependencies": {
"esbuild": "^0.14.27",
"postcss": "^8.4.6",
"postcss": "^8.4.12",
"resolve": "^1.22.0",
"rollup": "^2.59.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
},
"devDependencies": {
"@ampproject/remapping": "^2.1.0",
"@babel/parser": "^7.17.0",
"@ampproject/remapping": "^2.1.2",
"@babel/parser": "^7.17.7",
"@babel/types": "^7.17.0",
"@jridgewell/trace-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.4",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-dynamic-import-vars": "^1.4.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "13.1.3",
"@rollup/plugin-typescript": "^8.3.0",
"@rollup/pluginutils": "^4.1.2",
"@rollup/plugin-typescript": "^8.3.1",
"@rollup/pluginutils": "^4.2.0",
"@types/convert-source-map": "^1.5.2",
"@types/cross-spawn": "^6.0.2",
"@types/debug": "^4.1.7",
Expand All @@ -71,12 +71,12 @@
"@types/less": "^3.0.3",
"@types/micromatch": "^4.0.2",
"@types/mime": "^2.0.3",
"@types/node": "^16.11.22",
"@types/node": "^16.11.26",
"@types/resolve": "^1.20.1",
"@types/sass": "~1.43.1",
"@types/stylus": "^0.48.36",
"@types/ws": "^8.2.2",
"@vue/compiler-dom": "^3.2.30",
"@types/ws": "^8.5.3",
"@vue/compiler-dom": "^3.2.31",
"acorn": "^8.7.0",
"cac": "6.7.9",
"chokidar": "^3.5.3",
Expand All @@ -88,14 +88,14 @@
"debug": "^4.3.3",
"dotenv": "^14.3.2",
"dotenv-expand": "^5.1.0",
"es-module-lexer": "^0.9.3",
"es-module-lexer": "^0.10.1",
"estree-walker": "^2.0.2",
"etag": "^1.8.1",
"fast-glob": "^3.2.11",
"http-proxy": "^1.18.1",
"json5": "^2.2.0",
"launch-editor-middleware": "^2.3.0",
"magic-string": "^0.25.7",
"magic-string": "^0.26.1",
"micromatch": "^4.0.4",
"mrmime": "^1.0.0",
"node-forge": "^1.2.1",
Expand All @@ -105,13 +105,13 @@
"picocolors": "^1.0.0",
"postcss-import": "^14.0.2",
"postcss-load-config": "^3.1.3",
"postcss-modules": "^4.3.0",
"postcss-modules": "^4.3.1",
"resolve.exports": "^1.1.0",
"rollup-plugin-license": "^2.6.1",
"sirv": "^2.0.2",
"source-map-support": "^0.5.21",
"strip-ansi": "^6.0.1",
"terser": "^5.10.0",
"terser": "^5.12.1",
"tsconfck": "^1.2.0",
"tslib": "^2.3.1",
"types": "link:./types",
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/src/node/plugins/importAnalysis.ts
Expand Up @@ -388,7 +388,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
continue
}

const isDynamicImport = dynamicIndex >= 0
const isDynamicImport = dynamicIndex > -1

// static import or valid string in dynamic import
// If resolvable, let's resolve it
Expand Down Expand Up @@ -474,8 +474,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
if (isDynamicImport) {
// rewrite `import('package')` to expose the default directly
str().overwrite(
dynamicIndex,
end + 1,
expStart,
expEnd,
`import('${url}').then(m => m.default && m.default.__esModule ? m.default : ({ ...m.default, default: m.default }))`
)
} else {
Expand Down
11 changes: 6 additions & 5 deletions packages/vite/src/node/plugins/importAnalysisBuild.ts
Expand Up @@ -142,6 +142,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
s: start,
e: end,
ss: expStart,
se: expEnd,
n: specifier,
d: dynamicIndex
} = imports[index]
Expand Down Expand Up @@ -173,10 +174,9 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {

if (dynamicIndex > -1 && insertPreload) {
needPreloadHelper = true
const dynamicEnd = source.indexOf(`)`, end) + 1
const original = source.slice(dynamicIndex, dynamicEnd)
const original = source.slice(expStart, expEnd)
const replacement = `${preloadMethod}(() => ${original},${isModernFlag}?"${preloadMarker}":void 0)`
str().overwrite(dynamicIndex, dynamicEnd, replacement)
str().overwrite(expStart, expEnd, replacement)
}

// Differentiate CSS imports that use the default export from those that
Expand Down Expand Up @@ -263,7 +263,8 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
n: name,
s: start,
e: end,
d: dynamicIndex
ss: expStart,
se: expEnd
} = imports[index]
// check the chunk being imported
let url = name
Expand Down Expand Up @@ -302,7 +303,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
hasRemovedPureCssChunk = true
}

s.overwrite(dynamicIndex, end + 1, 'Promise.resolve({})')
s.overwrite(expStart, expEnd, 'Promise.resolve({})')
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions packages/vite/src/node/server/send.ts
Expand Up @@ -38,7 +38,8 @@ export function send(

if (req.headers['if-none-match'] === etag) {
res.statusCode = 304
return res.end()
res.end()
return
}

res.setHeader('Content-Type', alias[type] || type)
Expand All @@ -63,7 +64,8 @@ export function send(
}

res.statusCode = 200
return res.end(content)
res.end(content)
return
}

function genSourceMapString(map: SourceMap | string | undefined) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/transformRequest.ts
Expand Up @@ -63,7 +63,7 @@ export function transformRequest(
// In all cases, the next time this module is requested, it should be
// re-processed.
//
// We save the timestap when we start processing and compare it with the
// We save the timestamp when we start processing and compare it with the
// last time this module is invalidated
const timestamp = Date.now()

Expand Down

0 comments on commit 07a01b5

Please sign in to comment.