Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node 16
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
/.sass-cache
/connect.lock
/coverage
/.jest-cache
/libpeerconnection.log
npm-debug.log
yarn-error.log
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [2.7.0] - 2026-02-03

- Migrate to Angular 20

## [2.6.2] - 2026-01-13

- Fix error code version
Expand Down
36 changes: 21 additions & 15 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,6 @@
}
}
},
"ngx-jsonapi-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "ngx-jsonapi:serve"
}
}
}
},
"ngx-jsonapi-lib": {
"projectType": "library",
"root": "projects/ngx-jsonapi-lib",
Expand Down Expand Up @@ -126,13 +112,33 @@
"flat": true,
"skipTests": true,
"prefix": "bc",
"type": "component",
"style": "css"
},
"@schematics/angular:directive": {
"type": "directive",
"prefix": "bc"
},
"@schematics/angular:service": {
"type": "service"
},
"@schematics/angular:guard": {
"typeSeparator": "."
},
"@schematics/angular:interceptor": {
"typeSeparator": "."
},
"@schematics/angular:module": {
"typeSeparator": "."
},
"@schematics/angular:pipe": {
"typeSeparator": "."
},
"@schematics/angular:resolver": {
"typeSeparator": "."
}
},
"cli": {
"analytics": false
}
}
}
4 changes: 2 additions & 2 deletions demo/app/books/components/books.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BooksService, Book } from './../books.service';
import { AuthorsService } from './../../authors/authors.service';
import { PhotosService } from '../../photos/photos.service';
// ActivatedRoute already imported above
import { Observable } from 'rxjs';
import { Observable, lastValueFrom } from 'rxjs';

@Component({
selector: 'demo-books',
Expand Down Expand Up @@ -63,7 +63,7 @@ export class BooksComponent {
},
(error) => console.log('error books controller', error)
);
books$.toPromise().then((_success) => console.log('books loaded PROMISE'));
lastValueFrom(books$).then((_success) => console.log('books loaded PROMISE'));
}

public delete(book: Resource): void {
Expand Down
3 changes: 0 additions & 3 deletions demo/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@

// Zone.js is required by Angular itself
import 'zone.js';

// Optional: only if you need touch gesture support
// import 'hammerjs';
2 changes: 1 addition & 1 deletion demo/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"downlevelIteration": true,
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"moduleResolution": "bundler",
"experimentalDecorators": true,
"lib": ["es2017", "dom"],
"outDir": "../out-tsc/app",
Expand Down
14 changes: 0 additions & 14 deletions e2e/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/app.po.ts

This file was deleted.

18 changes: 0 additions & 18 deletions e2e/tsconfig.e2e.json

This file was deleted.

26 changes: 17 additions & 9 deletions jest.base.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
module.exports = {
preset: 'jest-preset-angular',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
transform: { '^.+.(ts|mjs|js|html)$': 'jest-preset-angular' },
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/projects/ngx-jsonapi-lib/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$'
}
]
},
moduleFileExtensions: ['ts', 'js', 'mjs', 'html', 'json'],
transformIgnorePatterns: ['node_modules/(?!(lodash-es|@angular|zone.js|ngx-jsonapi|@ngrx|@ngxs)/)'],
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$|@angular|rxjs|zone\\.js|lodash-es|dexie)'],
modulePathIgnorePatterns: ['dist'],
moduleNameMapper: {
'^lodash-es$': 'lodash',
'^ngx-jsonapi/(?!db)(.*)': '<rootDir>/projects/ngx-jsonapi-lib/src/$1'
},
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$'
}
},
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment'
]
],
// Optimizaciones de performance
maxWorkers: '50%',
cache: true,
cacheDirectory: '<rootDir>/.jest-cache',
testTimeout: 10000
};
26 changes: 7 additions & 19 deletions jest.demo.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
const baseConfig = require('./jest.base.config');

module.exports = {
...baseConfig,
roots: ['<rootDir>/demo'],
modulePaths: ['<rootDir>/dist'],
moduleNameMapper: {
'^ngx-jsonapi$': '<rootDir>/projects/ngx-jsonapi-lib/src/public_api.ts',
'^ngx-jsonapi/(.*)$': '<rootDir>/projects/ngx-jsonapi-lib/src/$1'
},
coveragePathIgnorePatterns: [
'/node_modules/',
'/src/*.*/'
],
...baseConfig,
roots: ['<rootDir>/demo'],
modulePaths: ['<rootDir>/dist'],
moduleNameMapper: {
'\\.(html)$': '<rootDir>/demo/__mocks__/htmlMock.js',
...baseConfig.moduleNameMapper,
'^ngx-jsonapi$': '<rootDir>/projects/ngx-jsonapi-lib/src/public_api.ts',
'\\.(html)$': '<rootDir>/demo/__mocks__/htmlMock.js'
},

globals: {
'ts-jest': {
tsConfigFile: 'demo/tsconfig.spec.json'
},
stringifyContentPathRegex: true
},
coveragePathIgnorePatterns: ['/node_modules/', '/src/*.*/']
};
7 changes: 0 additions & 7 deletions jest.lib.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@ module.exports = {
coveragePathIgnorePatterns: ['/node_modules/', '/demo/*.*/'],
testEnvironmentOptions: {
url: 'http://localhost/'
},
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
globals: {
'ts-jest': {
tsconfig: 'projects/ngx-jsonapi-lib/tsconfig.spec.json'
},
stringifyContentPathRegex: true
}
};
Loading