-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: issues with cli reading from package.json #981
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
8cac1bc
to
64e5f37
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix. See the comment.
packages/create-waku/src/index.ts
Outdated
@@ -161,7 +160,9 @@ Options: | |||
} | |||
|
|||
async function notifyUpdate() { | |||
const packageJson = JSON.parse(readFileSync('../package.json', 'utf8')); | |||
const packageJson = JSON.parse( | |||
readFileSync(path.resolve(import.meta.dirname, '../package.json'), 'utf8'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import.meta.dirname
isn't available in Node 18.
https://nodejs.org/docs/latest-v18.x/api/esm.html#importmetaurl
Can you try this?
import { readFileSync } from 'node:fs';
const buffer = readFileSync(new URL('./data.proto', import.meta.url));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that works, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx!
fix for #978 (comment)
Also fixed an issue where the default folder name was not showing on conflict