The project is based on the HelloWorld skill template used when you execute ask new -n <skill-name> but it has been modified to work with TypeScript.
Maybe for the first time in a template, you get the benefits of:
Install/register for the following:
- Node.js (v8.10.0)
- NPM
- Git
- Amazon Developer Account
- AWS Account
- TypeScript
- AWS CLI (including
aws configure) - ASK CLI (including
ask init)
Clone the repo
$ git clone https://github.com/ask-community/ask-nodejs-ts-hello world.git my-skill-name
$ cd my-skill-name/lambda/custom
$ npm installThe template is already configured for TypeScript. From the my-skill-name/lambda/custom folder, start the build.
folder: my-skill-name/lambda/custom
$ npm run buildThe build command does the following:
- executes the TypeScript compiler (
tsc) - creates a
distfolder - copies all the JavaScript generate from the
.tsfiles intodist - copies the
package.jsonfile todist - runs
npm installinside thedistfolder
Now all the TypeScript is compiled into JavaScript and the node_modules folder contains the needed packages.
From the root folder (where .ask folder is), execute the command to deploy the skill:
folder: root
ask deployThis will:
- Deploy the skill info (
skill.json) - Deploy the skill model (
models/en-US.json) - Zip up the
distfolder - Deploy the zip to lambda
- Update the
.ask/configfile