pnpm-settings-migrator 0.9.0 → 0.10.0
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/README.md +38 -3
- package/dist/cli.mjs +331 -291
- package/dist/index.d.mts +68 -19
- package/dist/index.mjs +159 -313
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -19,7 +19,8 @@ After migration, the CLI reports how many root settings changed and shows a
|
|
|
19
19
|
GitHub-style YAML diff. Removed lines are red and added lines are green:
|
|
20
20
|
|
|
21
21
|
```text
|
|
22
|
-
|
|
22
|
+
✔ 2 settings changed
|
|
23
|
+
|
|
23
24
|
packages:
|
|
24
25
|
- packages/*
|
|
25
26
|
+ - apps/*
|
|
@@ -29,6 +30,40 @@ GitHub-style YAML diff. Removed lines are red and added lines are green:
|
|
|
29
30
|
+ bar: 2.0.0
|
|
30
31
|
```
|
|
31
32
|
|
|
33
|
+
When nothing needs updating, the only output is:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
ℹ No changes needed.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The CLI no longer prints a startup banner, missing optional files, a zero-change
|
|
40
|
+
count, or a duplicate completion message. Use `--version` to see the version.
|
|
41
|
+
Warnings are reserved for settings requiring attention. Information blocks have
|
|
42
|
+
one blank line between them, with no extra blank lines at the start or end.
|
|
43
|
+
|
|
44
|
+
Other outcomes are reported according to the files actually changed:
|
|
45
|
+
|
|
46
|
+
- No configuration files: `ℹ No configuration files found.`
|
|
47
|
+
- Source cleanup with no settings diff: `✔ Migration completed. Source settings cleaned up.`
|
|
48
|
+
- Runtime migration with no settings diff: `✔ Migration completed. Node.js runtime updated in package.json.`
|
|
49
|
+
- File formatting changes with no settings diff: `✔ Migration completed. Configuration files updated.`
|
|
50
|
+
- Failure: one error report and exit code `1`.
|
|
51
|
+
|
|
52
|
+
## Library usage
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { migratePnpmSettings } from 'pnpm-settings-migrator'
|
|
56
|
+
|
|
57
|
+
const result = await migratePnpmSettings({ cwd: '/path/to/workspace' })
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Library calls now return a `MigrationResult` and do not print logs. The result
|
|
61
|
+
contains `settingsChanges` (before/after root workspace settings), `changedFiles`
|
|
62
|
+
(absolute paths, including created or removed files), `sourceSettingsCleaned`,
|
|
63
|
+
`packageJsonRuntimeChanged`, `hasConfigurationFiles`, and `warnings`. Errors are
|
|
64
|
+
thrown to the caller. Consumers that relied on console output should render the
|
|
65
|
+
returned changes and warnings themselves.
|
|
66
|
+
|
|
32
67
|
## CLI Options
|
|
33
68
|
|
|
34
69
|
### `--cwd`
|
|
@@ -149,8 +184,8 @@ Disable migrating `resolutions` field in `package.json`.
|
|
|
149
184
|
- **Type**: `boolean`
|
|
150
185
|
- **Default behavior**: `showChanges=true` (use this flag to disable)
|
|
151
186
|
|
|
152
|
-
|
|
153
|
-
|
|
187
|
+
Hide the settings diff while keeping the outcome summary and warnings. This is a
|
|
188
|
+
CLI display preference; library results always include settings changes.
|
|
154
189
|
|
|
155
190
|
### `--no-clean-npmrc`
|
|
156
191
|
|