From 8bc3af75e333fe5931f658a35c69918202a50133 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Tue, 23 Apr 2024 14:53:31 +0200 Subject: [PATCH] chore: Updated fixtures --- .../my-app/output/app/components/example-1.ts | 8 +++++--- .../my-app/output/app/components/example-2.ts | 11 +++++++---- .../my-app/output/app/components/example-3.ts | 8 +++++--- .../my-app/output/app/components/example-4.ts | 10 ++++++---- .../my-app/output/app/components/example-5.js | 2 +- .../my-app/output/app/components/example-6.ts | 10 ++++++---- .../my-app/output/app/components/example-7.js | 2 +- .../my-app/output/app/controllers/example-1.ts | 10 ++++++---- .../my-app/output/app/controllers/example-2.ts | 11 +++++++---- .../my-app/output/app/controllers/example-3.ts | 10 ++++++---- .../my-app/output/app/controllers/example-4.ts | 12 +++++++----- .../my-app/output/app/controllers/example-5.js | 8 ++++---- tests/fixtures/my-app/output/app/routes/example-1.ts | 2 +- tests/fixtures/my-app/output/app/routes/example-2.ts | 6 +++--- tests/fixtures/my-app/output/app/routes/example-4.ts | 6 +++--- tests/fixtures/my-app/output/app/routes/example-5.ts | 6 +++--- .../my-app/output/app/services/current-user.ts | 5 +++-- .../output/app/services/domain-1/business-logic.ts | 5 +++-- tests/fixtures/my-app/output/app/utils/example-1.ts | 6 ++++-- tests/fixtures/my-app/output/app/utils/example-2.ts | 6 ++++-- tests/fixtures/my-app/output/app/utils/example-3.ts | 10 ++++++---- tests/fixtures/my-app/output/app/utils/example-4.ts | 10 ++++++---- .../my-v1-addon/output/addon/components/example-1.ts | 8 +++++--- .../my-v1-addon/output/addon/components/example-7.js | 2 +- .../output/addon/services/current-user.ts | 5 +++-- .../output/addon/services/domain-1/business-logic.ts | 5 +++-- .../output/tests/dummy/app/components/example-3.ts | 8 +++++--- .../my-v2-addon/output/src/components/example-1.ts | 8 +++++--- .../my-v2-addon/output/src/components/example-3.ts | 8 +++++--- .../my-v2-addon/output/src/components/example-7.js | 2 +- .../my-v2-addon/output/src/services/current-user.ts | 5 +++-- .../output/src/services/domain-1/business-logic.ts | 5 +++-- 32 files changed, 131 insertions(+), 89 deletions(-) diff --git a/tests/fixtures/my-app/output/app/components/example-1.ts b/tests/fixtures/my-app/output/app/components/example-1.ts index 0266eb6..013cf7e 100644 --- a/tests/fixtures/my-app/output/app/components/example-1.ts +++ b/tests/fixtures/my-app/output/app/components/example-1.ts @@ -1,5 +1,5 @@ import { action } from '@ember/object'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; import type ApiService from '../services/api'; @@ -10,8 +10,10 @@ export default class Example1Component extends Component { @service('domain-1/business-logic') declare domain1BusinessLogic: Domain1BusinessLogicService; - @service declare currentUser: CurrentUserService; - @service declare api: ApiService; + @service + declare currentUser: CurrentUserService; + @service + declare api: ApiService; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/components/example-2.ts b/tests/fixtures/my-app/output/app/components/example-2.ts index 195b328..4981104 100644 --- a/tests/fixtures/my-app/output/app/components/example-2.ts +++ b/tests/fixtures/my-app/output/app/components/example-2.ts @@ -1,5 +1,5 @@ import { action } from '@ember/object'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; import type ApiService from '../services/api'; @@ -7,9 +7,12 @@ import type CurrentUserService from '../services/current-user'; import type Domain1BusinessLogicService from '../services/domain-1/business-logic'; export default class Example2Component extends Component { - @service('domain-1/business-logic') declare dbl: Domain1BusinessLogicService; - @service('current-user') declare user: CurrentUserService; - @service('api') declare xyz: ApiService; + @service('domain-1/business-logic') + declare dbl: Domain1BusinessLogicService; + @service('current-user') + declare user: CurrentUserService; + @service('api') + declare xyz: ApiService; @action async consent(): Promise { const id = this.user.user!.id; diff --git a/tests/fixtures/my-app/output/app/components/example-3.ts b/tests/fixtures/my-app/output/app/components/example-3.ts index 8533be6..4cf3783 100644 --- a/tests/fixtures/my-app/output/app/components/example-3.ts +++ b/tests/fixtures/my-app/output/app/components/example-3.ts @@ -1,13 +1,15 @@ import { action } from '@ember/object'; -import { inject as service, type Registry as Services } from '@ember/service'; +import { service, type Registry as Services } from '@ember/service'; import Component from '@glimmer/component'; export default class Example3Component extends Component { @service('domain-1/business-logic') declare domain1BusinessLogic: Services['domain-1/business-logic']; - @service declare currentUser: Services['current-user']; - @service declare api: Services['api']; + @service + declare currentUser: Services['current-user']; + @service + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/components/example-4.ts b/tests/fixtures/my-app/output/app/components/example-4.ts index 2f5cf26..29616c1 100644 --- a/tests/fixtures/my-app/output/app/components/example-4.ts +++ b/tests/fixtures/my-app/output/app/components/example-4.ts @@ -1,14 +1,16 @@ import { action } from '@ember/object'; import type { Registry as Services } from '@ember/service'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; export default class Example4Component extends Component { @service('domain-1/business-logic') - private declare readonly domain1BusinessLogic: Services['domain-1/business-logic']; + declare domain1BusinessLogic: Services['domain-1/business-logic']; - @service private declare readonly currentUser: Services['current-user']; - @service private declare readonly api: Services['api']; + @service + declare currentUser: Services['current-user']; + @service + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/components/example-5.js b/tests/fixtures/my-app/output/app/components/example-5.js index c5a52ad..b9244df 100644 --- a/tests/fixtures/my-app/output/app/components/example-5.js +++ b/tests/fixtures/my-app/output/app/components/example-5.js @@ -1,5 +1,5 @@ import { action } from '@ember/object'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; export default class Example5Component extends Component { diff --git a/tests/fixtures/my-app/output/app/components/example-6.ts b/tests/fixtures/my-app/output/app/components/example-6.ts index 3e9abf2..55030e4 100644 --- a/tests/fixtures/my-app/output/app/components/example-6.ts +++ b/tests/fixtures/my-app/output/app/components/example-6.ts @@ -1,14 +1,16 @@ import { action } from '@ember/object'; import type { Registry as Services } from '@ember/service'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; export default class Example6Component extends Component { @service('domain-1/business-logic') - domain1BusinessLogic!: Services['domain-1/business-logic']; + declare domain1BusinessLogic: Services['domain-1/business-logic']; - @service('current-user') currentUser!: Services['current-user']; - @service api!: Services['api']; + @service('current-user') + declare currentUser: Services['current-user']; + @service + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/components/example-7.js b/tests/fixtures/my-app/output/app/components/example-7.js index c47a7a4..79fdf24 100644 --- a/tests/fixtures/my-app/output/app/components/example-7.js +++ b/tests/fixtures/my-app/output/app/components/example-7.js @@ -1,5 +1,5 @@ import Component from '@ember/component'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; export default Component.extend({ domain1BusinessLogic: service('domain-1/business-logic'), diff --git a/tests/fixtures/my-app/output/app/controllers/example-1.ts b/tests/fixtures/my-app/output/app/controllers/example-1.ts index 64c5053..85ed821 100644 --- a/tests/fixtures/my-app/output/app/controllers/example-1.ts +++ b/tests/fixtures/my-app/output/app/controllers/example-1.ts @@ -1,17 +1,19 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; -import { inject } from '@ember/service'; +import { service } from '@ember/service'; import type ApiService from '../services/api'; import type CurrentUserService from '../services/current-user'; import type Domain1BusinessLogicService from '../services/domain-1/business-logic'; export default class Example1Controller extends Controller { - @inject('domain-1/business-logic') + @service('domain-1/business-logic') declare domain1BusinessLogic: Domain1BusinessLogicService; - @inject declare currentUser: CurrentUserService; - @inject declare api: ApiService; + @service + declare currentUser: CurrentUserService; + @service + declare api: ApiService; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/controllers/example-2.ts b/tests/fixtures/my-app/output/app/controllers/example-2.ts index 7eeddc8..fcb4ccb 100644 --- a/tests/fixtures/my-app/output/app/controllers/example-2.ts +++ b/tests/fixtures/my-app/output/app/controllers/example-2.ts @@ -1,15 +1,18 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; -import { inject } from '@ember/service'; +import { service } from '@ember/service'; import type ApiService from '../services/api'; import type CurrentUserService from '../services/current-user'; import type Domain1BusinessLogicService from '../services/domain-1/business-logic'; export default class Example2Controller extends Controller { - @inject('domain-1/business-logic') declare dbl: Domain1BusinessLogicService; - @inject('current-user') declare user: CurrentUserService; - @inject('api') declare xyz: ApiService; + @service('domain-1/business-logic') + declare dbl: Domain1BusinessLogicService; + @service('current-user') + declare user: CurrentUserService; + @service('api') + declare xyz: ApiService; @action async consent(): Promise { const id = this.user.user!.id; diff --git a/tests/fixtures/my-app/output/app/controllers/example-3.ts b/tests/fixtures/my-app/output/app/controllers/example-3.ts index 1d519c0..bd77497 100644 --- a/tests/fixtures/my-app/output/app/controllers/example-3.ts +++ b/tests/fixtures/my-app/output/app/controllers/example-3.ts @@ -1,13 +1,15 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; -import { inject, type Registry as Services } from '@ember/service'; +import { service, type Registry as Services } from '@ember/service'; export default class Example3Controller extends Controller { - @inject('domain-1/business-logic') + @service('domain-1/business-logic') declare domain1BusinessLogic: Services['domain-1/business-logic']; - @inject declare currentUser: Services['current-user']; - @inject declare api: Services['api']; + @service + declare currentUser: Services['current-user']; + @service + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/controllers/example-4.ts b/tests/fixtures/my-app/output/app/controllers/example-4.ts index 1a46c6e..bf43a31 100644 --- a/tests/fixtures/my-app/output/app/controllers/example-4.ts +++ b/tests/fixtures/my-app/output/app/controllers/example-4.ts @@ -1,14 +1,16 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; import type { Registry as Services } from '@ember/service'; -import { inject } from '@ember/service'; +import { service } from '@ember/service'; export default class Example4Controller extends Controller { - @inject('domain-1/business-logic') - private declare readonly domain1BusinessLogic: Services['domain-1/business-logic']; + @service('domain-1/business-logic') + declare domain1BusinessLogic: Services['domain-1/business-logic']; - @inject private declare readonly currentUser: Services['current-user']; - @inject private declare readonly api: Services['api']; + @service + declare currentUser: Services['current-user']; + @service + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/controllers/example-5.js b/tests/fixtures/my-app/output/app/controllers/example-5.js index e17b8b4..af0246b 100644 --- a/tests/fixtures/my-app/output/app/controllers/example-5.js +++ b/tests/fixtures/my-app/output/app/controllers/example-5.js @@ -1,11 +1,11 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; -import { inject } from '@ember/service'; +import { service } from '@ember/service'; export default class Example5Controller extends Controller { - @inject('domain-1/business-logic') domain1BusinessLogic; - @inject currentUser; - @inject api; + @service('domain-1/business-logic') domain1BusinessLogic; + @service currentUser; + @service api; @action async consent() { const id = this.currentUser.user.id; diff --git a/tests/fixtures/my-app/output/app/routes/example-1.ts b/tests/fixtures/my-app/output/app/routes/example-1.ts index 4bac847..b6a1561 100644 --- a/tests/fixtures/my-app/output/app/routes/example-1.ts +++ b/tests/fixtures/my-app/output/app/routes/example-1.ts @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; export default Route.extend({ api: service(), diff --git a/tests/fixtures/my-app/output/app/routes/example-2.ts b/tests/fixtures/my-app/output/app/routes/example-2.ts index 438478d..b6a1561 100644 --- a/tests/fixtures/my-app/output/app/routes/example-2.ts +++ b/tests/fixtures/my-app/output/app/routes/example-2.ts @@ -1,9 +1,9 @@ import Route from '@ember/routing/route'; -import { inject } from '@ember/service'; +import { service } from '@ember/service'; export default Route.extend({ - api: inject(), - currentUser: inject('current-user'), + api: service(), + currentUser: service('current-user'), async model() { await this.currentUser.fetchUser(); diff --git a/tests/fixtures/my-app/output/app/routes/example-4.ts b/tests/fixtures/my-app/output/app/routes/example-4.ts index 4dbae05..5c1e4b5 100644 --- a/tests/fixtures/my-app/output/app/routes/example-4.ts +++ b/tests/fixtures/my-app/output/app/routes/example-4.ts @@ -1,9 +1,9 @@ import Route from '@ember/routing/route'; -import { inject as s } from '@ember/service'; +import { service } from '@ember/service'; export default Route.extend({ - xyz: s('api'), - user: s('current-user'), + xyz: service('api'), + user: service('current-user'), async model() { await this.user.fetchUser(); diff --git a/tests/fixtures/my-app/output/app/routes/example-5.ts b/tests/fixtures/my-app/output/app/routes/example-5.ts index 6fafa51..5c1e4b5 100644 --- a/tests/fixtures/my-app/output/app/routes/example-5.ts +++ b/tests/fixtures/my-app/output/app/routes/example-5.ts @@ -1,9 +1,9 @@ import Route from '@ember/routing/route'; -import { service as s } from '@ember/service'; +import { service } from '@ember/service'; export default Route.extend({ - xyz: s('api'), - user: s('current-user'), + xyz: service('api'), + user: service('current-user'), async model() { await this.user.fetchUser(); diff --git a/tests/fixtures/my-app/output/app/services/current-user.ts b/tests/fixtures/my-app/output/app/services/current-user.ts index 4119427..249a2b5 100644 --- a/tests/fixtures/my-app/output/app/services/current-user.ts +++ b/tests/fixtures/my-app/output/app/services/current-user.ts @@ -1,6 +1,6 @@ import { action } from '@ember/object'; import Service, { - inject as service, + service, type Registry as Services, } from '@ember/service'; import { tracked } from '@glimmer/tracking'; @@ -11,7 +11,8 @@ type User = { }; export default class CurrentUserService extends Service { - @service declare api: Services['api']; + @service + declare api: Services['api']; @tracked user?: User; diff --git a/tests/fixtures/my-app/output/app/services/domain-1/business-logic.ts b/tests/fixtures/my-app/output/app/services/domain-1/business-logic.ts index c791968..0f19e0a 100644 --- a/tests/fixtures/my-app/output/app/services/domain-1/business-logic.ts +++ b/tests/fixtures/my-app/output/app/services/domain-1/business-logic.ts @@ -1,9 +1,10 @@ -import Service, { inject } from '@ember/service'; +import Service, { service } from '@ember/service'; import type CurrentUserService from '../current-user'; export default class Domain1BusinessLogicService extends Service { - @inject declare currentUser: CurrentUserService; + @service + declare currentUser: CurrentUserService; get message(): string | undefined { const { user } = this.currentUser; diff --git a/tests/fixtures/my-app/output/app/utils/example-1.ts b/tests/fixtures/my-app/output/app/utils/example-1.ts index 01c90bc..bf9dbee 100644 --- a/tests/fixtures/my-app/output/app/utils/example-1.ts +++ b/tests/fixtures/my-app/output/app/utils/example-1.ts @@ -9,8 +9,10 @@ export default class Example1Utility { @service('domain-1/business-logic') declare domain1BusinessLogic: Domain1BusinessLogicService; - @service declare currentUser: CurrentUserService; - @service declare api: ApiService; + @service + declare currentUser: CurrentUserService; + @service + declare api: ApiService; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/utils/example-2.ts b/tests/fixtures/my-app/output/app/utils/example-2.ts index d841508..49d46d9 100644 --- a/tests/fixtures/my-app/output/app/utils/example-2.ts +++ b/tests/fixtures/my-app/output/app/utils/example-2.ts @@ -5,8 +5,10 @@ export default class Example2Utility { @service('domain-1/business-logic') declare dbl: Services['domain-1/business-logic']; - @service('current-user') declare user: Services['current-user']; - @service('api') declare xyz: Services['api']; + @service('current-user') + declare user: Services['current-user']; + @service('api') + declare xyz: Services['api']; @action async consent(): Promise { const id = this.user.user!.id; diff --git a/tests/fixtures/my-app/output/app/utils/example-3.ts b/tests/fixtures/my-app/output/app/utils/example-3.ts index f3f36d8..b789409 100644 --- a/tests/fixtures/my-app/output/app/utils/example-3.ts +++ b/tests/fixtures/my-app/output/app/utils/example-3.ts @@ -1,16 +1,18 @@ import { action } from '@ember/object'; -import { inject as s } from '@ember/service'; +import { service } from '@ember/service'; import type ApiService from '../services/api'; import type CurrentUserService from '../services/current-user'; import type Domain1BusinessLogicService from '../services/domain-1/business-logic'; export default class Example3Utility { - @s('domain-1/business-logic') + @service('domain-1/business-logic') declare domain1BusinessLogic: Domain1BusinessLogicService; - @s declare currentUser: CurrentUserService; - @s declare api: ApiService; + @service + declare currentUser: CurrentUserService; + @service + declare api: ApiService; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-app/output/app/utils/example-4.ts b/tests/fixtures/my-app/output/app/utils/example-4.ts index 952e89b..a739aeb 100644 --- a/tests/fixtures/my-app/output/app/utils/example-4.ts +++ b/tests/fixtures/my-app/output/app/utils/example-4.ts @@ -1,13 +1,15 @@ import { action } from '@ember/object'; import type { Registry as Services } from '@ember/service'; -import { service as s } from '@ember/service'; +import { service } from '@ember/service'; export default class Example4Utility { - @s('domain-1/business-logic') + @service('domain-1/business-logic') declare domain1BusinessLogic: Services['domain-1/business-logic']; - @s('current-user') declare currentUser: Services['current-user']; - @s('api') declare api: Services['api']; + @service('current-user') + declare currentUser: Services['current-user']; + @service('api') + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-v1-addon/output/addon/components/example-1.ts b/tests/fixtures/my-v1-addon/output/addon/components/example-1.ts index 0266eb6..013cf7e 100644 --- a/tests/fixtures/my-v1-addon/output/addon/components/example-1.ts +++ b/tests/fixtures/my-v1-addon/output/addon/components/example-1.ts @@ -1,5 +1,5 @@ import { action } from '@ember/object'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; import type ApiService from '../services/api'; @@ -10,8 +10,10 @@ export default class Example1Component extends Component { @service('domain-1/business-logic') declare domain1BusinessLogic: Domain1BusinessLogicService; - @service declare currentUser: CurrentUserService; - @service declare api: ApiService; + @service + declare currentUser: CurrentUserService; + @service + declare api: ApiService; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-v1-addon/output/addon/components/example-7.js b/tests/fixtures/my-v1-addon/output/addon/components/example-7.js index c47a7a4..79fdf24 100644 --- a/tests/fixtures/my-v1-addon/output/addon/components/example-7.js +++ b/tests/fixtures/my-v1-addon/output/addon/components/example-7.js @@ -1,5 +1,5 @@ import Component from '@ember/component'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; export default Component.extend({ domain1BusinessLogic: service('domain-1/business-logic'), diff --git a/tests/fixtures/my-v1-addon/output/addon/services/current-user.ts b/tests/fixtures/my-v1-addon/output/addon/services/current-user.ts index 4119427..249a2b5 100644 --- a/tests/fixtures/my-v1-addon/output/addon/services/current-user.ts +++ b/tests/fixtures/my-v1-addon/output/addon/services/current-user.ts @@ -1,6 +1,6 @@ import { action } from '@ember/object'; import Service, { - inject as service, + service, type Registry as Services, } from '@ember/service'; import { tracked } from '@glimmer/tracking'; @@ -11,7 +11,8 @@ type User = { }; export default class CurrentUserService extends Service { - @service declare api: Services['api']; + @service + declare api: Services['api']; @tracked user?: User; diff --git a/tests/fixtures/my-v1-addon/output/addon/services/domain-1/business-logic.ts b/tests/fixtures/my-v1-addon/output/addon/services/domain-1/business-logic.ts index c791968..0f19e0a 100644 --- a/tests/fixtures/my-v1-addon/output/addon/services/domain-1/business-logic.ts +++ b/tests/fixtures/my-v1-addon/output/addon/services/domain-1/business-logic.ts @@ -1,9 +1,10 @@ -import Service, { inject } from '@ember/service'; +import Service, { service } from '@ember/service'; import type CurrentUserService from '../current-user'; export default class Domain1BusinessLogicService extends Service { - @inject declare currentUser: CurrentUserService; + @service + declare currentUser: CurrentUserService; get message(): string | undefined { const { user } = this.currentUser; diff --git a/tests/fixtures/my-v1-addon/output/tests/dummy/app/components/example-3.ts b/tests/fixtures/my-v1-addon/output/tests/dummy/app/components/example-3.ts index 8533be6..4cf3783 100644 --- a/tests/fixtures/my-v1-addon/output/tests/dummy/app/components/example-3.ts +++ b/tests/fixtures/my-v1-addon/output/tests/dummy/app/components/example-3.ts @@ -1,13 +1,15 @@ import { action } from '@ember/object'; -import { inject as service, type Registry as Services } from '@ember/service'; +import { service, type Registry as Services } from '@ember/service'; import Component from '@glimmer/component'; export default class Example3Component extends Component { @service('domain-1/business-logic') declare domain1BusinessLogic: Services['domain-1/business-logic']; - @service declare currentUser: Services['current-user']; - @service declare api: Services['api']; + @service + declare currentUser: Services['current-user']; + @service + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-v2-addon/output/src/components/example-1.ts b/tests/fixtures/my-v2-addon/output/src/components/example-1.ts index 0266eb6..013cf7e 100644 --- a/tests/fixtures/my-v2-addon/output/src/components/example-1.ts +++ b/tests/fixtures/my-v2-addon/output/src/components/example-1.ts @@ -1,5 +1,5 @@ import { action } from '@ember/object'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; import type ApiService from '../services/api'; @@ -10,8 +10,10 @@ export default class Example1Component extends Component { @service('domain-1/business-logic') declare domain1BusinessLogic: Domain1BusinessLogicService; - @service declare currentUser: CurrentUserService; - @service declare api: ApiService; + @service + declare currentUser: CurrentUserService; + @service + declare api: ApiService; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-v2-addon/output/src/components/example-3.ts b/tests/fixtures/my-v2-addon/output/src/components/example-3.ts index 8533be6..4cf3783 100644 --- a/tests/fixtures/my-v2-addon/output/src/components/example-3.ts +++ b/tests/fixtures/my-v2-addon/output/src/components/example-3.ts @@ -1,13 +1,15 @@ import { action } from '@ember/object'; -import { inject as service, type Registry as Services } from '@ember/service'; +import { service, type Registry as Services } from '@ember/service'; import Component from '@glimmer/component'; export default class Example3Component extends Component { @service('domain-1/business-logic') declare domain1BusinessLogic: Services['domain-1/business-logic']; - @service declare currentUser: Services['current-user']; - @service declare api: Services['api']; + @service + declare currentUser: Services['current-user']; + @service + declare api: Services['api']; @action async consent(): Promise { const id = this.currentUser.user!.id; diff --git a/tests/fixtures/my-v2-addon/output/src/components/example-7.js b/tests/fixtures/my-v2-addon/output/src/components/example-7.js index c47a7a4..79fdf24 100644 --- a/tests/fixtures/my-v2-addon/output/src/components/example-7.js +++ b/tests/fixtures/my-v2-addon/output/src/components/example-7.js @@ -1,5 +1,5 @@ import Component from '@ember/component'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; export default Component.extend({ domain1BusinessLogic: service('domain-1/business-logic'), diff --git a/tests/fixtures/my-v2-addon/output/src/services/current-user.ts b/tests/fixtures/my-v2-addon/output/src/services/current-user.ts index 4119427..249a2b5 100644 --- a/tests/fixtures/my-v2-addon/output/src/services/current-user.ts +++ b/tests/fixtures/my-v2-addon/output/src/services/current-user.ts @@ -1,6 +1,6 @@ import { action } from '@ember/object'; import Service, { - inject as service, + service, type Registry as Services, } from '@ember/service'; import { tracked } from '@glimmer/tracking'; @@ -11,7 +11,8 @@ type User = { }; export default class CurrentUserService extends Service { - @service declare api: Services['api']; + @service + declare api: Services['api']; @tracked user?: User; diff --git a/tests/fixtures/my-v2-addon/output/src/services/domain-1/business-logic.ts b/tests/fixtures/my-v2-addon/output/src/services/domain-1/business-logic.ts index c791968..0f19e0a 100644 --- a/tests/fixtures/my-v2-addon/output/src/services/domain-1/business-logic.ts +++ b/tests/fixtures/my-v2-addon/output/src/services/domain-1/business-logic.ts @@ -1,9 +1,10 @@ -import Service, { inject } from '@ember/service'; +import Service, { service } from '@ember/service'; import type CurrentUserService from '../current-user'; export default class Domain1BusinessLogicService extends Service { - @inject declare currentUser: CurrentUserService; + @service + declare currentUser: CurrentUserService; get message(): string | undefined { const { user } = this.currentUser;