Skip to content

Prune verified dead code and unused dependencies - #625

Open
fpigeonjr wants to merge 2 commits into
masterfrom
IAEMOD-61187/feat-slug
Open

Prune verified dead code and unused dependencies#625
fpigeonjr wants to merge 2 commits into
masterfrom
IAEMOD-61187/feat-slug

Conversation

@fpigeonjr

Copy link
Copy Markdown
Contributor

Description

Prunes verified dead code and unused dependencies left over from the pre-2018 webpack/karma build pipeline, now fully superseded by the Angular CLI / Karma harness in test-app. Run solo/last in the pipeline wave per the parent epic, since it touches both package.json roots and angular.json broadly.

  • Root package.json: removed 41 unused dependencies (@angular-devkit/schematics plus 40 devDependencies for webpack, loaders, the old karma stack, and typedoc). Confirmed unreferenced by any working script via depcheck and knip, cross-checked manually against every script/config in the repo.
  • Root angular.json: removed the dead build/serve/extract-i18n/test architect targets. They pointed at files that no longer exist (src/main.ts, src/test.ts, karma.conf.js, etc.), and the underlying builder package (@angular-devkit/build-angular) isn't even installed at the root. The working lint target (used by CI) is unchanged.
  • mock-test.js: deleted — an unreferenced 2018 BSP workaround (process.exit() only, no script invokes it).
  • test-app/package.json: removed @angular/language-service and karma-cli. Both confirmed unused by depcheck; also verified with a clean reinstall (rm -rf node_modules && npm install) followed by a full test/build/lint run to rule out any tooling-implicit usage.

No component or spec source files under src/ were removed. knip's "unused exports/files" report for the library source is largely false positives in this raw-source, barrel-export publishing model — the frozen consumer-deep-imports.json paths must stay reachable even though nothing inside this repo imports them directly, and static analysis can't safely distinguish "genuinely dead" from "part of the public surface" here. Source-level pruning is left as a judgment call for a dedicated follow-up rather than risking the frozen deep-import contract.

Motivation and Context

Closes #572

Type of Change (Select One and Apply Label)

  • Bug fix (non-breaking change which fixes an issue) → Apply bugfix label
  • New feature (non-breaking change which adds functionality) → Apply enhancement label
  • Breaking change (fix or feature that would cause existing functionality to change) → Apply breaking label
  • Documentation / configuration update → Apply maintenance label

How to Test

  1. npm install at repo root, then npm --prefix test-app install — both should complete cleanly with the pruned dependency sets.
  2. npm run format:check — passes (0 errors; pre-existing warn-only Prettier backlog is unchanged from master).
  3. npm run lint — passes (0 errors, 1631 warnings, unchanged from master).
  4. npm run validate:publish — confirms the frozen deep-import contract: 741 packed files, 637 tracked src/ui-kit files, src/formly/index.ts, and all 67 consumer deep imports across 3 repos still resolve.
  5. cd test-app && npm run build — succeeds.
  6. cd test-app && npm test — 667/667 executed specs pass (37 skipped, same as pre-change baseline).
  7. cd test-app && npm run test:e2e — Playwright smoke test passes.

Expected result: All commands above complete with no new failures, and dependency counts in both package.json files are reduced with no change in test/lint/build outcomes.

Screenshots (if appropriate)

N/A — backend/tooling changes only.

Checklist

  • Branch name follows convention (Jira ticket ID IAEMOD-61187/feat-slug, per this repo's Jira-tracked epic IAEMOD-61187)
  • PR title starts with a verb in the imperative mood
  • I have self-reviewed my own code
  • format:check passes (npm run format:check)
  • lint passes (npm run lint)
  • build passes (cd test-app && npm run build)
  • Tests pass and coverage is reported (cd test-app && npm test)
  • If this change requires a documentation update, I have updated it accordingly
  • If there are dependent changes, they have been merged and published in downstream modules

Removes dead build tooling and unused dependencies left over from the
pre-2018 webpack/karma pipeline, now superseded by the Angular CLI /
Karma harness in test-app.

- Root package.json: drop 41 unused deps (@angular-devkit/schematics
  plus 40 devDeps for webpack, loaders, old karma, typedoc, etc.) that
  depcheck and knip confirm are unreferenced by any working script.
- Root angular.json: remove dead build/serve/extract-i18n/test
  architect targets — they point at files that no longer exist
  (src/main.ts, src/test.ts, karma.conf.js, etc.) and the underlying
  builder package isn't even installed. The working lint target is
  unchanged.
- Delete mock-test.js, an unreferenced 2018 BSP workaround
  (process.exit() only).
- test-app/package.json: drop @angular/language-service and
  karma-cli, confirmed unused by depcheck and by a clean reinstall +
  full test/build/lint run.

Verified with npm run validate:publish that the frozen consumer
deep-import contract (src/formly, src/ui-kit/**) is unaffected, and
that build + all 667 executed specs remain green in test-app after
the prune.

Closes #572
@fpigeonjr fpigeonjr added the maintenance Repo maintenance / tooling label Aug 26, 2026
@fpigeonjr fpigeonjr self-assigned this Aug 26, 2026
@fpigeonjr
fpigeonjr requested a balanced review from Copilot August 26, 2026 19:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Prunes obsolete root build/test tooling while preserving the active test-app harness and publication contract.

Changes:

  • Removes legacy Angular architect targets and unused dependencies.
  • Deletes the obsolete BSP test workaround.
  • Regenerates both dependency lockfiles.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
angular.json Removes inactive root build, serve, i18n, and test targets.
package.json Removes legacy tooling dependencies.
package-lock.json Updates the root dependency resolution.
mock-test.js Deletes the obsolete test workaround.
test-app/package.json Removes two unused development dependencies.
test-app/package-lock.json Updates test-app dependency resolution.
Files not reviewed (1)
  • test-app/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json
Comment thread package.json
- tsconfig.json: remove the now-dangling 'webpack' entry from
  compilerOptions.types (its @types/webpack devDependency was already
  removed in the previous commit; leaving it would surface TS2688 on
  any tool that loads this root config after a clean install).
- Delete typedoc.json and typedoc.md: no script references the
  typedoc command anymore since its devDependency was removed, and
  the docs described an unsupported workflow. No replacement command
  is currently exposed, per the PR's dead-code pruning scope.
@fpigeonjr
fpigeonjr marked this pull request as ready for review August 26, 2026 20:06
@fpigeonjr
fpigeonjr requested a review from a team as a code owner August 26, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Repo maintenance / tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prune verified dead code + unused dependencies (solo/last)

2 participants