Skip to content

Commit 1228ff0

Browse files
authored
Merge pull request #288 from typed-ember/build-code-typescript-setup
Set up build-time code for TypeScript development
2 parents a5f1a09 + 23d9c3a commit 1228ff0

File tree

42 files changed

+279
-126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+279
-126
lines changed

.eslintignore

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
/blueprints/*/files/**/*.js
1+
# unconventional js
2+
/blueprint-files/
3+
/test-fixtures/
4+
/vendor/
5+
6+
# compiled output
7+
/dist/
8+
/tmp/
9+
/js/
10+
11+
# dependencies
12+
/bower_components/
13+
/tests/dummy/lib/*/node_modules/
14+
15+
# misc
16+
/coverage/
17+
18+
# ember-try
19+
/.node_modules.ember-try/
20+
/bower.json.ember-try
21+
/package.json.ember-try

.eslintrc.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,24 @@ module.exports = {
1010
browser: true,
1111
},
1212
rules: {},
13+
settings: {
14+
node: {
15+
// Honor both extensions when enforcing e.g. `node/no-missing-require`
16+
tryExtensions: ['.js', '.ts'],
17+
},
18+
},
1319
overrides: [
1420
// node files
1521
{
1622
files: [
1723
'ember-cli-build.js',
1824
'index.js',
25+
'register-ts-node.js',
1926
'testem.js',
2027
'blueprints/*/index.js',
2128
'config/**/*.js',
2229
'tests/dummy/config/**/*.js',
23-
'lib/**/*.js',
24-
'node-tests/**/*.js',
30+
'ts/**/*.js',
2531
],
2632
excludedFiles: ['app/**', 'addon/**', 'tests/dummy/app/**'],
2733
parserOptions: {
@@ -41,22 +47,33 @@ module.exports = {
4147

4248
// test files
4349
{
44-
files: ['tests/**/*.js'],
45-
excludedFiles: ['tests/dummy/**/*.js'],
50+
files: ['tests/**/*.{js,ts}'],
51+
excludedFiles: ['tests/dummy/**/*.{js,ts}'],
4652
env: {
4753
embertest: true,
4854
},
4955
},
5056

5157
// node test files
5258
{
53-
files: ['node-tests/**/*.js'],
59+
files: ['ts/tests/**/*.{js,ts}'],
5460
env: {
5561
mocha: true,
5662
},
5763
rules: {
5864
'node/no-unpublished-require': 'off',
5965
},
6066
},
67+
68+
// all TypeScript files
69+
{
70+
files: ['**/*.ts'],
71+
parser: 'typescript-eslint-parser',
72+
rules: {
73+
// These are covered by tsc
74+
'no-undef': 'off',
75+
'no-unused-var': 'off'
76+
}
77+
}
6178
],
6279
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# compiled output
44
/dist
55
/tmp
6+
/js
67

78
# dependencies
89
/node_modules

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
/dist
44
/tests
55
/tmp
6+
/test-fixtures
7+
/ts
8+
/js/tests
9+
610
**/.gitkeep
711
.bowerrc
812
.editorconfig

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ install:
3636

3737
script:
3838
- test $MD_ONLY && echo "Skipped!" || yarn lint:js
39+
# Typecheck and compile the addon, then nuke the TS source so we're testing the code we would publish
40+
- test $MD_ONLY && echo "Skipped!" || yarn ci:prepare
3941
# Usually, it's ok to finish the test scenario without reverting
4042
# to the addon's original dependency state, skipping "cleanup".
4143
- test $MD_ONLY && echo "Skipped!" || yarn ember try:one $EMBER_TRY_SCENARIO --skip-cleanup

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ cache:
2727
test_script:
2828
# Output useful info for debugging.
2929
- yarn versions
30+
# Typecheck and compile the addon, then nuke the TS source so we're testing the code we would publish
31+
- cmd: yarn ci:prepare
3032
- cmd: yarn ember try:one defaults
3133

3234
# Don't actually build.

0 commit comments

Comments
 (0)