Skip to content

Remove dead core-web libraries (libs/dotcms, libs/dot-layout-grid) #36950

Description

@nicobytes

Description

Two Nx libraries in core-web are dead code and should be removed. Both have zero consumers, are excluded from CI, and do not compile today.

They surfaced while working through the strict-mode rollout (epic #35932) — enabling strict on either would mean fixing type errors in code nobody uses, with zero verification signal since no CI target compiles them.

Library What it is Superseded by Strict errors avoided
libs/dotcms Legacy initDotCMS SDK (dotcms@0.0.21) @dotcms/client ~48
libs/dot-layout-grid Legacy NgGrid layout grid (vendored angular2-grid) GridStack 8.4.0 in libs/template-builder 119

1. libs/dotcms — legacy initDotCMS SDK

Nobody imports it — verified five ways

Check Result
Nx project graph 0 dependents, 0 outgoing dependencies
@dotcms/dotcms imports across the repo None
initDotCMS symbol usage None outside the library
dotcms declared as a dependency in any package.json None
References to libs/dotcms Only tsconfig.base.json:35 (alias), nx.json:227 (Jest plugin glob), README.MD:12

Unmaintained and broken

  • libs/dotcms/project.json is tagged ["skip:test", "skip:lint", "skip:build"] — CI never builds, lints, or tests it.
  • Does not compile, even with strict disabled. src/lib/api/DotApiContentType.ts:1 and src/lib/api/DotApiForm.ts:1 import from 'dotcms-models', a path alias that no longer exists (current one is @dotcms/dotcms-models) — 5 TS2307 errors regardless of strict mode.
  • Last published to npm 2022-10-10. No release wiring: the publish target points at tools/scripts/publish.mjs, which does not reference it, and no workflow invokes it.

2. libs/dot-layout-grid — legacy NgGrid layout grid

Nobody imports it — verified four ways

Check Result
Nx project graph 0 dependents, 0 outgoing dependencies
@dotcms/dot-layout-grid alias usage Only its own definition at tsconfig.base.json:33
Exported symbols (NgGridModule, NgGrid, NgGridItem, NgGridConfig, NgGridPlaceholder, …) in .ts None outside the library
Template usage (nggrid, ng-grid) in .html None

The symbol and template searches matter here — it is a library of Angular directives, consumed from templates, so the path alias alone would not be sufficient proof.

Dead for two years, and broken

  • Its last consumer was deleted in 5e75d4ddb0 (2024-08-22, "remove unused code from old template builder"), which removed dot-edit-layout-grid, dot-container-selector-layout and dot-edit-layout.service.ts from apps/dotcms-ui. Every commit touching it since is a mechanical sweep (Angular v19/v20, Nx 23, eslint 9, the inject() codemod).
  • Does not compile. src/lib/directives/NgGrid.ts:8 imports ComponentFactoryResolver from @angular/core, removed from Angular (deprecated in v13, dropped in v20+) — 2 errors present without enabling strict.
  • package.json declares peerDependencies of @angular/common / @angular/core at ^6.0.0 || ^7.2.0; the workspace is on Angular 21+.
  • Has no build target at allproject.json defines only test, and it is tagged ["skip:test", "skip:lint"]. Nothing compiles it, not even an inferred target.
  • Never published to npmdot-layout-grid does not exist in the registry (version: 0.0.1). No external consumers are possible.
  • ng-package.json and ng-package.prod.json are orphaned — they point at dist-lib/dot-layout-grid but no executor references them.

Acceptance Criteria

libs/dotcms

  • Confirm with the team that no external consumer depends on dotcms@0.0.21 on npm.
  • Delete core-web/libs/dotcms/.
  • Remove the @dotcms/dotcms path alias from core-web/tsconfig.base.json.
  • Remove the libs/dotcms/**/* entry from the @nx/jest/plugin include glob in core-web/nx.json.
  • Remove its row from the project table in core-web/README.MD (line 12).
  • Run npm deprecate dotcms "This package is no longer maintained. Use @dotcms/client instead." so external users get a migration pointer.

libs/dot-layout-grid

  • Delete core-web/libs/dot-layout-grid/ (including the orphaned ng-package.json / ng-package.prod.json).
  • Remove the @dotcms/dot-layout-grid path alias from core-web/tsconfig.base.json (line 33).
  • Remove its row from the project table in core-web/README.MD (line 13).
  • No npm step needed — it was never published.

Both

Priority

Low

Additional Context

Audit of the rest of the rollout

After two dead projects in a row, all 44 rollout projects were swept for the same profile (0 dependents + skip: tags). The problem is bounded — these two are the only dead libraries:

Project Type Dependents Skips Verdict
dotcms library 0 test, lint, build Dead — remove
dot-layout-grid library 0 test, lint Dead — remove
dotcms-block-editor application 0 test, lint Normal — apps have no dependents
dotcms-scss library 0 test, lint Already out of scope (SCSS only)
mcp-server application 0 build Already out of scope

Root cause: the 44 sub-issues were generated from the Nx graph without checking whether each project was still alive. Worth verifying that before generating automated rollouts in future.

Reproduce

cd core-web

# libs/dotcms — 2 errors remain with every strict flag off (the broken 'dotcms-models' import)
pnpm exec tsc -p libs/dotcms/tsconfig.lib.json --noEmit \
  --strict false --noPropertyAccessFromIndexSignature false --noImplicitReturns false

# libs/dot-layout-grid — 2 errors with no strict flags (ComponentFactoryResolver no longer exists)
pnpm exec tsc -p libs/dot-layout-grid/tsconfig.lib.json --noEmit

# neither has dependents
pnpm exec nx graph --file=/tmp/graph.json
# then inspect graph.dependencies for edges targeting "dotcms" or "dot-layout-grid"

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status
    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions