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 install
The 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 build
The build
command does the following:
- executes the TypeScript compiler (
tsc
) - creates a
dist
folder - copies all the JavaScript generate from the
.ts
files intodist
- copies the
package.json
file todist
- runs
npm install
inside thedist
folder
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 deploy
This will:
- Deploy the skill info (
skill.json
) - Deploy the skill model (
models/en-US.json
) - Zip up the
dist
folder - Deploy the zip to lambda
- Update the
.ask/config
file