docs/angular-type-check/README.md
Type-checks all Angular example files under docs/content/**/angular/*.ts using the Angular compiler (ngc).
@handsontable/angular-wrapper APIs — wrong generic type arguments, missing properties, invalid method callsstrictTemplates: true)strict, noImplicitOverride, noImplicitReturns, noPropertyAccessFromIndexSignature@handsontable/angular-wrapper is resolved from the local dist (wrappers/angular-wrapper/dist/hot-table) via a pnpm workspace link: reference, so examples are always validated against the current build, not the last published npm release.
Build the local packages first, then run the type check from the repo root:
pnpm install
npm run build --prefix handsontable
npm run build --prefix wrappers/angular-wrapper
npm run typecheck --prefix docs/angular-type-check
Or run the script directly from inside the directory (after the builds above):
node check.mjs
Exit code 0 = all examples pass. Any non-zero exit code means at least one type error was found; the failing file and error are printed to stdout.
.ts file located in a directory named angular under docs/content/ (e.g. docs/content/recipes/cell-types/flatpickr/angular/example1.ts)./* file: app.component.ts */
// ...
/* end-file */
/* file: app.config.ts */
// ...
/* end-file */
.tmp/{guide-path}/{example-name}/.import '...css' bare CSS importsstyleUrls: [...] — replaced with styles: [] (referenced .css files don't exist in .tmp/)tsconfig.tmp.json that extends tsconfig.json and includes only the .tmp/ tree plus types/**/*.d.ts shims.ngc --noEmit and forwards its output directly to the terminal.tsconfig.tmp.json after the run (the .tmp/ directory is left for inspection on failure).| Import | Resolved to |
|---|---|
@handsontable/angular-wrapper | wrappers/angular-wrapper/dist/hot-table (pnpm link:, requires wrapper to be built) |
handsontable / handsontable/* | handsontable/types (local source types, via tsconfig paths) |
handsontable runtime (peer dep) | handsontable/tmp (pnpm link:, requires core to be built) |
@angular/*, rxjs, zone.js | node_modules/ (managed by pnpm workspace) |
This package is a pnpm workspace member. Its dependencies are managed alongside the rest of the monorepo in the root pnpm-lock.yaml.
If a new example imports a library that is not yet listed in docs/angular-type-check/package.json, the check will fail with a "could not find declaration file" or "cannot find module" error.
When you add an example that uses a new library:
@types/* package if it ships types separately) to docs/angular-type-check/package.json:
"devDependencies": {
"some-library": "^x.y.z",
"@types/some-library": "^x.y.z"
}
pnpm install at the repo root to update pnpm-lock.yaml.package.json and pnpm-lock.yaml.If the library has no TypeScript declarations at all (not even via @types/), add a bare declare module entry to types/shims.d.ts instead:
declare module 'some-library';
types/shims.d.ts declares modules that ship without TypeScript declarations:
numbro/dist/languages.min.jsAdd further declare module '...' entries there for any other untyped imports used in examples.
The check runs automatically on every pull request and on every push to any branch when files under docs/content/**/angular/*.ts or docs/angular-type-check/** change. See .github/workflows/docs-angular-typecheck.yml.