Skip to content

Commit c4fdfac

Browse files
authored
Merge pull request #7141 from BitGo/revert-7098-WP-6096/nx-cache
Revert "feat: upgrade lerna and enable local cache"
2 parents ca7d097 + 846ea74 commit c4fdfac

File tree

12 files changed

+4308
-4163
lines changed

12 files changed

+4308
-4163
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ permissions:
1414
contents: read
1515
pull-requests: read
1616

17-
env:
18-
NX_NO_CLOUD: true
19-
NX_CACHE_FILES: "modules/*/src/**/*.ts,modules/*/src/**/*.js,modules/*/*.json"
20-
2117
jobs:
2218
unit-test:
2319
runs-on: ubuntu-latest
@@ -67,31 +63,16 @@ jobs:
6763
- name: Check In-Repo Package Versions
6864
run: yarn run check-versions
6965

70-
- name: restore nx cache
71-
id: nx-cache
72-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
73-
if: "!contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')"
74-
with:
75-
path: |
76-
.nx/cache
77-
modules/*/dist
78-
key: ${{ runner.os }}-nx-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles(env.NX_CACHE_FILES) }}
79-
restore-keys: |
80-
${{ runner.os }}-nx-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}-
81-
${{ runner.os }}-nx-${{ matrix.node-version }}-
82-
8366
- name: build packages
8467
env:
8568
# Workaround for https://github.com/nodejs/node/issues/51555
8669
DISABLE_V8_COMPILE_CACHE: '1'
87-
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'SKIP_CACHE') && 'true' || '' }}
8870
run: yarn run postinstall
8971

9072
- name: Unit Test
9173
run: yarn run unit-test-changed
9274
env:
9375
BITGOJS_TEST_PASSWORD: ${{ secrets.BITGOJS_TEST_PASSWORD }}
94-
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'SKIP_CACHE') && 'true' || '' }}
9576

9677
# - name: Upload Code Coverage
9778
# run: |
@@ -177,24 +158,10 @@ jobs:
177158
if: steps.lerna-cache.outputs.cache-hit != 'true'
178159
run: yarn install --with-frozen-lockfile --ignore-scripts
179160

180-
- name: restore nx cache
181-
id: nx-cache
182-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
183-
if: "!contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')"
184-
with:
185-
path: |
186-
.nx/cache
187-
modules/*/dist
188-
key: ${{ runner.os }}-nx-license-${{ hashFiles('yarn.lock') }}-${{ hashFiles(env.NX_CACHE_FILES) }}
189-
restore-keys: |
190-
${{ runner.os }}-nx-license-${{ hashFiles('yarn.lock') }}-
191-
${{ runner.os }}-nx-license-
192-
193161
- name: build packages
194162
env:
195163
# Workaround for https://github.com/nodejs/node/issues/51555
196164
DISABLE_V8_COMPILE_CACHE: '1'
197-
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'SKIP_CACHE') && 'true' || '' }}
198165
run: yarn run postinstall
199166

200167
- name: Run Fossa Analysis
@@ -284,19 +251,6 @@ jobs:
284251
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
285252
run: yarn install --with-frozen-lockfile
286253

287-
- name: restore nx cache
288-
id: nx-cache
289-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
290-
if: "!contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')"
291-
with:
292-
path: |
293-
.nx/cache
294-
modules/*/dist
295-
key: ${{ runner.os }}-nx-browser-${{ hashFiles('yarn.lock') }}-${{ hashFiles(env.NX_CACHE_FILES) }}
296-
restore-keys: |
297-
${{ runner.os }}-nx-browser-${{ hashFiles('yarn.lock') }}-
298-
${{ runner.os }}-nx-browser-
299-
300254
- name: build packages
301255
if: steps.lerna-cache.outputs.cache-hit == 'true'
302256
env:
@@ -308,7 +262,6 @@ jobs:
308262
run: yarn run browser-tests
309263
env:
310264
BITGOJS_TEST_PASSWORD: ${{ secrets.BITGOJS_TEST_PASSWORD }}
311-
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'SKIP_CACHE') && 'true' || '' }}
312265

313266
docker-build:
314267
runs-on: ubuntu-latest

.github/workflows/publish.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ permissions:
1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313

14-
env:
15-
NX_NO_CLOUD: true
16-
NX_SKIP_NX_CACHE: true
17-
1814
jobs:
1915
publish:
2016
name: Publish Release

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@ modules/**/pack-scoped/
1818
coverage
1919
/.direnv/
2020
.claude/
21-
.nx/
22-
CLAUDE.sessions.md
23-
sessions/

.prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ CHANGELOG.md
88
flake.lock
99

1010
modules/babylonlabs-io-btc-staking-ts/
11-
12-
/.nx/workspace-data

CLAUDE.md

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -54,64 +54,6 @@ yarn integration-test
5454
yarn coverage
5555
```
5656

57-
### Test Caching
58-
BitGoJS uses Lerna + Nx for local test caching to speed up development:
59-
60-
```bash
61-
# Tests are automatically cached when you run them
62-
yarn unit-test
63-
64-
# Cache status is shown in output:
65-
# - Fresh run: Tests execute normally
66-
# - Cache hit: "[existing outputs match the cache, left as is]"
67-
68-
# Clear cache if needed
69-
yarn clean-cache
70-
71-
# Cache works with all test commands
72-
yarn unit-test --scope @bitgo/sdk-core # Caches per package
73-
yarn unit-test-changed # Caches changed packages
74-
```
75-
76-
The cache automatically invalidates when:
77-
- Source files change
78-
- Test files change
79-
- Dependencies change
80-
- Configuration files change (tsconfig.json, .mocharc.*, package.json)
81-
82-
### CI Caching
83-
84-
BitGoJS CI uses both GitHub Actions cache and Nx cache for optimal performance:
85-
86-
**GitHub Actions Cache**:
87-
- Caches `node_modules` and `modules/*/node_modules`
88-
- Caches `.nx/cache` and `modules/*/dist` directories
89-
- Cache keys include source file hashes for proper invalidation
90-
91-
**Nx Cache**:
92-
- Automatically enabled in CI (via `useNx: true` in lerna.json)
93-
- Caches build outputs and test results
94-
- Respects task dependencies (tests depend on builds)
95-
96-
**Skipping Cache**:
97-
- Add the `SKIP_CACHE` label to a PR to bypass all caching
98-
- This forces fresh installs and builds
99-
- When `SKIP_CACHE` is used:
100-
- GitHub Actions cache is not restored
101-
- Nx caching is disabled (`NX_SKIP_NX_CACHE=true`)
102-
- All tasks run fresh without any caching
103-
104-
**Troubleshooting**:
105-
If you encounter module resolution errors in CI:
106-
```bash
107-
# Option 1: Use --skip-nx-cache flag
108-
yarn unit-test --skip-nx-cache
109-
110-
# Option 2: Clear cache and rebuild
111-
yarn clean-cache
112-
yarn build
113-
```
114-
11557
### Browser Compatibility
11658
```bash
11759
# Run browser tests
@@ -179,7 +121,3 @@ This will generate the necessary boilerplate for a new coin implementation.
179121
## Node.js Version Support
180122

181123
BitGoJS supports Node.js versions >=20 and <23, with NPM >=3.10.10.
182-
183-
## Sessions System Behaviors
184-
185-
@CLAUDE.sessions.md

lerna.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"version": "independent",
33
"npmClient": "yarn",
4+
"useWorkspaces": true,
45
"command": {
56
"version": {
67
"message": "chore(root): publish modules"
78
}
89
},
910
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
10-
"useNx": true
11+
"useNx": false
1112
}

modules/babylonlabs-io-btc-staking-ts/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"author": "Babylon Labs Ltd.",
3333
"license": "SEE LICENSE IN LICENSE",
3434
"devDependencies": {
35-
"@types/glob": "^8.1.0",
3635
"dts-bundle-generator": "^9.3.1",
3736
"esbuild": "^0.20.2",
3837
"nanoevents": "^9.1.0"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"61f039aad587c2000745c687373e0fa9": "{\"iv\":\"W14so0ZwIVOO/5y4cl3H3g==\",\"v\":1,\"iter\":10000,\"ks\":256,\"ts\":64,\"mode\":\"ccm\",\"adata\":\"\",\"cipher\":\"aes\",\"salt\":\"Jeck6aR6egU=\",\"ct\":\"GfqFuIoLp5jOTSTTB1byjWlW4D/8WBTr35P2UDjud0b0nA0WnJVAytbNkTlSIsRemhXQrcwhA74/BwZ14zvU4Frtmt3D3tvqKtb4i1ZVPREpcsIbp9V/RC+E5acNX6+bUCMXVZMEuYEGtkDxNRSIGsRZkAeTFlg=\"}"
3+
}

modules/express/test/unit/clientRoutes/externalSign.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ describe('External signer', () => {
9898
if (nock.isActive()) {
9999
nock.restore();
100100
}
101-
102-
// Clean up encryptedPrivKeys.json file if it exists
103-
const encryptedPrivKeysPath = 'encryptedPrivKeys.json';
104-
if (fs.existsSync(encryptedPrivKeysPath)) {
105-
fs.unlinkSync(encryptedPrivKeysPath);
106-
}
107101
});
108102

109103
it('should read an encrypted prv from signerFileSystemPath and pass it to coin.signTransaction', async () => {

nx.json

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)