Skip to content

Commit b0d63fd

Browse files
feat(signals): initial setup (#4002)
Closes #3992
1 parent 7716e46 commit b0d63fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2901
-2
lines changed

build/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export const packages: PackageDescription[] = fs
2020
return false;
2121
}
2222

23-
if (path.includes('eslint-plugin')) {
23+
// TODO: Remove signals when released as a stable package
24+
if (path.includes('eslint-plugin') || path.includes('signals')) {
2425
return false;
2526
}
2627

build/copy-schematics-core.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const copySchematics = createBuilder([
88

99
copySchematics({
1010
scope: '@ngrx',
11-
packages,
11+
// TODO: Remove signals when released as a stable package
12+
packages: [...packages, { name: 'signals' }],
1213
}).catch((err) => {
1314
console.error(err);
1415
process.exit(1);

modules/signals/.eslintrc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*", "schematics-core"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:@nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
11+
"parserOptions": {
12+
"project": ["modules/signals/tsconfig.*?.json"]
13+
},
14+
"rules": {
15+
"@angular-eslint/directive-selector": "off",
16+
"@angular-eslint/component-selector": "off"
17+
},
18+
"plugins": ["@typescript-eslint"]
19+
},
20+
{
21+
"files": ["*.html"],
22+
"extends": ["plugin:@nx/angular-template"],
23+
"rules": {}
24+
}
25+
]
26+
}

modules/signals/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Change Log
2+
3+
See [CHANGELOG.md](https://github.com/ngrx/platform/blob/main/CHANGELOG.md)

modules/signals/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @ngrx/signals
2+
3+
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.

modules/signals/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* DO NOT EDIT
3+
*
4+
* This file is automatically generated at build
5+
*/
6+
7+
export * from './public_api';

modules/signals/jest.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'Signals',
4+
preset: '../../jest.preset.js',
5+
coverageDirectory: '../../coverage/modules/signals',
6+
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
7+
transform: {
8+
'^.+\\.(ts|mjs|js|html)$': [
9+
'jest-preset-angular',
10+
{
11+
tsconfig: '<rootDir>/tsconfig.spec.json',
12+
stringifyContentPathRegex: '\\.(html|svg)$',
13+
},
14+
],
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
],
22+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3+
"schematics": {}
4+
}

modules/signals/ng-package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/modules/signals",
4+
"assets": ["migrations/**/*.json", "schematics/**/*.json", "**/files/**/*"],
5+
"lib": {
6+
"entryFile": "index.ts"
7+
}
8+
}

modules/signals/package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@ngrx/signals",
3+
"version": "0.0.0",
4+
"description": "Reactive State Management with Angular Signals",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/ngrx/platform.git"
8+
},
9+
"keywords": [
10+
"Angular",
11+
"NgRx",
12+
"Signals",
13+
"Signal Store",
14+
"Signal State",
15+
"State Management"
16+
],
17+
"author": "NgRx",
18+
"license": "MIT",
19+
"bugs": {
20+
"url": "https://github.com/ngrx/platform/issues"
21+
},
22+
"homepage": "https://github.com/ngrx/platform#readme",
23+
"peerDependencies": {
24+
"@angular/core": "^16.1.0"
25+
},
26+
"schematics": "./schematics/collection.json",
27+
"sideEffects": false,
28+
"ng-update": {
29+
"packageGroup": ["@ngrx/signals"],
30+
"migrations": "./migrations/migration.json"
31+
},
32+
"dependencies": {
33+
"tslib": "^2.3.0"
34+
}
35+
}

0 commit comments

Comments
 (0)