10000 feat: Lucia adder by AdrianGonz97 · Pull Request #30 · sveltejs/cli · GitHub
[go: up one dir, main page]

Skip to content

feat: Lucia adder #30

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 23 commits into from
Oct 2, 2024
Merged

feat: Lucia adder #30

merged 23 commits into from
Oct 2, 2024

Conversation

AdrianGonz97
Copy link
Member
@AdrianGonz97 AdrianGonz97 commented Sep 19, 2024

originally from svelte-add/svelte-add#543

  • missing a lot of error handling
  • need to gracefully handle existing user and session tables
  • implement named import merging (e.g. append new import specifiers to existing named imports if the sources match)
  • figure out why comments are not preserved for the app.d.ts modifications
    • this should be fixed once we rework content processing
  • still need to implement the logic for hooks.server.ts
  • add a demo option (mainly based off of the SK example from lucia's examples repo)
    • to avoid collisions with existing user logic, the demo is created under a new route /demo
    • it features a combined login/register page (/demo/login) which mirrors the Named Actions examples in the SvelteKit docs, and a logout action
  • link lucia to drizzle, such that when lucia is selected, drizzle also gets selected
    • a confirmation prompt was also added so that it can be ignored
  • db:push for better-sqlite3 is throwing an error. might be a bug in the newest drizzle-kit/orm version?

also closes #43

Copy link
pkg-pr-new bot commented Sep 19, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/sveltejs/cli/@svelte-cli/ast-tooling@30
pnpm add https://pkg.pr.new/sveltejs/cli/sv@30
pnpm add https://pkg.pr.new/sveltejs/cli/@svelte-cli/core@30

commit: 2f0ebaa

@manuel3108
Copy link
Member
  • figure out why comments are not preserved for the app.d.ts modifications

I know we had such a discussion in the past, but i dont find it. We were using silver-fleece at some point to handle such cases. The problem is that comments are non JSON spec, so the best way is to only patch those files instead of deserializing and serializing such fields. I think we removed it previously as it was not used anymore.

@AdrianGonz97
Copy link
Member Author

@manuel3108 @benmccann This is pretty much ready for review now. I have some concerns around the demo, such as the approach of creating it in a /demo route and if we should have an outside dependency for password hashing, but outside of those, it should be good to go.

@AdrianGonz97 AdrianGonz97 changed the title feat(DRAFT): Lucia adder feat: Lucia adder Sep 24, 2024
Copy link
Member
@manuel3108 manuel3108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer 😄 : I have never used lucia before or fiddled with the handle hook so i cannot say anything besides how it works.

Overall the code looks perfect and the adder and demo work without any problems. I really think having a demo with this adder will really help to get an quick and easy setup.

The only think i noticed is that comments get deleted inside app.d.ts:
image

Edit: Reading is key, this can be ignored.

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@manuel3108
Copy link
Member

Looks like everything is done here, merging.

@manuel3108 manuel3108 merged commit c8147c5 into main Oct 2, 2024
5 checks passed
@manuel3108 manuel3108 deleted the feat/lucia-adder branch October 2, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drizzle adder adds *.db file under Vite category in .gitignore
3 participants
0