-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
bugSomething isn't workingSomething isn't workingcli@terrazzo/cli@terrazzo/cliparser@terrazzo/parser@terrazzo/parser
Description
Versions
- terrazzo/parser: 0.10.3
Node.js version
24.4.1
OS + version
macOS 26
Description
Seems that the parser handles Buffer differently than the cli. But if it gets one it executes itself without an error.
As seen in the documentation :
const filename = new URL("./tokens/my-tokens.json", import.meta.url);
const { tokens, sources } = await parse(
[{ filename, src: await fs.readFile(filename) }],
{ config }
);
This runs without any error but do not find any error
The idea here is to update documentation to go from await fs.readFile(filename)
to await fs.readFile(filename, 'utf-8')
and add an error handling if a buffer is found in the parser.
Reproduction
Use JS API to generate tokens using the doc.
Expected result
If the tokens.json input is filled with DTCG compliant tokens it builds tokens without error
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)
drwpow
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcli@terrazzo/cli@terrazzo/cliparser@terrazzo/parser@terrazzo/parser