json5-manifest-sync 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +19 -22
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.3.2] - 2026-11-09
6
+
7
+ ### Changed
8
+
9
+ - Clarified the README's explanation and example for documenting npm package manifests with `package.json5`.
10
+
5
11
  ## [0.3.0] - 2026-11-02
6
12
 
7
13
  ### Added
package/README.md CHANGED
@@ -1,6 +1,24 @@
1
1
  # json5-manifest-sync
2
2
 
3
- Keep `package.json` and a documented `package.json5` in sync. Choose either file as the source of truth: maintain comments in `package.json5` and generate strict JSON for tools that require it, or update the JSON5 companion from `package.json`.
3
+ Add comments to your npm package manifest in `package.json5`, then sync it with the standard `package.json` expected by npm and other tools. Choose either file as the source of truth for manifest values; `package.json` always remains valid strict JSON.
4
+
5
+ For example, document dependencies in `package.json5` and generate `package.json` from it:
6
+
7
+ <!-- prettier-ignore -->
8
+ ```json5
9
+ {
10
+ "dependencies": {
11
+ // Keep JSON5 parsing available to the CLI.
12
+ "json5": "^2.2.3",
13
+ },
14
+ }
15
+ ```
16
+
17
+ ```bash
18
+ npx json5-manifest-sync --source=package.json5
19
+ ```
20
+
21
+ The tool can also work in the other direction: by default, it updates `package.json5` from `package.json`, preserving mapped `//` comments where possible.
4
22
 
5
23
  pnpm supports `package.json5` natively, but other tools in a project’s scripts, CI/CD, publishing, or deployment workflows may still expect `package.json`. When both files exist, pnpm prefers `package.json`; it reads `package.json5` natively when `package.json` is absent. This tool bridges mixed toolchains by keeping both manifests synchronized in either direction.
6
24
 
@@ -140,27 +158,6 @@ Run it:
140
158
  npm run sync:json5
141
159
  ```
142
160
 
143
- ## Generated `package.json5` example
144
-
145
- Illustrative output (trimmed):
146
-
147
- <!-- prettier-ignore -->
148
- ```json5
149
- {
150
- // Package name used by npm and consumers.
151
- "name": "consumer-app",
152
- // Release version (keep in sync with git tags).
153
- "version": "1.2.3",
154
- // Development and release scripts.
155
- "scripts": {
156
- // Compile TypeScript to dist/.
157
- "build": "tsc -p tsconfig.json",
158
- },
159
- }
160
- ```
161
-
162
- For the current full output style, see this repo's live example: [`package.json5`](./package.json5).
163
-
164
161
  ### Options
165
162
 
166
163
  By default, the tool runs with `--blank-comments=preserve`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json5-manifest-sync",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Sync package.json and package.json5 manifests in either direction, preserving JSON5 comments where possible.",
5
5
  "author": {
6
6
  "name": "Bradley Baysinger",