forked from yarnpkg/berry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes TypeScript 3.5 compatibility (yarnpkg#1061)
* Updates the patches * Adds tests * Fixes versions * Updates the cache
- Loading branch information
Showing
9 changed files
with
104 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ on: | |
pull_request: | ||
paths: | ||
- .github/workflows/e2e-typescript-workflow.yml | ||
- packages/plugin-compat/sources/patches/typescript.patch.ts | ||
- scripts/e2e-setup-ci.sh | ||
|
||
name: 'E2E TypeScript' | ||
|
@@ -27,6 +28,17 @@ jobs: | |
run: | | ||
node ./scripts/run-yarn.js build:cli | ||
- name: 'Installing all versions of TS' | ||
run: | | ||
source scripts/e2e-setup-ci.sh | ||
yarn init -p | ||
yarn add \ | ||
v35@npm:[email protected] \ | ||
v36@npm:[email protected] \ | ||
v37@npm:[email protected] \ | ||
v38@npm:[email protected] | ||
- name: 'Running the integration test' | ||
run: | | ||
source scripts/e2e-setup-ci.sh | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
releases: | ||
"@yarnpkg/cli": prerelease | ||
"@yarnpkg/plugin-compat": prerelease | ||
|
||
declined: | ||
- "@yarnpkg/plugin-constraints" | ||
- "@yarnpkg/plugin-dlx" | ||
- "@yarnpkg/plugin-essentials" | ||
- "@yarnpkg/plugin-init" | ||
- "@yarnpkg/plugin-interactive-tools" | ||
- "@yarnpkg/plugin-node-modules" | ||
- "@yarnpkg/plugin-npm-cli" | ||
- "@yarnpkg/plugin-pack" | ||
- "@yarnpkg/plugin-patch" | ||
- "@yarnpkg/plugin-pnp" | ||
- "@yarnpkg/plugin-stage" | ||
- "@yarnpkg/plugin-typescript" | ||
- "@yarnpkg/plugin-version" | ||
- "@yarnpkg/plugin-workspace-tools" | ||
- "@yarnpkg/core" | ||
- "@yarnpkg/doctor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,11 @@ set -ex | |
THIS_DIR=$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
TEMP_DIR="$(mktemp -d)" | ||
|
||
HASHES=( | ||
"426f5a7" ">=3 <3.6" | ||
"bcb6dbf" ">3.6" | ||
) | ||
|
||
git clone [email protected]:arcanis/typescript "$TEMP_DIR"/clone | ||
|
||
mkdir -p "$TEMP_DIR"/orig | ||
|
@@ -11,36 +16,44 @@ mkdir -p "$TEMP_DIR"/patched | |
reset-git() { | ||
git checkout . | ||
git clean -df | ||
|
||
yarn | ||
} | ||
|
||
cd "$TEMP_DIR"/clone | ||
|
||
yarn | ||
|
||
reset-git | ||
git checkout master | ||
|
||
yarn gulp local LKG | ||
cp -r lib "$TEMP_DIR"/orig/ | ||
|
||
reset-git | ||
git checkout mael/pnp | ||
while [[ ${#HASHES[@]} -gt 0 ]]; do | ||
HASH="${HASHES[0]}" | ||
RANGE="${HASHES[1]}" | ||
HASHES=("${HASHES[@]:2}") | ||
|
||
yarn gulp local LKG | ||
cp -r lib/ "$TEMP_DIR"/patched/ | ||
reset-git | ||
git checkout "$HASH" | ||
|
||
yarn gulp local LKG | ||
cp -r lib/ "$TEMP_DIR"/patched/ | ||
|
||
PATCHFILE="$THIS_DIR"/../../sources/patches/typescript.patch.ts | ||
rm -f "$PATCHFILE" && touch "$PATCHFILE" | ||
PATCHFILE="$THIS_DIR"/../../sources/patches/typescript.patch.ts | ||
rm -f "$PATCHFILE" && touch "$PATCHFILE" | ||
|
||
git diff --no-index "$TEMP_DIR"/orig "$TEMP_DIR"/patched \ | ||
| perl -p -e"s#^--- #semver exclusivity $RANGE\n--- #" \ | ||
| perl -p -e"s#$TEMP_DIR/orig##" \ | ||
| perl -p -e"s#$TEMP_DIR/patched##" \ | ||
| perl -p -e"s#__spreadArrays#[].concat#" \ | ||
>> "$TEMP_DIR"/patch.tmp || true | ||
done | ||
|
||
echo 'export const patch =' \ | ||
>> "$PATCHFILE" | ||
git diff --no-index "$TEMP_DIR"/orig "$TEMP_DIR"/patched \ | ||
| perl -p -e"s#^--- #semver exclusivity >=3\n--- #" \ | ||
| perl -p -e"s#$TEMP_DIR/orig##" \ | ||
| perl -p -e"s#$TEMP_DIR/patched##" \ | ||
| perl -p -e"s#__spreadArrays#[].concat#" \ | ||
> "$TEMP_DIR"/patch.tmp || true | ||
node "$THIS_DIR"/../jsonEscape.js < "$TEMP_DIR"/patch.tmp \ | ||
>> "$PATCHFILE" | ||
echo ';' \ | ||
>> "$PATCHFILE" | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters