Skip to content

Commit b5e1833

Browse files
committed
feat: add typescript support
1 parent 518c73b commit b5e1833

File tree

5 files changed

+362
-10
lines changed

5 files changed

+362
-10
lines changed

package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,23 @@
99
"test": "ember test",
1010
"test:all": "ember try:each",
1111
"semantic-release": "semantic-release",
12-
"travis-deploy-once": "travis-deploy-once"
12+
"travis-deploy-once": "travis-deploy-once",
13+
"prepublishOnly": "ember ts:precompile",
14+
"postpublish": "ember ts:clean"
1315
},
1416
"engines": {
1517
"node": "6.* || 8.* || >= 10.*"
1618
},
1719
"homepage": "https://github.com/mike-north/ember-resize",
1820
"devDependencies": {
1921
"@mike-north/js-lib-semantic-release-config": "^0.0.0-development",
22+
"@types/ember": "^2.8.32",
23+
"@types/ember-qunit": "^3.0.3",
24+
"@types/ember-test-helpers": "^0.7.1",
25+
"@types/ember-testing-helpers": "^0.0.3",
26+
"@types/ember__test-helpers": "^0.7.0",
27+
"@types/qunit": "^2.5.2",
28+
"@types/rsvp": "^4.0.2",
2029
"broccoli-asset-rev": "^2.7.0",
2130
"ember-cli": "^3.3.0",
2231
"ember-cli-app-version": "^3.1.3",
@@ -28,12 +37,14 @@
2837
"ember-cli-qunit": "^4.3.2",
2938
"ember-cli-release": "1.0.0-beta.2",
3039
"ember-cli-shims": "^1.2.0",
40+
"ember-cli-typescript": "^1.4.0",
3141
"ember-cli-uglify": "^2.0.0",
3242
"ember-disable-prototype-extensions": "^1.1.2",
3343
"ember-disable-proxy-controllers": "^1.0.1",
3444
"ember-export-application-global": "^2.0.0",
3545
"ember-load-initializers": "^1.1.0",
3646
"ember-maybe-import-regenerator": "^0.1.6",
47+
"ember-qunit-decorators": "^1.2.0",
3748
"ember-resolver": "^4.5.0",
3849
"ember-source": "~3.3.0",
3950
"ember-source-channel-url": "^1.0.1",
@@ -43,7 +54,8 @@
4354
"loader.js": "^4.2.3",
4455
"qunit-dom": "^0.6.2",
4556
"semantic-release": "^15.9.9",
46-
"travis-deploy-once": "^5.0.2"
57+
"travis-deploy-once": "^5.0.2",
58+
"typescript": "^3.0.1"
4759
},
4860
"keywords": [
4961
"ember-addon",
@@ -67,4 +79,4 @@
6779
"release": {
6880
"extends": "@mike-north/js-lib-semantic-release-config"
6981
}
70-
}
82+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default config;
2+
3+
/**
4+
* Type declarations for
5+
* import config from './config/environment'
6+
*
7+
* For now these need to be managed by the developer
8+
* since different ember addons can materialize new entries.
9+
*/
10+
declare const config: {
11+
environment: any;
12+
modulePrefix: string;
13+
podModulePrefix: string;
14+
locationType: string;
15+
rootURL: string;
16+
};

tsconfig.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2017",
4+
"allowJs": true,
5+
"moduleResolution": "node",
6+
"allowSyntheticDefaultImports": true,
7+
"noImplicitAny": true,
8+
"noImplicitThis": true,
9+
"alwaysStrict": true,
10+
"strictNullChecks": true,
11+
"strictPropertyInitialization": true,
12+
"noFallthroughCasesInSwitch": true,
13+
"noUnusedLocals": true,
14+
"noUnusedParameters": true,
15+
"noImplicitReturns": true,
16+
"noEmitOnError": false,
17+
"noEmit": true,
18+
"inlineSourceMap": true,
19+
"inlineSources": true,
20+
"baseUrl": ".",
21+
"module": "es6",
22+
"paths": {
23+
"dummy/tests/*": [
24+
"tests/*"
25+
],
26+
"dummy/*": [
27+
"tests/dummy/app/*",
28+
"app/*"
29+
],
30+
"ember-resize": [
31+
"addon"
32+
],
33+
"ember-resize/*": [
34+
"addon/*"
35+
],
36+
"ember-resize/test-support": [
37+
"addon-test-support"
38+
],
39+
"ember-resize/test-support/*": [
40+
"addon-test-support/*"
41+
],
42+
"*": [
43+
"types/*"
44+
]
45+
}
46+
},
47+
"include": [
48+
"app/**/*",
49+
"addon/**/*",
50+
"tests/**/*",
51+
"types/**/*",
52+
"test-support/**/*",
53+
"addon-test-support/**/*"
54+
]
55+
}

types/dummy/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)