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
30 changes: 18 additions & 12 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,39 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
node-version: [22.x, 24.x, 26.x]

steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v5
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: ${{matrix.node-version}}
cache: yarn
- name: Yarn
run: yarn
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: yarn lint && yarn test
run: pnpm lint && pnpm test

report-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v5
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: yarn
- name: Yarn
run: yarn
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: yarn coverage
run: pnpm coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
Expand All @@ -53,13 +57,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v5
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: yarn
- name: Yarn
run: yarn
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Pack SDK tarball
run: |
SDK_TARBALL="$(npm pack --silent --ignore-scripts | tail -n 1)"
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn run pre-commit
pnpm run pre-commit
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,39 +56,39 @@ Clone the repository and install dependencies:
```bash
git clone https://github.com/Unleash/unleash-node-sdk.git
cd unleash-node-sdk
yarn install
pnpm install
```

The [client specification](https://github.com/Unleash/client-specification) test data is included as a dev dependency (`@unleash/client-specification`). It defines a shared contract that all Unleash SDKs test against.

### Running tests

```bash
yarn test # run tests
yarn coverage # run tests with coverage
pnpm test # run tests
pnpm coverage # run tests with coverage
```

### Benchmarking

Run the feature flag evaluation benchmark:

```bash
yarn bench:isEnabled
pnpm bench:isEnabled
```

### Code style and formatting

The project uses [Biome](https://biomejs.dev/) for linting and formatting:

```bash
yarn lint # check for issues
yarn lint:fix # auto-fix issues
pnpm lint # check for issues
pnpm lint:fix # auto-fix issues
```

### Building

```bash
yarn build # compile TypeScript to lib/
pnpm build # compile TypeScript to lib/
```

## License
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.11/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
43 changes: 19 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"pre-commit": "lint-staged",
"prebuild": "del-cli --force lib",
"build": "tsc -p .",
"prepare": "husky && yarn run build",
"prepare": "husky && pnpm run build",
"test": "vitest run",
"coverage": "vitest run --coverage",
"bench:isEnabled": "node ./bench/is-enabled.bench.js"
Expand All @@ -33,13 +33,13 @@
"dependencies": {
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.5",
"ip-address": "^10.0.0",
"ip-address": "^10.2.0",
"launchdarkly-eventsource": "2.2.0",
"lru-cache": "^11.2.5",
"make-fetch-happen": "^15.0.3",
"murmurhash3js": "^3.0.1",
"proxy-from-env": "^1.1.0",
"re2js": "^1.2.2",
"re2js": "^2.6.1",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one, why did we use such an old re2js version?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not old, 1.2.2 was released in Feb. This is a major upgrade, what does the re2js changelog say about the change?

"semver": "^7.7.3"
},
"engines": {
Expand All @@ -51,46 +51,41 @@
"examples"
],
"devDependencies": {
"@biomejs/biome": "2.4.11",
"@biomejs/biome": "2.4.15",
"@tsconfig/node20": "^20.1.0",
"@types/express": "^4.17.25",
"@types/jsbn": "^1.2.33",
"@types/make-fetch-happen": "^10.0.4",
"@types/murmurhash3js": "^3.0.7",
"@types/nock": "^11.1.0",
"@types/node": "^20.17.17",
"@types/node": "^22.19.18",
"@types/proxy-from-env": "^1.0.4",
"@types/semver": "^7.5.0",
"@types/semver": "^7.7.1",
"@unleash/client-specification": "6.1.0",
"@vitest/coverage-v8": "4.0.14",
"@vitest/ui": "4.0.14",
"@vitest/coverage-v8": "4.1.5",
"@vitest/ui": "4.1.5",
"del-cli": "^7.0.0",
"husky": "^9.1.7",
"lint-staged": "^16.2.7",
"lint-staged": "^17.0.4",
"mkdirp": "^3.0.1",
"nock": "^14.0.10",
"nock": "^14.0.15",
"redis": "^4.6.7",
"sinon": "^21.0.0",
"tinybench": "^2.9.0",
"typescript": "^5.9.3",
"vitest": "^4.0.14"
"vitest": "^4.1.5"
},
"resolutions": {
"ansi-regex": "^5.0.1",
"debug": "^4.0.0",
"braces": "^3.0.3",
"ip-address": "^10.0.0",
"json-schema": "^0.4.0",
"json5": "^2.0.0",
"qs": "^6.5.3",
"minimatch": "^9.0.0",
"semver": "^7.5.3"
"pnpm": {
"overrides": {
"ansi-regex": "^5.0.1",
"debug": "^4.0.0",
"braces": "^3.0.3",
"minimatch": "^10.2.5"
}
},
"lint-staged": {
"*.{js,ts,jsx,tsx,json,md}": [
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
]
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"packageManager": "pnpm@11.0.8",
"type": "commonjs"
}
Loading
Loading