diff --git a/.changeset/modern-laws-hang.md b/.changeset/modern-laws-hang.md deleted file mode 100644 index 868f817..0000000 --- a/.changeset/modern-laws-hang.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -"@lemonsqueezy/lemonsqueezy.js": major ---- - -BREAKING CHANGE: Completely rewritten the JS SDK for full type-safety and tree-shakeability. - -## Notes: - -- **Bun**: Transitioned to Bun for repo management. - -- **Type-safe**: Written in TypeScript and documented with TSDoc. - -- **Tree-shakeable**: Use only functions that you need. - -- **Improved docs**: Added detailed Wiki pages on how to use the new SDK functions. - -- **Deprecate old SDK classes and methods**: The deprecated methods and the LemonSqueezy class will be removed with the next major release. - -- **Unit tests**: Introduces comprehensive unit tests for all functions. - -- **Improved repo management**: Transitioned to Bun, adopted Conventional Commits convention, husky, Prettier, ESLint and other tools for better repo management. - -## Fixes: - -This release fixes the following issues. - -- #35 -- #29 -- #28 -- #25 -- #22 -- #19 - -## How to upgrade - -Use the new setup function to initialize the SDK with your API key. - -```tsx -lemonSqueezySetup({ apiKey }); -``` - -Import functions from the SDK and use them in your application. - -```tsx -const { data, error, statusCode } = await getAuthenticatedUser(); -``` - -For more information, see [API Reference](https://docs.lemonsqueezy.com/api) and [Functions Usage Wiki](https://github.com/lmsqueezy/lemonsqueezy.js/wiki). - -## Credits - -🎉 A massive thanks to @heybrostudio for their awesome work and contributions that led to this release. \ No newline at end of file diff --git a/.changeset/weak-ads-beg.md b/.changeset/weak-ads-beg.md deleted file mode 100644 index 6ffade2..0000000 --- a/.changeset/weak-ads-beg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@lemonsqueezy/lemonsqueezy.js": patch ---- - -update dependencies diff --git a/.github/changeset-version.js b/.github/changeset-version.js deleted file mode 100644 index 15d64f2..0000000 --- a/.github/changeset-version.js +++ /dev/null @@ -1,7 +0,0 @@ -// This script is used by the `release.yml` workflow to update the version of the packages being released. -// The standard step is only to run `changeset version` but this does not update the package-lock.json file. -// So we also run `bun install`, which does this update. -// This is a workaround until this is handled automatically by `changeset version`. -// See https://github.com/changesets/changesets/issues/421. -Bun.spawnSync("bun", ["changeset", "version"]); -Bun.spawnSync("bun", ["install"]); diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e94cac5..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -env: - STORE_PATH: "" - -jobs: - release: - if: ${{ github.repository_owner == 'lmsqueezy' }} - name: "Create Release Pull Request or Publish to npm" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Bun - uses: oven-sh/setup-bun@v1 - - - name: Install dependencies - run: bun install - - - name: Build the package - run: bun run build - - - name: Publish to NPM - id: changesets - uses: changesets/action@v1.4.5 - with: - commit: "chore(release): version packages" - title: "chore(release): version packages" - version: bun changeset version && bun install - publish: bun changeset publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NODE_ENV: "production" diff --git a/CHANGELOG.md b/CHANGELOG.md index 49445f1..90e9f2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,56 @@ # @lemonsqueezy/lemonsqueezy.js +## 2.0.0 + +### Major Changes + +- [#48](https://github.com/lmsqueezy/lemonsqueezy.js/pull/48) [`fd20741`](https://github.com/lmsqueezy/lemonsqueezy.js/commit/fd20741b496a37d54981be5485ca9218126fc25a) Thanks [@keyding](https://github.com/keyding)! - BREAKING CHANGE: Completely rewritten the JS SDK for full type-safety and tree-shakeability. + + ## Notes: + + - **Bun**: Transitioned to Bun for repo management. + - **Type-safe**: Written in TypeScript and documented with TSDoc. + - **Tree-shakeable**: Use only functions that you need. + - **Improved docs**: Added detailed Wiki pages on how to use the new SDK functions. + - **Deprecate old SDK classes and methods**: The deprecated methods and the LemonSqueezy class will be removed with the next major release. + - **Unit tests**: Introduces comprehensive unit tests for all functions. + - **Improved repo management**: Transitioned to Bun, adopted Conventional Commits convention, husky, Prettier, ESLint and other tools for better repo management. + + ## Fixes: + + This release fixes the following issues. + + - #35 + - #29 + - #28 + - #25 + - #22 + - #19 + + ## How to upgrade + + Use the new setup function to initialize the SDK with your API key. + + ```tsx + lemonSqueezySetup({ apiKey }); + ``` + + Import functions from the SDK and use them in your application. + + ```tsx + const { data, error, statusCode } = await getAuthenticatedUser(); + ``` + + For more information, see [API Reference](https://docs.lemonsqueezy.com/api) and [Functions Usage Wiki](https://github.com/lmsqueezy/lemonsqueezy.js/wiki). + + ## Credits + + 🎉 A massive thanks to @heybrostudio for their awesome work and contributions that led to this release. + +### Patch Changes + +- [#50](https://github.com/lmsqueezy/lemonsqueezy.js/pull/50) [`655fe01`](https://github.com/lmsqueezy/lemonsqueezy.js/commit/655fe014597c2bc838a70ff36acd9cbdd1df9180) Thanks [@brankoconjic](https://github.com/brankoconjic)! - update dependencies + ## 1.2.5 ### Patch Changes diff --git a/package.json b/package.json index c702715..0932090 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@lemonsqueezy/lemonsqueezy.js", "description": "The official Lemon Squeezy JavaScript SDK.", - "version": "1.2.5", + "version": "2.0.0", "author": { "name": "Lemon Squeezy", "email": "hello@lemonsqueezy.com", @@ -56,7 +56,11 @@ "lint:fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix", "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'", "test": "bun test", - "typecheck": "tsc --noEmit" + "typecheck": "tsc --noEmit", + "version": "changeset version", + "version:dev": "changeset version --snapshop --no-git-tag --tag dev", + "release": "pnpm build && changeset publish", + "release:dev": "pnpm build && changeset publish --snapshot --no-git-tag --tag dev" }, "devDependencies": { "@changesets/changelog-github": "^0.5.0",