Skip to content

Commit

Permalink
test moar things
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance committed Nov 1, 2024
1 parent 48c7072 commit 17d43f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ethers": "^5.7.2",
"file-type": "^19.6.0",
"mime-types": "^2.1.35",
"prettier": "^2.7.1",
"prettier": "^3.3.3",
"sharp": "0.32.6",
"zod": "^3.23.8"
},
Expand Down
25 changes: 7 additions & 18 deletions packages/scripts/src/addOrbitChain/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,31 +462,20 @@ export async function runPrettier(targetJsonPath: string): Promise<void> {
try {
const fileContent = fs.readFileSync(targetJsonPath, "utf8");

// Import prettier dynamically to ensure we get the full module
const prettier = await import("prettier");
console.log({ prettier });
const config = await import(
"../../../arb-token-bridge-ui/prettier.config.js"
);

const formattedContent2 = await prettier.format(fileContent, {
// Explicit parser based on file extension
parser: "json",
// Explicit config to ensure it works in CI
printWidth: 80,
const formattedContent = await prettier.format(fileContent, {
tabWidth: 2,
singleQuote: false,
trailingComma: "all",
bracketSpacing: true,
endOfLine: "lf",
});
console.log({ formattedContent2 });

const prettierConfig = await prettier.resolveConfig(targetJsonPath);
console.log({ prettierConfig });
const formattedContent = await prettier.format(fileContent, {
...prettierConfig,
const formattedContent2 = await prettier.format(fileContent, {
...config,
filepath: targetJsonPath,
});

console.log({ formattedContent });
console.log({ formattedContent2 });
fs.writeFileSync(targetJsonPath, formattedContent);
console.log(`Prettier formatting applied to ${targetJsonPath}`);
} catch (error) {
Expand Down

0 comments on commit 17d43f5

Please sign in to comment.