xataio / examples

Your one-stop-shop to try Xata out. From packages to apps, whatever you need to get started.
https://xata.io
Apache License 2.0
62 stars 14 forks source link

Hardcoded db in postinstall script #97

Closed kostasb closed 1 year ago

kostasb commented 1 year ago

The Vercel Serverless Functions example app has a postinstall script that is referencing a certain db

https://github.com/xataio/examples/blob/main/apps/starter-vercel-serverless-functions/package.json

This causes pnpm install to error for users who don’t have access to that workspace, which can be misleading for users who want to test out other apps.

 pnpm install  
Scope: all 7 workspace projects
../..                                    |    +1209 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
../..                                    | Progress: resolved 1209, reused 1131, downloaded 0, added 1209, done
../../node_modules/.pnpm/bcrypt@5.1.0/node_modules/bcrypt: Running install script, done in 1.7s
../sample-imdb postinstall$ pnpm tailwind
│ > sample-imdb@0.1.0 tailwind /Users/kostas/workers-demo/examples/apps/sample-imdb
│ > tailwindcss -i styles/globals.css -o styles/dist.css
│ Done in 86ms.
└─ Done in 931ms
. postinstall$ npx @xata.io/cli codegen --db="https://xata_examples-hf8grf.eu-west-1.xata.sh/db/marvel" -b="main" -o="_lib/xata.codegen.ts"
│ npm ERR! Cannot set properties of null (setting 'peer')
│ npm ERR! A complete log of this run can be found in:
│ npm ERR!     /Users/kostas/.npm/_logs/2022-11-28T16_48_11_368Z-debug-0.log
└─ Failed in 1.8s
 ELIFECYCLE  Command failed with exit code 1.
kostasb commented 1 year ago

This has been worked around by suggesting npm in other apps instead of pnpm.