From 07668e6959a3595a2e9aeae68e20fd7ba1640be8 Mon Sep 17 00:00:00 2001 From: Elliott Marquez <5981958+e111077@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:35:56 -0700 Subject: [PATCH] build(catalog): re-enable catalog typechecking This enables typechecking on the catalog so that we catch type build issues in CI next time. Type issues didn't break before since we run our code through esbuild, and it was disabled because of some weird 11ty issues that are fixed in this CL --- .gitignore | 3 ++- catalog/package.json | 9 +++++++-- catalog/src/types/is-land.d.ts | 11 +++++++++++ catalog/tsconfig.json | 3 ++- 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 catalog/src/types/is-land.d.ts diff --git a/.gitignore b/.gitignore index 8e3dd5b045..cc3c57be99 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ catalog/site/components/*.md catalog/site/components/images catalog/*.tsbuildinfo catalog/stories/*/ -!catalog/stories/components/ \ No newline at end of file +!catalog/stories/components/ +!catalog/src/types/**/*.d.ts \ No newline at end of file diff --git a/catalog/package.json b/catalog/package.json index b071418ed7..cb3cb030a0 100644 --- a/catalog/package.json +++ b/catalog/package.json @@ -22,7 +22,8 @@ "build:dev": { "dependencies": [ "build:dev:eleventy", - "build:dev:ts" + "build:dev:ts", + "build:type-check" ] }, "build:dev:eleventy": { @@ -66,12 +67,16 @@ "clean": "if-file-deleted", "output": [ "tsconfig.tsbuildinfo" + ], + "dependencies": [ + "..:build" ] }, "build:prod": { "dependencies": [ "build:prod:eleventy", - "build:prod:ts" + "build:prod:ts", + "build:type-check" ] }, "build:prod:eleventy": { diff --git a/catalog/src/types/is-land.d.ts b/catalog/src/types/is-land.d.ts new file mode 100644 index 0000000000..e84f473f85 --- /dev/null +++ b/catalog/src/types/is-land.d.ts @@ -0,0 +1,11 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +declare module '@11ty/is-land' { + export class Island extends HTMLElement { + forceFallback(): void; + } +} \ No newline at end of file diff --git a/catalog/tsconfig.json b/catalog/tsconfig.json index d62c0783e1..1ee8c16b41 100644 --- a/catalog/tsconfig.json +++ b/catalog/tsconfig.json @@ -12,7 +12,8 @@ "useDefineForClassFields": false, "forceConsistentCasingInFileNames": true, "noEmit": true, - "skipLibCheck": true + "skipLibCheck": true, + "types": [] }, "include": ["src/**/*", "stories/*", "stories/components"], "exclude": []