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
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-node@v6
with:
node-version: 24
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make install install-styleguide build test
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install install-styleguide build test
# node-compatibility checks that the build version of the app can be imported
# and used on older versions of node
node-compatibility:
Expand All @@ -24,32 +25,35 @@ jobs:
matrix:
node-version: [16.x, 17.x, 18.x, 19.x, 20.x, 21.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-node@v6
with:
node-version: 24
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make install install-styleguide build
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install install-styleguide build
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test-node-compatibility
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test-node-compatibility
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-node@v6
with:
node-version: 24
- run: make install install-styleguide build lint
- run: just install install-styleguide build lint
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-node@v6
with:
node-version: 24
- run: make install install-styleguide build
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
- run: just install install-styleguide build
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
- name: Coveralls
if: github.ref == 'refs/heads/master'
uses: coverallsapp/github-action@master
Expand All @@ -59,14 +63,15 @@ jobs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Install Dependencies
run: make install
run: just install
- name: Generate Docs
run: make docs
run: just docs
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: actions/setup-node@v6
with:
node-version: 24
Expand Down
91 changes: 0 additions & 91 deletions Makefile

This file was deleted.

24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ client.clearResponseHooks();

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

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.
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.

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

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

```bash
# Install dependencies
make install
just install

# Install style guides (Unix only)
make install-styleguide
just install-styleguide

# Update dependencies
make update
just update

# Build the project
make build
just build

# Lint the project
make lint
make lint-fix
just lint
just lint-fix

# Run tests (these will be transpiled on the fly)
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make test
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make coverage
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage

# Run security analysis
make scan
just scan

# Generate library documentation
make docs
just docs

# Update submodules
make update-examples-submodule
just update-examples-submodule
```

### Typescript Definitions
Expand Down
2 changes: 2 additions & 0 deletions audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
"$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json",
// Only fail the audit if there are critical vulnerabilities.
"critical": true,
// Can't update ESLint yet because we must support Node 16
"allowlist": ["GHSA-p5wg-g6qr-c7cg"],
}
85 changes: 85 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Builds the project
build:
npm run build

# Cleans the project
clean:
npm run clean

# Test the project and generate a coverage report
coverage:
npm run coverage

# Generate docs for the library
docs:
npm run docs

# Lint the project
eslint:
npm run lint

# Fixes the lint
eslint-fix:
npm run lintFix

# Initialize the examples submodule
init-examples-submodule:
git submodule init
git submodule update

# Install the styleguide (Unix only)
install-styleguide: init-examples-submodule
sh examples/symlink_directory_files.sh examples/style_guides/node .

# Install project dependencies (Unix only)
install: init-examples-submodule
npm install

# Lint the project
lint: eslint prettier scan

# Fix linting errors
lint-fix: eslint-fix prettier-fix

# Publish the built assets to NPM
publish:
npm publish

# Publish the built assets to NPM for a release candidate
publish-next:
npm publish --tag next

# Checks the format with prettier
prettier:
npm run formatCheck

# Fixes the format with prettier
prettier-fix:
npm run format

# Cuts a release for the project on GitHub (requires GitHub CLI)
# tag = The associated tag title of the release
# target = Target branch or full commit SHA
release tag target:
gh release create {{tag}} dist/* --target {{target}}

# Runs security analysis on the project with Brakeman
scan:
npm run scan

# Test the project
test:
npm run test

# Check the built project works for older versions of Node
test-node-compatibility:
npm run test:node-compatibility

# Update dependencies (Unix only)
update: update-examples-submodule
npm update

# Update the examples submodule
update-examples-submodule:
git submodule init
git submodule update --remote
Loading