Remove dead code and unwired API surface - #70
Open
charlesHetterich wants to merge 3 commits into
Open
Conversation
Drop never-called exports (deployBatch, getOnChainCode, the flat toposort family, sync pvmContractBuild, computeCid, normalizeCdmJson, unused solidity helpers), the never-emitted check-cached event and cached status, reserved deploy options, the unused MetadataPublisher client param, hardcoded fake publish tx/block hashes, and the AssetHubConnection/BulletinConnection types. Constants are no longer re-exported from cdm-builder; import them from cdm-utils. Flat toposort tests are ported to the layered API.
Delete the unwired PipelineStatusAdapter observer API (onStatusChange, onPhaseChange, onLogChange, PhaseInfo, addressesFromSummary, unread fields), the unreachable checking/registering/cached UI states and their DeployTable branches, progressBar/formatDuration, the duplicate up-front detectBuildOrder call (the table now populates from the library's detect event), the unused InstallResult import/re-export, and the empty postInstallRust placeholder. cdm install now prints where each contract's artifacts were saved.
Drop the fabricated weeklyCalls stat, the unused Package.versions field, placeholder Docs/Playground header links, no-op biome-ignore comments (the biome linter is disabled), the empty App.css/index.css husks, and the keyword-chip hover styling orphaned by the plain-span change. Replace the stock Vite README with a real one and share a single splitPackageName helper between PackagePage and PackageCard.
Contributor
CDM CLI dev releaseThis PR includes a Install it: curl -fsSL https://raw.githubusercontent.com/paritytech/contract-dependency-manager/59442e63d93bc889f03f1b9ce1a4f0b7ab63fa31/install.sh | CDM_TAG=cdm-cli-dev-pr-70 bashUpdate an existing install: cdm update --tag cdm-cli-dev-pr-70Release tag: |
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.
Summary
Removes the dead surface identified in the repo audit. Every item below was re-verified as unused by grepping the current
main(post-#65/#67/#68) before deletion; where a deletion orphaned an import or a consumer branch, the cascade was cleaned in the same commit. Two small approved conversions ride along (renderedsavedPath, single-sourced constants). No refactors or dedup beyond that.Deletions
@parity/cdm-builder
ContractDeployer.deployBatch+getOnChainCode— zero callers; production usesdeployAndRegisterBatch. Doc comments referencingdeployBatchupdated.toposort,DeploymentOrder,createCrateToPackageMap,detectDeploymentOrder) — production only uses the layered variants. Tests ported to the layered API:detection.test.tsnow asserts againstdetectDeploymentOrderLayered(...).layers.flat(), and the flat suite's reverse-insertion linear-chain case was ported as atoposortLayers(g).flat()assertion; the cycle/self-loop/determinism assertions already existed in thetoposortLayerssuite and are retained.check-cachedevent +"cached"summary status — never emitted anywhere (confirmed delete, not TODO). Downstream handling removed from the CLI adapter andDeployTable(incl. the now-unusedCachedcomponent and thestatus !== "cached"filter in the layer error path).DeployContractsOptionsfieldswaitFor/timeoutMs/gateway— never read.pvmContractBuild— only the async variant is called; its doc rationale moved ontopvmContractBuildAsync.computeCid— zero callers; the pipeline doc comment that cited it now correctly namescomputeBulletinStoreCid.readSolidityAbi/artifactDisplayPath/bytecodeSizein solidity.ts — zero callers, and never re-exported from the package index.normalizeCdmJsonidentity cast + its no-op "keeps manifests unchanged" test —readCdmJsoncasts directly. Real validation/round-trip tests are deferred to the tests PR.MetadataPublisher: unused_clientconstructor param dropped (and the pipeline call site no longer passesbulletinClient);publishBatchno longer returns hardcoded faketxHash: ""/blockHash: ""— the fields are gone from its return type and from thepublish-doneevent. Cascade:ContractStatus.publishTxHash/publishBlockHash(only ever set to"") removed, along with theDeployTablebranches keyed on them, which were unreachable for the same reason.@parity/cdm-env
AssetHubConnection/BulletinConnectiontypes + index re-exports — zero references.@parity/cdm-cli
PipelineStatusAdapterunwired observer API:onStatusChange/onPhaseChange/onLogChange,PhaseInfo+ thephasefield,addressesFromSummary(), and the unreadlayers/contractsfields — onlyonCdmPackageDetectedwas ever wired (verified against post-Fix error handling, network resolution, and frontend correctness bugs #68ui.ts). Thecratesfield became unread after the ui.ts change below and was removed too (row order now comes fromstatusesinsertion order, which the adapter fills in layered order ondetect). Misleading comments fixed: the "spinner above the table" docstring and the "runDeployWithUI logs deploy-plan to stderr" claim (it never did)."checking"/"registering"inContractState+ the seven unreachableDeployTableconditionals that reduced tostate === "done".progressBar+formatDurationin ui.ts — zero callers.precomputeBuildDisplay's up-frontdetectBuildOrdercall deleted; the table now populates purely from the library'sdetectevent (Ink re-renders on the 80 ms tick and re-reads the mutatedstatuses/displayNamesmaps). Docstrings reconciled. Verified via the event flow and the CLI help/tests.InstallResultunused import/re-export incommands/install/index.ts(cascade: the same now-unused re-export ininstall-pipeline.ts).postInstallRustno-op deleted along with its call site — it was an empty placeholder from the day it was added (866bdde, "Add @dotdm/cdm TypeScript client library and post-install codegen") and never gained a body; the install command already writes everything Rust consumers (cdm::import!) read fromcdm.json. A comment at the hook site records why Rust needs no post-install step.@parity/cdm-frontend
weeklyCallsfabricated stat: type field, both hardcodedweeklyCalls: 0sites in registry-queries.ts, and the PackageCard render block (+ itsformatCallshelper).Package.versions?: {version; date}[]— fully dead after Fix error handling, network resolution, and frontend correctness bugs #68's Versions tab (which usesusePackageVersions/PackageVersionInfo); never written or read.playground.dotdomain).biome-ignorecomments (PackagePage, SearchPage, SkeletonCard, and one in the CLI's deploy-pipeline.ts) — biome.json has"linter": { "enabled": false }, so none of them suppress anything; the frontend ESLint config flags none of the annotated lines (verified:eslint .clean after removal).App.css+index.css"intentionally left empty" husks — verified unimported (main.tsx imports neither; global styles live instyles/global.css).splitNamein PackagePage vssplitPackageNamein PackageCard — kept one, moved tosrc/lib/package-name.ts(approved exception to the no-dedup rule)..sidebar-keyword:hoverlink-affordance CSS (plus thetransition/text-decorationthat only served it) — orphaned by Fix error handling, network resolution, and frontend correctness bugs #68's change of keyword chips to plain spans.Conversions (approved)
InstallStatus.savedPathis now rendered instead of deleted: after a successful install, each row gets a dim↳ .cdm/contracts/<name>/<version>line showing where artifacts landed (path relative to cwd, same↳style as the existing link fallback line).GAS_LIMIT/STORAGE_DEPOSIT_LIMIT/CONTRACTS_REGISTRY_CRATEre-exports removed from@parity/cdm-builder; the two importers (cli/commands/deploy.ts,scripts/deploy-registry.ts) now import from@parity/cdm-utilsdirectly.Skipped items
None — every audited item re-verified as dead on current main. (The
"checking"strings remaining intoolchain.ts/setup.tsare a different, live toolchain-setup status type, untouched.)Changeset
One changeset:
@parity/cdm-buildermajor (removed exports, events, options, and the constants re-exports),@parity/cdm-envpatch (removed dead types),@parity/cdm-clipatch (dead code removal + savedPath display). The previous cycle's changesets were consumed by the last "chore: version packages", so this is the only pending one.Verification
pnpm checkgreen end-to-end (embed:templates + format:check + typecheck + build incl. build:registry + vitest + macro + Rust tests).normalizeCdmJsontest, +1 ported flat-semantics chain test; all other affected tests ported in place).deployBatch,getOnChainCode,toposort,DeploymentOrder,createCrateToPackageMap,detectDeploymentOrder,check-cached,pvmContractBuild,computeCid,readSolidityAbi,artifactDisplayPath,normalizeCdmJson,AssetHubConnection,BulletinConnection,PhaseInfo,onStatusChange,onPhaseChange,onLogChange,addressesFromSummary,progressBar,formatDuration,weeklyCalls,postInstallRust,splitName,publishTxHash,biome-ignore).pnpm --filter @parity/cdm-frontend buildandeslint .both pass.