GithubHelp home page GithubHelp logo

Comments (3)

nikhilym avatar nikhilym commented on June 9, 2024 1

Hey @andrelandgraf , sorry for the late response. So as you may already know, the Alexa Console built-in repository is just the normal AWS Lambda function over an AWS CodeCommit repository for the skill, handled by the Hosted skills service. AWS Lambda doesn't currently support Typescript out of the box, and the developers are expected to build the .ts files to .js files before uploading to the service. This is the reason why you would still need to upload the dist directory containing the js files.

Additionally, the default handler location for the AWS Lambda function for the hosted skills service is index.handler and at the moment, that service doesn't provide a way to configure this handler through the tools. This is the reason why you would have to re-import the handler from dist/index and export it back again, in your workaround. You can also configure your tsconfig.json to output the built files to the same lambda folder, and hence not do such workarounds. However, that would add both js and ts files in the same folder, leading to confusion and maintainability issues. I think your workaround is a good one, until the hosted skill service provides a way to configure the handler location.

As for the sample skill, it seems to have been built on the ask cli v1 structure. If so, skill devs can use this migration guide, to convert it to the ask cli v2 structure, which is compatible with the ASK Toolkit vscode extension. Hope this helps.

I am going ahead and closing this issue, considering you are unblocked at the moment. Please create an issue in case you have further questions or have any feedback on the extension. Thanks.

from ask-toolkit-for-vscode.

andrelandgraf avatar andrelandgraf commented on June 9, 2024

I was able to make it work now.

  • I added the dist folder to git and deploy it to lambda using Alexa Skills Toolkit
  • I added a index.js inside lambda/ which just looks like follows:
const handler = require('./dist/index')

exports.handler = handler

Is this how TypeScript is supposed to work with Alexa Skills Toolkit or is there a better way to configure it?

from ask-toolkit-for-vscode.

andrelandgraf avatar andrelandgraf commented on June 9, 2024

Thanks @nikhilym for the in-depth explanations! This cleared up a lot of assumptions I made. Great to hear that you recommend my workaround for now.

from ask-toolkit-for-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.