Skip to content

Commit c9211a9

Browse files
committed
build: automate prepare/lerna:prepare for yarn3+
we lost the `prepare` script auto-execution when we moved to yarn3+, but you may emulate it with a yarn plugin so, add a post-install plugin for yarn, and have it call our preparation scripts
1 parent e9cad01 commit c9211a9

File tree

11 files changed

+24
-10
lines changed

11 files changed

+24
-10
lines changed

.github/workflows/create_test_patches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
timeout_minutes: 15
5252
retry_wait_seconds: 60
5353
max_attempts: 3
54-
command: DETOX_DISABLE_POSTINSTALL=1 yarn && yarn lerna:prepare
54+
command: DETOX_DISABLE_POSTINSTALL=1 yarn
5555

5656
- name: Create Patches
5757
env:

.github/workflows/linting.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
timeout_minutes: 15
4444
retry_wait_seconds: 30
4545
max_attempts: 3
46-
command: yarn && yarn lerna:prepare
46+
command: yarn
4747
- name: Lint
4848
uses: nick-fields/retry@v3
4949
with:
@@ -83,7 +83,7 @@ jobs:
8383
timeout_minutes: 15
8484
retry_wait_seconds: 30
8585
max_attempts: 3
86-
command: yarn && yarn lerna:prepare
86+
command: yarn
8787
- name: Lint
8888
run: yarn tsc:compile
8989
- uses: actions/cache/save@v4
@@ -118,7 +118,7 @@ jobs:
118118
timeout_minutes: 15
119119
retry_wait_seconds: 30
120120
max_attempts: 3
121-
command: yarn && yarn lerna:prepare
121+
command: yarn
122122
- name: Yarn Install (Website)
123123
uses: nick-fields/retry@v3
124124
with:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
timeout_minutes: 15
3131
retry_wait_seconds: 60
3232
max_attempts: 3
33-
command: yarn && yarn lerna:prepare
33+
command: yarn
3434
- name: GIT Setup
3535
# Alter branding of release commit, despite GITHUB_TOKEN having real owner
3636
run: |

.github/workflows/tests_e2e_android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
timeout_minutes: 15
156156
retry_wait_seconds: 60
157157
max_attempts: 3
158-
command: DETOX_DISABLE_POSTINSTALL=1 yarn && yarn lerna:prepare
158+
command: DETOX_DISABLE_POSTINSTALL=1 yarn
159159

160160
- name: Cache Firestore Emulator
161161
uses: actions/cache@v4

.github/workflows/tests_e2e_ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
timeout_minutes: 15
157157
retry_wait_seconds: 60
158158
max_attempts: 3
159-
command: yarn && yarn lerna:prepare
159+
command: yarn
160160

161161
- name: Setup Ruby
162162
uses: ruby/setup-ruby@v1

.github/workflows/tests_e2e_other.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
timeout_minutes: 15
143143
retry_wait_seconds: 60
144144
max_attempts: 3
145-
command: DETOX_DISABLE_POSTINSTALL=1 yarn && yarn lerna:prepare
145+
command: DETOX_DISABLE_POSTINSTALL=1 yarn
146146

147147
- name: Setup Ruby
148148
uses: ruby/setup-ruby@v1

.github/workflows/tests_jest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
timeout_minutes: 15
5151
retry_wait_seconds: 60
5252
max_attempts: 3
53-
command: yarn && yarn lerna:prepare
53+
command: yarn
5454
- name: Jest
5555
run: yarn tests:jest-coverage
5656
- uses: codecov/codecov-action@v5
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable */
2+
//prettier-ignore
3+
module.exports = {
4+
name: "@yarnpkg/plugin-postinstall-dev",
5+
factory: function (require) {
6+
var plugin=(()=>{var i=Object.create,s=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var u=t=>s(t,"__esModule",{value:!0});var f=t=>{if(typeof require!="undefined")return require(t);throw new Error('Dynamic require of "'+t+'" is not supported')};var g=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},k=(t,e,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!p.call(t,r)&&r!=="default"&&s(t,r,{get:()=>e[r],enumerable:!(o=n(e,r))||o.enumerable});return t},P=t=>k(u(s(t!=null?i(l(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var x={};g(x,{default:()=>w});var c=P(f("@yarnpkg/core")),a="postinstallDev",h={hooks:{async afterAllInstalled(t){let e=t.topLevelWorkspace.anchoredLocator;if(await c.scriptUtils.hasPackageScript(e,a,{project:t})){let o=await c.scriptUtils.executePackageScript(e,a,[],{project:t,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr});if(o!==0){let r=new Error(`${a} script failed with exit code ${o}`);throw r.stack=void 0,r}}}}},w=h;return x;})();
7+
return plugin;
8+
}
9+
};

.yarnrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ nmHoistingLimits: workspaces
66

77
nodeLinker: node-modules
88

9+
plugins:
10+
- checksum: 67ce9e30cf152af35d3dc292f915cb39220942f5f406211801da2b721d873857f8ea6d9c57893e1295133f5d128fa6388bf16a4610ef788f30e987e58f84db26
11+
path: .yarn/plugins/@yarnpkg/plugin-postinstall-dev.cjs
12+
spec: "https://raw.githubusercontent.com/sachinraja/yarn-plugin-postinstall-dev/main/bundles/%40yarnpkg/plugin-postinstall-dev.js"
13+
914
yarnPath: .yarn/releases/yarn-4.9.2.cjs

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ cd react-native-firebase
9797

9898
```bash
9999
yarn
100-
yarn lerna:prepare # Note, requires very current node, e.g., node v22.19.1+
101100
brew tap wix/brew
102101
brew install applesimutils xcbeautify
103102
```

0 commit comments

Comments
 (0)