Skip to content

Commit

Permalink
Merge pull request #247 from tildeio/types
Browse files Browse the repository at this point in the history
Move to TypeScript
  • Loading branch information
chadhietala committed Aug 21, 2018
2 parents bfcb66f + 7535d8c commit 73d6a7f
Show file tree
Hide file tree
Showing 46 changed files with 3,264 additions and 3,462 deletions.
16 changes: 0 additions & 16 deletions .eslintrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true
}
23 changes: 15 additions & 8 deletions ember-cli-build.js
Expand Up @@ -5,7 +5,8 @@ const Funnel = require('broccoli-funnel');
const MergeTrees = require('broccoli-merge-trees');
const Babel = require('broccoli-babel-transpiler');
const Concat = require('broccoli-concat');
const ESLint = require('broccoli-lint-eslint');
const TSLint = require('broccoli-tslinter');
const typescript = require('broccoli-typescript-compiler').default;

function findLib(name, libPath) {
let packagePath = path.join(name, 'package');
Expand Down Expand Up @@ -35,13 +36,17 @@ function toAMD(tree) {
},
],
],

resolveModuleSource: require('amd-name-resolver').moduleResolve,
moduleIds: true,
});
}

module.exports = function() {
let eslatest = 'lib';
let ts = 'lib';
let eslatest = new Funnel(typescript(ts), {
srcDir: 'lib',
});

let amd = toAMD(eslatest);

let cjs = new Babel(eslatest, {
Expand All @@ -63,15 +68,17 @@ module.exports = function() {
new Funnel(cjs, { srcDir: 'router', destDir: 'cjs' }),
];

let lintedLib = new ESLint(eslatest, {
testGenerator: 'qunit',
let lintedLib = new TSLint('lib/router', {
configuration: 'tslint.json',
});

let lintedTests = new ESLint('tests', {
testGenerator: 'qunit',
let lintedTests = new TSLint('tests', {
configuration: 'tslint.json',
});

let testAMD = toAMD('tests');
let tsTests = typescript('tests');

let testAMD = toAMD(tsTests);

let tests = new MergeTrees([testAMD, lintedLib, lintedTests], {
overwrite: true,
Expand Down
1 change: 1 addition & 0 deletions lib/backburner/index.d.ts
@@ -0,0 +1 @@
declare module "backburner"
7 changes: 7 additions & 0 deletions lib/router/core.ts
@@ -0,0 +1,7 @@
export type Present = {} | void;
export type Option<T> = T | null;
export type Maybe<T> = Option<T> | undefined | void;
export type Recast<T, U> = (T & U) | U;
export interface Dict<T> {
[key: string]: T;
}
267 changes: 0 additions & 267 deletions lib/router/handler-info.js

This file was deleted.

0 comments on commit 73d6a7f

Please sign in to comment.