Skip to content

Commit e052b7d

Browse files
committed
Updated readme
1 parent 57b8e56 commit e052b7d

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,53 @@ Scalable JavaScript development with types, classes and modules.
1313

1414
## Install
1515

16-
npm install -g typescript
16+
### Instructions for the in-development version:
17+
18+
1. Download the zip file of this repository from https://github.com/mbrowne/typescript-dci/archive/master.zip
19+
2. If you already have typescript installed, you will need to remove the symlink to the existing Typescript compiler
20+
or else the `npm install` command below will fail. If you installed typescript as a global module in the standard location,
21+
you can remove the existing symlink by running:
22+
23+
`rm /usr/local/bin/tsc`
24+
25+
3. Unzip the downloaded file:
26+
27+
`unzip typescript-dci-master.zip`
28+
29+
4. Install it as a global node.js module (note: on some systems you may need to prefix this command with `sudo`):
30+
31+
`npm install -g typescript-dci-master`
32+
33+
34+
### Coming Soon:
35+
npm install -g typescript-dci
1736

1837
## Usage
1938

20-
tsc hello.ts
21-
39+
tsc --module commonjs hello.ts
40+
or:
41+
42+
tsc --module amd hello.ts
43+
44+
The `--module` flag is required when using DCI because some features are achieved at runtime, so the `typescript-dci/dci` module
45+
needs to be available to every DCI program. For server-side or desktop programs, use `commonjs` and it should work out of the box.
46+
47+
To generate client-side code that will run in the browser, use `amd` to compile your project into [AMD](http://requirejs.org/docs/whyamd.html)
48+
modules. You will also need to ensure that your project has access to the `typescript-dci/dci` module. To do this, copy the
49+
file `typescript-dci/dci/dci-amd.js` to your project directory and rename it to `dci.js`. In the future this process will be
50+
simplified.
51+
52+
In order to run the client-side code you will need an AMD loader. Some good AMD loaders include:
53+
54+
- [curl](https://github.com/cujojs/curl) (not to be confused with the command-line tool of the same name)
55+
- [RequireJS](http://requirejs.org/)
56+
57+
(curl is listed first because it is more lightweight, but both are excellent projects.)
58+
59+
Some AMD projects also provide a bundling tool that makes it possible to combine all your modules into one or more minified files,
60+
in order to optimize your app for production. For example, [curl](https://github.com/cujojs/curl) has a companion project
61+
[cram](https://github.com/cujojs/cram/tree/master/docs).
62+
2263

2364
## Build
2465

samples/dci/js/TransferMoney/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var ctx = new TransferMoney(src, dst, 10);
1313
ctx.run();
1414

1515
//ctx.bindRoles(dst, src, 50);
16-
//ctx.execute();
16+
//ctx.run();
1717

1818
console.log(src.getBalance());
1919
console.log(dst.getBalance());

samples/dci/typescript/Dijkstra/HashMap.js

100644100755
File mode changed.

0 commit comments

Comments
 (0)