alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

fix: fix the github action workflow and compilation making relative require fail issue #658

Closed ShenChen93 closed 3 years ago

ShenChen93 commented 3 years ago
  1. The current github workflow run unit tests on each sub pkg independently without caring about other changes in local dependencies. E.G. changes to ask-sdk-runtime won't be used in ask-sdk-core's tests.
  2. Due to we changed lint to eslint, and we want to include tests in linting as well, we added 'tst' folder to tsconfig file. Then it will lead to issue similar to https://stackoverflow.com/questions/40324229/tsconfig-json-for-project-with-src-and-tests/44860881. The folder structure of complied result will be changed as there will be one more layer in dist foler. Thus relative require such as require(../../package.json) won't work anymore. The unit tests didn't report this issue because it use ts-node which directly consume ts src code instead of compiled result. But once I copy the complied dist folder and use it in a skill code, it will report module not found issue.

Description

  1. Delete github actions for individual pkgs, but use the lerna to run all tests for ask-sdk (7 pkgs included). Lerna will use the local dependencies if available.
  2. Since we want tst be included in lint, but we also don't want tst to be complied into output folder dist. Thus create new tsconfig file under tst folder. Remove tst from the original tsconfig. Thus after compile, tst folder won't be added to dist and folder structure will be remain same as src code.

Motivation and Context

Testing

Screenshots (if appropriate)

Types of changes

Checklist

License