Open CodingDoug opened 1 year ago
Have now resolved the above issues, looks good to go.
Looking much better! Still a few more things to work out here:
turso db url [DATABASE-NAME]
doesn't work. You probably meantturso db show [DATABASE-NAME] --url
Don't forget to run through the entire set of steps yourself to make sure everything works the way you expect.
Optional but nice:
I just noticed that you're using images from Unsplash. They have a very permissive license, which is great. I think it would be fair to them for the README to call out in a section at the bottom that this project uses their images, and possibly even attribution for the individual artists who contributed the images in use.
Thanks for the feedback, I actually should have tested the instructions on the readme before submitting. I didnt know i had minor mistakes there. On the env variables, perhaps its a different convention, there is a .env.example file before but I have now renamed it to .env.local so that we are on the same page.
I think the readme looks good to go now
Instead of showing the CLI installation instructions, link to the documentation in case they ever change? We're going to apply the same change to our other repos.
Put the instructions to create tables right after the shell command. That's what you'd probably want people to do right away after starting the shell.
Prefer to use
npm
overpnpm
since the former is always present.Add an instruction to install node modules before running the dev script (otherwise it will fail).
When I ran the dev script, it failed with:
So, for the env vars, point out specifically which file needs to be modified to include the db url and auth token. I wasn't familiar with nextjs at all, so I had to go look up how this works. Perhaps you could instruct the user to first copy the
.env.sample
file to.env.local
and provide the required values in it.The newest version of the CLI actually creates token with no expiration by default, so you can remove the
--expiration
flag if you want. But if you want to leave it on, the new proper value isnever
(none
still works but is likely going to be deprecated).pages/index.ts
shows a lint errorAlso, I'm thinking API calls like this should also be in a react hook rather than right there in the component. What do you think? Try a web search for "react hook make api calls" for guidance from the internet.
I see you copied James's
responseDataAdapter
. This function is no longer needed at all because the client ResultSet now allow Row objects to be indexed by both column name and number. See the documentation for example code and details. We'll be removing it from other examples as well.Update
@libsql/client
to the latest version 0.1.4. There might be breakage in future versions of the SDK, so we might reach out to you again to update it in order to keep this code relevant going forward.The LICENSE file should be at the root of the repo, not under src.
Optional but I think very helpful for others (fix or disable the lint rules that are causing them):
src/db/turso.ts
shows a lint warning:pages/api/turso.ts
shows a bunch of lint errors about the use ofany
. Strict checking turns these checks on because use ofany
has been shown to lead to bugs due to lack of proper type information.next.config.mjs
: In the first lineenv
is unused and can be removed. This perhaps means thatsrc/env/server.mjs
is also unnecessary?