Skip to content
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(adapters): add triplit adapter #9541

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wernst
Copy link

@wernst wernst commented Jan 4, 2024

This PR adds a db adapter for Triplit, a realtime database that runs on both the browser and server. We're big fans of next auth and have been using it internally for projects at Triplit, so are excited to make this adapter available to the public.

The code should work as is, however I'm running into two issues.

  1. I'm unable to get the tests running with jest and pnpm. I've done some configuring of jest on my end (not in this PR) to get around what appear to be some esm issues, but am having trouble resolving the @triplit/client package with pnpm. I'll keep fiddling, but if you have any ideas please let me know.
  2. I am unsure how documentation is generated. I have the content for the docs ready, but I'm unsure if its content is auto-generated or hand written.

Thank you for any guidance.

Copy link

vercel bot commented Jan 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Jul 18, 2024 5:51pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Jul 18, 2024 5:51pm
Copy link

vercel bot commented Jan 4, 2024

@wernst is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the adapters Changes related to the core code concerning database adapters label Jan 4, 2024
@ndom91
Copy link
Member

ndom91 commented Jan 5, 2024

@wernst thanks for the PR! I haven't looked closely so can't answer your first question yet, but the docs are mostly included as typedocs in the code as comments (in your triplit-adapter/src/index.ts for example). Check out the prisma adapter for an example 👍

@wernst
Copy link
Author

wernst commented Jan 5, 2024

@ndom91 Thanks for the info! Looks like the testing issues were related to a cjs/esm packaging issue in our js libs, so that should be resolvable on our end. I'll add the relevant typedocs comments as well.

@wernst
Copy link
Author

wernst commented Jan 9, 2024

Hi @ndom91 , I just pushed up a commit adding the doc strings. The testing issue is also resolved. I'll let you take a look when you have a chance, but let me know if there's anything else I can be helpful with to merge the PR. Thanks for your time!

@ndom91
Copy link
Member

ndom91 commented Jan 10, 2024

Hi @ndom91 , I just pushed up a commit adding the doc strings. The testing issue is also resolved. I'll let you take a look when you have a chance, but let me know if there's anything else I can be helpful with to merge the PR. Thanks for your time!

Thanks @wernst! There do seem to be some merge conflicts atm, can you take a look at those? 🙏

Copy link

socket-security bot commented Jan 10, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/react-dom@18.2.14 None 0 32.7 kB types
npm/@types/react@18.2.31 None +3 1.62 MB types
npm/prisma@5.2.0 None +1 16.2 MB prismabot
npm/svelte@4.2.8 Transitive: unsafe +11 5.22 MB svelte-admin
npm/unstorage@1.10.2 Transitive: environment, filesystem, network, shell, unsafe +53 14.9 MB pi0

🚮 Removed packages: npm/@types/react-dom@18.2.18, npm/@types/react@18.2.48, npm/prisma@5.8.1, npm/react-dom@18.3.1, npm/react@18.3.1, npm/shiki@1.3.0, npm/svelte@4.2.9

View full report↗︎

@wernst
Copy link
Author

wernst commented Jan 10, 2024

@ndom91 My apologies! Just rebased the branch, so those conflicts in the lock file should be resolved now.

@ndom91
Copy link
Member

ndom91 commented Jan 14, 2024

Thanks, looking much better! I have a few more notes, mostly small repo organisation type stuff.

I'll just add them as a checklist here:

  • Add triplit to .github/pr-labeler.yml
  • Add triplit to .github/workflows/release.yml
  • Add triplit to docs/scripts/generate-manifest.mjs
  • Add a triplit icon to docs/static/img/adapters/triplit.svg
  • Add a README.md to packages/adapter-triplit/README.md (see other adapters for example)
  • Add triplit to the turborepo config (turbo.json)
  • package.json is missing exports map and a few other metadata fields that other adapters have (see other adapter / packages package.json's)

If you could take care of those, that'd be great! Also, if you haven't seen it yet, we have a guide for adding a new adapter which includes a lot of reminders / guidelines 🙏

@ndom91 ndom91 changed the title Add triplit adapter Jan 14, 2024
@wernst
Copy link
Author

wernst commented Jan 16, 2024

@ndom91 Those updates should be in (if I missed anything my apologies). I did see there was one file (.github/ISSUE_TEMPLATE/3_bug_adapter.yml) that also looked like it had some references to adapters - let me know if I should add there as well.

Copy link

socket-security bot commented Jan 22, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@wernst
Copy link
Author

wernst commented Feb 8, 2024

Hi @ndom91 , just want to bump this one more time while I dont have a lock file conflict. Just switched over the test runner to vitest. The only outstanding question I have is whether I should edit: .github/ISSUE_TEMPLATE/3_bug_adapter.yml?

Thanks!

@wernst
Copy link
Author

wernst commented Apr 24, 2024

@ndom91 just rebased onto main, so bumping this

@wernst
Copy link
Author

wernst commented Jul 18, 2024

@ndom91 just rebased onto main, so bumping this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters
2 participants