Skip to content

Commit 65921d3

Browse files
authored
chore: swap makefile for justfile (#532)
# Description <!-- Please provide a general summary of your PR changes and link any related issues or other pull requests. --> # Testing <!-- Please provide details on how you tested this code. See below. - All pull requests must be tested (unit tests where possible with accompanying cassettes, or provide a screenshot of end-to-end testing when unit tests are not possible) - New features must get a new unit test - Bug fixes/refactors must re-record existing cassettes --> # Pull Request Type Please select the option(s) that are relevant to this PR. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)
1 parent 812b3c4 commit 65921d3

7 files changed

Lines changed: 443 additions & 419 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
15+
- uses: extractions/setup-just@v3
1516
- uses: actions/setup-node@v6
1617
with:
1718
node-version: 24
18-
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make install install-styleguide build test
19+
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install install-styleguide build test
1920
# node-compatibility checks that the build version of the app can be imported
2021
# and used on older versions of node
2122
node-compatibility:
@@ -24,32 +25,35 @@ jobs:
2425
matrix:
2526
node-version: [16.x, 17.x, 18.x, 19.x, 20.x, 21.x, 22.x, 24.x]
2627
steps:
27-
- uses: actions/checkout@v5
28+
- uses: actions/checkout@v6
29+
- uses: extractions/setup-just@v3
2830
- uses: actions/setup-node@v6
2931
with:
3032
node-version: 24
31-
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make install install-styleguide build
33+
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install install-styleguide build
3234
- uses: actions/setup-node@v6
3335
with:
3436
node-version: ${{ matrix.node-version }}
35-
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test-node-compatibility
37+
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test-node-compatibility
3638
lint:
3739
runs-on: ubuntu-latest
3840
steps:
39-
- uses: actions/checkout@v5
41+
- uses: actions/checkout@v6
42+
- uses: extractions/setup-just@v3
4043
- uses: actions/setup-node@v6
4144
with:
4245
node-version: 24
43-
- run: make install install-styleguide build lint
46+
- run: just install install-styleguide build lint
4447
coverage:
4548
runs-on: ubuntu-latest
4649
steps:
47-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
51+
- uses: extractions/setup-just@v3
4852
- uses: actions/setup-node@v6
4953
with:
5054
node-version: 24
51-
- run: make install install-styleguide build
52-
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
55+
- run: just install install-styleguide build
56+
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
5357
- name: Coveralls
5458
if: github.ref == 'refs/heads/master'
5559
uses: coverallsapp/github-action@master
@@ -59,14 +63,15 @@ jobs:
5963
if: github.ref == 'refs/heads/master'
6064
runs-on: ubuntu-latest
6165
steps:
62-
- uses: actions/checkout@v5
66+
- uses: actions/checkout@v6
67+
- uses: extractions/setup-just@v3
6368
- uses: actions/setup-node@v6
6469
with:
6570
node-version: 24
6671
- name: Install Dependencies
67-
run: make install
72+
run: just install
6873
- name: Generate Docs
69-
run: make docs
74+
run: just docs
7075
- name: Deploy docs
7176
uses: peaceiris/actions-gh-pages@v3
7277
with:

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@v6
13+
- uses: extractions/setup-just@v3
1314
- uses: actions/setup-node@v6
1415
with:
1516
node-version: 24

Makefile

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

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ client.clearResponseHooks();
199199

200200
API documentation can be found at: <https://docs.easypost.com>.
201201

202-
Library documentation can be found on the web at: <https://easypost.github.io/easypost-node/> or by building them locally via the `make docs` command.
202+
Library documentation can be found on the web at: <https://easypost.github.io/easypost-node/> or by building them locally via the `just docs` command.
203203

204204
Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md).
205205

@@ -213,33 +213,33 @@ For additional support, see our [org-wide support policy](https://github.com/Eas
213213

214214
```bash
215215
# Install dependencies
216-
make install
216+
just install
217217

218218
# Install style guides (Unix only)
219-
make install-styleguide
219+
just install-styleguide
220220

221221
# Update dependencies
222-
make update
222+
just update
223223

224224
# Build the project
225-
make build
225+
just build
226226

227227
# Lint the project
228-
make lint
229-
make lint-fix
228+
just lint
229+
just lint-fix
230230

231231
# Run tests (these will be transpiled on the fly)
232-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make test
233-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make coverage
232+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test
233+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage
234234

235235
# Run security analysis
236-
make scan
236+
just scan
237237

238238
# Generate library documentation
239-
make docs
239+
just docs
240240

241241
# Update submodules
242-
make update-examples-submodule
242+
just update-examples-submodule
243243
```
244244

245245
### Typescript Definitions

audit-ci.jsonc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
"$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json",
33
// Only fail the audit if there are critical vulnerabilities.
44
"critical": true,
5+
// Can't update ESLint yet because we must support Node 16
6+
"allowlist": ["GHSA-p5wg-g6qr-c7cg"],
57
}

justfile

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Builds the project
2+
build:
3+
npm run build
4+
5+
# Cleans the project
6+
clean:
7+
npm run clean
8+
9+
# Test the project and generate a coverage report
10+
coverage:
11+
npm run coverage
12+
13+
# Generate docs for the library
14+
docs:
15+
npm run docs
16+
17+
# Lint the project
18+
eslint:
19+
npm run lint
20+
21+
# Fixes the lint
22+
eslint-fix:
23+
npm run lintFix
24+
25+
# Initialize the examples submodule
26+
init-examples-submodule:
27+
git submodule init
28+
git submodule update
29+
30+
# Install the styleguide (Unix only)
31+
install-styleguide: init-examples-submodule
32+
sh examples/symlink_directory_files.sh examples/style_guides/node .
33+
34+
# Install project dependencies (Unix only)
35+
install: init-examples-submodule
36+
npm install
37+
38+
# Lint the project
39+
lint: eslint prettier scan
40+
41+
# Fix linting errors
42+
lint-fix: eslint-fix prettier-fix
43+
44+
# Publish the built assets to NPM
45+
publish:
46+
npm publish
47+
48+
# Publish the built assets to NPM for a release candidate
49+
publish-next:
50+
npm publish --tag next
51+
52+
# Checks the format with prettier
53+
prettier:
54+
npm run formatCheck
55+
56+
# Fixes the format with prettier
57+
prettier-fix:
58+
npm run format
59+
60+
# Cuts a release for the project on GitHub (requires GitHub CLI)
61+
# tag = The associated tag title of the release
62+
# target = Target branch or full commit SHA
63+
release tag target:
64+
gh release create {{tag}} dist/* --target {{target}}
65+
66+
# Runs security analysis on the project with Brakeman
67+
scan:
68+
npm run scan
69+
70+
# Test the project
71+
test:
72+
npm run test
73+
74+
# Check the built project works for older versions of Node
75+
test-node-compatibility:
76+
npm run test:node-compatibility
77+
78+
# Update dependencies (Unix only)
79+
update: update-examples-submodule
80+
npm update
81+
82+
# Update the examples submodule
83+
update-examples-submodule:
84+
git submodule init
85+
git submodule update --remote

0 commit comments

Comments
 (0)