diff options
author | 2022-08-05 17:46:52 -0400 | |
---|---|---|
committer | 2022-08-05 17:46:52 -0400 | |
commit | c9b679e56e65f25eccb1d91b9827702cb5b82673 (patch) | |
tree | d24013dcf5fde986ca7bda7ce88867acc2dd79cd /examples | |
parent | 69db0298d07b560992346d1a41e85afd767ee61f (diff) | |
download | astro-c9b679e56e65f25eccb1d91b9827702cb5b82673.tar.gz astro-c9b679e56e65f25eccb1d91b9827702cb5b82673.tar.zst astro-c9b679e56e65f25eccb1d91b9827702cb5b82673.zip |
Move types to a .d.ts file inside examples projects (#4171)
* Move types to a .d.ts file to avoid making types explicit
* Rename to proper types
* Move to proper place
* Add noEmit to tsconfig.json
* Add back removed code by accident
Diffstat (limited to 'examples')
45 files changed, 68 insertions, 46 deletions
diff --git a/examples/basics/src/env.d.ts b/examples/basics/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/basics/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/basics/tsconfig.json b/examples/basics/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/basics/tsconfig.json +++ b/examples/basics/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/blog/src/env.d.ts b/examples/blog/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/blog/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/blog/tsconfig.json b/examples/blog/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/blog/tsconfig.json +++ b/examples/blog/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/docs/src/env.d.ts b/examples/docs/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/docs/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/docs/tsconfig.json b/examples/docs/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/docs/tsconfig.json +++ b/examples/docs/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/env-vars/tsconfig.json b/examples/env-vars/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/env-vars/tsconfig.json +++ b/examples/env-vars/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-alpine/src/env.d.ts b/examples/framework-alpine/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-alpine/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-alpine/tsconfig.json b/examples/framework-alpine/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/framework-alpine/tsconfig.json +++ b/examples/framework-alpine/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-lit/src/env.d.ts b/examples/framework-lit/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-lit/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-lit/tsconfig.json b/examples/framework-lit/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/framework-lit/tsconfig.json +++ b/examples/framework-lit/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-multiple/src/env.d.ts b/examples/framework-multiple/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-multiple/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-multiple/tsconfig.json b/examples/framework-multiple/tsconfig.json index 7e64c543c..8885491e4 100644 --- a/examples/framework-multiple/tsconfig.json +++ b/examples/framework-multiple/tsconfig.json @@ -11,7 +11,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-preact/src/env.d.ts b/examples/framework-preact/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-preact/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-preact/tsconfig.json b/examples/framework-preact/tsconfig.json index be8e3ea96..766e72684 100644 --- a/examples/framework-preact/tsconfig.json +++ b/examples/framework-preact/tsconfig.json @@ -12,7 +12,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-react/src/env.d.ts b/examples/framework-react/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-react/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-react/tsconfig.json b/examples/framework-react/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/framework-react/tsconfig.json +++ b/examples/framework-react/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-solid/src/env.d.ts b/examples/framework-solid/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-solid/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-solid/tsconfig.json b/examples/framework-solid/tsconfig.json index 45d5b5d48..807b3fac7 100644 --- a/examples/framework-solid/tsconfig.json +++ b/examples/framework-solid/tsconfig.json @@ -12,7 +12,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-svelte/src/env.d.ts b/examples/framework-svelte/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-svelte/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-svelte/tsconfig.json b/examples/framework-svelte/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/framework-svelte/tsconfig.json +++ b/examples/framework-svelte/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/framework-vue/src/env.d.ts b/examples/framework-vue/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/framework-vue/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/framework-vue/tsconfig.json b/examples/framework-vue/tsconfig.json index 7e64c543c..8885491e4 100644 --- a/examples/framework-vue/tsconfig.json +++ b/examples/framework-vue/tsconfig.json @@ -11,7 +11,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/minimal/src/env.d.ts b/examples/minimal/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/minimal/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/minimal/tsconfig.json b/examples/minimal/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/minimal/tsconfig.json +++ b/examples/minimal/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/non-html-pages/src/env.d.ts b/examples/non-html-pages/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/non-html-pages/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/non-html-pages/tsconfig.json b/examples/non-html-pages/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/non-html-pages/tsconfig.json +++ b/examples/non-html-pages/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/portfolio/src/env.d.ts b/examples/portfolio/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/portfolio/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/portfolio/tsconfig.json b/examples/portfolio/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/portfolio/tsconfig.json +++ b/examples/portfolio/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/ssr/src/env.d.ts b/examples/ssr/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/ssr/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/ssr/tsconfig.json b/examples/ssr/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/ssr/tsconfig.json +++ b/examples/ssr/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/subpath/src/env.d.ts b/examples/subpath/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/subpath/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/subpath/tsconfig.json b/examples/subpath/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/subpath/tsconfig.json +++ b/examples/subpath/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/with-markdown-plugins/src/env.d.ts b/examples/with-markdown-plugins/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/with-markdown-plugins/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/with-markdown-plugins/tsconfig.json b/examples/with-markdown-plugins/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/with-markdown-plugins/tsconfig.json +++ b/examples/with-markdown-plugins/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/with-markdown-shiki/src/env.d.ts b/examples/with-markdown-shiki/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/with-markdown-shiki/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/with-markdown-shiki/tsconfig.json b/examples/with-markdown-shiki/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/with-markdown-shiki/tsconfig.json +++ b/examples/with-markdown-shiki/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/with-mdx/src/env.d.ts b/examples/with-mdx/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/with-mdx/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/with-mdx/tsconfig.json b/examples/with-mdx/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/with-mdx/tsconfig.json +++ b/examples/with-mdx/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/with-nanostores/src/env.d.ts b/examples/with-nanostores/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/with-nanostores/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/with-nanostores/tsconfig.json b/examples/with-nanostores/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/with-nanostores/tsconfig.json +++ b/examples/with-nanostores/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/with-tailwindcss/src/env.d.ts b/examples/with-tailwindcss/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/with-tailwindcss/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/with-tailwindcss/tsconfig.json b/examples/with-tailwindcss/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/with-tailwindcss/tsconfig.json +++ b/examples/with-tailwindcss/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } diff --git a/examples/with-vite-plugin-pwa/src/env.d.ts b/examples/with-vite-plugin-pwa/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/examples/with-vite-plugin-pwa/src/env.d.ts @@ -0,0 +1 @@ +/// <reference types="astro/client" /> diff --git a/examples/with-vite-plugin-pwa/tsconfig.json b/examples/with-vite-plugin-pwa/tsconfig.json index 4db6ee701..e9e9245fd 100644 --- a/examples/with-vite-plugin-pwa/tsconfig.json +++ b/examples/with-vite-plugin-pwa/tsconfig.json @@ -9,7 +9,7 @@ "resolveJsonModule": true, // Enable stricter transpilation for better output. "isolatedModules": true, - // Add type definitions for our Astro runtime. - "types": ["astro/client"] + // Astro will directly run your TypeScript code, no transpilation needed. + "noEmit": true } } |