a spike to attempt to port aurelia code into typescript
The process is to take the ES6 Aurelia source code, maintain a local copy here for comparison when porting across new code changes: aurelia repo source code
Using the source from above, the next step in the process is to create equivalent, matching typescript source code by copying .js
files and renaming them .ts
extension, changing all ambient imports (import {Router} from 'aurelia-router'
) to explicit imports (import {Router} from '../router/index'
), making small edits to make the typescript compiler happy, and adding typescript type annotations:
aurelia repo typescript-converted source code
The atom editor, with its built-in, updated, almost-typescript-1.5 atom-typescript package is used to build the .js
files in ES5 format, identify compile-time errors, and provide intellisense.
build output
- clone this repo
- run
git bash
shell, change to the main folder - install atom
- install atom-typescript: run
apm install atom-typescript
- open the clone folder in atom
- to build typescript files
-
run
./get-latest.sh
this is a
git bash
script to help keep the aurelia-latest up to date -
clones aurelia repos into
aurelia-latest-repos
-
copies
src
folder from each repo into corresponding folder inaurelia-latest
-
manually copy
.js
files fromaurelia-latest
intoaurelia-ts
(rename each to.ts
) -
replace ambient imports (
import {Router} from 'aurelia-router'
) to explicit imports (import {Router} from '../router/index'
)