feat(scripting): register workflow scripts as CLI commands#695
Open
yahgwai wants to merge 102 commits intofeat/deploy-full-chainfrom
Open
feat(scripting): register workflow scripts as CLI commands#695yahgwai wants to merge 102 commits intofeat/deploy-full-chainfrom
yahgwai wants to merge 102 commits intofeat/deploy-full-chainfrom
Conversation
Move deployNewChain, createTokenBridge (renamed to createTokenBridgeAndWethGateway), transferOwnership, and deployFullChain from examples/ to workflows/ and register them in runCli. Add workflow() helper to scriptUtils for single-arg command handlers.
Remove workflow() helper and the barrel file. Use cmd() with a toTuple adapter instead, keeping all command registration in one place.
Split each workflow's schema into inputSchema (ZodObject before transform) and schema (with transform). This allows deployFullChain to reference field definitions from transferOwnership and createTokenBridgeAndWethGateway via .shape instead of redeclaring them.
Rename params to createRollupParams, group token bridge fields under tokenBridgeParams, and ownership transfer fields under ownershipTransferParams for clearer CLI input structure.
Add overrides for vite, flatted, picomatch, brace-expansion, and yaml to resolve transitive vulnerabilities in dev tooling (vitest, eslint, typescript-eslint, @wagmi/cli, ts-morph, patch-package).
Add action schemas (buildSetIsBatchPoster, buildSetValidKeyset, buildInvalidateKeysetHash, buildSetMaxTimeVariation, buildScheduleArbOSUpgrade, isBatchPoster, isValidKeysetHash, getMaxTimeVariation) and utility schemas (configDefaults, parentChainIsArbitrum, consensus release lookups, isKnownWasmModuleRoot) to the CLI runner.
…orkflows # Conflicts: # src/scripting/cli.ts
# Conflicts: # package.json # pnpm-lock.yaml
…ction schemas The build* actions take account: Address, not a private key. The schemas should only require what the function actually needs.
# Conflicts: # package.json # pnpm-lock.yaml
Add publicClientSchema, parentChainPublicClientSchema, and actionWriteBaseSchema to common.ts. Add withPublicClient helper to viemTransforms.ts. Update 26 schema files to extend base schemas instead of redeclaring fields. Simplify 9 destructure-and-spread transforms to use withPublicClient.
…define-script-create-token-bridge
…bridge' into feat/cli-workflows
…define-script-create-token-bridge
…bridge' into feat/cli-workflows # Conflicts: # src/scripting/cli.ts
…define-script-create-token-bridge
…bridge' into feat/cli-workflows
The regex layer was subsumed by viem's isHex/isAddress and was only retained to feed the schema coverage test generator. Drop it here; the coverage generator in feat/schema-coverage will need to learn about the address/hex formats directly (follow-up on that branch).
…generator Now that addressSchema and hexSchema use viem's isAddress / isHex refines (no pattern for the generator to sample from), short-circuit on them directly. getSchemaLeaves treats either as an atomic leaf so derived shapes (wrapped in optional/default/pipe/object) still reach it, and generateForType emits a canonically valid address or hex string when encountered.
…define-script-create-token-bridge
…bridge' into feat/cli-workflows
Replace the regex with viem's isHex + size(v) === 32. Matches the style of hexSchema / addressSchema (refine-backed, no regex). Coverage generator follow-up lands on feat/schema-coverage.
Replace the regex with isHex + v.length === 66 (0x prefix plus 64 hex chars). Matches the style of hexSchema / addressSchema. Coverage generator follow-up lands on feat/schema-coverage. Supersedes the earlier isHex + size attempt; viem's size() rounds odd-length hex up via Math.ceil, so it couldn't strictly enforce length. An explicit length check is accurate.
Extend the identity-based fast path to include privateKeySchema, now that it's validated via isHex + length (no regex for the generator to sample).
…define-script-create-token-bridge
…bridge' into feat/cli-workflows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move deployNewChain, createTokenBridge (renamed to createTokenBridgeAndWethGateway), transferOwnership, and deployFullChain from examples/ to workflows/ and register them in runCli. Add workflow() helper to scriptUtils for single-arg command handlers.