Skip to content

feat: pnpm migration, contracts precompiles build & npm publish#1021

Open
nowooj wants to merge 8 commits intocosmos:mainfrom
nowooj:feat/contracts-package
Open

feat: pnpm migration, contracts precompiles build & npm publish#1021
nowooj wants to merge 8 commits intocosmos:mainfrom
nowooj:feat/contracts-package

Conversation

@nowooj
Copy link

@nowooj nowooj commented Feb 26, 2026

Closes: #428

Temporary published package: cosmos-evm-contracts
If you want to keep using this package name, I will transfer npm package ownership from the account that published it.


1. contracts package – precompiles build & npm publish

  • Precompiles-only build: Build .sol and ABI into dist/ from solidity/precompiles, excluding testdata and testutil
  • Publish config: files, exports, and prepublishOnly so npm publish runs the build and exposes the right entry paths
Path Change
contracts/scripts/build-precompiles.js New. Precompiles build script
contracts/package.json build:precompiles, compile, prepublishOnly, files, exports; packageManager, deps, etc.
contracts/README.md New. Installation, package structure, usage
contracts/.gitignore Add dist/
contracts/hardhat.config.js Config updates
contracts/pnpm-lock.yaml Lockfile (pnpm)

2. pnpm migration (reason)

  • Faster installs and less disk usage via a content-addressable store
  • Strict dependency resolution to avoid phantom dependencies and keep the dependency tree predictable
  • Built-in workspace support for the repo’s multiple packages (contracts/, tests/, evm-tools-compatibility, etc.)

CI, scripts, and lockfiles across the repo are updated to use pnpm accordingly.


How to verify

# Full contract compile
make contracts-all  # or use scripts/compile_smart_contracts

# Build contracts precompiles
cd contracts && pnpm install && pnpm run build:precompiles

How to publish

cd contracts

# 1) Log in to npm (once)
npm login

# 2) Publish (prepublishOnly runs build:precompiles)
pnpm publish

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

@nowooj nowooj force-pushed the feat/contracts-package branch from 92d6f00 to 3ca5e17 Compare February 26, 2026 10:40
@aljo242 aljo242 assigned aljo242 and vladjdk and unassigned aljo242 Feb 26, 2026
@nowooj nowooj force-pushed the feat/contracts-package branch 3 times, most recently from bcf6953 to 816a66c Compare March 5, 2026 08:34
@nowooj nowooj force-pushed the feat/contracts-package branch 4 times, most recently from 6887e03 to 260c1dd Compare March 6, 2026 02:53
@nowooj
Copy link
Author

nowooj commented Mar 9, 2026

Rebase on main

nowooj added 7 commits March 9, 2026 15:33
chore: refine exports structure for TypeScript compatibility

chore: enhance exports for Solidity files

refactor: enhance TypeScript configuration for precompiles

feat: add dual ESM/CJS build for ABI exports

refactor: streamline build process for precompiles

chore: make contracts-all
@nowooj nowooj force-pushed the feat/contracts-package branch from 260c1dd to 40696d7 Compare March 9, 2026 06:33
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.

Declare the common Types.sol as a library.

3 participants