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 Apr 26, 2024
2 parents 72150d6 + f71ba5b commit 064f747
Show file tree
Hide file tree
Showing 47 changed files with 523 additions and 423 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # v44.0.0
uses: tj-actions/changed-files@0874344d6ebbaa00a27da73276ae7162fadcaf69 # v44.3.0
with:
files: |
docs/**
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"docs-serve": "vitepress serve"
},
"devDependencies": {
"@shikijs/vitepress-twoslash": "^1.2.4",
"@shikijs/vitepress-twoslash": "^1.3.0",
"@types/express": "^4.17.21",
"vitepress": "1.0.2",
"vue": "^3.4.21"
"vitepress": "1.1.3",
"vue": "^3.4.24"
}
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,28 @@
"@types/etag": "^1.8.3",
"@types/fs-extra": "^11.0.4",
"@types/less": "^3.0.6",
"@types/micromatch": "^4.0.6",
"@types/node": "^20.12.5",
"@types/micromatch": "^4.0.7",
"@types/node": "^20.12.7",
"@types/picomatch": "^2.3.3",
"@types/semver": "^7.5.8",
"@types/stylus": "^0.48.42",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vitejs/release-scripts": "^1.3.1",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^8.57.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-i": "^2.29.1",
"eslint-plugin-n": "^17.2.0",
"eslint-plugin-n": "^17.2.1",
"eslint-plugin-regexp": "^2.5.0",
"execa": "^8.0.1",
"feed": "^4.2.2",
"fs-extra": "^11.2.0",
"lint-staged": "^15.2.2",
"npm-run-all2": "^6.1.2",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.43.0",
"playwright-chromium": "^1.43.1",
"prettier": "3.2.5",
"rimraf": "^5.0.5",
"rollup": "^4.13.0",
Expand All @@ -84,7 +84,7 @@
"typescript": "^5.2.2",
"unbuild": "^2.0.0",
"vite": "workspace:*",
"vitest": "^1.4.0"
"vitest": "^1.5.0"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false"
Expand All @@ -103,7 +103,7 @@
"eslint --cache --fix"
]
},
"packageManager": "[email protected].6",
"packageManager": "[email protected].7",
"pnpm": {
"overrides": {
"vite": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-vite/template-lit-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"lit": "^3.1.2"
"lit": "^3.1.3"
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"preview": "vite preview"
},
"dependencies": {
"lit": "^3.1.2"
"lit": "^3.1.3"
},
"devDependencies": {
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-preact-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.20.1"
"preact": "^10.20.2"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.2",
"typescript": "^5.2.2",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.20.1"
"preact": "^10.20.2"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.2",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-qwik-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"preview": "serve dist"
},
"devDependencies": {
"serve": "^14.2.1",
"serve": "^14.2.2",
"typescript": "^5.2.2",
"vite": "^5.2.8"
"vite": "^5.2.10"
},
"dependencies": {
"@builder.io/qwik": "^1.5.1"
"@builder.io/qwik": "^1.5.2"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-qwik/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "serve dist"
},
"devDependencies": {
"serve": "^14.2.1",
"vite": "^5.2.8"
"serve": "^14.2.2",
"vite": "^5.2.10"
},
"dependencies": {
"@builder.io/qwik": "^1.5.1"
"@builder.io/qwik": "^1.5.2"
}
}
10 changes: 5 additions & 5 deletions packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"typescript": "^5.2.2",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-solid-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"preview": "vite preview"
},
"dependencies": {
"solid-js": "^1.8.16"
"solid-js": "^1.8.17"
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.2.8",
"vite": "^5.2.10",
"vite-plugin-solid": "^2.10.2"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"solid-js": "^1.8.16"
"solid-js": "^1.8.17"
},
"devDependencies": {
"vite": "^5.2.8",
"vite": "^5.2.10",
"vite-plugin-solid": "^2.10.2"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-svelte-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@tsconfig/svelte": "^5.0.4",
"svelte": "^4.2.12",
"svelte": "^4.2.15",
"svelte-check": "^3.6.9",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"svelte": "^4.2.12",
"vite": "^5.2.8"
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"svelte": "^4.2.15",
"vite": "^5.2.10"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"preview": "vite preview"
},
"devDependencies": {
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-vue-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.4.21"
"vue": "^3.4.24"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"typescript": "^5.2.2",
"vite": "^5.2.8",
"vue-tsc": "^2.0.11"
"vite": "^5.2.10",
"vue-tsc": "^2.0.14"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.4.21"
"vue": "^3.4.24"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"vite": "^5.2.8"
"vite": "^5.2.10"
}
}
2 changes: 1 addition & 1 deletion packages/plugin-legacy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ npm add -D terser
### `modernTargets`

- **Type:** `string | string[]`
- **Default:** [`'edge>=80, firefox>=72, chrome>=80, safari>=13.1, chromeAndroid>=80, iOS>=13.1'`](https://browsersl.ist/#q=edge%3E%3D80%2C+firefox%3E%3D72%2C+chrome%3E%3D80%2C+safari%3E%3D13.1%2C+chromeAndroid%3E%3D80%2C+iOS%3E%3D13.1)
- **Default:** [`'edge>=79, firefox>=67, chrome>=64, safari>=12, chromeAndroid>=64, iOS>=12'`](https://browsersl.ist/#q=edge%3E%3D79%2C+firefox%3E%3D67%2C+chrome%3E%3D64%2C+safari%3E%3D12%2C+chromeAndroid%3E%3D64%2C+iOS%3E%3D12)

If explicitly set, it's passed on to [`@babel/preset-env`](https://babeljs.io/docs/en/babel-preset-env#targets) when rendering **modern chunks**.

Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"@babel/preset-env": "^7.24.4",
"browserslist": "^4.23.0",
"browserslist-to-esbuild": "^2.1.1",
"core-js": "^3.36.1",
"magic-string": "^0.30.9",
"core-js": "^3.37.0",
"magic-string": "^0.30.10",
"regenerator-runtime": "^0.14.1",
"systemjs": "^6.14.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-legacy/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface Options {
*/
targets?: string | string[] | { [key: string]: string }
/**
* default: 'edge>=80, firefox>=72, chrome>=80, safari>=13.1, chromeAndroid>=80, iOS>=13.1'
* default: 'edge>=79, firefox>=67, chrome>=64, safari>=12, chromeAndroid>=64, iOS>=12'
*/
modernTargets?: string | string[]
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"http-proxy": "^1.18.1",
"launch-editor-middleware": "^2.6.1",
"lightningcss": "^1.24.1",
"magic-string": "^0.30.9",
"magic-string": "^0.30.10",
"micromatch": "^4.0.5",
"mlly": "^1.6.1",
"mrmime": "^2.0.0",
Expand All @@ -144,7 +144,7 @@
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-license": "^3.3.1",
"sass": "^1.74.1",
"sass": "^1.75.0",
"sirv": "^2.0.4",
"source-map-support": "^0.5.21",
"strip-ansi": "^7.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ exports[`parse positives > ? in worker 1`] = `"__variableDynamicImportRuntimeHel
exports[`parse positives > alias path 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js")), \`./mods/\${base}.js\`)"`;
exports[`parse positives > alias path with multi ../ 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("../../*.js")), \`../../\${base}.js\`)"`;
exports[`parse positives > basic 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js")), \`./mods/\${base}.js\`)"`;
exports[`parse positives > with ../ and itself 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("../dynamicImportVar/*.js")), \`./\${name}.js\`)"`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ async function run(input: string) {
(await transformDynamicImport(
input,
normalizePath(resolve(__dirname, 'index.js')),
(id) => id.replace('@', resolve(__dirname, './mods/')),
(id) =>
id
.replace('@', resolve(__dirname, './mods/'))
.replace('#', resolve(__dirname, '../../')),
__dirname,
)) || {}
return `__variableDynamicImportRuntimeHelper(${glob}, \`${rawPattern}\`)`
Expand All @@ -27,6 +30,10 @@ describe('parse positives', () => {
expect(await run('`@/${base}.js`')).toMatchSnapshot()
})

it('alias path with multi ../', async () => {
expect(await run('`#/${base}.js`')).toMatchSnapshot()
})

it('with query', async () => {
expect(await run('`./mods/${base}.js?foo=bar`')).toMatchSnapshot()
})
Expand Down
13 changes: 7 additions & 6 deletions packages/vite/src/node/plugins/dynamicImportVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,14 @@ export async function transformDynamicImport(
if (!resolvedFileName) {
return null
}
const relativeFileName = posix.relative(
posix.dirname(normalizePath(importer)),
normalizePath(resolvedFileName),
)
importSource = normalizePath(
'`' + (relativeFileName[0] === '.' ? '' : './') + relativeFileName + '`',
const relativeFileName = normalizePath(
posix.relative(
posix.dirname(normalizePath(importer)),
normalizePath(resolvedFileName),
),
)
importSource =
'`' + (relativeFileName[0] === '.' ? '' : './') + relativeFileName + '`'
}

const dynamicImportPattern = parseDynamicImportPattern(importSource)
Expand Down
Loading

0 comments on commit 064f747

Please sign in to comment.