@pnpm/pkg-manifest.commands 1100.1.29 → 1100.1.31
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 +17 -0
- package/lib/pkg.js +57 -54
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @pnpm/pkg-manifest.commands
|
|
2
2
|
|
|
3
|
+
## 1100.1.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies:
|
|
8
|
+
- @pnpm/config.reader@1102.3.2
|
|
9
|
+
|
|
10
|
+
## 1100.1.30
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies:
|
|
15
|
+
- @pnpm/cli.utils@1101.0.30
|
|
16
|
+
- @pnpm/config.reader@1102.3.1
|
|
17
|
+
- @pnpm/error@1100.2.1
|
|
18
|
+
- @pnpm/object.property-path@1100.1.8
|
|
19
|
+
|
|
3
20
|
## 1100.1.29
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/lib/pkg.js
CHANGED
|
@@ -129,77 +129,80 @@ async function pkgDelete(opts, args) {
|
|
|
129
129
|
}
|
|
130
130
|
async function pkgFix(opts) {
|
|
131
131
|
const { manifest, writeProjectManifest } = await readProjectManifest(opts.dir);
|
|
132
|
-
const
|
|
133
|
-
if ('name' in
|
|
134
|
-
delete
|
|
132
|
+
const untypedManifest = manifest;
|
|
133
|
+
if ('name' in untypedManifest && typeof untypedManifest.name !== 'string') {
|
|
134
|
+
delete untypedManifest.name;
|
|
135
135
|
}
|
|
136
|
-
if ('version' in
|
|
137
|
-
delete
|
|
136
|
+
if ('version' in untypedManifest && typeof untypedManifest.version !== 'string') {
|
|
137
|
+
delete untypedManifest.version;
|
|
138
138
|
}
|
|
139
139
|
for (const field of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies', 'scripts']) {
|
|
140
|
-
if (field in
|
|
141
|
-
delete
|
|
140
|
+
if (field in untypedManifest && !isPlainObject(untypedManifest[field])) {
|
|
141
|
+
delete untypedManifest[field];
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
if ('bin' in
|
|
145
|
-
delete
|
|
144
|
+
if ('bin' in untypedManifest && typeof untypedManifest.bin !== 'string' && !isPlainObject(untypedManifest.bin)) {
|
|
145
|
+
delete untypedManifest.bin;
|
|
146
146
|
}
|
|
147
147
|
await writeProjectManifest(manifest);
|
|
148
148
|
}
|
|
149
149
|
function isPlainObject(value) {
|
|
150
150
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
151
151
|
}
|
|
152
|
+
const COMMANDS = {
|
|
153
|
+
title: 'Commands',
|
|
154
|
+
list: [
|
|
155
|
+
{
|
|
156
|
+
description: 'Retrieves a value from package.json',
|
|
157
|
+
name: 'get [<key> [<key> ...]]',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
description: 'Sets a value in package.json',
|
|
161
|
+
name: 'set <key>=<value> [<key>=<value> ...]',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
description: 'Deletes a key from package.json',
|
|
165
|
+
name: 'delete <key> [<key> ...]',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
description: 'Auto corrects common errors in package.json',
|
|
169
|
+
name: 'fix',
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
const OPTIONS = {
|
|
174
|
+
title: 'Options',
|
|
175
|
+
list: [
|
|
176
|
+
{
|
|
177
|
+
description: 'When setting, parse the value as JSON. When getting a single key, return its JSON-encoded form instead of the raw value',
|
|
178
|
+
name: '--json',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
description: 'Run on every workspace project or every project selected by a filter',
|
|
182
|
+
name: '--recursive',
|
|
183
|
+
shortAlias: '-r',
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
};
|
|
187
|
+
const USAGES = [
|
|
188
|
+
'pnpm pkg get [<key> [<key> ...]]',
|
|
189
|
+
'pnpm pkg set <key>=<value> [<key>=<value> ...]',
|
|
190
|
+
'pnpm pkg delete <key> [<key> ...]',
|
|
191
|
+
'pnpm pkg fix',
|
|
192
|
+
'pnpm pkg set <key>=<value> --json',
|
|
193
|
+
'pnpm -r pkg get name',
|
|
194
|
+
'pnpm --filter <selector> pkg get name',
|
|
195
|
+
'pnpm -r pkg set version=1.0.0',
|
|
196
|
+
];
|
|
152
197
|
export function help() {
|
|
153
198
|
return renderHelp({
|
|
154
199
|
description: 'Manages your package.json',
|
|
155
200
|
descriptionLists: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
list: [
|
|
159
|
-
{
|
|
160
|
-
description: 'Retrieves a value from package.json',
|
|
161
|
-
name: 'get [<key> [<key> ...]]',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
description: 'Sets a value in package.json',
|
|
165
|
-
name: 'set <key>=<value> [<key>=<value> ...]',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
description: 'Deletes a key from package.json',
|
|
169
|
-
name: 'delete <key> [<key> ...]',
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
description: 'Auto corrects common errors in package.json',
|
|
173
|
-
name: 'fix',
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
title: 'Options',
|
|
179
|
-
list: [
|
|
180
|
-
{
|
|
181
|
-
description: 'When setting, parse the value as JSON. When getting a single key, return its JSON-encoded form instead of the raw value',
|
|
182
|
-
name: '--json',
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
description: 'Run on every workspace project or every project selected by a filter',
|
|
186
|
-
name: '--recursive',
|
|
187
|
-
shortAlias: '-r',
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
},
|
|
201
|
+
COMMANDS,
|
|
202
|
+
OPTIONS,
|
|
191
203
|
],
|
|
192
204
|
url: docsUrl('pkg'),
|
|
193
|
-
usages:
|
|
194
|
-
'pnpm pkg get [<key> [<key> ...]]',
|
|
195
|
-
'pnpm pkg set <key>=<value> [<key>=<value> ...]',
|
|
196
|
-
'pnpm pkg delete <key> [<key> ...]',
|
|
197
|
-
'pnpm pkg fix',
|
|
198
|
-
'pnpm pkg set <key>=<value> --json',
|
|
199
|
-
'pnpm -r pkg get name',
|
|
200
|
-
'pnpm --filter <selector> pkg get name',
|
|
201
|
-
'pnpm -r pkg set version=1.0.0',
|
|
202
|
-
],
|
|
205
|
+
usages: USAGES,
|
|
203
206
|
});
|
|
204
207
|
}
|
|
205
208
|
//# sourceMappingURL=pkg.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/pkg-manifest.commands",
|
|
3
|
-
"version": "1100.1.
|
|
3
|
+
"version": "1100.1.31",
|
|
4
4
|
"description": "Commands for managing package.json",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"!*.map"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@pnpm/cli.utils": "1101.0.
|
|
32
|
-
"@pnpm/config.reader": "1102.3.
|
|
33
|
-
"@pnpm/error": "1100.2.
|
|
34
|
-
"@pnpm/object.property-path": "1100.1.
|
|
31
|
+
"@pnpm/cli.utils": "1101.0.30",
|
|
32
|
+
"@pnpm/config.reader": "1102.3.2",
|
|
33
|
+
"@pnpm/error": "1100.2.1",
|
|
34
|
+
"@pnpm/object.property-path": "1100.1.8",
|
|
35
35
|
"@pnpm/types": "1102.1.1",
|
|
36
36
|
"render-help": "^2.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@jest/globals": "30.4.1",
|
|
40
|
-
"@pnpm/pkg-manifest.commands": "1100.1.
|
|
41
|
-
"@pnpm/prepare": "1100.0.
|
|
40
|
+
"@pnpm/pkg-manifest.commands": "1100.1.31",
|
|
41
|
+
"@pnpm/prepare": "1100.0.34"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=22.13"
|