Skip to content

Commit 40330a6

Browse files
authored
Merge pull request #460 from appuniversum/feat/glint-typescript-support
Set up Glint and TypeScript for development
2 parents 63b7c03 + 3e73a53 commit 40330a6

20 files changed

+1837
-332
lines changed

.ember-cli

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
44
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
55
*/
6-
"isTypeScriptProject": false
6+
"isTypeScriptProject": true
77
}

.eslintrc.js

+11-12
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22

33
module.exports = {
44
root: true,
5-
parser: '@babel/eslint-parser',
5+
parser: '@typescript-eslint/parser',
66
parserOptions: {
77
ecmaVersion: 'latest',
8-
sourceType: 'module',
9-
requireConfigFile: false,
10-
babelOptions: {
11-
plugins: [
12-
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
13-
],
14-
},
158
},
16-
plugins: ['ember'],
9+
plugins: ['ember', '@typescript-eslint'],
1710
extends: ['eslint:recommended', 'plugin:ember/recommended', 'prettier'],
1811
env: {
1912
browser: true,
2013
},
2114
rules: {},
2215
overrides: [
16+
// ts files
17+
{
18+
files: ['**/*.{gts,ts}'],
19+
extends: [
20+
'plugin:@typescript-eslint/eslint-recommended',
21+
'plugin:@typescript-eslint/recommended',
22+
],
23+
rules: {},
24+
},
2325
// node files
2426
{
2527
files: [
@@ -34,9 +36,6 @@ module.exports = {
3436
'./config/**/*.js',
3537
'./tests/dummy/config/**/*.js',
3638
],
37-
parserOptions: {
38-
sourceType: 'script',
39-
},
4039
env: {
4140
browser: false,
4241
node: true,

.npmignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
/dist/
33
/tmp/
44
/storybook-static/
5+
# We don't want to publish the declaration files for the tests folder, but we can't prevent it
6+
# with only a single tsconfig file and Glint doesn't support multiple tsconfig files yet.
7+
/declarations/tests/
58

69
# misc
710
/.editorconfig
@@ -25,17 +28,21 @@
2528
/jsconfig.json
2629
/RELEASE.md
2730
/testem.js
31+
/tsconfig.json
32+
/tsconfig.declarations.json
2833
/tests/
2934
/yarn-error.log
3035
/yarn.lock
3136
.gitkeep
3237
/.storybook
3338
/stories/
3439
/build-storybook.log
40+
# These types are local types that are only needed for development of the addon
41+
/types/
42+
/unpublished-development-types/
3543

3644
# ember-try
3745
/.node_modules.ember-try/
38-
/bower.json.ember-try
3946
/npm-shrinkwrap.json.ember-try
4047
/package.json.ember-try
4148
/package-lock.json.ember-try

addon/components/au-hr.gjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ export default class AuHr extends Component {
77
else return '';
88
}
99

10-
<template>
11-
<hr class="au-c-hr {{this.size}}" ...attributes />
12-
</template>
10+
<template><hr class="au-c-hr {{this.size}}" ...attributes /></template>
1311
}

addon/template-registry.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default interface AppuniversumRegistry {}

ember-cli-build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
44

55
module.exports = function (defaults) {
66
const app = new EmberAddon(defaults, {
7-
// Add options here
7+
'ember-cli-babel': { enableTypeScriptTransform: true },
88
sassOptions: {
99
sourceMapEmbed: true,
1010
includePaths: ['./styles'], // This ensures that the /styles folder is watched and auto-reloading works.

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
module.exports = {
44
name: require('./package').name,
5+
56
options: {
67
babel: {
78
// This is needed for dynamic imports to work: https://github.com/ef4/ember-auto-import#installing-ember-auto-import-in-an-addon
89
plugins: [require.resolve('ember-auto-import/babel-plugin')],
910
},
11+
'ember-cli-babel': { enableTypeScriptTransform: true },
1012
},
1113
};

jsconfig.json

-5
This file was deleted.

0 commit comments

Comments
 (0)