Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for migrating to TypeScript #184

Merged
merged 2 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,26 @@
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test",
"test:all": "ember try:each"
"test:all": "ember try:each",
"prepublishOnly": "ember ts:precompile",
"postpublish": "ember ts:clean"
},
"dependencies": {
"axe-core": "^4.0.1",
"broccoli-funnel": "^3.0.3",
"ember-cli-babel": "^7.22.1",
"ember-cli-typescript": "^3.1.4",
"ember-cli-version-checker": "^5.1.1",
"ember-get-config": "^0.2.4"
},
"devDependencies": {
"@ember/jquery": "^1.1.0",
"@ember/optional-features": "^1.3.0",
"@types/ember": "^3.16.0",
"@types/ember-qunit": "^3.4.9",
"@types/ember__test-helpers": "^1.7.2",
"@types/qunit": "^2.9.1",
"@types/rsvp": "^4.0.3",
"broccoli-asset-rev": "^3.0.0",
"ember-ajax": "^5.0.0",
"ember-cli": "^3.20.0",
Expand All @@ -45,6 +53,7 @@
"ember-cli-release": "^0.2.9",
"ember-cli-sass": "^10.0.1",
"ember-cli-sri": "^2.1.1",
"ember-cli-typescript-blueprints": "^3.0.0",
"ember-cli-uglify": "^3.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
Expand All @@ -63,7 +72,8 @@
"qunit-dom": "^1.4.0",
"release-it": "^13.6.5",
"release-it-lerna-changelog": "^2.3.0",
"sass": "^1.26.10"
"sass": "^1.26.10",
"typescript": "^4.0.2"
},
"engines": {
"node": "10.* || >= 12"
Expand Down
16 changes: 16 additions & 0 deletions tests/dummy/app/config/environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default config;

/**
* Type declarations for
* import config from './config/environment'
*
* For now these need to be managed by the developer
* since different ember addons can materialize new entries.
*/
declare const config: {
environment: any;
modulePrefix: string;
podModulePrefix: string;
locationType: string;
rootURL: string;
};
56 changes: 56 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"compilerOptions": {
"target": "es2017",
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noImplicitThis": true,
"alwaysStrict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noEmitOnError": false,
"noEmit": true,
"inlineSourceMap": true,
"inlineSources": true,
"baseUrl": ".",
"module": "es6",
"experimentalDecorators": true,
"paths": {
"dummy/tests/*": [
"tests/*"
],
"dummy/*": [
"tests/dummy/app/*",
"app/*"
],
"ember-a11y-testing": [
"addon"
],
"ember-a11y-testing/*": [
"addon/*"
],
"ember-a11y-testing/test-support": [
"addon-test-support"
],
"ember-a11y-testing/test-support/*": [
"addon-test-support/*"
],
"*": [
"types/*"
]
}
},
"include": [
"app/**/*",
"addon/**/*",
"tests/**/*",
"types/**/*",
"test-support/**/*",
"addon-test-support/**/*"
]
}
1 change: 1 addition & 0 deletions types/dummy/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 6 additions & 0 deletions types/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Types for compiled templates
declare module 'ember-a11y-testing/templates/*' {
import { TemplateFactory } from 'htmlbars-inline-precompile';
const tmpl: TemplateFactory;
export default tmpl;
}
Loading