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
5 changes: 5 additions & 0 deletions .changeset/happy-teams-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mppx': patch
---

Added experimental support for payment links
53 changes: 51 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
ci-gate:
name: CI Gate
if: always()
needs: [checks, test]
needs: [checks, test, test-html]
runs-on: ubuntu-latest
steps:
- run: |
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
run: pnpm check:ci

- name: Check types
run: pnpm dev && pnpm check:types && pnpm check:types:examples
run: pnpm dev && pnpm exec tsx scripts/build:html.ts && pnpm check:types && pnpm check:types:html && pnpm check:types:examples

test:
name: Test Runtime
Expand Down Expand Up @@ -101,6 +101,9 @@ jobs:
docker pull ghcr.io/tempoxyz/tempo:${VITE_TEMPO_TAG}
docker save ghcr.io/tempoxyz/tempo:${VITE_TEMPO_TAG} -o /tmp/tempo-image.tar

- name: Bundle HTML files
run: pnpm build

- name: Run tests
run: |
eval "$(dbus-launch --sh-syntax)"
Expand All @@ -109,3 +112,49 @@ jobs:
pnpm run test --bail=1
env:
CI: true

test-html:
name: Test HTML
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Cache Playwright browsers
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install chromium

- name: Install Playwright system deps
run: pnpm exec playwright install-deps chromium

- name: Bundle HTML files
run: pnpm build

- name: Run tests
run: pnpm run test:html
env:
CI: true
MPP_SECRET_KEY: test-secret-key
VITE_STRIPE_SECRET_KEY: ${{ secrets.VITE_STRIPE_SECRET_KEY }}
VITE_STRIPE_PUBLIC_KEY: ${{ secrets.VITE_STRIPE_PUBLIC_KEY }}

- name: Upload Playwright artifacts
if: ${{ always() }}
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: playwright-artifacts
path: |
playwright-report
test-results
if-no-files-found: ignore
retention-days: 7
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
_
dist
node_modules
*.gen.ts
coverage
*.tsbuildinfo
.DS_Store
.env
.env.*
!.env.example
test-results/
2 changes: 2 additions & 0 deletions examples/charge/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ const currency = '0x20c0000000000000000000000000000000000000' as const // pathUS
const mppx = Mppx.create({
methods: [
tempo({
account,
currency,
feePayer: true,
html: true,
recipient: account.address,
testnet: true,
}),
Expand Down
4 changes: 4 additions & 0 deletions examples/stripe/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const mppx = Mppx.create({
methods: [
stripe.charge({
client: stripeClient,
html: {
publishableKey: process.env.VITE_STRIPE_PUBLIC_KEY!,
createTokenUrl: '/api/create-spt',
},
// Stripe Business Network profile ID.
networkId: 'internal',
// Ensure only card is supported.
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"scripts": {
"build": "zile",
"build": "node --import tsx scripts/build:html.ts && zile",
"changeset:publish": "zile publish:prepare && changeset publish && zile publish:post",
"changeset:version": "changeset version && vp fmt .",
"check": "vp lint --fix && vp fmt --write .",
"check:ci": "vp lint && vp fmt --check .",
"check:types": "tsgo -b",
"check:types:html": "tsgo -p src/tempo/server/internal/html/tsconfig.json && tsgo -p src/stripe/server/internal/html/tsconfig.json",
"check:types:examples": "pnpm -r --filter './examples/**' run check:types",
"deps": "pnpx taze -r --no-ignore-other-workspaces --ignore-paths node_modules",
"deps:ci": "pnpx actions-up",
"dev": "zile dev",
"dev:example": "node scripts/dev:example.ts",
"mppx": "node --import tsx src/bin.ts",
"test": "vp test"
"test": "vp test",
"test:html": "playwright test --config test/html/playwright.config.ts"
},
"browserslist": [
"defaults",
Expand All @@ -29,6 +31,7 @@
"@changesets/cli": "^2.30.0",
"@hono/node-server": "^1.19.9",
"@modelcontextprotocol/sdk": "^1.25.3",
"@playwright/test": "^1.58.2",
"@types/express": "^5.0.6",
"@types/node": "^25.5.0",
"@typescript/native-preview": "7.0.0-dev.20260323.1",
Expand All @@ -41,6 +44,7 @@
"hono": "^4.11.9",
"playwright": "^1.58.2",
"prool": "^0.2.4",
"rolldown": "1.0.0-rc.12",
"tempo.ts": "^0.14.2",
"testcontainers": "^11.11.0",
"tsx": "^4.21.0",
Expand Down Expand Up @@ -173,7 +177,7 @@
"@remix-run/fetch-proxy": "^0.7.1",
"@remix-run/node-fetch-server": "^0.13.0",
"incur": "^0.3.1",
"ox": "^0.14.1",
"ox": "0.14.7",
"zod": "^4.3.6"
},
"repository": {
Expand Down
Loading
Loading