Write the Integration in Typescript
Write a TypeScript “Pokémon of the Day” integration for Pandium by customizing the starter repo, updating package settings, installing dependencies, and building before each run.
Beginning with the starter files created by Pandium, you will now write your Pokémon of the day integration and get it working locally!
Since you just pulled Pandium's initial commit your new integration folder should have a the following file structure:
├── src
└── index.ts
└── lib.ts
└── package.json
└── PANDIUM.yaml
└── tsconfig.jsonStart by replacing the pre-filled generic information with something that fits our project.
In the package.json change the name from
pokemontopokemon-of-the-day.
You may notice the start command is node/build/src and doesn't mention ts-node. That's because this TypeScript integration is a module. You can read more about TypeScript Modules if you haven't written one before, but for our integration's purposes it means:
You will need to build before any code changes you've made will take effect.
Your imports will need to reference .js files.
Run
pandium local build. This executes thebuildcommand from your PANDIUM.yaml, which installs the dependencies and compiles the TypeScript, so it should add the node_modules and build folders to your root directory. You will run this before every local run of the integration.
Last updated
Was this helpful?