diff options
author | 2022-06-22 14:13:32 -0700 | |
---|---|---|
committer | 2022-06-22 16:13:32 -0500 | |
commit | 921d9a27e243c27e40e429a0a5c7d562d7b9633f (patch) | |
tree | 24169ada193c8ca435ea8d4d53f21abddcbb61d4 | |
parent | b9f891b8a65652e5ef167829c19b0a3f39501bb4 (diff) | |
download | astro-921d9a27e243c27e40e429a0a5c7d562d7b9633f.tar.gz astro-921d9a27e243c27e40e429a0a5c7d562d7b9633f.tar.zst astro-921d9a27e243c27e40e429a0a5c7d562d7b9633f.zip |
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>
-rw-r--r-- | .changeset/pink-shirts-mix.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/add/index.ts | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/pink-shirts-mix.md b/.changeset/pink-shirts-mix.md new file mode 100644 index 000000000..a1d14454a --- /dev/null +++ b/.changeset/pink-shirts-mix.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fix a bug with `astro add react` adding a too-complex semver to your package.json diff --git a/packages/astro/src/core/add/index.ts b/packages/astro/src/core/add/index.ts index 09664f8f1..f02259912 100644 --- a/packages/astro/src/core/add/index.ts +++ b/packages/astro/src/core/add/index.ts @@ -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) { |