Skip to content

Commit 0f73f54

Browse files
v2.0.0-rc.0 - Edge runtime support and more. (#45)
## 2.0.0-rc.0 - 2024-09-26 > **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below. ### Added - Added support for edge runtime. ### Changed - **Breaking change:** Updated the minimum required Node.js version to v18. - **Breaking change:** `Webhooks.unmarshal` and `Webhooks.isSignatureValid` now returns a promise. - Enabled conditional exports based on runtimes. - Switched from `node-fetch` to native `fetch` API. ---
1 parent 2b65e10 commit 0f73f54

File tree

562 files changed

+2402
-1997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

562 files changed

+2402
-1997
lines changed

.eslintrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ rules:
2222
ignorePatterns:
2323
- 'jest.config.js'
2424
- '**/__tests__/**'
25+
- 'index.esm.*.ts'

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "08:00"
9+
groups:
10+
npm:
11+
patterns:
12+
- "*"

.github/workflows/build-test.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
push:
55
branches:
66
- main
7-
- v1.X
7+
- v1.x
88
- release/beta
99
pull_request:
1010
branches:
1111
- main
12-
- v1.X
12+
- v1.x
1313
- release/beta
1414

1515
concurrency:
@@ -20,19 +20,21 @@ jobs:
2020
run-build-test:
2121
name: Run Build & test
2222
runs-on: ubuntu-latest
23-
23+
strategy:
24+
matrix:
25+
node: [ 18, 20, 22 ]
2426
permissions:
2527
contents: read
2628
actions: write
2729

2830
steps:
2931
- name: Check out git repository
30-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3133

3234
- name: Set up Node.js
33-
uses: actions/setup-node@v3
35+
uses: actions/setup-node@v4
3436
with:
35-
node-version: lts/*
37+
node-version: ${{ matrix.node }}
3638
cache: "yarn"
3739

3840
- name: Install yarn dependencies

.github/workflows/linting.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
push:
55
branches:
66
- main
7-
- v1.X
7+
- v1.x
88
- release/beta
99
pull_request:
1010
branches:
1111
- main
12-
- v1.X
12+
- v1.x
1313
- release/beta
1414

1515
concurrency:
@@ -27,10 +27,10 @@ jobs:
2727

2828
steps:
2929
- name: Check out git repository
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3131

3232
- name: Set up Node.js
33-
uses: actions/setup-node@v3
33+
uses: actions/setup-node@v4
3434
with:
3535
node-version: lts/*
3636
cache: "yarn"

.github/workflows/publish-beta.yml

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

.github/workflows/publish-latest.yml renamed to .github/workflows/publish.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- v1.x
78

89
jobs:
910
run-publish:
@@ -16,10 +17,10 @@ jobs:
1617

1718
steps:
1819
- name: Check out git repository
19-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2021

2122
- name: Set up Node.js
22-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2324
with:
2425
node-version: lts/*
2526
cache: "yarn"
@@ -35,6 +36,12 @@ jobs:
3536
run: yarn test
3637

3738
- name: Publish
38-
run: yarn publish:latest
39+
run: |
40+
VERSION=$(node -p "require('./package.json').version" )
41+
if [[ "$VERSION" =~ (rc) ]]; then
42+
yarn publish:rc
43+
else
44+
yarn publish:latest
45+
fi
3946
env:
4047
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-on-push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- v1.x
78

89
jobs:
910
release_on_push:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
1212

1313
This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.
1414

15+
## 2.0.0-rc.0 - 2024-09-26
16+
17+
> **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below.
18+
19+
### Added
20+
21+
- Added support for edge runtime.
22+
23+
### Changed
24+
25+
- **Breaking change:** Updated the minimum required Node.js version to v18.
26+
- **Breaking change:** `Webhooks.unmarshal` and `Webhooks.isSignatureValid` now returns a promise.
27+
- Enabled conditional exports based on runtimes.
28+
- Switched from `node-fetch` to native `fetch` API.
29+
30+
---
31+
1532
## 1.7.0 - 2024-09-18
1633

1734
### Fixed

UPGRADING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Upgrading
2+
3+
All breaking changes will be documented in this file to assist with upgrading to newer versions of the SDK.
4+
5+
## v2.0.0
6+
7+
There are two breaking changes in this release:
8+
9+
1. Minimum Node.js version is now 18.0.0.
10+
- We had to restrict the minimum version as we would like to use native `fetch` API instead of `node-fetch` package.
11+
- If you are using Node.js version 16 or below, you will need to upgrade to Node.js version 18 or above.
12+
13+
2. `Webhooks.unmarshal` and `Webhooks.isSignatureValid` now returns a promise.
14+
- As we started supporting edge runtimes, we had to make these methods async as the edge version of crypto returns a promise.
15+
- If you are using these methods, you will need to update your code to handle the promise.
16+
17+
---

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const config = {
99
testMatch: ['**/__tests__/**/*.test.ts'],
1010
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
1111
cacheDirectory: process.env.JEST_CACHE_FOLDER || '/tmp/node-sdk/.jest-cache',
12+
moduleNameMapper: {
13+
'(.+)\\.js': '$1',
14+
},
1215
coveragePathIgnorePatterns: [
1316
'/src/types/',
1417
'__tests__',

0 commit comments

Comments
 (0)