Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cli add prettier task #750

Merged
merged 6 commits into from
Mar 6, 2024
Merged

Cli add prettier task #750

merged 6 commits into from
Mar 6, 2024

Conversation

technophile-04
Copy link
Collaborator

Description

Since we have .template.mjs file eg this. So when the whole project is scaffolded there are some prettier warning left for eg: #748 logs.

This PR:

  • Adds base format script in root package.json to format both hardhat and foundry
  • Adds a new task "🪄 Formatting files with prettier" to cli
  • For foundry
    • Added [fmt] in foundry.toml kindof inline with our hardhat configuration to format solidity files, formated .sol file with forge fmt
    • Formated .js file with prettier also added .prettier.json in packages/foundry

@technophile-04
Copy link
Collaborator Author

Also tagging @jrcarlos2000 just to verify if I added [fmt] correctly, seems like working fine for me 🙌

@jrcarlos2000
Copy link
Collaborator

Looks good !

const result = await execa("yarn", ["format"], { cwd: targetDir });

if (result.failed) {
throw new Error("There was a problem running the format commend");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo command

@rin-st
Copy link
Member

rin-st commented Mar 5, 2024

Great job Shiv! 👍

Tried to reproduce #748

For both foundry and hardhat it were an errors similar to described

yarn build
   ▲ Next.js 14.0.4

 ✓ Creating an optimized production build    
 ✓ Compiled successfully
 ✓ Linting and checking validity of types    
   Collecting page data  ..TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:405:5)
    at new URL (node:internal/url:611:13)
    at 47436 (/Users/liana/Documents/se-2/mde/packages/nextjs/.next/server/chunks/1174.js:29:972)
    at Function.t (/Users/liana/Documents/se-2/mde/packages/nextjs/.next/server/webpack-runtime.js:1:143)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async collectGenerateParams (/Users/liana/Documents/se-2/mde/packages/nextjs/node_modules/next/dist/build/utils.js:884:17)
    at async /Users/liana/Documents/se-2/mde/packages/nextjs/node_modules/next/dist/build/utils.js:1100:17
    at async Span.traceAsyncFn (/Users/liana/Documents/se-2/mde/packages/nextjs/node_modules/next/dist/trace/trace.js:147:20) {
  input: 'http://localhost:undefined',
  code: 'ERR_INVALID_URL'
}

> Build error occurred
Error: Failed to collect page data for /blockexplorer
    at /Users/liana/Documents/se-2/mde/packages/nextjs/node_modules/next/dist/build/utils.js:1220:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'Error'
}
   Collecting page data  .%                                                                          

but it was because no .env file and PORT in it. Fixed after adding || 3000 to http://localhost:${process.env.PORT}

@technophile-04
Copy link
Collaborator Author

For both foundry and hardhat it were an errors similar to described

Ohh yeah it should be fixed once we create the main back merge PR

Thanks all merging this 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants