simplify a complex peer semver used by astro add (#3633)
* fix peer semver used by astro add * Create pink-shirts-mix.md * update with regex over `' '` split Co-authored-by: Ben Holmes <hey@bholmes.dev>
This commit is contained in:
parent
b9f891b8a6
commit
921d9a27e2
2 changed files with 6 additions and 1 deletions
5
.changeset/pink-shirts-mix.md
Normal file
5
.changeset/pink-shirts-mix.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Fix a bug with `astro add react` adding a too-complex semver to your package.json
|
|
@ -407,7 +407,7 @@ async function getInstallIntegrationsCommand({
|
|||
.map<[string, string | null][]>((i) => [[i.packageName, null], ...i.dependencies])
|
||||
.flat(1)
|
||||
.filter((dep, i, arr) => arr.findIndex((d) => d[0] === dep[0]) === i)
|
||||
.map(([name, version]) => (version === null ? name : `${name}@${version}`))
|
||||
.map(([name, version]) => (version === null ? name : `${name}@${version.split(/\s*\|\|\s*/).pop()}`))
|
||||
.sort();
|
||||
|
||||
switch (pm.name) {
|
||||
|
|
Loading…
Reference in a new issue