Skip to content

Commit

Permalink
chore: Updated fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Apr 23, 2024
1 parent 45d5f28 commit d2ec2c8
Show file tree
Hide file tree
Showing 25 changed files with 94 additions and 49 deletions.
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/components/example-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
9 changes: 6 additions & 3 deletions tests/fixtures/my-app/output/app/components/example-2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const id = this.user.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/components/example-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ 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<void> {
const id = this.currentUser.user!.id;
Expand Down
8 changes: 5 additions & 3 deletions tests/fixtures/my-app/output/app/components/example-4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ 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<void> {
const id = this.currentUser.user!.id;
Expand Down
8 changes: 5 additions & 3 deletions tests/fixtures/my-app/output/app/components/example-7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ 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<void> {
const id = this.currentUser.user!.id;
Expand Down
8 changes: 5 additions & 3 deletions tests/fixtures/my-app/output/app/components/example-8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import type Domain1BusinessLogicService from '../services/domain-1/business-logi

export default class Example8Component extends Component {
@service('domain-1/business-logic')
public domain1BusinessLogic!: Domain1BusinessLogicService;
declare domain1BusinessLogic: Domain1BusinessLogicService;

@service public currentUser!: CurrentUserService;
@service public api!: ApiService;
@service
declare currentUser: CurrentUserService;
@service
declare api: ApiService;

@action async consent(): Promise<void> {
const id = this.currentUser.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/controllers/example-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ export default class Example1Controller extends Controller {
@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<void> {
const id = this.currentUser.user!.id;
Expand Down
9 changes: 6 additions & 3 deletions tests/fixtures/my-app/output/app/controllers/example-2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import type CurrentUserService from '../services/current-user';
import type Domain1BusinessLogicService from '../services/domain-1/business-logic';

export default class Example2Controller extends Controller {
@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<void> {
const id = this.user.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/controllers/example-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default class Example3Controller extends Controller {
@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<void> {
const id = this.currentUser.user!.id;
Expand Down
8 changes: 5 additions & 3 deletions tests/fixtures/my-app/output/app/controllers/example-4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { service } from '@ember/service';

export default class Example4Controller extends Controller {
@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<void> {
const id = this.currentUser.user!.id;
Expand Down
3 changes: 2 additions & 1 deletion tests/fixtures/my-app/output/app/services/current-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Service, { service } from '@ember/service';
import type CurrentUserService from '../current-user';

export default class Domain1BusinessLogicService extends Service {
@service declare currentUser: CurrentUserService;
@service
declare currentUser: CurrentUserService;

get message(): string | undefined {
const { user } = this.currentUser;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/utils/example-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/utils/example-2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const id = this.user.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/utils/example-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ export default class Example3Utility {
@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<void> {
const id = this.currentUser.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-app/output/app/utils/example-4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default class Example4Utility {
@service('domain-1/business-logic')
declare domain1BusinessLogic: Services['domain-1/business-logic'];

@service('current-user') declare currentUser: Services['current-user'];
@service('api') declare api: Services['api'];
@service('current-user')
declare currentUser: Services['current-user'];
@service('api')
declare api: Services['api'];

@action async consent(): Promise<void> {
const id = this.currentUser.user!.id;
Expand Down
3 changes: 2 additions & 1 deletion tests/fixtures/my-app/output/app/utils/example-6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default class Example6Utility {
private declare readonly fooBar: Services['foo/bar'];

// @ts-expect-error: Property 'quux' does not exist on type 'Registry'.
@service('quux') private declare readonly quux: Services['quux'];
@service('quux')
declare quux: Services['quux'];

get baz(): string {
return `${this.fooBar.baz} ${this.quux.baz}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Service, { service } from '@ember/service';
import type CurrentUserService from '../current-user';

export default class Domain1BusinessLogicService extends Service {
@service declare currentUser: CurrentUserService;
@service
declare currentUser: CurrentUserService;

get message(): string | undefined {
const { user } = this.currentUser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ 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<void> {
const id = this.currentUser.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-v2-addon/output/src/components/example-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/my-v2-addon/output/src/components/example-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ 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<void> {
const id = this.currentUser.user!.id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Service, { service } from '@ember/service';
import type CurrentUserService from '../current-user';

export default class Domain1BusinessLogicService extends Service {
@service declare currentUser: CurrentUserService;
@service
declare currentUser: CurrentUserService;

get message(): string | undefined {
const { user } = this.currentUser;
Expand Down

0 comments on commit d2ec2c8

Please sign in to comment.