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/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
with:
ref: ${{ github.base_ref }}
- uses: actions/checkout@v2
- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
- run: npm ci
- run: npm run build
- run: npm run test
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ testem.log
Thumbs.db

.angular

.nx/cache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/dist
/coverage
.angular

/.nx/cache
7 changes: 2 additions & 5 deletions apps/examples-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/examples-e2e/**/*.{js,ts}"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
22 changes: 6 additions & 16 deletions apps/examples/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,29 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "examples:build:production"
"buildTarget": "examples:build:production"
},
"development": {
"browserTarget": "examples:build:development"
"buildTarget": "examples:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "examples:build"
"buildTarget": "examples:build"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/examples/**/*.ts", "apps/examples/**/*.html"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/examples/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
"jestConfig": "apps/examples/jest.config.ts"
}
},
"serve-static": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Brewery } from '../model/brewery';
import { RandomBreweryService } from '../random-brewery.service';
import * as angularCore from '@angular/core';

jest.mock('@angular/core');

describe('BasicSmartComponent', () => {
function createComponent(): {
component: BasicSmartComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
} from 'ngx-http-request-state';
import { HttpErrorResponse } from '@angular/common/http';

jest.mock('@angular/core');

describe('MultipleSourcesContainerComponent', () => {
function setup(): {
component: MultipleSourcesContainerComponent;
Expand Down
17 changes: 17 additions & 0 deletions libs/ngx-http-request-state/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": "package.json",
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"ignoredDependencies": ["tslib"],
"ignoredFiles": [
"**/jest.config.ts",
"**/test-setup.ts",
"**/*.spec.ts"
]
}
]
}
},
{
"files": ["*.ts"],
"rules": {
Expand Down
21 changes: 21 additions & 0 deletions libs/ngx-http-request-state/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 David Scourfield

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 2 additions & 1 deletion libs/ngx-http-request-state/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ support its development:

## Versions

Version `^3.0.0` supports Angular 14, 15 & 16.
Version `^3.1.0` supports Angular 14 - 17.
Version `3.0.0` supports Angular 14, 15 & 16.
Version `^2.1.0` supports Angular 14 & 15.
Version `1.2.0` supports Angular 8 to 13.
Angular versions 7 and earlier are not supported.
Expand Down
3 changes: 2 additions & 1 deletion libs/ngx-http-request-state/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"dest": "../../dist/libs/ngx-http-request-state",
"lib": {
"entryFile": "src/index.ts"
}
},
"assets": ["LICENSE"]
}
5 changes: 2 additions & 3 deletions libs/ngx-http-request-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"loading",
"error"
],
"version": "3.0.0",
"version": "3.1.0",
"peerDependencies": {
"rxjs": "^6.2.0 || ^7.4.0",
"@angular/common": "^14.2.10 || ^15.0.1 || ^16.0.0",
"@angular/core": "^14.2.10 || ^15.0.1 || ^16.0.0"
"@angular/common": "^14.2.10 || ^15.0.1 || ^16.0.0 || ^17.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
Expand Down
20 changes: 3 additions & 17 deletions libs/ngx-http-request-state/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {
"project": "libs/ngx-http-request-state/ng-package.json",
"updateBuildableProjectDepsInPackageJson": false
"project": "libs/ngx-http-request-state/ng-package.json"
},
"configurations": {
"production": {
Expand All @@ -24,27 +23,14 @@
"defaultConfiguration": "production"
},
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/ngx-http-request-state/src/**/*.ts",
"libs/ngx-http-request-state/src/**/*.html"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/ngx-http-request-state/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
"jestConfig": "libs/ngx-http-request-state/jest.config.ts"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions libs/ngx-http-request-state/src/lib/builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { HttpErrorResponse } from '@angular/common/http';
*
* @param value may be provided to indicate the previously-loaded, or last-known, state
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const loadingState = <T = any>(value?: T): LoadingState<T> => ({
isLoading: true,
value,
Expand All @@ -29,6 +30,7 @@ export const loadedState = <T>(value: T): LoadedState<T> => ({
* @param error
* @param value may be provided to indicate the previously-loaded, or last-known, state
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const errorState = <T = any>(
error: HttpErrorResponse | Error,
value?: T
Expand Down
36 changes: 21 additions & 15 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
"affected": {
"defaultBase": "origin/main"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"]
}
}
},
"generators": {
"@nx/angular:application": {
"style": "css",
Expand All @@ -29,21 +21,34 @@
},
"targetDefaults": {
"e2e": {
"inputs": ["default", "^production"]
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"inputs": ["default", "^production"],
"cache": true
},
"lint": {
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/.eslintignore"
]
],
"cache": true
},
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
"inputs": ["production", "^production"],
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"namedInputs": {
Expand All @@ -53,7 +58,8 @@
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/.eslintrc.json"
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/src/test-setup.[jt]s"
],
"sharedGlobals": []
}
Expand Down
Loading