Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# Mark generated files as binary to prevent git from trying to merge them
/.pnp.* binary linguist-generated
packages/plugin-compat/sources/patches/*.ts binary linguist-generated
packages/yarnpkg-pnp/sources/esm-loader/built-loader.js binary linguist-generated
packages/yarnpkg-pnp/sources/hook.js binary linguist-generated
packages/yarnpkg-core/sources/worker-zip/index.js binary linguist-generated
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@ jobs:
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}

- name: 'Check that the patch files are consistent with fresh builds'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/plugin-compat/sources/patches | wc -l) -gt 0 ]]; then
for generator in packages/plugin-compat/extra/*/gen-*-patch.sh; do
bash $generator;
done
for generator in packages/plugin-compat/extra/*/gen-*-patch.js; do
yarn node $generator;
done
[[ $(git diff --name-only packages/plugin-compat/sources/patches "packages/plugin-compat/extra/typescript/patch*" | tee /dev/stderr | wc -l) -eq 0 ]]
fi
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}

- name: 'Check that libzip artifacts are consistent with a fresh build (fix w/ "git merge master && bash packages/yarnpkg-libzip/artifacts/build.sh")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/yarnpkg-libzip/artifacts' 'packages/yarnpkg-libzip/sources/*.js' | wc -l) -gt 0 ]]; then
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/plugin-compat-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,46 @@ jobs:
- name: 'Run the plugin-compat tests'
run: |
node ./scripts/run-yarn.js test:plugin-compat

check-patches:
name: 'Check that the patch files are consistent with fresh builds'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: |
git fetch --no-tags --unshallow origin HEAD master

- uses: ./.github/actions/prepare

- name: 'Regenerate affected patches'
run: |
PKGS=$(basename -a packages/plugin-compat/extra/*/)
if ! git diff --quiet "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/plugin-compat/extra' ':!packages/plugin-compat/extra/*/*'; then
# If a file outside of the package-specific folders changed, rebuild all patches
for pkg in $PKGS; do
echo "::group::Regenerating $pkg patch"
yarn "build:patch:$pkg" '*'
echo "::endgroup::"
done
else
# Otherwise, only rebuild the patches that have changed
for pkg in $PKGS; do
if ! git diff --quiet "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- "packages/plugin-compat/sources/patches/$pkg.patch.ts" "packages/plugin-compat/extra/$pkg/"; then
echo "::group::Regenerating $pkg patch"
yarn "build:patch:$pkg" '*'
echo "::endgroup::"
fi
done
fi
if ! git diff --quiet -- 'packages/plugin-compat/extra/*/patches/*' 'packages/plugin-compat/sources/patches/'; then
echo ''
echo "Files would be changed by fresh builds:"
git diff --name-only -- 'packages/plugin-compat/extra/*/patches/*' 'packages/plugin-compat/sources/patches/' | sed 's/^/- /'
exit 1
fi
shell: bash
if: github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
GEN_PATCHES_NO_CACHE: '1'
228 changes: 164 additions & 64 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 23 additions & 0 deletions .yarn/versions/df63f4ee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-compat": patch

declined:
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
Loading
Loading