json5-manifest-sync 0.3.1 → 0.3.3
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 +21 -23
- 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.3] - 2026-11-09
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Clarified pnpm's manifest selection behavior and how synchronized manifests keep package values aligned.
|
|
10
|
+
|
|
11
|
+
## [0.3.2] - 2026-11-09
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Clarified the README's explanation and example for documenting npm package manifests with `package.json5`.
|
|
16
|
+
|
|
5
17
|
## [0.3.0] - 2026-11-02
|
|
6
18
|
|
|
7
19
|
### Added
|
package/README.md
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
# json5-manifest-sync
|
|
2
2
|
|
|
3
|
-
|
|
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
4
|
|
|
5
|
-
|
|
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.
|
|
22
|
+
|
|
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`.
|
|
6
25
|
|
|
7
26
|
## Quick Start
|
|
8
27
|
|
|
@@ -140,27 +159,6 @@ Run it:
|
|
|
140
159
|
npm run sync:json5
|
|
141
160
|
```
|
|
142
161
|
|
|
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
162
|
### Options
|
|
165
163
|
|
|
166
164
|
By default, the tool runs with `--blank-comments=preserve`.
|
package/package.json
CHANGED