Closed colingourlay closed 4 years ago
Exciting. Just installed. Giving it a try.
Wow what a huge release. I'm trying it out now. Looking good so far!
A potential bug: If I start a Typescript Preact project and then run aunty generate component
it generates a Javascript component for me.
A potential bug: If I start a Typescript Preact project and then run
aunty generate component
it generates a Javascript component for me.
I believe component generation is a feature still to be added @colingourlay ?
@andrewkesper component generators will be dropping later today!
Alrighty folks, give things another shot now (including component generation)
This closes #106
This big ol' bundle of changes brings full TypeScript support to
@abcnews/aunty
, across all project types. From here on, you have the choice of writing your source, tests, or both in TypeScript.tl;dr
New project generators
All new project templates are available with a TypeScript opt-in prompted during initialisation (
aunty new
/aunty init
). The main differences you'll see from older templates are:Worm
graphic is a standalone component, rather than baked into toApp
component..js
or.ts(x)
depending on your language choice (TypeScript is indicated by<script lang="ts">
in.svelte
&.vue
files).<style lang="scss">
in.svelte
&.vue
files).How to upgrade existing projects
Aunty's extensible internal TypeScript config and definitions for module imports facilitated by webpack's various loaders will have you up and running in existing projects by adding a
tsconfig.json
file to the root of your project containing the following:...and installing the relevant DefinitelyTyped dev dependencies:
@types/jest
&@types/webpack
@types/react
,@types/react-dom
&@types/react-test-renderer
.At this point, you should be able to rename any file in your project from
.js
to.ts
(or.tsx
if it contains JSX syntax), and test, serve & build to your heart's content.VSCode setup
The TypeScript compiler will catch problems when serving/building/testing your project, but if you want to take advantage of real-time checking in VSCode, make sure you have the following extensions installed:
ESLint
;Prettier - Code formatter
Svelte for VS Code
Vetur