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 261a40b commit 8bc3af7
Show file tree
Hide file tree
Showing 32 changed files with 131 additions and 89 deletions.
8 changes: 5 additions & 3 deletions tests/fixtures/my-app/output/app/components/example-1.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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
11 changes: 7 additions & 4 deletions tests/fixtures/my-app/output/app/components/example-2.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
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';
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
8 changes: 5 additions & 3 deletions tests/fixtures/my-app/output/app/components/example-3.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
10 changes: 6 additions & 4 deletions tests/fixtures/my-app/output/app/components/example-4.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/my-app/output/app/components/example-5.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
10 changes: 6 additions & 4 deletions tests/fixtures/my-app/output/app/components/example-6.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/my-app/output/app/components/example-7.js
Original file line number Diff line number Diff line change
@@ -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'),
Expand Down
10 changes: 6 additions & 4 deletions tests/fixtures/my-app/output/app/controllers/example-1.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
11 changes: 7 additions & 4 deletions tests/fixtures/my-app/output/app/controllers/example-2.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.user.user!.id;
Expand Down
10 changes: 6 additions & 4 deletions tests/fixtures/my-app/output/app/controllers/example-3.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
12 changes: 7 additions & 5 deletions tests/fixtures/my-app/output/app/controllers/example-4.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/my-app/output/app/controllers/example-5.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/my-app/output/app/routes/example-1.ts
Original file line number Diff line number Diff line change
@@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/my-app/output/app/routes/example-2.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/my-app/output/app/routes/example-4.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/my-app/output/app/routes/example-5.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/my-app/output/app/services/current-user.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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
@@ -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;
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
10 changes: 6 additions & 4 deletions tests/fixtures/my-app/output/app/utils/example-3.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
10 changes: 6 additions & 4 deletions tests/fixtures/my-app/output/app/utils/example-4.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const id = this.currentUser.user!.id;
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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
@@ -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'),
Expand Down
Loading

0 comments on commit 8bc3af7

Please sign in to comment.