pulumi/cmd/lumijs
joeduffy 7fe8052941 Fix some lint in our lint
After 233c5a8 landed, I noticed there are a few things to be fixed up:

    * Run gometalinter in all the right places.  We need to run both in
      lint and lint_quiet targets.  I've also cleaned up some of the logic
      around what to suppress so there's less repetition.

    * We currently @ meaningful commands, which is unfortunate, since it
      makes debugging Makefiles tough (especially when looking at CI build
      logs).  Going forward, we should only use @ for meaningless commands,
      like @echo.

    * The AWS project wasn't actually running tslint, because it needs to
      say `tslint './pack/**/*.ts' --exclude='./pack/node_modules/**'`.
      The current script of `tslint lib/aws/pack/...` wasn't actually
      running lint, hence we missed a lot of AWS lint issues.

    * Fix up the issues that these fixes uncovered.  Mostly err shadowing.
2017-06-21 13:24:35 -07:00
..
cmd Rename Coconut to Lumi 2017-05-18 11:38:28 -07:00
lib Fix empty body issues 2017-06-14 10:30:46 -07:00
tests Fix empty body issues 2017-06-14 10:30:46 -07:00
.gitignore Rename Coconut to Lumi 2017-05-18 11:38:28 -07:00
lumijs Eliminate use of nonstandard tools 2017-06-03 11:08:09 -07:00
Makefile Fix some lint in our lint 2017-06-21 13:24:35 -07:00
package.json Upgrade LumiJS Typescript dependency to 2.3.4 2017-06-13 15:48:14 -07:00
README.md Preserve the lumi prefix on our CLI tools 2017-05-18 12:38:58 -07:00
tsconfig.json Rename Coconut to Lumi 2017-05-18 11:38:28 -07:00
tslint.json Rename Coconut to Lumi 2017-05-18 11:38:28 -07:00
yarn.lock Upgrade LumiJS Typescript dependency to 2.3.4 2017-06-13 15:48:14 -07:00

LumiJS

This directory contains Lumi's JavaScript compiler.

It implements a subset of JavaScript, with optional TypeScript-style type annotations, and compiles that subset into LumiPack/IL.

Building and Testing

LumiJS is built independent from the overall Lumi toolchain. First clone and cd to the right place:

$ git clone git@github.com:pulumi/lumi
$ cd lumi/cmd/lumijs

Next, install dependencies, ideally using Yarn:

$ yarn install

(NPM can be used instead, but Yarn offers better performance, reliability, and security, so it's what we use below.)

From there, to build:

$ yarn run build

It's possible to simply run the TypeScript compiler using tsc, however the Yarn build step performs a couple extra steps; namely, it runs TSLint and also copies some test baseline files into the right place.

Next, to test, simply run:

$ yarn run test

It will be obvious if the tests passed or failed and, afterwards, code coverage data will be output to the console.

After building, a typical developer setup would be to add cmd/lumijs/ to your $PATH; there is a lumijs executable in the root directory that conveniently wraps invocation of the compiler, passing through any arguments.

Libraries

In order to use the Lumi libraries -- including the standard library -- you will need to do a few additional steps to prepare your developer workspace. Please see this document for details on how to do this.