Skip to content

Commit

Permalink
Removes Webpack/Babel in favor of SWC (#461)
Browse files Browse the repository at this point in the history
- Moves to swc
- Removes uneccessary deps
- Exports all errors and models
- Moves from babel/register to swc-node/register
- Fixes typos
- Fixes testing different node versions
  • Loading branch information
ralexmatthews authored Jul 24, 2024
1 parent d17e60c commit 64656fe
Show file tree
Hide file tree
Showing 18 changed files with 3,005 additions and 5,778 deletions.
54 changes: 0 additions & 54 deletions .babelrc

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ jobs:
node-version: [12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x, 21.x, 22.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js To Build
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 22.x
- run: make install
- run: make install-styleguide
- run: make build
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test
- name: Use Node.js ${{ matrix.node-version }} to test importing and using
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: make test-import-and-use
lint:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timeout": 10000,
"require": ["@babel/register", "dotenv/config", "./test/helpers/common.js"],
"require": ["@swc-node/register", "dotenv/config", "./test/helpers/common.js"],
"recursive": true
}
2 changes: 1 addition & 1 deletion .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"lines": 90,
"reporter": ["lcov", "text"],
"include": ["src/**/*.js"],
"require": ["@babel/register", "./test/helpers/common.js"]
"require": ["@swc-node/register", "./test/helpers/common.js"]
}
7 changes: 7 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://swc.rs/schema.json",
"sourceMaps": true,
"env": {
"targets": "Node >= 12"
}
}
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ scan:
test:
npm run test

## test actually importing and useing the built version
test-import-and-use:
npm run test-import-and-use

## update - Update dependencies (Unix only)
update: | update-examples-submodule
npm update
Expand Down
1 change: 0 additions & 1 deletion index.js

This file was deleted.

Loading

0 comments on commit 64656fe

Please sign in to comment.