pnpm / pacquet

experimental package manager for node.js
Apache License 2.0
763 stars 21 forks source link

TODO List: Initial integration of pacquet's frozen-lockfile to pnpm #149

Open KSXGitHub opened 11 months ago

KSXGitHub commented 11 months ago
zkochan commented 11 months ago

What will JSON API be used for?

KSXGitHub commented 11 months ago

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.

zkochan commented 11 months ago

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.

KSXGitHub commented 11 months ago

@zkochan What about error reporting?

zkochan commented 11 months ago

Error is one of the log types

https://github.com/pnpm/logger/blob/37902c06048ec4df19f6ebc11b14d1263d9f1a17/src/logger.ts#L12

KSXGitHub commented 11 months ago

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" } }
zkochan commented 11 months ago

Let's not do any fallback stuff. This is experimental. If it fails, it is fine.