Skip to content

Commit fd20741

Browse files
keydingbrankoconjic
andauthoredFeb 4, 2024
refactor: rewrite js sdk (#48)
* refactor: rewrite js sdk * feat: integrate comprehensive JS SDK rewrite Merge includes a complete overhaul of the JavaScript SDK, introducing full type-safety, tree-shakeable modules, and deprecated legacy SDK classes and methods. BREAKING CHANGE: The SDK rewrite introduces breaking changes to the public API. Users are recommended to migrate to the new API functions. Resolves: #35, #29, #28, #25, #22, #19 * chore: add pre-commit and commit-msg git hooks --------- Co-authored-by: Branko Conjic <brankoconjic@gmail.com>
1 parent c048b26 commit fd20741

File tree

103 files changed

+16355
-5799
lines changed

Some content is hidden

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

103 files changed

+16355
-5799
lines changed
 

‎.changeset/config.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3-
"changelog": ["@changesets/changelog-github", { "repo": "lmsqueezy/lemonsqueezy.js" }],
4-
"commit": false,
5-
"fixed": [],
6-
"linked": [],
7-
"access": "public",
8-
"baseBranch": "main",
9-
"updateInternalDependencies": "patch",
10-
"ignore": []
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "lmsqueezy/lemonsqueezy.js" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
1111
}

‎.changeset/modern-laws-hang.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
"@lemonsqueezy/lemonsqueezy.js": major
3+
---
4+
5+
BREAKING CHANGE: Completely rewritten the JS SDK for full type-safety and tree-shakeability.
6+
7+
## Notes:
8+
9+
- **Bun**: Transitioned to Bun for repo management.
10+
11+
- **Type-safe**: Written in TypeScript and documented with TSDoc.
12+
13+
- **Tree-shakeable**: Use only functions that you need.
14+
15+
- **Improved docs**: Added detailed Wiki pages on how to use the new SDK functions.
16+
17+
- **Deprecate old SDK classes and methods**: The deprecated methods and the LemonSqueezy class will be removed with the next major release.
18+
19+
- **Unit tests**: Introduces comprehensive unit tests for all functions.
20+
21+
- **Improved repo management**: Transitioned to Bun, adopted Conventional Commits convention, husky, Prettier, ESLint and other tools for better repo management.
22+
23+
## Fixes:
24+
25+
This release fixes the following issues.
26+
27+
- #35
28+
- #29
29+
- #28
30+
- #25
31+
- #22
32+
- #19
33+
34+
## How to upgrade
35+
36+
Use the new setup function to initialize the SDK with your API key.
37+
38+
```tsx
39+
lemonSqueezySetup({ apiKey });
40+
```
41+
42+
Import functions from the SDK and use them in your application.
43+
44+
```tsx
45+
const { data, error, statusCode } = await getAuthenticatedUser();
46+
```
47+
48+
For more information, see [API Reference](https://docs.lemonsqueezy.com/api) and [Functions Usage Wiki](https://github.com/lmsqueezy/lemonsqueezy.js/wiki).
49+
50+
## Credits
51+
52+
🎉 A massive thanks to @heybrostudio for their awesome work and contributions that led to this release.

0 commit comments

Comments
 (0)
Please sign in to comment.