Skip to content

Commit f92387c

Browse files
committed
release: v8.2.0-rc.0
1 parent 989d97e commit f92387c

17 files changed

+72
-248
lines changed

projects/ngx-firestore-repository/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@paddls/ngx-firestore-repository",
3-
"version": "8.1.2",
3+
"version": "8.2.0-rc.0",
44
"peerDependencies": {
55
"@angular/common": ">= 18.0.0",
66
"@angular/core": ">= 18.0.0",
7-
"@paddls/ngx-repository": "^8.0.0",
7+
"@paddls/ngx-repository": "^8.0.0 || 8.2.0-rc.0",
88
"firebase": ">= 9.9.2"
99
},
1010
"dependencies": {

projects/ngx-firestore-repository/src/e2e/util/repository-intializer.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Injectable, Type } from '@angular/core';
2-
import { InjectRepository, provideNgxRepository } from '@paddls/ngx-repository';
2+
import { InjectRepository, NgxRepositoryModule } from '@paddls/ngx-repository';
33
import { TestBed } from '@angular/core/testing';
44
import { Firestore, getFirestore } from 'firebase/firestore';
55
import { initializeApp } from 'firebase/app';
66
import { FirestoreRepository } from '../../lib/repository/firestore.repository';
7-
import { provideNgxFirestoreRepository } from '../../lib/ngx-firestore-repository.module';
7+
import { NgxFirestoreRepositoryModule } from '../../lib/ngx-firestore-repository.module';
88
import { FIRESTORE_APP } from '../../lib/ngx-firestore-repository.module.di';
99

1010
export interface RepositoryContext<T> {
@@ -35,9 +35,11 @@ export function initializeRepository<T>(bookImpl: Type<T>, providers: any[] = []
3535
}
3636

3737
TestBed.configureTestingModule({
38+
imports: [
39+
NgxRepositoryModule.forRoot(),
40+
NgxFirestoreRepositoryModule.forRoot()
41+
],
3842
providers: [
39-
provideNgxRepository(),
40-
provideNgxFirestoreRepository(),
4143
BookServiceImpl,
4244
{
4345
provide: FIRESTORE_APP,

projects/ngx-firestore-repository/src/lib/ngx-firestore-repository.module.spec.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

projects/ngx-firestore-repository/src/lib/ngx-firestore-repository.module.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'reflect-metadata';
22

3-
import { EnvironmentProviders, makeEnvironmentProviders, ModuleWithProviders, NgModule, Provider } from '@angular/core';
3+
import { ModuleWithProviders, NgModule, Provider } from '@angular/core';
44
import { FirestoreRepositoryBuilder } from './repository/firestore-repository-builder.service';
55
import { FIRESTORE_APP } from './ngx-firestore-repository.module.di';
66
import { REPOSITORY_BUILDER_TOKEN } from '@paddls/ngx-repository';
@@ -34,22 +34,6 @@ export interface NgxFirestoreRepositoryModuleConfiguration { // @TODO: RMA/TNI :
3434
debug?: boolean;
3535
}
3636

37-
export function provideNgxFirestoreRepository(config: NgxFirestoreRepositoryModuleConfiguration = {debug: false}): EnvironmentProviders {
38-
const providers: Provider[] = [
39-
...MODULE_PROVIDERS,
40-
{
41-
provide: FIRESTORE_APP,
42-
useValue: config.firestore
43-
}
44-
];
45-
46-
if (config.debug) {
47-
providers.push(LogExecuteFirestoreRequestEventListener);
48-
}
49-
50-
return makeEnvironmentProviders(providers);
51-
}
52-
5337
/**
5438
* @ignore
5539
*/
@@ -60,9 +44,6 @@ export function provideNgxFirestoreRepository(config: NgxFirestoreRepositoryModu
6044
})
6145
export class NgxFirestoreRepositoryModule {
6246

63-
/**
64-
* @deprecated The method should not be used, use provideNgxFirestoreRepository instead
65-
*/
6647
public static forRoot(config: NgxFirestoreRepositoryModuleConfiguration = {debug: false}): ModuleWithProviders<NgxFirestoreRepositoryModule> {
6748
const providers: Provider[] = [
6849
{

projects/ngx-firestore-repository/src/public-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ export { FirestoreRepositoryResponse } from './lib/response/firestore-repository
6464

6565
export { FIRESTORE_APP } from './lib/ngx-firestore-repository.module.di';
6666
export {
67-
provideNgxFirestoreRepository, NgxFirestoreRepositoryModule, NgxFirestoreRepositoryModuleConfiguration
67+
NgxFirestoreRepositoryModule, NgxFirestoreRepositoryModuleConfiguration
6868
} from './lib/ngx-firestore-repository.module';

projects/ngx-http-repository/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@paddls/ngx-http-repository",
3-
"version": "8.1.2",
3+
"version": "8.2.0-rc.0",
44
"peerDependencies": {
55
"@angular/common": ">= 18.0.0",
66
"@angular/core": ">= 18.0.0",
7-
"@paddls/ngx-repository": "^8.0.0"
7+
"@paddls/ngx-repository": "^8.0.0 || 8.2.0-rc.0"
88
},
99
"dependencies": {
1010
"tslib": "^2.0.0",

projects/ngx-http-repository/src/e2e/http-request.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { TestBed } from '@angular/core/testing';
22
import {
33
Column,
44
Id,
5+
NgxRepositoryModule,
56
NgxRepositoryService,
67
Page,
78
PageResponseProcessor,
89
PathColumn,
9-
PathParam,
10-
provideNgxRepository
10+
PathParam
1111
} from '@paddls/ngx-repository';
12-
import { provideNgxHttpRepository } from '../lib/ngx-http-repository.module';
12+
import { NgxHttpRepositoryModule } from '../lib/ngx-http-repository.module';
1313
import { Injectable } from '@angular/core';
1414
import { HttpClient } from '@angular/common/http';
1515
import { expectHttpRequest, HttpRequestTestContext } from './util/expect-http-request.spec';
@@ -193,9 +193,11 @@ describe('HttpRequestDecorator', () => {
193193

194194
beforeEach(() => {
195195
TestBed.configureTestingModule({
196+
imports: [
197+
NgxRepositoryModule.forRoot(),
198+
NgxHttpRepositoryModule.forRoot()
199+
],
196200
providers: [
197-
provideNgxRepository(),
198-
provideNgxHttpRepository(),
199201
Api
200202
]
201203
});

projects/ngx-http-repository/src/e2e/live-resource.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { TestBed } from '@angular/core/testing';
2-
import { Column, Id, InjectRepository, Page, provideNgxRepository } from '@paddls/ngx-repository';
3-
import { HttpLiveResource, HttpRepository, HttpResource } from '../public-api';
2+
import { Column, Id, InjectRepository, NgxRepositoryModule, Page } from '@paddls/ngx-repository';
3+
import { HttpLiveResource, HttpRepository, HttpResource, NgxHttpRepositoryModule } from '../public-api';
44
import { Injectable } from '@angular/core';
55
import { HttpClient } from '@angular/common/http';
66
import { of } from 'rxjs';
77
import { take, toArray } from 'rxjs/operators';
8-
import { provideNgxHttpRepository } from '../lib/ngx-http-repository.module';
98

109
describe('LiveResource', () => {
1110

@@ -39,9 +38,11 @@ describe('LiveResource', () => {
3938

4039
beforeEach(() => {
4140
TestBed.configureTestingModule({
41+
imports: [
42+
NgxRepositoryModule.forRoot(),
43+
NgxHttpRepositoryModule.forRoot()
44+
],
4245
providers: [
43-
provideNgxRepository(),
44-
provideNgxHttpRepository(),
4546
BookService
4647
]
4748
});

projects/ngx-http-repository/src/e2e/util/repository-intializer.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { HttpClient } from '@angular/common/http';
22
import { Injectable, Type } from '@angular/core';
3-
import { InjectRepository, provideNgxRepository } from '@paddls/ngx-repository';
3+
import { InjectRepository, NgxRepositoryModule } from '@paddls/ngx-repository';
44
import { HttpRepository } from '../../lib/repository/http.repository';
55
import { TestBed } from '@angular/core/testing';
6-
import { provideNgxHttpRepository } from '../../lib/ngx-http-repository.module';
6+
import { NgxHttpRepositoryModule } from '../../lib/ngx-http-repository.module';
77

88
export interface RepositoryContext<T> {
99
repository: HttpRepository<T, number>;
@@ -20,9 +20,11 @@ export function initializeRepository<T>(bookImpl: Type<T>, providers: any[] = []
2020
}
2121

2222
TestBed.configureTestingModule({
23+
imports: [
24+
NgxRepositoryModule.forRoot(),
25+
NgxHttpRepositoryModule.forRoot()
26+
],
2327
providers: [
24-
provideNgxRepository(),
25-
provideNgxHttpRepository(),
2628
BookServiceImpl,
2729
...providers
2830
]

projects/ngx-http-repository/src/e2e/util/test-http-repository.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Injectable, Type } from '@angular/core';
2-
import { InjectRepository, provideNgxRepository } from '@paddls/ngx-repository';
2+
import { InjectRepository, NgxRepositoryModule } from '@paddls/ngx-repository';
33
import { TestBed } from '@angular/core/testing';
44
import { HttpClient, HttpParams } from '@angular/common/http';
55
import { HttpRepository } from '../../lib/repository/http.repository';
6-
import { NgxHttpRepositoryModuleConfiguration } from '../../public-api';
6+
import { NgxHttpRepositoryModule, NgxHttpRepositoryModuleConfiguration } from '../../public-api';
77
import { expectHttpRequest, HttpRequestTestContext } from './expect-http-request.spec';
8-
import { provideNgxHttpRepository } from '../../lib/ngx-http-repository.module';
98
import { forOwn } from '../../lib/utils/for-own';
109

1110
export interface HttpTestContext extends HttpRequestTestContext {
@@ -57,9 +56,11 @@ export async function httpTest(httpTestContext: HttpTestContext): Promise<void>
5756
}
5857

5958
TestBed.configureTestingModule({
59+
imports: [
60+
NgxRepositoryModule.forRoot(),
61+
NgxHttpRepositoryModule.forRoot(httpTestContext.httpConfiguration || {debug: false})
62+
],
6063
providers: [
61-
provideNgxRepository(),
62-
provideNgxHttpRepository(httpTestContext.httpConfiguration || {debug: false}),
6364
...(httpTestContext.providers || []),
6465
...providers
6566
]

projects/ngx-http-repository/src/lib/ngx-http-repository.module.spec.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

projects/ngx-http-repository/src/lib/ngx-http-repository.module.ts

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'reflect-metadata';
22

3-
import { EnvironmentProviders, makeEnvironmentProviders, ModuleWithProviders, NgModule, Provider } from '@angular/core';
3+
import { ModuleWithProviders, NgModule, Provider } from '@angular/core';
44
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
55
import { REPOSITORY_BUILDER_TOKEN } from '@paddls/ngx-repository';
66
import { HttpRepositoryDriver } from './driver/http-repository.driver';
@@ -10,16 +10,15 @@ import { LogExecuteHttpRequestEventListener } from './driver/listener/log-execut
1010
import { HttpRepositoryBuilder } from './repository/http-repository.builder';
1111
import { HTTP_REPOSITORY_CONFIGURATION } from './configuration/http-repository.configuration';
1212

13-
const PROVIDERS: (Provider | EnvironmentProviders)[] = [
13+
const PROVIDERS: Provider[] = [
1414
HttpRepositoryBuilder,
1515
HttpRepositoryDriver,
1616
HttpRequestBuilder,
1717
{
1818
provide: REPOSITORY_BUILDER_TOKEN,
1919
useExisting: HttpRepositoryBuilder,
2020
multi: true
21-
},
22-
provideHttpClient(withInterceptorsFromDi())
21+
}
2322
];
2423

2524
export interface NgxHttpRepositoryModuleConfiguration {
@@ -29,35 +28,17 @@ export interface NgxHttpRepositoryModuleConfiguration {
2928
debug?: boolean;
3029
}
3130

32-
export function provideNgxHttpRepository(config: NgxHttpRepositoryModuleConfiguration = {debug: false}): EnvironmentProviders {
33-
const providers: Provider = [
34-
...PROVIDERS,
35-
{
36-
provide: HTTP_REPOSITORY_CONFIGURATION,
37-
useValue: config?.configuration || {}
38-
}
39-
];
40-
41-
if (config.debug) {
42-
providers.push(LogExecuteHttpRequestEventListener);
43-
}
44-
45-
return makeEnvironmentProviders(providers);
46-
}
47-
4831
/**
4932
* @ignore
5033
*/
5134
@NgModule({
5235
imports: [], providers: [
53-
...PROVIDERS
36+
...PROVIDERS,
37+
provideHttpClient(withInterceptorsFromDi())
5438
]
5539
})
5640
export class NgxHttpRepositoryModule {
5741

58-
/**
59-
* @deprecated The method should not be used, use provideNgxHttpRepository
60-
*/
6142
public static forRoot(config: NgxHttpRepositoryModuleConfiguration = {debug: false}): ModuleWithProviders<NgxHttpRepositoryModule> {
6243
const providers: Provider[] = [
6344
{

0 commit comments

Comments
 (0)