Commit 0d4623e
committed
Restore toml-patch using @decimalturn/toml-patch (#246)
> [!NOTE] This work is originally by @DecimalTurn (PR #229). This PR is a resubmission because CI requires repository secrets that GitHub does not provide for fork builds.
## Original Description
This change still resolves #143 like in #227, but it retains comments preservation when editing TOML config files.
## Additional Context from Original PR
- The maintained fork (@decimalturn/toml-patch) has been verified to not have the same problem described in #143
- A new test was added to ensure the issue is caught: DecimalTurn/toml-patch@5c139ca
- The maintainer is committed to maintaining this fork for the foreseeable future
- The scoped package name (@decimalturn/toml-patch) will be maintained
## Changes
1. Replaced `smol-toml` with `@decimalturn/toml-patch` in package dependencies
2. Updated `updateConfigToml` function to use TOML.patch() instead of stringify()
3. Removed the note about losing comments and formatting from documentation
4. Updated tests to use the new package
5. Added proper typing for parsed config variables
## Benefits
- Preserves comments and formatting in config.toml files
- Resolves the issue with missing sections (from #143)
- Maintains comment preservation capability (from original toml-patch)
---
Credit: @DecimalTurn for the original implementation and maintaining the toml-patch fork1 parent 6aa7afb commit 0d4623e
File tree
5 files changed
+23
-21
lines changed- .changeset
- pkgs/cli
- __tests__/commands/install
- src/commands/install
5 files changed
+23
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
| 57 | + | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
| |||
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
135 | | - | |
136 | | - | |
137 | 133 | | |
138 | 134 | | |
139 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
140 | 138 | | |
141 | 139 | | |
142 | 140 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments