Skip to content
Merged
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
47 changes: 0 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ permissions:
contents: read
pull-requests: read

env:
NX_NO_CLOUD: true
NX_CACHE_FILES: "modules/*/src/**/*.ts,modules/*/src/**/*.js,modules/*/*.json"

jobs:
unit-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -67,31 +63,16 @@ jobs:
- name: Check In-Repo Package Versions
run: yarn run check-versions

- name: restore nx cache
id: nx-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
if: "!contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')"
with:
path: |
.nx/cache
modules/*/dist
key: ${{ runner.os }}-nx-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles(env.NX_CACHE_FILES) }}
restore-keys: |
${{ runner.os }}-nx-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-nx-${{ matrix.node-version }}-

- name: build packages
env:
# Workaround for https://github.com/nodejs/node/issues/51555
DISABLE_V8_COMPILE_CACHE: '1'
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'SKIP_CACHE') && 'true' || '' }}
run: yarn run postinstall

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

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

- name: restore nx cache
id: nx-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
if: "!contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')"
with:
path: |
.nx/cache
modules/*/dist
key: ${{ runner.os }}-nx-license-${{ hashFiles('yarn.lock') }}-${{ hashFiles(env.NX_CACHE_FILES) }}
restore-keys: |
${{ runner.os }}-nx-license-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-nx-license-

- name: build packages
env:
# Workaround for https://github.com/nodejs/node/issues/51555
DISABLE_V8_COMPILE_CACHE: '1'
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'SKIP_CACHE') && 'true' || '' }}
run: yarn run postinstall

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

- name: restore nx cache
id: nx-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
if: "!contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')"
with:
path: |
.nx/cache
modules/*/dist
key: ${{ runner.os }}-nx-browser-${{ hashFiles('yarn.lock') }}-${{ hashFiles(env.NX_CACHE_FILES) }}
restore-keys: |
${{ runner.os }}-nx-browser-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-nx-browser-

- name: build packages
if: steps.lerna-cache.outputs.cache-hit == 'true'
env:
Expand All @@ -308,7 +262,6 @@ jobs:
run: yarn run browser-tests
env:
BITGOJS_TEST_PASSWORD: ${{ secrets.BITGOJS_TEST_PASSWORD }}
NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'SKIP_CACHE') && 'true' || '' }}

docker-build:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ permissions:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

env:
NX_NO_CLOUD: true
NX_SKIP_NX_CACHE: true

jobs:
publish:
name: Publish Release
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ modules/**/pack-scoped/
coverage
/.direnv/
.claude/
.nx/
CLAUDE.sessions.md
sessions/
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ CHANGELOG.md
flake.lock

modules/babylonlabs-io-btc-staking-ts/

/.nx/workspace-data
62 changes: 0 additions & 62 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,64 +54,6 @@ yarn integration-test
yarn coverage
```

### Test Caching
BitGoJS uses Lerna + Nx for local test caching to speed up development:

```bash
# Tests are automatically cached when you run them
yarn unit-test

# Cache status is shown in output:
# - Fresh run: Tests execute normally
# - Cache hit: "[existing outputs match the cache, left as is]"

# Clear cache if needed
yarn clean-cache

# Cache works with all test commands
yarn unit-test --scope @bitgo/sdk-core # Caches per package
yarn unit-test-changed # Caches changed packages
```

The cache automatically invalidates when:
- Source files change
- Test files change
- Dependencies change
- Configuration files change (tsconfig.json, .mocharc.*, package.json)

### CI Caching

BitGoJS CI uses both GitHub Actions cache and Nx cache for optimal performance:

**GitHub Actions Cache**:
- Caches `node_modules` and `modules/*/node_modules`
- Caches `.nx/cache` and `modules/*/dist` directories
- Cache keys include source file hashes for proper invalidation

**Nx Cache**:
- Automatically enabled in CI (via `useNx: true` in lerna.json)
- Caches build outputs and test results
- Respects task dependencies (tests depend on builds)

**Skipping Cache**:
- Add the `SKIP_CACHE` label to a PR to bypass all caching
- This forces fresh installs and builds
- When `SKIP_CACHE` is used:
- GitHub Actions cache is not restored
- Nx caching is disabled (`NX_SKIP_NX_CACHE=true`)
- All tasks run fresh without any caching

**Troubleshooting**:
If you encounter module resolution errors in CI:
```bash
# Option 1: Use --skip-nx-cache flag
yarn unit-test --skip-nx-cache

# Option 2: Clear cache and rebuild
yarn clean-cache
yarn build
```

### Browser Compatibility
```bash
# Run browser tests
Expand Down Expand Up @@ -179,7 +121,3 @@ This will generate the necessary boilerplate for a new coin implementation.
## Node.js Version Support

BitGoJS supports Node.js versions >=20 and <23, with NPM >=3.10.10.

## Sessions System Behaviors

@CLAUDE.sessions.md
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"version": {
"message": "chore(root): publish modules"
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useNx": true
"useNx": false
}
1 change: 0 additions & 1 deletion modules/babylonlabs-io-btc-staking-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"author": "Babylon Labs Ltd.",
"license": "SEE LICENSE IN LICENSE",
"devDependencies": {
"@types/glob": "^8.1.0",
"dts-bundle-generator": "^9.3.1",
"esbuild": "^0.20.2",
"nanoevents": "^9.1.0"
Expand Down
3 changes: 3 additions & 0 deletions modules/express/encryptedPrivKeys.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"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=\"}"
}
6 changes: 0 additions & 6 deletions modules/express/test/unit/clientRoutes/externalSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ describe('External signer', () => {
if (nock.isActive()) {
nock.restore();
}

// Clean up encryptedPrivKeys.json file if it exists
const encryptedPrivKeysPath = 'encryptedPrivKeys.json';
if (fs.existsSync(encryptedPrivKeysPath)) {
fs.unlinkSync(encryptedPrivKeysPath);
}
});

it('should read an encrypted prv from signerFileSystemPath and pass it to coin.signTransaction', async () => {
Expand Down
84 changes: 0 additions & 84 deletions nx.json

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"https-browserify": "^1.0.0",
"husky": "^8.0.1",
"improved-yarn-audit": "^3.0.0",
"lerna": "^8.2.4",
"lerna": "^5.5.0",
"lint-staged": "^12.4.1",
"make-dir": "^3.1.0",
"mocha": "10.6.0",
Expand Down Expand Up @@ -128,7 +128,6 @@
"check-fmt-changed": "lerna run check-fmt --since origin/${GITHUB_REPO_BRANCH:-master}..HEAD --stream --parallel",
"check-fmt": "lerna run check-fmt --stream --parallel",
"check-commits": "yarn commitlint --from=origin/${GITHUB_REPO_BRANCH:-master} -V",
"clean-cache": "npx nx reset",
"check-deps": "tsx ./scripts/check-package-dependencies.ts",
"check-versions": "node ./check-package-versions.js",
"dev": "tsc -b ./tsconfig.packages.json -w",
Expand Down
Loading