@mui/toolpad-utils
Advanced tools
Comparing version 0.1.27 to 0.1.28
@@ -12,2 +12,10 @@ import { | ||
import { yamlOverwrite } from "yaml-diff-patch"; | ||
import * as prettier from "prettier"; | ||
async function formatYaml(code, filePath) { | ||
const readConfig = await prettier.resolveConfig(filePath); | ||
return prettier.format(code, { | ||
...readConfig, | ||
parser: "yaml" | ||
}); | ||
} | ||
async function readJsonFile(filePath, reviver) { | ||
@@ -45,3 +53,4 @@ const content = await fs.readFile(filePath, { encoding: "utf-8" }); | ||
const oldContent = await readMaybeFile(filePath); | ||
const newContent = oldContent ? yamlOverwrite(oldContent, content) : yaml.stringify(content); | ||
let newContent = oldContent ? yamlOverwrite(oldContent, content) : yaml.stringify(content); | ||
newContent = await formatYaml(newContent, filePath); | ||
if (newContent !== oldContent) { | ||
@@ -48,0 +57,0 @@ await writeFileRecursive(filePath, newContent); |
import { | ||
usePageTitle | ||
} from "../chunk-WKEABV4J.js"; | ||
import { | ||
useBoolean | ||
} from "../chunk-GNJHDIVW.js"; | ||
import { | ||
usePageTitle | ||
} from "../chunk-WKEABV4J.js"; | ||
export { | ||
@@ -8,0 +8,0 @@ useBoolean, |
@@ -12,2 +12,6 @@ declare const brand: unique symbol; | ||
} : never; | ||
/** | ||
* The inverse of Awaited. | ||
*/ | ||
export type Awaitable<T> = T | Promise<T> | PromiseLike<T>; | ||
export {}; |
{ | ||
"name": "@mui/toolpad-utils", | ||
"version": "0.1.27", | ||
"version": "0.1.28", | ||
"description": "Build MUI apps quickly", | ||
@@ -56,2 +56,3 @@ "author": "MUI Toolpad team", | ||
"invariant": "2.2.4", | ||
"prettier": "2.8.8", | ||
"react-is": "18.2.0", | ||
@@ -63,5 +64,6 @@ "yaml": "2.3.2", | ||
"@types/invariant": "2.2.35", | ||
"@types/prettier": "2.7.3", | ||
"@types/react-is": "18.2.1" | ||
}, | ||
"gitHead": "342439583072ebcaaa3b3587517804e4fdfb9dcf" | ||
"gitHead": "60bec54459ba0f3334c62f12e6e6c2c10a08fd21" | ||
} |
@@ -10,7 +10,3 @@ # @mui/toolpad-core | ||
```bash | ||
// with npm | ||
npm install @mui/toolpad-core | ||
// with yarn | ||
yarn add @mui/toolpad-core | ||
``` | ||
@@ -17,0 +13,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
234250
119
2710
6
3
16
+ Addedprettier@2.8.8
+ Addedprettier@2.8.8(transitive)