UNPKG

ask-cli-x

Version:

Alexa Skills Kit (ASK) Command Line Interfaces

108 lines (81 loc) 4.1 kB
This file has instructions to produce a version of askx with a private acdl compiler askx is produced in the [askx-typescript-release](https://code.amazon.com/packages/ASK-CLI/blobs/heads/askx-typescript-release/--/package.json) branch of the [ASK-CLI](https://code.amazon.com/packages/ASK-CLI/trees/develop-int) package this file is under. It depends on the [ask-ac](https://github.com/alexa/ask-ac) ACDL compiler that contains many separate packages under @alexa/packages. Specifically as seen in ASK-CLI’s [./package.json](https://code.amazon.com/packages/ASK-CLI/blobs/a4252be6c818fb97a17712efc24d0ae474327244/--/package.json#L43) the only dependency is in the in the @alexa/acdl package: ``` "dependencies"*: { "@alexa/acdl"*: "^0.1.4", ``` I suggest you start with changes like this to ASK-CLI’s package.json: ``` - "version": "2.22.4-beta.13", + "version": "2.22.4-beta-ce.13", "dependencies": { "@alexa/acdl": "^0.1.4", ... }, + "bundledDependencies": [ + "@alexa/acdl" + ], ``` Replace “ce” with something that describes the feature you are testing. The version change will allow someone to know they have the private version of askx by running ``` > askx --version 2.22.4-beta-ce.13 ``` The bundledDependencies will ensure the private version of @alexa/acdl is carried along. Before you build ASK-CLI you need to get the private version of the compiler in node-modules. In the root [ask-ac](https://github.com/alexa/ask-ac) directory build all packages: ``` npm run build ``` check it succeeded. You might want to make sure npm run test is passing too, if you have not yet done that yet. Pack the compiler: ``` cd packages/@alexa/acdl npm pack ``` This will produce a tgz file. Move it out of the git directory (the file name will change): ``` mv alexa-acdl-0.1.16.tgz ~/Documents ``` Now in *ASK-CLI’s root directory*, which is the same spot this .md file is at, install that private compiler package with: ``` npm install --no-save ~/Documents/alexa-acdl-0.1.16.tgz ``` The —no-save is essential. Without it npm install will change package.json into something like: ``` "dependencies": { "@alexa/acdl": "file:../../../../Documents/alexa-acdl-0.1.16.tgz", ``` Which will cause the bundledDependencies to fail when askx is later run in the customer box. Now we are ready to build ask-cli. Still in the root (ASK-CLI) directory: ``` > npm run prepublishOnly ``` For me, this will produce output like this: ``` > ask-cli-x@2.22.4-beta-ce.13 prepublishOnly /Users/lumas/workplace/cli/src/ASK-CLI > tsc && npm run copy:assets > ask-cli-x@2.22.4-beta-ce.13 copy:assets /Users/lumas/workplace/cli/src/ASK-CLI > copyfiles -u 1 lib/**/*.yaml dist/lib ``` And pack it (still in ASK-CLI): ``` npm pack ``` This will generate a file like ask-cli-x-2.22.4-beta-ce.13.tgz (file name will change) that you might want to move out of git: ``` mv ask-cli-x-2.22.4-beta-ce.13.tgz ~/Documents ``` This is the file you share with customers, usually 1P testers. I place the file in https://drive.corp.amazon.com/ and send a quip describing the feature and how to install the tgz like [Complex Entities](https://quip-amazon.com/kU3oAQYlQWKS). It sure is nice to describe how to use the features in the private askx. I strongly advise to include the section [Make current ASKX work](https://quip-amazon.com/kU3oAQYlQWKS#temp:C:XOP55e406e4344344aeb1201c433) to separate what is broken for unrelated reasons than the private askx. The only mandatory section of that document is the one explaining how to install the private: [Use the version of ASKX supporting Complex Entities](https://quip-amazon.com/kU3oAQYlQWKS#temp:C:XOP71eb7d3806284f849b77bd01c) It has the 3 steps below. If you don’t want to create a new quip those are the minimum instructions to customers along with the pointer to the tgz: ``` npm install -g ask-cli-x-2.22.4-beta-<your feature>.13.tgz npm uninstall -g ask-cli-x npm uninstall -g @alexa/acdl ``` I’ve seen one case where @alexa/acdl was installed globally hence the second step. It doesn’t do anything if not installed.