vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
5.77k stars 1.18k forks source link

Add --silent flag to piped npx commands #335

Open chriscarrollsmith opened 2 months ago

chriscarrollsmith commented 2 months ago

I noticed some npm console output getting erroneously piped into the migration and types files. For instance, this script:

"supabase:generate-types": "npx supabase gen types typescript --local --schema public > types_db.ts"

was producing a types file that looked like this:


> scribert@0.0.1 npx
> supabase gen types typescript --local --schema public

export type Json =
  | string
  | number
  ...

To resolve this, I added the -silent flag to this command:

"supabase:generate-types": "npx --silent supabase gen types typescript --local --schema public > types_db.ts"

And instead of piping a db diff into the migration, I just used push and pull:

    "supabase:push-local": "npx supabase db push --local",
    "supabase:pull-local": "npx supabase db pull --local",
    "supabase:push-remote": "npx supabase db push --remote",
    "supabase:pull-remote": "npx supabase db pull --remote"