-
Notifications
You must be signed in to change notification settings - Fork 26
refactor: remove packages instead use compact-tools as submodules
#295
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
Changes from all commits
da2a7e1
79b2ac9
0e818fa
bd654d7
6b3112b
e996465
40693f0
4a103d4
39dda20
8a213b7
6a32663
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| .env | ||
| .act.env | ||
| .turbo | ||
| *.log | ||
| *.tsbuildinfo | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [submodule "compact-tools"] | ||
| path = compact-tools | ||
| url = https://github.com/OpenZeppelin/compact-tools |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| .PHONY: help setup install build-submodule submodule-init submodule-update | ||
|
|
||
| help: ## Show this help message | ||
| @echo "Available targets:" | ||
| @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' | ||
|
|
||
| setup: submodule-init build-submodule install ## Complete setup: init submodules, build compact-tools, and install dependencies | ||
| @echo "✅ Setup complete!" | ||
|
|
||
| install: ## Install dependencies for the main project | ||
| @echo "📦 Installing dependencies..." | ||
| @yarn install | ||
|
|
||
| build-submodule: ## Build the compact-tools submodule | ||
| @echo "🔨 Building compact-tools submodule..." | ||
| @cd compact-tools && yarn && yarn build | ||
|
|
||
| submodule-init: ## Initialize git submodules | ||
| @echo "📥 Initializing submodules..." | ||
| @git submodule update --init --recursive | ||
|
|
||
| submodule-update: ## Update submodules to latest commits and rebuild | ||
| @echo "🔄 Updating submodules..." | ||
| @git submodule update --remote | ||
| @echo "🔨 Rebuilding compact-tools..." | ||
| @$(MAKE) build-submodule | ||
| @echo "📦 Updating lockfile..." | ||
| @yarn install | ||
| @echo "✅ Submodules updated!" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| }, | ||
| "files": { | ||
| "ignoreUnknown": true, | ||
| "experimentalScannerIgnores": ["compact-tools/**"], | ||
| "includes": [ | ||
|
Comment on lines
10
to
12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: In Biome v2.3.8,
Example: {
"files": {
"experimentalScannerIgnores": ["lodash", "dist", "RedisCommander.d.ts"]
}
}
``` [1]
Note: In the newer docs (post‑2.3.8), this option is marked **deprecated**, with guidance to use the **force-ignore syntax via `files.includes`** (notably `!!` to fully exclude from indexing). [2][3]
**Sources:** Biome configuration reference (includes `files.experimentalScannerIgnores`) [1][2], Biome v2.3 blog (explains `!` vs `!!` and the deprecation) [3].
---
</details>
**Move `experimentalScannerIgnores` under `files` and use basename matching instead of glob patterns.**
The correct config path is `files.experimentalScannerIgnores`, not at the root level. Additionally, this option only accepts literal basenames or path segments—not glob patterns. `"compact-tools/**"` will not work as intended. Either use `"compact-tools"` as a basename, or switch to `files.includes` with the `!!` force-ignore syntax (the recommended approach in current Biome versions).
<details>
<summary>🤖 Prompt for AI Agents</summary>
In |
||
| "**", | ||
| "!**/tsconfig.base.json", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,25 +21,24 @@ | |
| "homepage": "https://docs.openzeppelin.com/contracts-compact/", | ||
| "type": "module", | ||
| "scripts": { | ||
| "compact": "compact-compiler", | ||
| "compact:access": "compact-compiler --dir access", | ||
| "compact:archive": "compact-compiler --dir archive", | ||
| "compact:security": "compact-compiler --dir security", | ||
| "compact:token": "compact-compiler --dir token", | ||
| "compact:utils": "compact-compiler --dir utils", | ||
| "compact": "compact-compiler +0.26.0 --hierarchical", | ||
| "compact:fast": "compact-compiler +0.26.0 --hierarchical --skip-zk", | ||
| "compact:access": "compact-compiler +0.26.0 --dir access --hierarchical", | ||
| "compact:archive": "compact-compiler +0.26.0 --dir archive --hierarchical", | ||
| "compact:security": "compact-compiler +0.26.0 --dir security --hierarchical", | ||
| "compact:token": "compact-compiler +0.26.0 --dir token --hierarchical", | ||
| "compact:utils": "compact-compiler +0.26.0 --dir utils --hierarchical", | ||
|
Comment on lines
+24
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of the imports expect a flattened structure
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh scratch that, the test script compiles without the flag. Nit: would consistency be better with compiling vs compile + testing? Right now, my artifacts dir is including both flattened + hierarchical |
||
| "build": "compact-builder", | ||
| "test": "compact-compiler --skip-zk && vitest run", | ||
| "test": "compact-compiler +0.26.0 --skip-zk && vitest run", | ||
|
Comment on lines
+24
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: For Compact compiler (compactc) / toolchain 0.26.0, the official flag docs list
If you’re seeing Citations:
Remove unsupported 🤖 Prompt for AI Agents |
||
| "types": "tsc -p tsconfig.json --noEmit", | ||
| "clean": "git clean -fXd" | ||
| }, | ||
| "engines": { | ||
| "node": ">=22" | ||
| }, | ||
| "dependencies": { | ||
| "@openzeppelin-compact/compact": "workspace:^" | ||
| }, | ||
| "devDependencies": { | ||
| "@openzeppelin-compact/contracts-simulator": "workspace:^", | ||
| "@openzeppelin/compact-tools-cli": "file:../compact-tools/packages/cli", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CLI is required to build the package for the compiled artifacts. I think this should be a regular dep |
||
| "@openzeppelin/compact-tools-simulator": "file:../compact-tools/packages/simulator", | ||
|
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check if .gitmodules exists and shows submodule configuration
cat .gitmodules 2>/dev/null || echo "No .gitmodules found"Repository: OpenZeppelin/compact-contracts Length of output: 176 🏁 Script executed: # Check the current state of compact-tools directory
ls -la compact-tools 2>/dev/null || echo "compact-tools directory not found"Repository: OpenZeppelin/compact-contracts Length of output: 182 🏁 Script executed: # Check git config for submodule configuration
git config --file=.gitmodules --get-regexp path 2>/dev/null || echo "No submodule paths in config"Repository: OpenZeppelin/compact-contracts Length of output: 116 🏁 Script executed: # Check if the paths referenced in package.json actually exist
echo "Checking cli package..."
test -f compact-tools/packages/cli/package.json && echo "✓ cli/package.json exists" || echo "✗ cli/package.json not found"
echo "Checking simulator package..."
test -f compact-tools/packages/simulator/package.json && echo "✓ simulator/package.json exists" || echo "✗ simulator/package.json not found"Repository: OpenZeppelin/compact-contracts Length of output: 191 🏁 Script executed: # Look for any documentation about setup/initialization
find . -maxdepth 2 -type f \( -name "README*" -o -name "SETUP*" -o -name ".github" \) -exec echo "Found: {}" \;Repository: OpenZeppelin/compact-contracts Length of output: 92 🏁 Script executed: # Check contracts/package.json to see the exact dependencies
head -50 contracts/package.json | tail -15Repository: OpenZeppelin/compact-contracts Length of output: 485 🏁 Script executed: # Check README for setup instructions
cat README.md | head -100Repository: OpenZeppelin/compact-contracts Length of output: 3034 Submodule initialization is required before install; already documented in README but worth reinforcing. The Consider adding a setup validation script or preinstall hook to ensure the submodule is initialized before dependency resolution. 🤖 Prompt for AI Agents |
||
| "@tsconfig/node24": "^24.0.3", | ||
| "@types/node": "24.10.0", | ||
| "ts-node": "^10.9.2", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,12 +8,12 @@ | |
| "packages/*" | ||
| ], | ||
| "scripts": { | ||
| "compact": "turbo run compact --filter=@openzeppelin-compact/contracts --log-prefix=none", | ||
| "compact": "turbo run compact --filter=@openzeppelin/compact-contracts --log-prefix=none", | ||
| "build": "turbo run build --log-prefix=none", | ||
| "test": "turbo run test --filter=@openzeppelin-compact/contracts --log-prefix=none", | ||
| "fmt-and-lint": "biome check . --changed", | ||
| "fmt-and-lint:fix": "biome check . --changed --write", | ||
| "fmt-and-lint:ci": "biome ci . --changed --no-errors-on-unmatched", | ||
| "test": "turbo run test --filter=@openzeppelin/compact-contracts --log-prefix=none", | ||
| "fmt-and-lint": "cd contracts && biome check . --changed", | ||
| "fmt-and-lint:fix": "cd contracts && biome check . --changed --write", | ||
| "fmt-and-lint:ci": "cd contracts && biome ci . --changed --no-errors-on-unmatched", | ||
|
Comment on lines
+14
to
+16
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to add this because I couldn't find any workaround to ignore the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :(
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. biome does not play well with submodules 🥲 |
||
| "types": "turbo run types", | ||
| "clean": "turbo run clean" | ||
| }, | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix malformed package scope in changelog entries.
Several entries read
@openzeppelin/compact-/..., which appears to be a typo and could confuse users.✍️ Suggested corrections (example)
🤖 Prompt for AI Agents