@eui/cli 18.0.1 → 18.0.2-snapshot-1718177856730

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 18.0.1
1
+ 18.0.2-snapshot-1718177856730
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "18.0.1",
3
+ "version": "18.0.2-snapshot-1718177856730",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "private": true,
22
22
  "dependencies": {
23
- "@eui/deps-base": "18.0.1"
23
+ "@eui/deps-base": "18.0.2-snapshot-1718177856730"
24
24
  },
25
25
  "resolutions": {
26
26
  "js-yaml": ">=3.13.1",
@@ -1,10 +1,12 @@
1
1
  import {TestBed} from '@angular/core/testing';
2
- import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
2
+ import { HttpTestingController, provideHttpClientTesting } from "@angular/common/http/testing";
3
3
  import {CONFIG_TOKEN, I18nService, UserService} from '@eui/core';
4
4
  import {EuiAppConfig} from '@eui/core';
5
5
  import {of} from 'rxjs';
6
6
  import {AppStarterService} from './app-starter.service';
7
7
  import SpyObj = jasmine.SpyObj;
8
+ import { EuiServiceStatus } from '@eui/base';
9
+ import { provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
8
10
 
9
11
  describe('AppStarterService', () => {
10
12
  let service: AppStarterService;
@@ -19,8 +21,9 @@ describe('AppStarterService', () => {
19
21
  configMock = {global: {}, modules: {core: {base: 'localhost:3000', userDetails: 'dummy'}}};
20
22
 
21
23
  TestBed.configureTestingModule({
22
- imports: [HttpClientTestingModule],
23
24
  providers: [
25
+ provideHttpClient(withInterceptorsFromDi()),
26
+ provideHttpClientTesting(),
24
27
  AppStarterService,
25
28
  {provide: UserService, useValue: userServiceMock},
26
29
  {provide: I18nService, useValue: i18nServiceMock},
@@ -37,8 +40,8 @@ describe('AppStarterService', () => {
37
40
  });
38
41
 
39
42
  it('should call start method', () => {
40
- userServiceMock.init.and.returnValue(of(null));
41
- i18nServiceMock.init.and.returnValue(of(null));
43
+ userServiceMock.init.and.returnValue(of({ } as EuiServiceStatus));
44
+ i18nServiceMock.init.and.returnValue(of({ } as EuiServiceStatus));
42
45
  service.start().subscribe(() => {
43
46
  expect(userServiceMock.init).toHaveBeenCalled();
44
47
  expect(i18nServiceMock.init).toHaveBeenCalled();
@@ -46,7 +49,7 @@ describe('AppStarterService', () => {
46
49
  });
47
50
 
48
51
  it('should call initUserService method', () => {
49
- userServiceMock.init.and.returnValue(of(null));
52
+ userServiceMock.init.and.returnValue(of({ } as EuiServiceStatus));
50
53
  service.initUserService().subscribe(() => {
51
54
  expect(userServiceMock.init).toHaveBeenCalled();
52
55
  });
@@ -58,7 +61,7 @@ describe('AppStarterService', () => {
58
61
  expect(userDetails).toEqual(dummyUserDetails);
59
62
  });
60
63
 
61
- const req = httpMock.expectOne(`${configMock.modules.core.base}${configMock.modules.core.userDetails}`);
64
+ const req = httpMock.expectOne(`${configMock.modules?.['core']['base']}${configMock.modules?.['core']['userDetails']}`);
62
65
  expect(req.request.method).toBe('GET');
63
66
  req.flush(dummyUserDetails);
64
67
  });
@@ -1,15 +1,13 @@
1
1
  import { Inject, Injectable } from '@angular/core';
2
+ import { HttpClient } from '@angular/common/http';
2
3
  import {
3
4
  CONFIG_TOKEN,
4
5
  UserService,
5
6
  I18nService,
6
- } from '@eui/core';
7
- import {
8
7
  EuiAppConfig,
9
8
  UserDetails,
10
9
  UserPreferences,
11
10
  } from '@eui/core';
12
- import { HttpClient } from '@angular/common/http';
13
11
  import { Observable, of, zip } from 'rxjs';
14
12
  import { switchMap } from 'rxjs/operators';
15
13
 
@@ -17,7 +15,7 @@ import { switchMap } from 'rxjs/operators';
17
15
  providedIn: 'root',
18
16
  })
19
17
  export class AppStarterService {
20
- defaultUserPreferences: UserPreferences;
18
+ defaultUserPreferences: UserPreferences | undefined;
21
19
 
22
20
  constructor(
23
21
  protected userService: UserService,
@@ -58,8 +56,8 @@ export class AppStarterService {
58
56
  */
59
57
  private fetchUserDetails(): Observable<UserDetails> {
60
58
  // const url = this.config.modules.your_custom_module.your_custom_endpoint
61
- const moduleCoreApi = this.config.modules.core;
62
- const url = `${moduleCoreApi.base}${moduleCoreApi.userDetails}`;
59
+ const moduleCoreApi= this.config.modules?.['core'];
60
+ const url = `${moduleCoreApi?.['base']}${moduleCoreApi?.['userDetails']}`;
63
61
  const user = { userId: 'anonymous' };
64
62
 
65
63
  if (!url) {
@@ -2,9 +2,9 @@ import {ComponentFixture, TestBed} from '@angular/core/testing';
2
2
  import {RouterModule} from '@angular/router';
3
3
  import {AppComponent} from './app.component';
4
4
  import {EuiAppModule} from '@eui/components/layout';
5
- import {HttpClientTestingModule} from '@angular/common/http/testing';
6
- import {CoreModule} from "./core/core.module";
7
- import {routes} from "./app-routing.module";
5
+ import {CoreModule} from './core/core.module';
6
+ import {routes} from './app-routing.module';
7
+ import { provideHttpClientTesting } from '@angular/common/http/testing';
8
8
 
9
9
  describe('AppComponent', () => {
10
10
  let component: AppComponent;
@@ -16,7 +16,9 @@ describe('AppComponent', () => {
16
16
  RouterModule.forRoot(routes),
17
17
  CoreModule,
18
18
  EuiAppModule,
19
- HttpClientTestingModule,
19
+ ],
20
+ providers: [
21
+ provideHttpClientTesting()
20
22
  ],
21
23
  declarations: [AppComponent],
22
24
  }).compileComponents();
@@ -21,7 +21,7 @@ import { AppStarterService } from './app-starter.service';
21
21
  AppStarterService,
22
22
  {
23
23
  provide: APP_INITIALIZER,
24
- useFactory: (appStarterService) => () => new Promise<void>((resolve) => {
24
+ useFactory: (appStarterService: AppStarterService) => () => new Promise<void>((resolve) => {
25
25
  appStarterService.start().subscribe(() => resolve());
26
26
  }),
27
27
  deps: [AppStarterService],
@@ -3,7 +3,7 @@ import { TranslateModule } from '@ngx-translate/core';
3
3
  import { StoreModule } from '@ngrx/store';
4
4
  import { EffectsModule } from '@ngrx/effects';
5
5
  import { StoreDevtoolsModule } from '@ngrx/store-devtools';
6
- import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
6
+ import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
7
7
  import {
8
8
  CachePreventionInterceptor,
9
9
  CorsSecurityInterceptor,
@@ -17,10 +17,10 @@ import {
17
17
  import { EuiLayoutModule } from '@eui/components/layout';
18
18
  import { EuiUserProfileModule } from '@eui/components/eui-user-profile';
19
19
 
20
- import { appConfig } from '../../config/index';
20
+ import { appConfig } from '../../config';
21
21
  import { environment } from '../../environments/environment';
22
22
 
23
- import { REDUCER_TOKEN, getReducers, metaReducers } from './reducers/index';
23
+ import { REDUCER_TOKEN, getReducers, metaReducers } from './reducers';
24
24
 
25
25
  import { SharedModule } from '@shared/shared.module';
26
26
 
@@ -29,7 +29,6 @@ import { SharedModule } from '@shared/shared.module';
29
29
  EuiLayoutModule,
30
30
  EuiUserProfileModule,
31
31
  SharedModule,
32
- HttpClientModule,
33
32
  EuiCoreModule.forRoot(),
34
33
  EffectsModule.forRoot([...CoreModuleEffects]),
35
34
  TranslateModule.forRoot(translateConfig),
@@ -45,6 +44,7 @@ import { SharedModule } from '@shared/shared.module';
45
44
  SharedModule,
46
45
  ],
47
46
  providers: [
47
+ provideHttpClient(withInterceptorsFromDi()),
48
48
  {
49
49
  provide: REDUCER_TOKEN,
50
50
  deps: [],
@@ -1,6 +1,10 @@
1
1
  import { EuiEnvConfig } from '@eui/core';
2
2
 
3
- export const environment: EuiEnvConfig = {
3
+ interface EnvConfig extends EuiEnvConfig {
4
+ production: boolean;
5
+ }
6
+
7
+ export const environment: EnvConfig = {
4
8
  production: false,
5
9
  enableDevToolRedux: true,
6
10
  envDynamicConfig: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "18.0.1",
3
+ "version": "18.0.2-snapshot-1718177856730",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -21,7 +21,7 @@
21
21
  "private": true,
22
22
  "dependencies": {
23
23
  "@eui/deps-base": "16.2.18",
24
- "@eui/mobile-core": "16.10.0",
25
- "@eui/mobile-styles": "16.10.0"
24
+ "@eui/mobile-core": "16.10.1-snapshot-1714734024630",
25
+ "@eui/mobile-styles": "16.10.1-snapshot-1714734024630"
26
26
  }
27
27
  }
@@ -3,6 +3,7 @@ import { Store } from '@ngrx/store';
3
3
  import {
4
4
  getUserState,
5
5
  UserState,
6
+ CoreState,
6
7
  } from '@eui/core';
7
8
  import { Observable, Subscription } from 'rxjs';
8
9
 
@@ -26,7 +27,7 @@ export class AppComponent implements OnDestroy {
26
27
  isLoggedIn = false;
27
28
 
28
29
  constructor(
29
- private store: Store<UserState>,
30
+ private store: Store<CoreState>,
30
31
  ) {
31
32
  this.userState = this.store.select(getUserState);
32
33
  this.subs.push(this.userState.subscribe((user: UserState) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "18.0.1",
3
+ "version": "18.0.2-snapshot-1718177856730",
4
4
  "license": "EUPL-1.1",
5
5
  "description": "eUI JEE Symfony app scripts",
6
6
  "scripts": {
@@ -18,6 +18,6 @@
18
18
  },
19
19
  "private": true,
20
20
  "dependencies": {
21
- "@eui/deps-base": "18.0.1"
21
+ "@eui/deps-base": "18.0.2-snapshot-1718177856730"
22
22
  }
23
23
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eui/cli",
3
- "version": "18.0.1",
4
- "tag": "latest",
3
+ "version": "18.0.2-snapshot-1718177856730",
4
+ "tag": "snapshot",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI CLI app generator",
7
7
  "bin": {