nicoalbanese / kirimase

Build full-stack Next.js apps, incredibly fast
https://kirimase.dev
MIT License
2.39k stars 107 forks source link

More Typescript errors #70

Closed sangrepura closed 7 months ago

sangrepura commented 8 months ago

Summary

name: Typescript Error about: Module '"@/lib/auth/utils"' declares 'AuthSession' locally, but it is not exported. labels: bug

Bug Description

Type errors in generated code.

tsc --project ./tsconfig.json

src/app/account/PlanSettings.tsx:9:10 - error TS2459: Module '"@/lib/auth/utils"' declares 'AuthSession' locally, but it is not exported.

9 import { AuthSession } from "@/lib/auth/utils";
           ~~~~~~~~~~~

  src/lib/auth/utils.ts:4:6
    4 type AuthSession = {
           ~~~~~~~~~~~
    'AuthSession' is declared here.

src/app/account/UserSettings.tsx:4:10 - error TS2459: Module '"@/lib/auth/utils"' declares 'AuthSession' locally, but it is not exported.

4 import { AuthSession } from "@/lib/auth/utils";
           ~~~~~~~~~~~

  src/lib/auth/utils.ts:4:6
    4 type AuthSession = {
           ~~~~~~~~~~~
    'AuthSession' is declared here.

Found 2 errors in 2 files.

Errors  Files
     1  src/app/account/PlanSettings.tsx:9
     1  src/app/account/UserSettings.tsx:4

Looks like we just forgot to export the type in src/lib/auth/utils.ts this time.

Just my $.02, but I think adding an integration test that runs tsc --project ./tsconfig.json to catch these errors after generating a project directory (before tagging a public release) would really improve the developer experience.

nicoalbanese commented 8 months ago

Hey @sangrepura - thanks for this! Yes silly mistake from my end. Will push changes as part of next update. Would absolutely love to have tests as I'm doing them manually and it sucks. Any suggestions? I've never built or run tests before, and wouldn't know where to start with a CLI like this.

mcapodici commented 8 months ago

I would make a test at the shell level that invokes the tool, installs everything then builds and lints the resulting code. If the exit code is not 0 it fails. This will work well with CI.

Happy to contribute! Just let me know and I can put something together.

dinhkhanh commented 7 months ago

Any updates? @nicoalbanese The latest release (3 days ago) doesn't include this fix?

nicoalbanese commented 7 months ago

@dinhkhanh hey - this was fixed but I put out another update yesterday that introduced an error here if you are using next auth. I’ll take a look today.

nicoalbanese commented 7 months ago

Should be sorted with 0.0.32!