-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test-app): add Typescript. Migrate some files
- Loading branch information
1 parent
4d925a9
commit c587784
Showing
11 changed files
with
295 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/test-app/app/controllers/index.js → packages/test-app/app/controllers/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import Controller from '@ember/controller'; | ||
import { inject as service } from '@ember/service'; | ||
import type SessionService from 'test-app/services/session'; | ||
|
||
export default class ApplicationIndexController extends Controller { | ||
@service session; | ||
@service declare session: SessionService; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { inject as service } from '@ember/service'; | ||
import Session from 'ember-simple-auth/services/session'; | ||
|
||
export default class SessionService extends Session { | ||
@service sessionAccount: any; | ||
|
||
handleAuthentication(routeAfterInvalidation: string) { | ||
super.handleAuthentication(routeAfterInvalidation); | ||
|
||
this.sessionAccount.loadCurrentUser().catch(() => (this as any).invalidate()); | ||
} | ||
} | ||
|
||
declare module '@ember/service' { | ||
interface Registry { | ||
session: SessionService; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import Cookie from 'ember-simple-auth/session-stores/cookie'; | ||
import CookieStore from 'ember-simple-auth/session-stores/cookie'; | ||
|
||
export default Cookie.extend(); | ||
export default class ApplicationStore extends CookieStore {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"plugins": [ | ||
"@embroider/addon-dev/template-colocation-plugin", | ||
["@babel/plugin-transform-typescript", { "allowDeclareFields": true }], | ||
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
"@babel/plugin-proposal-class-properties" | ||
"@babel/plugin-proposal-class-properties", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"extends": "@tsconfig/ember/tsconfig.json", | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "esnext", | ||
// The combination of `baseUrl` with `paths` allows Ember's classic package | ||
// layout, which is not resolvable with the Node resolution algorithm, to | ||
// work with TypeScript. | ||
"baseUrl": ".", | ||
"experimentalDecorators": true, | ||
|
||
"paths": { | ||
"test-app/tests/*": ["tests/*"], | ||
"test-app/*": ["app/*"], | ||
"*": ["types/*"] | ||
}, | ||
"types": ["ember-source/types"] | ||
}, | ||
"glint": { | ||
"environment": "ember-loose" | ||
}, | ||
"include": ["app", "tests"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '@glint/environment-ember-loose'; |
Oops, something went wrong.