Skip to content

Consume compact tools from NPM instead of local packages#523

Merged
0xisk merged 7 commits into
OpenZeppelin:mainfrom
andrew-fleming:integrate-compact-tools
May 22, 2026
Merged

Consume compact tools from NPM instead of local packages#523
0xisk merged 7 commits into
OpenZeppelin:mainfrom
andrew-fleming:integrate-compact-tools

Conversation

@andrew-fleming
Copy link
Copy Markdown
Contributor

@andrew-fleming andrew-fleming commented May 22, 2026

Resolves #291

This PR integrates the packages released from compact-tools and updates the deps and imports accordingly. This PR also proposes to remove the packages/ directory

Summary by CodeRabbit

  • Chores
    • Migrated build infrastructure from internal workspace packages to published npm packages: @openzeppelin/compact-cli and @openzeppelin/compact-simulator.
    • Updated build and test commands to use new external packages for compilation and simulation.
    • Removed internal package modules and consolidated functionality into published dependencies.

Review Change Stack

@andrew-fleming andrew-fleming requested review from a team as code owners May 22, 2026 06:09
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Walkthrough

This PR removes local implementations of the compact and simulator packages from the monorepo and migrates to consuming published NPM versions. Package dependencies are updated, all contract test simulator imports are redirected to external packages, and the build pipeline configuration is adjusted accordingly.

Changes

Package externalization and import migration

Layer / File(s) Summary
Dependency configuration update
contracts/package.json, turbo.json
contracts/package.json scripts are refactored to use compact-builder and compact-compiler CLI tools; dependencies replace workspace references (@openzeppelin-compact/compact, @openzeppelin-compact/contracts-simulator) with NPM versions (@openzeppelin/compact-cli@^0.0.1, @openzeppelin/compact-simulator@^0.0.1). turbo.json removes the @openzeppelin-compact/compact#build task dependency.
Simulator import updates across contract test suites
contracts/src/access/test/simulators/*, contracts/src/security/test/simulators/*, contracts/src/token/test/simulators/*, contracts/src/utils/test/simulators/*
All simulator files (AccessControl, Ownable, ShieldedAccessControl, ZOwnablePK, Initializable, Pausable, FungibleToken, MultiToken, NonFungibleToken, Utils) update their imports to source createSimulator and BaseSimulatorOptions from @openzeppelin/compact-simulator instead of the local workspace package.
Local package implementation removal
packages/compact/src/*, packages/simulator/src/*, packages/simulator/test/*
Removes local implementations of the compact compiler/builder and simulator factory/core classes, test fixtures, and utilities that are now maintained externally and published as NPM packages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs


🐰 Hop along the dependency chain,
No more workspace, just NPM's plan!
External packages, clean and neat,
Make the monorepo complete.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses issue #291 by replacing local simulator and compact packages with NPM-distributed versions, updating all import statements and build/test scripts accordingly.
Out of Scope Changes check ✅ Passed All changes directly relate to migrating from local packages to NPM consumption: dependency updates, import path changes, build script modifications, and removal of local package files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: migrating from local package management to consuming compact tools from NPM, which is the primary objective of this substantial refactoring.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@andrew-fleming andrew-fleming changed the title Integrate compact tools Consume compact tools from NPM instead of local packages May 22, 2026
Copy link
Copy Markdown
Member

@0xisk 0xisk left a comment

Choose a reason for hiding this comment

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

LGTM! thank you @andrew-fleming!

@0xisk 0xisk merged commit ec44f51 into OpenZeppelin:main May 22, 2026
7 checks passed
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.

Refactor repo to consume simulator and compact packages via NPM

2 participants