-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat(testing): Add test projects for Cloudflare Workers. Vercel Remix + NextJS, Deno, and Bun #252
Conversation
3a27705
to
c124cfe
Compare
# or | ||
pnpm dev | ||
# or | ||
bun dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo? Not sure if you wanted bun here in Next.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the NextJS OOTB readme - they support bun too
project_id: "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317", | ||
secret: "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
project_id: "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317", | |
secret: "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=", | |
project_id: "YOUR_STYTCH_PROJECT_ID", | |
secret: "YOUR_STYTCH_SECRET", |
This is the pattern we use elsewhere, dealer's choice on which you'd prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The secrets I'm checking in here are a special set we used to have public on the homepage - they produce a specific error and make it easy to confirm network connectivity. I'll add better comments.
@@ -0,0 +1,2 @@ | |||
# Exclude lockfiles for packaging tests to reduce file churn | |||
/*/package-lock.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a preference for this over .nvmrc
for each project and checking in package-lock.json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.nvcmrc
for each project would mean many versions of Node, which we don't need... yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we commit the lockfiles from each environment-specific package manager, but not any of the package-lock.json
files. Is that an important distinction?
(I've never used any of Bun, Deno, etc., but I wouldn't be surprised if the answer is "package-lock.json
is derived from the other lockfile".)
.catch((err: unknown) => console.log(JSON.stringify(err))); | ||
} | ||
|
||
doStytchRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this this Promise be await
-ed or .then()
'd? Does Bun do some magic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bun does some magic! Bun won't end the process until the microtask queue is empty. No top-level await nesc.
|
||
// Learn more at https://deno.land/manual/examples/module_metadata#concepts | ||
if (import.meta.main) { | ||
doStytchRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to Bun, should this have await
/.then()
? Or is there magic?
you are correct! |
Adds a new
test-runtimes
directory with setup instructions for various runtimes the Node SDK can be used in. Hopefully this will make it easier to test iterations of the Node SDK in different runtimes. Runtimes are not plug&play, developers will need to install various things, make accounts with providers, etc.The following runtimes are tested:
cloudflare-workers
remix
nextjs serverless
nextjs edge
deno
bun