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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "getpaykit/paykit" }],
"commit": false,
"fixed": [["paykitjs", "@paykitjs/polar", "@paykitjs/stripe"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
47 changes: 22 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,26 @@ jobs:
group: ${{ github.workflow }}-lint-${{ github.event.pull_request.number || github.event.merge_group.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
bun-version: 1.3.13
node-version: 22
cache: pnpm

- name: Install
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Lint
run: bun lint
run: pnpm lint

- name: Format
run: bun format:check
run: pnpm format:check

typecheck:
runs-on: ubuntu-latest
Expand All @@ -53,24 +52,23 @@ jobs:
group: ${{ github.workflow }}-typecheck-${{ github.event.pull_request.number || github.event.merge_group.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
bun-version: 1.3.13
node-version: 22
cache: pnpm

- name: Install
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Typecheck
run: bun typecheck
run: pnpm typecheck

unit:
runs-on: ubuntu-latest
Expand All @@ -81,21 +79,20 @@ jobs:
group: ${{ github.workflow }}-unit-${{ github.event.pull_request.number || github.event.merge_group.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
bun-version: 1.3.13
node-version: 22
cache: pnpm

- name: Install
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Unit tests
run: bun test:unit
run: pnpm test:unit
57 changes: 27 additions & 30 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,20 @@ jobs:
E2E_STRIPE_WHSEC: ${{ secrets.E2E_STRIPE_WHSEC }}
TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/postgres
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
bun-version: 1.3.13
node-version: 22
cache: pnpm

- name: Install workspace dependencies
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Validate CLI E2E configuration
run: |
Expand All @@ -73,7 +72,7 @@ jobs:
done

- name: Run CLI E2E suite
run: bun --filter e2e test:cli
run: pnpm --filter e2e test:cli

stripe:
name: Stripe E2E
Expand Down Expand Up @@ -104,21 +103,20 @@ jobs:
E2E_STRIPE_WHSEC: ${{ secrets.E2E_STRIPE_WHSEC }}
TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/postgres
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
bun-version: 1.3.13
node-version: 22
cache: pnpm

- name: Install workspace dependencies
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Validate Stripe E2E configuration
env:
Expand All @@ -133,13 +131,13 @@ jobs:
done

- name: Setup cloudflared
uses: AnimMouse/setup-cloudflared@v2
uses: AnimMouse/setup-cloudflared@b80ad7aa7850e1ec9960d75831f32ac9855df988 # v2

- name: Check cloudflared version
run: cloudflared --version

- name: Install Playwright Chromium
run: bunx playwright install --with-deps chromium
run: pnpm --filter e2e exec playwright install --with-deps chromium

- name: Run Stripe E2E suite
env:
Expand Down Expand Up @@ -185,11 +183,11 @@ jobs:
sleep 0.5
done

bun --filter e2e test:stripe
pnpm --filter e2e test:stripe

- name: Upload cloudflared log
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
if-no-files-found: ignore
name: stripe-e2e-cloudflared-log
Expand Down Expand Up @@ -224,21 +222,20 @@ jobs:
E2E_POLAR_WHSEC: ${{ secrets.E2E_POLAR_WHSEC }}
TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/postgres
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
bun-version: 1.3.13
node-version: 22
cache: pnpm

- name: Install workspace dependencies
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Validate Polar E2E configuration
env:
Expand All @@ -253,13 +250,13 @@ jobs:
done

- name: Setup cloudflared
uses: AnimMouse/setup-cloudflared@v2
uses: AnimMouse/setup-cloudflared@b80ad7aa7850e1ec9960d75831f32ac9855df988 # v2

- name: Check cloudflared version
run: cloudflared --version

- name: Install Playwright Chromium
run: bunx playwright install --with-deps chromium
run: pnpm --filter e2e exec playwright install --with-deps chromium

- name: Run Polar E2E suite
env:
Expand Down Expand Up @@ -305,11 +302,11 @@ jobs:
sleep 0.5
done

bun --filter e2e test:polar
pnpm --filter e2e test:polar

- name: Upload cloudflared log
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
if-no-files-found: ignore
name: polar-e2e-cloudflared-log
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-dist-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
dist-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"
Expand Down
60 changes: 20 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,46 @@ name: Release

on:
push:
tags:
- "v*"
branches:
- main

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
node-version-file: .nvmrc
cache: pnpm
registry-url: "https://registry.npmjs.org"

- run: bun install --frozen-lockfile
- run: pnpm install --frozen-lockfile

- run: npx changelogithub
continue-on-error: true
- name: Create Release Pull Request or Publish
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1
with:
version: pnpm ci:version
publish: pnpm ci:release
title: "chore: release"
commit: "chore: release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: bun turbo build --filter=./packages/*

- name: Determine npm tag
id: npm_tag
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
if [[ "$TAG" =~ -(alpha|beta|next|rc|canary) ]]; then
NPM_TAG="${BASH_REMATCH[1]}"
else
git fetch origin main
if git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
NPM_TAG="latest"
else
echo "::error::Stable releases must be on the main branch."
exit 1
fi
fi
echo "tag=$NPM_TAG" >> "$GITHUB_OUTPUT"
echo "Publishing with npm tag: $NPM_TAG"

- name: Publish to npm
shell: bash
run: |
for package_dir in packages/paykit packages/polar packages/stripe; do
(cd "$package_dir/dist" && bun publish --access public --tag "${{ steps.npm_tag.outputs.tag }}")
done
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
4 changes: 3 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"import/no-unassigned-import": "off",
"typescript/consistent-type-imports": "error",
"typescript/no-require-imports": "error",
"unicorn/prefer-node-protocol": "error"
"unicorn/prefer-node-protocol": "error",
"eslint/no-underscore-dangle": "off",
"unicorn/consistent-function-scoping": "off"
},
"overrides": [
{
Expand Down
2 changes: 1 addition & 1 deletion .superset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"setup": ["ROOT_PATH=\"$SUPERSET_ROOT_PATH\" bun run tree-setup"],
"setup": ["ROOT_PATH=\"$SUPERSET_ROOT_PATH\" pnpm run tree-setup"],
"teardown": [],
"run": []
}
Loading
Loading