diff options
author | 2024-01-04 19:06:37 +0800 | |
---|---|---|
committer | 2024-01-04 11:06:37 +0000 | |
commit | 00fcf82eb782266823b8b5ec58abf79b123fcf5d (patch) | |
tree | 32cb4dce7570cd25886c0e4d4ded6d3fa6553328 | |
parent | 6834b3d3fe6eba50613d22175b01b35e4aa75828 (diff) | |
download | astro-00fcf82eb782266823b8b5ec58abf79b123fcf5d.tar.gz astro-00fcf82eb782266823b8b5ec58abf79b123fcf5d.tar.zst astro-00fcf82eb782266823b8b5ec58abf79b123fcf5d.zip |
Fix ts errors for component template (#9602)
-rw-r--r-- | examples/component/tsconfig.json | 5 | ||||
-rw-r--r-- | scripts/smoke/check.js | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/examples/component/tsconfig.json b/examples/component/tsconfig.json index d78f81ec4..26f2fc53d 100644 --- a/examples/component/tsconfig.json +++ b/examples/component/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "compilerOptions": { + "jsx": "preserve" + } } diff --git a/scripts/smoke/check.js b/scripts/smoke/check.js index f574f5e5d..6318fe98a 100644 --- a/scripts/smoke/check.js +++ b/scripts/smoke/check.js @@ -1,7 +1,7 @@ // @ts-check import { spawn } from 'node:child_process'; -import { readdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'; import * as path from 'node:path'; import pLimit from 'p-limit'; import { tsconfigResolverSync } from 'tsconfig-resolver'; @@ -21,6 +21,14 @@ function checkExamples() { limit( () => new Promise((resolve) => { + // Sometimes some examples may get deleted, but after a `git pull` the directory still exists. + // This can stall the process time as it'll typecheck the entire monorepo, so do a quick exist + // check here before typechecking this directory. + if (!existsSync(path.join('./examples/', example.name, 'package.json'))) { + resolve(0); + return; + } + const originalConfig = prepareExample(example.name); let data = ''; const child = spawn('node', ['../../packages/astro/astro.js', 'check'], { |