|
1 | 1 | import fs from 'graceful-fs' |
2 | 2 | import { join } from 'path' |
3 | | -import { PackageJson, TsConfigJson } from 'type-fest' |
| 3 | +import { PackageJson, PartialDeep, TsConfigJson } from 'type-fest' |
4 | 4 | import { JsonRoot, loadJsonFile } from './loadJsonFile' |
5 | 5 |
|
6 | 6 | type MaybePromise<T> = T | Promise<T> |
@@ -128,22 +128,18 @@ export const modifyJsonFile: ModifyJsonFileGenericFunction = async (path, modify |
128 | 128 |
|
129 | 129 | // todo: use read-pkg / write-pkg for normalization |
130 | 130 |
|
131 | | -type TEST = 'HAYA' |
132 | | - |
133 | | -/** Use {@linkcode TEST instead} */ |
134 | | -const d = 5 |
135 | | - |
136 | 131 | /** |
137 | 132 | * Almost the same is sindresorhus/write-pkg, but with proper typing support and setters for properties |
138 | 133 | */ |
139 | | -export const modifyPackageJsonFile: ModifyJsonFileFunction<PackageJson, true> = (path, modify, options = {}) => { |
| 134 | +// TODO remove workaround once my pr is merged |
| 135 | +export const modifyPackageJsonFile: ModifyJsonFileFunction<PartialDeep<PackageJson>, true> = (path, modify, options = {}) => { |
140 | 136 | if (typeof path === 'object') { |
141 | 137 | path = join(path.dir, 'package.json') |
142 | 138 | } |
143 | 139 | return modifyJsonFile(path, modify, { removeJsonc: true, ...options }) |
144 | 140 | } |
145 | 141 |
|
146 | | -export const modifyTsConfigJsonFile: ModifyJsonFileFunction<TsConfigJson, true> = (path, modify, options = {}) => { |
| 142 | +export const modifyTsConfigJsonFile: ModifyJsonFileFunction<PartialDeep<TsConfigJson>, true> = (path, modify, options = {}) => { |
147 | 143 | if (typeof path === 'object') { |
148 | 144 | path = join(path.dir, 'tsconfig.json') |
149 | 145 | } |
|
0 commit comments