Open KSXGitHub opened 11 months ago
What will JSON API be used for?
What will JSON API be used for?
pnpm will interact with pacquet via JSON stdout. On happy path, pnpm will periodically listen to JSON messages and output report to the terminal. On error path, an appropriate JSON message will be processed by pnpm to determine if it should fallback to Node.js or print an error message.
pnpm uses NDJSON to log data and it is used by the reporter to do pretty output for the users. So if pacquet will print the same logs, pnpm's renderer will work.
@zkochan What about error reporting?
Error is one of the log types
https://github.com/pnpm/logger/blob/37902c06048ec4df19f6ebc11b14d1263d9f1a17/src/logger.ts#L12
Error is one of the log types
https://github.com/pnpm/logger/blob/37902c06048ec4df19f6ebc11b14d1263d9f1a17/src/logger.ts#L12
Does Error
in this code refer to JavaScript Error
object? JSON cannot construct JavaScript Error
object. I expect pnpm to be able to parse precise error message.
For example: If pnpm
receives the following JSON, it must fallback to TypeScript algorithm based on error.type
{ "error": { "type": "NotYetImplemented", "message": "monorepo is not yet implemented" } }
Let's not do any fallback stuff. This is experimental. If it fails, it is fine.
panic
when frozen-lockfile is enabled.