Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
d793cb2
docs(core-web): document the TS strict-mode rollout #35935
nicobytes Aug 7, 2026
7d0ffa4
refactor(sdk-create-app): enable TypeScript strict mode #35938
nicobytes Aug 7, 2026
e0ea37d
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 7, 2026
2e87ab9
refactor(dotcms-js): enable TypeScript strict mode #35939
nicobytes Aug 7, 2026
8d7178a
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 7, 2026
1ba6251
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 7, 2026
84054c1
refactor(utils): enable TypeScript strict mode #35940
nicobytes Aug 7, 2026
c8ec1cc
fix(utils-testing): restore clazz on the basic field mock + review fixes
nicobytes Aug 7, 2026
30c11e6
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 7, 2026
a78b526
docs(specs): record sdk-uve as already strict-compliant #35941
nicobytes Aug 7, 2026
bb38549
docs(specs): record sdk-client as already strict-compliant #35942
nicobytes Aug 7, 2026
8b5dfc4
docs(specs): correct published npm versions and consumer counts
nicobytes Aug 7, 2026
b4a6b30
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 8, 2026
5ea14e8
refactor(dotcms-webcomponents): prepare Stencil members for strict mo…
nicobytes Aug 10, 2026
0117273
fix(dotcms-webcomponents): correct the value prop type on dot-binary-…
nicobytes Aug 10, 2026
f22afce
fix(dotcms-webcomponents): revert the value prop annotation on dot-bi…
nicobytes Aug 10, 2026
6d45c07
fix(utils-testing): make the declared strict mode actually apply #35944
nicobytes Aug 10, 2026
8f3c2b4
refactor(sdk-react): complete TypeScript strict mode #35945
nicobytes Aug 10, 2026
5c7151d
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 10, 2026
1b50a81
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 11, 2026
66e3dc8
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 14, 2026
d2c906b
Enable stricter TypeScript checks in sdk/analytics and fix resulting err
nicobytes Aug 14, 2026
64a2237
refactor(sdk-angular): unmask tsconfig.spec.json for strict mode (#35…
nicobytes Aug 17, 2026
b369896
refactor(data-access): fix 83 errors behind inert strict flags (#35948)
nicobytes Aug 17, 2026
62aefe8
docs(strict-mode): record that ts-jest never type-checks specs
nicobytes Aug 17, 2026
8f79678
refactor(sdk-experiments): add the 5 missing strict flags (#35949)
nicobytes Aug 17, 2026
bd4f949
refactor(global-store): export WebSocketStatus as a type (#35950 #359…
nicobytes Aug 17, 2026
91d87b4
refactor(ui): enable strict flags and clear the library program (#35953)
nicobytes Aug 17, 2026
8f8036b
refactor(strict-mode): close dot-usage and edit-content-bridge (#3596…
nicobytes Aug 17, 2026
609b3a5
refactor(dotcdn): enable strict mode (#35970)
nicobytes Aug 17, 2026
57e4865
refactor(strict-mode): close three portlets (#35968 #35965 #35963)
nicobytes Aug 17, 2026
b6690e0
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 17, 2026
322788a
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 17, 2026
e2c1bbf
refactor(strict-mode): close dot-categories (#35962), clear dot-analy…
nicobytes Aug 17, 2026
5c3c6f7
chore(deps): regenerate lockfile after rebase onto the d3 types addition
nicobytes Aug 17, 2026
3d0106b
refactor(strict-mode): close dot-analytics (#35961) and content-drive…
nicobytes Aug 17, 2026
57b4358
refactor(ui): finish strict mode (#35953)
nicobytes Aug 17, 2026
82dbf4c
refactor(strict-mode): close dot-plugins (#35966) and new-block-edito…
nicobytes Aug 17, 2026
00c2850
refactor(block-editor): strict mode groundwork (#35955)
nicobytes Aug 17, 2026
48cadd2
refactor(block-editor): finish strict mode (#35955)
nicobytes Aug 17, 2026
af89bef
Merge branch 'main' into 35932-enable-strict-mode
nicobytes Aug 17, 2026
66060c1
refactor(dotcms-block-editor): strict mode (#35973), and a template d…
nicobytes Aug 18, 2026
d282cd6
fix(edit-content): stop a spec's module augmentation from disabling t…
nicobytes Aug 18, 2026
2a6b53d
refactor(edit-content): strict-mode groundwork (#35974)
nicobytes Aug 18, 2026
ebde4ea
refactor(edit-content): more strict-mode groundwork (#35974)
nicobytes Aug 18, 2026
4ad3390
refactor(edit-content): strict-mode groundwork, third pass (#35974)
nicobytes Aug 18, 2026
be8c2f9
refactor(edit-content): strict-mode groundwork, fourth pass (#35974)
nicobytes Aug 18, 2026
ec6231d
refactor(edit-ema-ui): enable strict mode (#35971)
nicobytes Aug 18, 2026
5375af5
refactor(template-builder): enable strict mode (#35958)
nicobytes Aug 18, 2026
c06bd94
refactor(edit-content): clear 77 of the 101 strict-mode errors in pro…
nicobytes Aug 18, 2026
7731cc3
refactor(edit-content): finish the production sources — 101 strict er…
nicobytes Aug 18, 2026
2e237d7
fix(edit-content): correct three strict-mode changes the tests caught…
nicobytes Aug 18, 2026
9142802
refactor(edit-content): clear 85 of the 208 strict-mode errors in the…
nicobytes Aug 18, 2026
808dbf5
refactor(edit-content): clear 25 more spec errors, four of them at th…
nicobytes Aug 18, 2026
399e59d
refactor(edit-content): clear 25 more spec errors; three were dead or…
nicobytes Aug 18, 2026
dd7ab14
refactor(edit-content): clear 29 more spec errors; the layout spec go…
nicobytes Aug 18, 2026
47eb07a
refactor(edit-content): clear 12 more spec errors; two stale specs an…
nicobytes Aug 18, 2026
a738c54
refactor(edit-content): clear 10 more spec errors; workflow scheme goes
nicobytes Aug 18, 2026
28c243b
refactor(edit-content): take the spec errors to 0 — the project is fu…
nicobytes Aug 18, 2026
6b453d8
feat(strict-mode): close the two projects edit-content was blocking (…
nicobytes Aug 18, 2026
5c4e879
docs(core-web): three more strict-mode measurement traps (#35932)
nicobytes Aug 18, 2026
8e888e1
refactor(content-drive): flags on, production sources to 0 (#35972)
nicobytes Aug 18, 2026
947fc01
refactor(content-drive): 232 spec errors down to 83 (#35972)
nicobytes Aug 18, 2026
d695086
refactor(content-drive): the last 83 spec errors — the project is ful…
nicobytes Aug 18, 2026
7c96c2b
fix(strict-mode): image-editor's spec config was hiding 8 real errors…
nicobytes Aug 18, 2026
c9d254b
docs(core-web): three more strict-mode measurement traps (#35932)
nicobytes Aug 18, 2026
a512439
refactor(webcomponents): 295 strict errors down to 239 (#35943)
nicobytes Aug 18, 2026
e3b4aff
refactor(webcomponents): 239 strict errors down to 207 (#35943)
nicobytes Aug 18, 2026
5a56f8e
refactor(webcomponents): 207 strict errors down to 161 (#35943)
nicobytes Aug 18, 2026
cd38374
refactor(webcomponents): 161 strict errors down to 138 (#35943)
nicobytes Aug 18, 2026
ebb67d1
refactor(webcomponents): 138 strict errors down to 118 (#35943)
nicobytes Aug 18, 2026
4ff35e3
refactor(webcomponents): 118 strict errors down to 105 (#35943)
nicobytes Aug 18, 2026
d9d6655
fix(webcomponents): repair the Stencil build I broke four commits ago…
nicobytes Aug 18, 2026
0879a46
refactor(webcomponents): 104 strict errors down to 78 (#35943)
nicobytes Aug 18, 2026
f28088e
refactor(webcomponents): 78 strict errors down to 55 (#35943)
nicobytes Aug 18, 2026
5493884
refactor(webcomponents): 55 strict errors down to 25 (#35943)
nicobytes Aug 18, 2026
7ba30d0
feat(webcomponents): enable TypeScript strict mode — project is at 0 …
nicobytes Aug 18, 2026
309f79e
fix(experiments): clear five type errors the project already had (#35…
nicobytes Aug 18, 2026
1933374
refactor(experiments): the configuration store goes strict-clean (#35…
nicobytes Aug 18, 2026
64dd013
refactor(experiments): lib 81 down to 48 — fields, sidebar, chart.js …
nicobytes Aug 18, 2026
fc89d68
refactor(experiments): lib 48 down to 36 — reports store, list store,…
nicobytes Aug 18, 2026
b687c1e
refactor(experiments): production sources reach 0 under strict (#35964)
nicobytes Aug 18, 2026
a28c71f
refactor(edit-content): clear 10 more spec errors; workflow scheme goes
nicobytes Aug 18, 2026
effba75
refactor(experiments): specs 184 down to 104, and three tests that re…
nicobytes Aug 18, 2026
164d8b6
feat(experiments): enable TypeScript strict mode — project is at 0 (#…
nicobytes Aug 18, 2026
cb90c77
fix(tsconfig): three config defects that measured 168 phantom errors …
nicobytes Aug 18, 2026
1d91aeb
refactor(dot-rules): one event model described two bubbling stages (#…
nicobytes Aug 18, 2026
46c3568
refactor(dot-rules): the entity models say what they hold (#35957)
nicobytes Aug 18, 2026
e3c0107
feat(dot-rules): enable TypeScript strict mode — 0 lib / 0 spec (#35957)
nicobytes Aug 18, 2026
b409b29
fix(edit-ema): dead module, wrong package, and a fixture the model ou…
nicobytes Aug 18, 2026
4c1fd42
fix(edit-ema): an over-wide props constraint was erasing the store's …
nicobytes Aug 18, 2026
4e638e0
refactor(edit-ema): the UVE action map claimed every handler takes an…
nicobytes Aug 18, 2026
07aa413
refactor(edit-ema): narrow at the boundaries the compiler could not s…
nicobytes Aug 18, 2026
0f4443b
refactor(edit-ema): write down the preconditions ActionPayload never …
nicobytes Aug 19, 2026
a4a2ffc
Merge origin/main into 35932-enable-strict-mode
nicobytes Aug 19, 2026
5a25b68
refactor(edit-ema): a global `any` on window.tinymce defeated every a…
nicobytes Aug 19, 2026
16d3d9f
refactor(edit-ema): four copies of one reload branch, each testing th…
nicobytes Aug 19, 2026
00312da
refactor(edit-ema): one editing rule written three times, against a t…
nicobytes Aug 19, 2026
9f297f4
fix(edit-ema): an upload that reports failure through its success cha…
nicobytes Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 66 additions & 2 deletions core-web/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,70 @@ Always wrap form fields with this structure for consistent styling:
</form>
```

## TypeScript Strict Mode

Strict mode is being rolled out **one project at a time** (epic #35932), bottom-up through the dependency graph. `tsconfig.base.json` stays at `"strict": false` — never flip it globally.

To make a project strict:

1. Add the flags to the **project's own** `tsconfig.json` (not `tsconfig.spec.json`, not the base):

```json
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
```

2. Fix every error. No new `any` — use explicit types. To silence something unavoidable, use `@ts-expect-error` with a `// TODO(#issue):` note, never a blanket `@ts-ignore`.

**What enforces this:** for Rollup libs that emit declarations (`"declaration": true`), `@rollup/plugin-typescript` is in the build chain and reports type errors, so the `build` target is the gate — CI runs `nx run-many -t build` (the `build-test` execution in `core-web/pom.xml`). Do **not** add a separate `typecheck` target to those projects; it is redundant. `lint` does not catch type errors — ESLint reports lint rules, not TS diagnostics.

Vite-based projects are the exception: their builds use esbuild and skip type checking, which is why the Nx Vite plugin infers a separate `typecheck` target for them.

Verify locally:

```bash
pnpm exec tsc -p <projectRoot>/tsconfig.lib.json --noEmit
pnpm exec nx run <project>:build
pnpm exec nx affected -t build,lint --base=origin/main # check you didn't break consumers
```

`<projectRoot>` is the path from `project.json`, which is often nested — e.g. `libs/sdk/create-app`, not `libs/create-app`. Two caveats on the tsconfig name:

- **Apps** use `tsconfig.app.json`.
- **Some projects have no `tsconfig.lib.json`** (`libs/sdk/create-app` is one); use their `tsconfig.json` instead.

Also check `tsconfig.spec.json` — the flags live in `tsconfig.json`, which the spec config extends, so specs go strict too and their errors are yours to fix.

> **Watch out for masked results.** If a tsconfig declares a `types` entry that is not installed, `tsc` reports `TS2688: Cannot find type definition file for '<name>'` and **stops before semantic checking** — you get one error and no type checking at all. A stable error count across a change proves nothing in that case. `libs/dotcms-js/tsconfig.spec.json` is affected today (`"types": ["jasmine"]`, and `@types/jasmine` is not installed in the workspace); check it with `--types node` to see real diagnostics. `apps/dotcms-block-editor` had the same defect in **three** of its configs — worth checking `tsconfig.editor.json` too, not just `spec`.
>
> A **`files` entry pointing at a file that does not exist** masks results the same way: `tsc` reports `TS6053: File '<path>' not found` and aborts before semantic checking. Unlike a non-matching `include` glob — which is harmless — a missing `files` entry is fatal. This is what hid `libs/sdk/angular/tsconfig.spec.json` (it listed a `next/test-setup.ts` left over from a deleted directory), so that config had never completed a single semantic pass. Before trusting any error count, confirm `tsc` actually reached the code: a config-level error means it did not.
>
> **Deprecated options abort too.** The workspace runs TypeScript 6.x, which raises `TS5101` for `baseUrl` and `TS5107` for `moduleResolution: "node"` / `"node10"` unless `ignoreDeprecations: "6.0"` is set — and those are config-level errors, so they abort before semantic checking just like the two above. `libs/dotcms-webcomponents` reports **2** errors without the flag and **279** with it. It cannot set the option in its tsconfig, because Stencil bundles TypeScript 5.8.3, which only accepts `"5.0"`; pass `--ignoreDeprecations 6.0` on the CLI instead.
>
> **The general rule:** any error whose code starts `TS5` or `TS6`, or `TS2688`, is a *configuration* error. `tsc` never reached your code, so the count that follows means nothing. Read the first error before trusting the last number.
>
> **A silent fake zero: `include: []`.** All the aborts above at least *report* something. This one does not. Many project tsconfigs hold only `references` and delegate the real work to `tsconfig.lib.json` / `tsconfig.app.json` — `apps/dotcms-binary-field-builder/tsconfig.json` is one. Pointing `tsc -p` at that file compiles **nothing** and prints nothing, which reads exactly like a clean project. That app had *none* of the six flags while appearing to be at zero. **Measure `tsconfig.lib.json` for libraries and `tsconfig.app.json` for apps — never the project tsconfig that only holds `references`.**
>
> **A project with no `build` target has never had its templates checked.** `libs/edit-content` and `libs/block-editor` have only a `test` target. Both declare `strictTemplates` in `angularCompilerOptions`, and in both it is inert: nothing ever compiles their templates. Since `tsc -p` does not check templates either (see above), a library like this can be at 0 errors on both its configs and still have template type errors — a manual `nx run <app>:build` of a consuming app found a real one in `block-editor`. Treat "0 errors" on a build-less library as covering its TypeScript only.
>
> **The repo's TypeScript is not always the strictest compiler in the build.** `libs/dotcms-webcomponents` type-checks twice: once by the workspace's `tsc` (6.0.3) and once by Stencil, which bundles its own 5.8.3. TypeScript 6 re-declared `Node.textContent` as an asymmetric accessor — `get(): string`, `set(value: string | null)` — so `element.textContent.replace(...)` is clean under 6 and `Object is possibly 'null'` under 5.8. The project reached **0** on `tsc -p` and the Stencil build still failed. Where two compilers check the same sources, the build is the gate; `tsc -p` at zero is a necessary condition, not a sufficient one.
>
> Related, and the reason that took two attempts to find: **verify a build by its exit status, never by grepping its output.** Stencil prints `transpile finished` and `build finished` for the phases that did succeed, so a grep for `finished` matches on a run that ends in `build failed` and exits non-zero. Four commits went in claiming a passing build on that basis.
>
> **`moduleResolution: node10` breaks Angular too, not just `@dotcms/*`.** A blast-radius sweep reported `libs/image-editor` at **996** spec errors; 335 of them were `TS2307: Cannot find module '@angular/common/http'`. Its `tsconfig.spec.json` carried `module: commonjs` + `moduleResolution: node10`, which cannot resolve subpath exports from *any* package. The real count was **8**. Unlike the aborts above this one produces a plausible-looking flood of code errors, so the tell is the first error, not the count: `TS2307` on a package that is obviously installed means the resolver, not the code. `libs/portlets/dot-agents` has the same config today (991 spec / 2 lib, unmeasured).
>
> **A Vite virtual module reads as one error per consumer.** `libs/sdk/client` imports `virtual:sdk-version`, which its Vite build injects and `tsc -p` cannot resolve. `libs/sdk/angular`, `libs/sdk/react` and `libs/sdk/vue` therefore each report exactly one `TS2307` that their real `build` target does not. Subtract it before comparing counts.
>
> **`SpyObject<T>` cannot re-implement a union-returning method.** `@openng/spectator`'s mapped type routes every member through `T[P] extends (...args: any[]) => infer R ? ... : ...`. When `R` is a union — `string | string[] | undefined`, say — that conditional *distributes*, so the member's type becomes an **intersection** of `jest.Mock`s whose `mockImplementation` overloads demand `=> undefined`, `=> string` and `=> string[]` simultaneously. No implementation satisfies all three, and the error names an intersection the source never wrote. Reach the spy through one explicit signature (`store.m as unknown as jest.Mock<R, [A]>`) rather than trying to satisfy it.
>
> **Flags interact across projects.** `libs/portlets/dot-query-tool` has `noImplicitReturns` *without* `strict`, and that combination caught a `TS7030` that `libs/edit-content` — which has `noImplicitReturns` too — did not, because its `strict` changes how a mixed `void`/teardown return is inferred. A clean `tsc -p` on the project you changed is not sufficient: re-measure the strict consumers as well.
>
> **`nx run <project>:test` does not type-check — anywhere.** `jest-preset-angular` runs on ts-jest, and ts-jest copies TypeScript's `isolatedModules` into its own transpile-only switch (`config-set.js:229`), which stops it from building the language-service host it needs for diagnostics (`ts-compiler.js:74`). Since the Jest guidance below requires `isolatedModules: true` in every `tsconfig.spec.json`, **passing tests are never evidence that specs type-check.** `libs/data-access` proved it: 84 `tsc` errors alongside 754 green tests. Always verify specs with `tsc -p <projectRoot>/tsconfig.spec.json --noEmit`.

## Portlet Development

New portlets go in `libs/portlets/`. For full patterns, architecture, testing, and Nx generator setup:
Expand All @@ -110,8 +174,8 @@ New portlets go in `libs/portlets/`. For full patterns, architecture, testing, a

- Use `dot-content-drive` portlet as reference for test config
- `tsconfig.spec.json` tsconfig.spec.json must have "isolatedModules": true in compilerOptions
- `tsconfig.json` — do NOT add `"strict": true` or `"module": "preserve"`
- `tsconfig.spec.json` — keep minimal (only `module`, `target`, `types`)
- `tsconfig.json` — do NOT add `"module": "preserve"`
- `tsconfig.spec.json` — keep minimal (only `module`, `target`, `types`); do NOT add `"strict": true` here, it belongs in the project's `tsconfig.json` (see [TypeScript Strict Mode](#typescript-strict-mode))
- Import `mockProvider` from `@openng/spectator/jest` (not `@openng/spectator`)

### SignalStore Tests
Expand Down
18 changes: 9 additions & 9 deletions core-web/apps/dotcdn/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class AppComponent implements OnInit {
private fb = inject(UntypedFormBuilder);
private dotCdnStore = inject(DotCDNStore);

@ViewChild('chart', { static: true }) chart: UIChart;
purgeZoneForm: UntypedFormGroup;
@ViewChild('chart', { static: true }) chart!: UIChart;
purgeZoneForm!: UntypedFormGroup;
periodValues: SelectItem[] = [
{ label: 'Last 15 days', value: ChartPeriod.Last15Days },
{ label: 'Last 30 days', value: ChartPeriod.Last30Days },
Expand All @@ -38,7 +38,7 @@ export class AppComponent implements OnInit {
vmPurgeLoaders$: Observable<Pick<DotCDNState, 'isPurgeUrlsLoading' | 'isPurgeZoneLoading'>> =
this.dotCdnStore.vmPurgeLoaders$;
chartHeight = '25rem';
options: CdnChartOptions;
options!: CdnChartOptions;

ngOnInit(): void {
this.setChartOptions();
Expand Down Expand Up @@ -74,9 +74,9 @@ export class AppComponent implements OnInit {
*/
purgeUrls(): void {
const urls: string[] = this.purgeZoneForm
.get('purgeUrlsTextArea')
.get('purgeUrlsTextArea')!
.value.split('\n')
.map((url) => url.trim());
.map((url: string) => url.trim());

this.dotCdnStore
.purgeCDNCache(urls)
Expand Down Expand Up @@ -109,7 +109,7 @@ export class AppComponent implements OnInit {
display: true,
position: 'left',
ticks: {
callback: function (value: number): string {
callback: function (value: string | number): string {
return value.toString() + 'MB';
}
}
Expand All @@ -131,10 +131,10 @@ export class AppComponent implements OnInit {
scales: {
...defaultOptions.scales,
x: {
...defaultOptions.scales.x,
...defaultOptions.scales?.['x'],
ticks: {
callback: (value: number): string => {
return Math.round(value).toString();
callback: (value: string | number): string => {
return Math.round(Number(value)).toString();
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion core-web/apps/dotcdn/src/app/dotcdn.component.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ export class DotCDNStore extends ComponentStore<DotCDNState> {
...state,
isPurgeZoneLoading: action.loadingState === LoadingState.LOADING
};

default:
return state;
}
}
);
Expand Down Expand Up @@ -247,7 +250,7 @@ export class DotCDNStore extends ComponentStore<DotCDNState> {
return { chartData, statsData, cdnDomain: stats.cdnDomain };
}

private formatDate(date) {
private formatDate(date: string) {
return new Date(date).toLocaleDateString('en-GB', {
month: '2-digit',
day: '2-digit'
Expand Down
6 changes: 6 additions & 0 deletions core-web/apps/dotcdn/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"files": [],
"include": [],
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"types": ["jest", "node"],
"target": "es2020",
"module": "preserve",
Expand Down
6 changes: 6 additions & 0 deletions core-web/apps/dotcms-binary-field-builder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
],
"compilerOptions": {
"target": "es2020",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"module": "preserve",
"moduleResolution": "bundler",
"lib": ["dom", "dom.iterable", "es2022"]
Expand Down
4 changes: 3 additions & 1 deletion core-web/apps/dotcms-block-editor/tsconfig.editor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "./tsconfig.json",
"include": ["**/*.ts"],
"compilerOptions": {
"types": ["jasmine", "node"]
// See tsconfig.spec.json: @types/jasmine is not installed, so listing it here aborted
// this config with TS2688 before any semantic checking.
"types": ["node"]
}
}
8 changes: 7 additions & 1 deletion core-web/apps/dotcms-block-editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"target": "es2020",
"module": "preserve",
"moduleResolution": "bundler",
"lib": ["dom", "dom.iterable", "es2022"]
"lib": ["dom", "dom.iterable", "es2022"],
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
}
}
6 changes: 5 additions & 1 deletion core-web/apps/dotcms-block-editor/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["jasmine", "node"],
// `jasmine` was listed here, but @types/jasmine is not installed — nor are
// karma-jasmine or jasmine-core — so this config aborted with TS2688 before any
// semantic checking and had never actually type-checked anything. The app has no
// spec files, so `node` alone is the truthful set.
"types": ["node"],
"target": "ES2022",
"useDefineForClassFields": false,
"moduleResolution": "bundler",
Expand Down
13 changes: 10 additions & 3 deletions core-web/libs/block-editor/src/lib/NodeViewRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DecorationSet, type DecorationSource } from 'prosemirror-view';
import { type Decoration, DecorationSet, type DecorationSource } from 'prosemirror-view';

import { Component, Injector, Input, Type, ChangeDetectionStrategy } from '@angular/core';

Expand Down Expand Up @@ -38,7 +38,9 @@ export class AngularNodeViewComponent implements NodeViewProps {
}

interface AngularNodeViewRendererOptions extends NodeViewRendererOptions {
update?: ((node: ProseMirrorNode, decorations: DecorationWithType[]) => boolean) | null;
update?:
| ((node: ProseMirrorNode, decorations: readonly DecorationWithType[]) => boolean)
| null;
toJSON?: toJSONFn;
injector: Injector;
}
Expand Down Expand Up @@ -123,7 +125,12 @@ class AngularNodeView extends NodeView<
}
}

update(node: ProseMirrorNode, decorations: DecorationWithType[]): boolean {
// Signature mirrors ProseMirror's `NodeView.update`, which hands over a readonly
// `Decoration[]`. TipTap narrows those to `DecorationWithType` for node views, which is
// what every consumer below expects.
update(node: ProseMirrorNode, nodeDecorations: readonly Decoration[]): boolean {
const decorations = nodeDecorations as readonly DecorationWithType[];

if (this.options.update) {
return this.options.update(node, decorations);
}
Expand Down
Loading
Loading