Skip to content

Commit 9e6ca1a

Browse files
authored
Merge pull request #2 from Protocore-UI/develop
Re-factors ts configs
2 parents 5ea7cbb + 581243f commit 9e6ca1a

File tree

10 files changed

+40
-52
lines changed

10 files changed

+40
-52
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
},
2020
"homepage": "https://github.com/Protocore-UI/protocore-typescript-edition#readme",
2121
"dependencies": {
22+
"@types/crossroads": "0.0.29",
23+
"@types/handlebars": "^4.0.31",
24+
"@types/hasher": "0.0.28",
25+
"@types/jquery": "^2.0.33",
26+
"@types/signals": "0.0.17",
2227
"body-parser": "~1.14.2",
2328
"cookie-parser": "~1.3.2",
2429
"crossroads": "^0.12.2",

src/apps/router/routes.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import signals from "signals";
2-
import hasher from "hasher";
3-
import crossroads from "crossroads";
1+
import * as signals from "signals";
2+
import * as hasher from "hasher";
3+
import * as crossroads from "crossroads";
44

5-
import HomeView from '../views/homeView.ts';
5+
import HomeView from '../views/homeView';
66
import HomeTemplate from '../templates/homeTpl.handlebars';
77

8-
import AboutView from '../views/aboutView.ts';
8+
import AboutView from '../views/aboutView';
99
import AboutTemplate from '../templates/aboutTpl.handlebars';
1010

1111
let router = crossroads.create();
1212

13-
let parseHash = (newHash) => {
13+
let parseHash = (newHash: any) => {
1414
router.parse(newHash);
1515
};
1616

src/apps/views/_baseView.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import $ from "jquery";
1+
import * as $ from "jquery";
22

3-
class BaseView {
3+
export default class BaseView {
44
el: string;
55

66
template: string;
@@ -18,5 +18,3 @@ class BaseView {
1818
$(this.el).html(this.template);
1919
}
2020
};
21-
22-
export default BaseView;

src/apps/views/aboutView.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import BaseView from './_baseView.ts';
1+
import BaseView from './_baseView';
22

3-
class AboutView extends BaseView {
3+
export default class AboutView extends BaseView {
44
constructor(params: any) {
55
super(params);
66
console.log('LOG: Initialize AboutView');
@@ -18,5 +18,3 @@ class AboutView extends BaseView {
1818
console.log("LOG: AboutView Events Hash");
1919
}
2020
};
21-
22-
export default AboutView;

src/apps/views/homeView.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import BaseView from './_baseView.ts';
1+
import BaseView from './_baseView';
22

3-
class HomeView extends BaseView {
3+
export default class HomeView extends BaseView {
44
constructor(params: any) {
55
super(params);
66
console.log('LOG: Initialize HomeView');
@@ -17,6 +17,4 @@ class HomeView extends BaseView {
1717
eventsHash() {
1818
console.log("LOG: HomeView Events Hash");
1919
}
20-
}
21-
22-
export default HomeView;
20+
};

src/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// import './stylesheets/less/_consolidate.less';
1+
import './stylesheets/less/_consolidate.less';
22

3-
import './apps/router/routes.ts';
3+
import './apps/router/routes';

tsconfig.json

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
{
2+
"compileOnSave": true,
23
"compilerOptions": {
3-
"target": "es5",
4-
"sourceMap": false,
4+
"outDir": "./dist/",
5+
"sourceMap": true,
6+
"noImplicitAny": true,
57
"module": "commonjs",
6-
"moduleResolution": "node",
7-
"allowJs": true,
8-
"allowSyntheticDefaultImports": true
8+
"moduleResolution": "node",
9+
"target": "es5",
10+
"removeComments": true
911
},
10-
"exclude": [
12+
"include": [
13+
"src/**/*"
14+
],
15+
"exclude": [
1116
"node_modules"
1217
]
1318
}

tsd.json

-21
This file was deleted.

typings.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"globalDependencies": {
3-
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd"
3+
"crossroads": "registry:dt/crossroads#0.0.0+20160317120654",
4+
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
5+
"handlebars": "registry:dt/handlebars#4.0.5+20160804082238",
6+
"hasher": "registry:dt/hasher#0.0.0+20160317120654",
7+
"jquery": "registry:dt/jquery#1.10.0+20160929162922",
8+
"js-signals": "registry:dt/js-signals#0.0.0+20160316155526"
49
}
510
}

webpack.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ var config = {
3131
test: /\.(jpg|jpeg|png|gif|svg)$/i,
3232
loader: 'file'
3333
}, {
34-
test: /\.handlebars$/i,
34+
test: /\.handlebars?$/i,
3535
loader: 'handlebars-loader'
3636
}, {
3737
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
3838
loader: "file"
3939
}, {
40-
test: /\.less$/,
40+
test: /\.less?$/,
4141
loader: 'style-loader!css-loader!less-loader'
4242
}, {
43-
test: /\.css$/,
43+
test: /\.css?$/,
4444
loader: 'style-loader!css-loader'
4545
}, {
4646
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,

0 commit comments

Comments
 (0)