diff --git a/.github/workflows/richnav-all.yml b/.github/workflows/richnav-all.yml index fe09145..a7bde27 100644 --- a/.github/workflows/richnav-all.yml +++ b/.github/workflows/richnav-all.yml @@ -35,9 +35,19 @@ jobs: with: node-version: 12.x + # **** Please update to point to the location where your node dependencies are installed **** # + - uses: actions/cache@v2 + id: caching-stage + name: Cache dependencies + with: + path: node_modules + key: ${{ runner.os }}-dependencies-${{ hashfiles('typescript/yarn.lock') }} + restore-keys: ${{ runner.os }}-dependencies- + # **** Please update, at least, the working directory below. You may also want to use npm install instead **** # - run: yarn working-directory: typescript + if: steps.caching-stage.outputs.cache-hit != 'true' # **** If you use NPM to install packages, please uncomment this task and delete the yarn task **** # # - name: npm install diff --git a/.github/workflows/richnav-typescript.yml b/.github/workflows/richnav-typescript.yml index ba4aaa6..590779c 100644 --- a/.github/workflows/richnav-typescript.yml +++ b/.github/workflows/richnav-typescript.yml @@ -26,8 +26,19 @@ jobs: with: node-version: ${{ matrix.node-version }} + # **** Please update to point to the location where your node dependencies are installed **** # + - uses: actions/cache@v2 + id: caching-stage + name: Cache dependencies + with: + path: node_modules + key: ${{ runner.os }}-dependencies-${{ hashfiles('typescript/yarn.lock') }} + restore-keys: ${{ runner.os }}-dependencies- + + # **** Please update the working-directory to the location where your package.json file resides **** # - run: yarn working-directory: typescript + if: steps.caching-stage.outputs.cache-hit != 'true' - uses: microsoft/RichCodeNavIndexer@v0.1 with: diff --git a/typescript/package.json b/typescript/package.json index 405365a..7b5361b 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -6,5 +6,9 @@ "license": "MIT", "scripts": { "build": "tsc -p ./" + }, + "dependencies": { + "@types/node": "^14.11.3", + "add-two-number": "^0.2.0" } -} \ No newline at end of file +} diff --git a/typescript/src/GameObject.ts b/typescript/src/GameObject.ts index 3a27d76..f76e0f9 100644 --- a/typescript/src/GameObject.ts +++ b/typescript/src/GameObject.ts @@ -1,5 +1,6 @@ import Drawable from './Drawable' import Interactive from './Interactive' +const add: any = require('add-two-number'); export default class GameObject implements Drawable, Interactive { posX: number; @@ -12,6 +13,7 @@ export default class GameObject implements Drawable, Interactive { interact(): void { console.log("Interacting with GameObject"); + console.log(`Adding two numbers: ${add(this.posX, this.posY)}`); } draw(): void { diff --git a/typescript/yarn.lock b/typescript/yarn.lock index fb57ccd..77e9bd2 100644 --- a/typescript/yarn.lock +++ b/typescript/yarn.lock @@ -2,3 +2,7 @@ # yarn lockfile v1 +add-two-number@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/add-two-number/-/add-two-number-0.2.0.tgz#f21e52b3a328f3551b247489b4b0351465ef363e" + integrity sha512-zB+QIdul0cHNXAj1xVAhzhk8WQ8JvLYlp1L3kwZr3zIIgdV+U1kp4DkRJRqutvPgDl1jBG9TcbMU3cWgeY9d7w==