remix-nx-fly icon indicating copy to clipboard operation
remix-nx-fly copied to clipboard

at which point CI has prisma generate results

Open vandriesh opened this issue 2 years ago • 2 comments
trafficstars

I've been trying to replicated your recipe to "bring" two remix app under nx roof

got stuck under nx run typechecking

Error: app/models/note.server.ts(1,15): error TS2[30](https://github.com/vandriesh/dev-assist/actions/runs/4489434364/jobs/7895249729#step:6:32)5: Module '"@prisma/client"' has no exported member 'User'.

I've generated indie stac.

I guess the question - is locally we generated prisma schema using

{
...
"scripts": {
    ...,
    "setup": "prisma generate && prisma migrate deploy && prisma db seed",
    ...
}
...
}

but what about CI env - how to make typechecking pass if we didn't generated schema in the CI env?

Thank you.

vandriesh avatar Mar 22 '23 16:03 vandriesh

Oh this is a bug! There's a weird "--if-affected" flag on the typecheck script in the workflow that makes it not find the real typecheck target, so the typechecks are just never running (and always returning green)

Running the setup script before the typecheck seems like the most straightforward solution here

- name: 🔎 Setup
        run: npx nx affected --base=$([[ ${{ github.ref == 'refs/heads/main'}} ]] && echo "origin/main~1" || echo "origin/main") --head=HEAD --target="setup" --parallel=3
        
- name: 🔎 Type check
        run: npx nx affected --base=$([[ ${{ github.ref == 'refs/heads/main'}} ]] && echo "origin/main~1" || echo "origin/main") --head=HEAD --target="typecheck" --if-affected --parallel=3  

jacobparis avatar Mar 24 '23 10:03 jacobparis

Thank you! that was the solution - I just wasn't sure that it's "natural" e.g. there is not setup step in standalone/generated indie stack ?! to me it's still "magic" who CI works on the first push... if that makes sense.

vandriesh avatar Mar 31 '23 06:03 vandriesh