Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@
// breaking changes
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
],
"customManagers": [
{
"customType": "regex",
"fileMatch": ["packages\/create-vite\/src\/index\\.ts$"],
"matchStrings": [
"\/\/\\s*renovate:\\s+datasource=(?<datasource>\\S+)\\s+depName=(?<depName>\\S+)\\s+(?:var|let|const)\\s+\\S+\\s*=\\s*[\"'](?<currentValue>[^\"']+)[\"']",
],
},
],
}
5 changes: 4 additions & 1 deletion packages/create-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,13 @@ function pkgFromUserAgent(userAgent: string | undefined): PkgInfo | undefined {
}

function setupReactSwc(root: string, isTs: boolean) {
// renovate: datasource=npm depName=@vitejs/plugin-react-swc
const reactSwcPluginVersion = '3.7.2'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const reactSwcPluginVersion = '3.7.2'
const reactSwcPluginVersion = '3.7.0'

I'm not sure how to test this PR. Maybe setting a lower version so that renovate tries to update it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with not testing this for now. Verifying the regex manually it seems that it should work as expected though.


editFile(path.resolve(root, 'package.json'), (content) => {
return content.replace(
/"@vitejs\/plugin-react": ".+?"/,
`"@vitejs/plugin-react-swc": "^3.7.2"`,
`"@vitejs/plugin-react-swc": "^${reactSwcPluginVersion}"`,
)
})
editFile(
Expand Down