Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce @ngrx/operators package #4097

Merged
merged 11 commits into from
Oct 26, 2023
Merged
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ The following is the list of supported scopes:
- **entity**
- **eslint-plugin**
- **example**
- **operators**
- **router-store**
- **schematics**
- **signals**
Expand Down
2 changes: 2 additions & 0 deletions build/publish-latest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export async function publishLatestToNpm() {
'schematics',
'eslint-plugin',
'data',
'signals',
'operators',
brandonroberts marked this conversation as resolved.
Show resolved Hide resolved
];

for (let pkg of publishablePackages) {
Expand Down
2 changes: 2 additions & 0 deletions build/publish-next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export async function publishNextToNpm() {
'schematics',
'eslint-plugin',
'data',
'signals',
'operators',
];

for (let pkg of publishablePackages) {
Expand Down
1 change: 1 addition & 0 deletions modules/component-store/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/modules/component-store",
"assets": ["migrations/**/*.json", "schematics/**/*.json", "**/files/**/*"],
"allowedNonPeerDependencies": ["@ngrx/operators"],
"lib": {
"entryFile": "index.ts"
}
Expand Down
5 changes: 3 additions & 2 deletions modules/component-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngrx/component-store",
"version": "16.3.0",
"version": "17.0.0-beta.0",
"description": "Reactive store for component state",
"repository": {
"type": "git",
Expand All @@ -22,7 +22,7 @@
},
"homepage": "https://github.com/ngrx/platform#readme",
"peerDependencies": {
"@angular/core": "^16.0.0",
"@angular/core": "^17.0.0-rc.0",
"rxjs": "^6.5.3 || ^7.5.0"
},
"schematics": "./schematics/collection.json",
Expand All @@ -43,6 +43,7 @@
"migrations": "./migrations/migration.json"
},
"dependencies": {
"@ngrx/operators": "17.0.0-beta.0",
"tslib": "^2.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const platformVersion = '^16.3.0';
export const platformVersion = '^17.0.0-beta.0';
1 change: 1 addition & 0 deletions modules/component-store/spec/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export const compilerOptions = () => ({
experimentalDecorators: true,
paths: {
'@ngrx/component-store': ['./modules/component-store'],
'@ngrx/operators': ['./modules/operators'],
},
});
2 changes: 1 addition & 1 deletion modules/component-store/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './component-store';
export * from './tap-response';
export { tapResponse } from '@ngrx/operators';
export {
provideComponentStore,
OnStateInit,
Expand Down
4 changes: 3 additions & 1 deletion modules/component-store/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"noImplicitReturns": true,
"downlevelIteration": true,
"outDir": "../../dist/modules/component-store",
"paths": {},
"paths": {
"@ngrx/operators": ["./dist/modules/operators"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
Expand Down
6 changes: 3 additions & 3 deletions modules/component/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngrx/component",
"version": "16.3.0",
"version": "17.0.0-beta.0",
"description": "Reactive Extensions for Angular Components",
"repository": {
"type": "git",
Expand All @@ -20,8 +20,8 @@
},
"homepage": "https://github.com/ngrx/platform#readme",
"peerDependencies": {
"@angular/common": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/common": "^17.0.0-rc.0",
"@angular/core": "^17.0.0-rc.0",
"rxjs": "^6.5.3 || ^7.5.0"
},
"schematics": "./schematics/collection.json",
Expand Down
2 changes: 1 addition & 1 deletion modules/component/schematics-core/utility/libs-version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const platformVersion = '^16.3.0';
export const platformVersion = '^17.0.0-beta.0';
12 changes: 6 additions & 6 deletions modules/data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngrx/data",
"version": "16.3.0",
"version": "17.0.0-beta.0",
"description": "API management for NgRx",
"repository": {
"type": "git",
Expand All @@ -20,11 +20,11 @@
},
"homepage": "https://github.com/ngrx/platform#readme",
"peerDependencies": {
"@angular/common": "^16.0.0",
"@angular/core": "^16.0.0",
"@ngrx/store": "16.3.0",
"@ngrx/effects": "16.3.0",
"@ngrx/entity": "16.3.0",
"@angular/common": "^17.0.0-rc.0",
"@angular/core": "^17.0.0-rc.0",
"@ngrx/store": "17.0.0-beta.0",
"@ngrx/effects": "17.0.0-beta.0",
"@ngrx/entity": "17.0.0-beta.0",
"rxjs": "^6.5.3 || ^7.5.0"
},
"schematics": "./schematics/collection.json",
Expand Down
2 changes: 1 addition & 1 deletion modules/data/schematics-core/utility/libs-version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const platformVersion = '^16.3.0';
export const platformVersion = '^17.0.0-beta.0';
1 change: 1 addition & 0 deletions modules/effects/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/modules/effects",
"assets": ["migrations/**/*.json", "schematics/**/*.json", "**/files/**/*"],
"allowedNonPeerDependencies": ["@ngrx/operators"],
"lib": {
"entryFile": "index.ts"
}
Expand Down
7 changes: 4 additions & 3 deletions modules/effects/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngrx/effects",
"version": "16.3.0",
"version": "17.0.0-beta.0",
"description": "Side effect model for @ngrx/store",
"repository": {
"type": "git",
Expand All @@ -21,8 +21,8 @@
},
"homepage": "https://github.com/ngrx/platform#readme",
"peerDependencies": {
"@angular/core": "^16.0.0",
"@ngrx/store": "16.3.0",
"@angular/core": "^17.0.0-rc.0",
"@ngrx/store": "17.0.0-beta.0",
"rxjs": "^6.5.3 || ^7.5.0"
},
"schematics": "./schematics/collection.json",
Expand All @@ -43,6 +43,7 @@
},
"sideEffects": false,
"dependencies": {
"@ngrx/operators": "17.0.0-beta.0",
"tslib": "^2.0.0"
}
}
2 changes: 1 addition & 1 deletion modules/effects/schematics-core/utility/libs-version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const platformVersion = '^16.3.0';
export const platformVersion = '^17.0.0-beta.0';
1 change: 1 addition & 0 deletions modules/effects/spec/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const compilerOptions = () => ({
paths: {
'@ngrx/store': ['./modules/store'],
'@ngrx/effects': ['./modules/effects'],
'@ngrx/operators': ['./modules/operators'],
rxjs: ['../npm/node_modules/rxjs', './node_modules/rxjs'],
},
});
2 changes: 1 addition & 1 deletion modules/effects/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export {
OnInitEffects,
} from './lifecycle_hooks';
export { USER_PROVIDED_EFFECTS } from './tokens';
export { concatLatestFrom } from './concat_latest_from';
export { concatLatestFrom } from '@ngrx/operators';
export { provideEffects } from './provide_effects';
4 changes: 3 additions & 1 deletion modules/effects/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"noImplicitReturns": true,
"downlevelIteration": true,
"outDir": "../../dist/modules/effects",
"paths": {},
"paths": {
"@ngrx/operators": ["./dist/modules/operators"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
Expand Down
6 changes: 3 additions & 3 deletions modules/entity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngrx/entity",
"version": "16.3.0",
"version": "17.0.0-beta.0",
"description": "Common utilities for entity reducers",
"repository": {
"type": "git",
Expand All @@ -20,8 +20,8 @@
},
"homepage": "https://github.com/ngrx/platform#readme",
"peerDependencies": {
"@angular/core": "^16.0.0",
"@ngrx/store": "16.3.0",
"@angular/core": "^17.0.0-rc.0",
"@ngrx/store": "17.0.0-beta.0",
"rxjs": "^6.5.3 || ^7.5.0"
},
"schematics": "./schematics/collection.json",
Expand Down
2 changes: 1 addition & 1 deletion modules/entity/schematics-core/utility/libs-version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const platformVersion = '^16.3.0';
export const platformVersion = '^17.0.0-beta.0';
2 changes: 1 addition & 1 deletion modules/eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngrx/eslint-plugin",
"version": "16.3.0",
"version": "17.0.0-beta.0",
"description": "NgRx ESLint Plugin",
"repository": {
"type": "git",
Expand Down
26 changes: 26 additions & 0 deletions modules/operators/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "schematics-core"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"parserOptions": {
"project": ["modules/operators/tsconfig.*?.json"]
},
"rules": {
"@angular-eslint/directive-selector": "off",
"@angular-eslint/component-selector": "off"
},
"plugins": ["@typescript-eslint"]
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
}
3 changes: 3 additions & 0 deletions modules/operators/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Change Log

See [CHANGELOG.md](https://github.com/ngrx/platform/blob/main/CHANGELOG.md)
3 changes: 3 additions & 0 deletions modules/operators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @ngrx/operators

The sources for this package are in the main [NgRx](https://github.com/ngrx/platform) repo. Please file issues and pull requests against that repo.
7 changes: 7 additions & 0 deletions modules/operators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* DO NOT EDIT
*
* This file is automatically generated at build
*/

export * from './public_api';
22 changes: 22 additions & 0 deletions modules/operators/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'Operators',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/modules/operators',
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
4 changes: 4 additions & 0 deletions modules/operators/migrations/migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {}
}
8 changes: 8 additions & 0 deletions modules/operators/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/modules/operators",
"assets": ["migrations/**/*.json", "schematics/**/*.json", "**/files/**/*"],
"lib": {
"entryFile": "index.ts"
}
}
45 changes: 45 additions & 0 deletions modules/operators/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@ngrx/operators",
"version": "17.0.0-beta.0",
"description": "Shared RxJS Operators for NgRx libraries",
"repository": {
"type": "git",
"url": "https://github.com/ngrx/platform.git"
},
"keywords": [
"Angular",
"NgRx",
"RxJS",
"Operators",
"State Management"
],
"author": "NgRx",
"license": "MIT",
"bugs": {
"url": "https://github.com/ngrx/platform/issues"
},
"homepage": "https://github.com/ngrx/platform#readme",
"peerDependencies": {
"rxjs": "^6.5.3 || ^7.4.0"
},
"schematics": "./schematics/collection.json",
"sideEffects": false,
"ng-update": {
"packageGroup": [
"@ngrx/store",
"@ngrx/effects",
"@ngrx/entity",
"@ngrx/router-store",
"@ngrx/data",
"@ngrx/schematics",
"@ngrx/store-devtools",
"@ngrx/component-store",
"@ngrx/component",
"@ngrx/eslint-plugin"
brandonroberts marked this conversation as resolved.
Show resolved Hide resolved
],
"migrations": "./migrations/migration.json"
},
"dependencies": {
"tslib": "^2.3.0"
}
}
Loading