Create project structure and monorepo workspace
Create the project folder and navigate into it:
mkdir walnut-app
cd walnut-appCreate the
packagesdirectory with subdirectories forcontractsandcli
mkdir -p packages/contracts packages/cliThe contracts subdirectory will house the Seismic smart contract(s) and test(s) for the project, while the cli will house the interface to interact with the contracts.
Initialize a bun project in the root directory:
bun init -y && rm index.ts && rm tsconfig.json && touch .prettierrc && touch .gitmodulesWe remove the default index.ts and tsconfig.json files created by bun init -y to keep the root directory clean and focused on managing the monorepo structure rather than containing code. We also create a .prettierrc file for consistent code formatting and a .gitmodules file to manage contract submodules.
Replace the default
package.jsonwith the following content for a monorepo setup:
{
"workspaces": [
"packages/**"
],
"dependencies": {},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
"prettier": "^3.4.2"
}
}Add the following to the
.prettierrcfile for consistent code formatting:
Replace the
.gitignorefile with:
Add the following to the
.gitmodulesfile to track git submodules (in our case, only the Forge standard library,forge-std):
Last updated

