Skip to content

Conversation

@darklight9811
Copy link

This pull request updates several packages to use the jsonc-parser library for parsing JSON files that may include comments or trailing commas, improving robustness when handling configuration and settings files across the codebase. The changes affect multiple plugins and the core SDK, and also update dependency listings to ensure jsonc-parser is available where needed.

Core improvements to JSON parsing:

  • Replaced all instances of JSON.parse with parseJsonc (from jsonc-parser) in project loading and plugin import/export logic, allowing for more flexible and error-tolerant configuration file parsing. [1] [2] [3] [4] [5] [6] [7]

  • Updated imports to include parseJsonc from jsonc-parser in all affected files, ensuring the new parser is used throughout. [1] [2] [3] [4]

Dependency and package management:

  • Added jsonc-parser as a dependency in package.json files for @inlang/sdk, @inlang/plugins/icu1, and @inlang/plugins/i18next, ensuring it is available wherever needed. [1] [2] [3]

  • Updated pnpm-lock.yaml to reflect the addition of jsonc-parser and to update some indirect dependencies, especially around Vitest and Vite, to newer versions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

These changes enhance the resilience of the project against malformed JSON and make it easier to work with user-edited configuration files that may not strictly adhere to the JSON standard.

- Implemented JSONC (JSON with comments) support in the SDK and various plugins, allowing for comments and trailing commas in JSON files.
- Updated `loadProjectFromDirectory.ts` to use `jsonc-parser` for reading settings files.
- Added `jsonc-parser` dependency to relevant packages.
- Modified plugins to support JSONC format.
- Ensured backward compatibility with existing JSON files.
@changeset-bot
Copy link

changeset-bot bot commented Jan 17, 2026

🦋 Changeset detected

Latest commit: 7f61116

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@inlang/plugin-icu1 Minor
@inlang/sdk Minor
@inlang/cli Minor
@inlang/plugin-i18next Minor
@inlang/rpc Minor
@inlang/plugin-m-function-matcher Patch
@inlang/plugin-t-function-matcher Patch
@inlang/editor-component Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2026

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12f93cbbd5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@darklight9811
Copy link
Author

In the tests are accusing error on something unrelated to this task, I will try to fix it but was this happening before the changes too?

@darklight9811
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 18, 2026
@samuelstroschein
Copy link
Member

Hi @darklight9811,

Thanks for the PR.

Unfortunately, I can't merge this. JSON with comments is not roundtrip-safe. A JSON with comments can be parsed buy it can't be serialized again. Applications like Sherlock and Fink that modify the settings.json file through the UI will drop all comments. The problem is similar to #1143

I recommend to open an issue first next time to gauge if a PR would be accepted.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants