json5-manifest-sync 0.3.2 → 0.3.4
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.
- package/CHANGELOG.md +12 -0
- package/README.md +30 -74
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.3.4] - 2026-11-09
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Simplified README installation guidance and removed repeated usage examples.
|
|
10
|
+
|
|
11
|
+
## [0.3.3] - 2026-11-09
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Clarified pnpm's manifest selection behavior and how synchronized manifests keep package values aligned.
|
|
16
|
+
|
|
5
17
|
## [0.3.2] - 2026-11-09
|
|
6
18
|
|
|
7
19
|
### Changed
|
package/README.md
CHANGED
|
@@ -20,7 +20,8 @@ npx json5-manifest-sync --source=package.json5
|
|
|
20
20
|
|
|
21
21
|
The tool can also work in the other direction: by default, it updates `package.json5` from `package.json`, preserving mapped `//` comments where possible.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> pnpm supports `package.json5` natively, but when both files exist it prefers `package.json`. Keeping the manifests synchronized makes this trivial: pnpm reads `package.json`, whose values match `package.json5`. Other tools in your scripts, CI/CD, publishing, or deployment workflows may also expect `package.json`.
|
|
24
25
|
|
|
25
26
|
## Quick Start
|
|
26
27
|
|
|
@@ -50,6 +51,28 @@ Run it:
|
|
|
50
51
|
npm run sync:json5
|
|
51
52
|
```
|
|
52
53
|
|
|
54
|
+
## Alternative installation methods
|
|
55
|
+
|
|
56
|
+
Global install (optional):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g json5-manifest-sync
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or with pnpm:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm add --global json5-manifest-sync
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Install from GitHub (alternative)
|
|
69
|
+
|
|
70
|
+
Use this if you want an unreleased branch or tag:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install github:BBaysinger/json5-manifest-sync#main
|
|
74
|
+
```
|
|
75
|
+
|
|
53
76
|
## Why this exists
|
|
54
77
|
|
|
55
78
|
`package.json` must be strict JSON, which means comments are invalid. That makes it hard to document complex scripts, dependency choices, or workspace settings directly in the manifest.
|
|
@@ -60,9 +83,6 @@ Some tooling does not treat `package.json5` as a package manifest source. While
|
|
|
60
83
|
|
|
61
84
|
This is also why the long-running Yarn Berry discussion about comment-friendly manifests is relevant here: [yarnpkg/berry#241](https://github.com/yarnpkg/berry/issues/241) describes the same underlying need, along with the ecosystem compatibility constraints that make a companion `package.json5` approach useful today.
|
|
62
85
|
|
|
63
|
-
> [!NOTE]
|
|
64
|
-
> pnpm's native `package.json5` support is useful when pnpm controls the workflow, but it does not make `package.json5` universally recognized across npm, CI/CD, deployment, release, and other JavaScript tooling. This project keeps `package.json` available for compatibility while providing a documented companion file.
|
|
65
|
-
|
|
66
86
|
The source of truth for this tool is configurable. By default:
|
|
67
87
|
|
|
68
88
|
- `package.json` is authoritative for manifest values.
|
|
@@ -100,65 +120,7 @@ Repository: https://github.com/BBaysinger/json5-manifest-sync
|
|
|
100
120
|
|
|
101
121
|
Package: https://www.npmjs.com/package/json5-manifest-sync
|
|
102
122
|
|
|
103
|
-
##
|
|
104
|
-
|
|
105
|
-
Bradley Baysinger ([@BBaysinger](https://github.com/BBaysinger))
|
|
106
|
-
|
|
107
|
-
## Install from the npm registry (recommended)
|
|
108
|
-
|
|
109
|
-
Use the package manager already used by your project so its lockfile stays consistent.
|
|
110
|
-
|
|
111
|
-
With npm:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
npm install --save-dev json5-manifest-sync
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
With pnpm:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
pnpm add --save-dev json5-manifest-sync
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Global install (optional):
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
npm install -g json5-manifest-sync
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Or with pnpm:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
pnpm add --global json5-manifest-sync
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Install from GitHub (alternative)
|
|
136
|
-
|
|
137
|
-
Use this if you want an unreleased branch or tag:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
npm install github:BBaysinger/json5-manifest-sync#main
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Use in a project
|
|
144
|
-
|
|
145
|
-
Add a script in your consuming project's `package.json`:
|
|
146
|
-
|
|
147
|
-
```json
|
|
148
|
-
{
|
|
149
|
-
"scripts": {
|
|
150
|
-
"sync:json5": "json5-manifest-sync"
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Run it:
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
npm run sync:json5
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Options
|
|
123
|
+
## Options
|
|
162
124
|
|
|
163
125
|
By default, the tool runs with `--blank-comments=preserve`.
|
|
164
126
|
|
|
@@ -183,7 +145,7 @@ npx --yes --package=json5-manifest-sync json5-manifest-sync --source=package.jso
|
|
|
183
145
|
|
|
184
146
|
You cannot use a local `npm run` script or install this tool as a local dev dependency until `package.json` exists. Once generated, npm and other strict-JSON tools can use it. Note that commands such as `npm install` update `package.json`; reconcile those changes back into `package.json5` with the default `--source=package.json` mode before regenerating JSON from the JSON5 source, or those updates could be overwritten.
|
|
185
147
|
|
|
186
|
-
|
|
148
|
+
In this setup, pnpm reads the generated `package.json`; it reads `package.json5` directly only when `package.json` is absent.
|
|
187
149
|
|
|
188
150
|
Choose a blank-comment mode with one of the following:
|
|
189
151
|
|
|
@@ -216,16 +178,10 @@ Example prompt:
|
|
|
216
178
|
|
|
217
179
|
> "Complete empty `//` comment lines in `package.json5` with concise, field-specific comments."
|
|
218
180
|
|
|
219
|
-
## Example dependency block in consumer
|
|
220
|
-
|
|
221
|
-
```json
|
|
222
|
-
{
|
|
223
|
-
"dependencies": {
|
|
224
|
-
"json5-manifest-sync": "^0.3.0"
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
181
|
## Changelog
|
|
230
182
|
|
|
231
183
|
See `CHANGELOG.md` for full release history.
|
|
184
|
+
|
|
185
|
+
## Author
|
|
186
|
+
|
|
187
|
+
Bradley Baysinger ([@BBaysinger](https://github.com/BBaysinger))
|
package/package.json
CHANGED