-
-
Notifications
You must be signed in to change notification settings - Fork 41
Refresh demo and listen workflow #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3bd7b3d
Add random demo account signup
maxktz 39e03cb
Use pnpm for demo script orchestration
maxktz 44fe62f
Fix PayKit config default interop
maxktz 82cf7bf
chore: update AGENTS.md
maxktz f74909e
Use default PayKit config discovery in demo
maxktz 143236f
Remove env sourcing from PayKit demo push
maxktz a42a78a
Remove demo tunnel scripts
maxktz 705f3ed
Run app command with PayKit listen
maxktz 7dfae17
chore: update AGENTS.md
maxktz f50b360
Use concurrently for listen run command
maxktz 1bffcd8
codex: address PR review feedback (#203)
maxktz e1d18c1
codex: address PR review feedback (#203)
maxktz 5fbd747
codex: address PR review feedback (#203)
maxktz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,39 @@ | ||
| import fs from "node:fs"; | ||
| import os from "node:os"; | ||
| import path from "node:path"; | ||
|
|
||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| import { getWebhookListenCommand } from "../commands/init"; | ||
| import { detectPaykitCli, getPaykitListenCommand, getStripeListenCommand } from "../commands/init"; | ||
|
|
||
| describe("cli/init", () => { | ||
| it("uses paykitjs listen when the PayKit CLI is available", () => { | ||
| expect(getWebhookListenCommand(3000, true)).toBe( | ||
| "paykitjs listen --forward-to localhost:3000/paykit/webhook", | ||
| ); | ||
| expect(getPaykitListenCommand("pnpm")).toBe("pnpm paykitjs listen -- pnpm dev"); | ||
| expect(getPaykitListenCommand("npm")).toBe("npx paykitjs listen -- npm run dev"); | ||
| }); | ||
|
|
||
| it("falls back to stripe listen when the PayKit CLI is unavailable", () => { | ||
| expect(getWebhookListenCommand(3000, false)).toBe( | ||
| expect(getStripeListenCommand(3000)).toBe( | ||
| "stripe listen --forward-to localhost:3000/paykit/webhook", | ||
| ); | ||
| }); | ||
|
|
||
| it("detects the PayKit CLI from the target project", () => { | ||
| const cwd = fs.mkdtempSync(path.join(os.tmpdir(), "paykit-init-")); | ||
|
|
||
| try { | ||
| fs.writeFileSync( | ||
| path.join(cwd, "package.json"), | ||
| JSON.stringify({ dependencies: { paykitjs: "workspace:*" } }), | ||
| ); | ||
| expect(detectPaykitCli(cwd)).toBe(false); | ||
|
|
||
| const packageDir = path.join(cwd, "node_modules", "paykitjs"); | ||
| fs.mkdirSync(packageDir, { recursive: true }); | ||
| fs.writeFileSync(path.join(packageDir, "package.json"), JSON.stringify({ name: "paykitjs" })); | ||
| expect(detectPaykitCli(cwd)).toBe(true); | ||
| } finally { | ||
| fs.rmSync(cwd, { force: true, recursive: true }); | ||
| } | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.