-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(signals): initial setup (#4002)
Closes #3992
- Loading branch information
1 parent
7716e46
commit b0d63fd
Showing
46 changed files
with
2,901 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/signals/tsconfig.*?.json"] | ||
}, | ||
"rules": { | ||
"@angular-eslint/directive-selector": "off", | ||
"@angular-eslint/component-selector": "off" | ||
}, | ||
"plugins": ["@typescript-eslint"] | ||
}, | ||
{ | ||
"files": ["*.html"], | ||
"extends": ["plugin:@nx/angular-template"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @ngrx/signals | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'Signals', | ||
preset: '../../jest.preset.js', | ||
coverageDirectory: '../../coverage/modules/signals', | ||
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', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json", | ||
"schematics": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/signals", | ||
"assets": ["migrations/**/*.json", "schematics/**/*.json", "**/files/**/*"], | ||
"lib": { | ||
"entryFile": "index.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@ngrx/signals", | ||
"version": "0.0.0", | ||
"description": "Reactive State Management with Angular Signals", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ngrx/platform.git" | ||
}, | ||
"keywords": [ | ||
"Angular", | ||
"NgRx", | ||
"Signals", | ||
"Signal Store", | ||
"Signal State", | ||
"State Management" | ||
], | ||
"author": "NgRx", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ngrx/platform/issues" | ||
}, | ||
"homepage": "https://github.com/ngrx/platform#readme", | ||
"peerDependencies": { | ||
"@angular/core": "^16.1.0" | ||
}, | ||
"schematics": "./schematics/collection.json", | ||
"sideEffects": false, | ||
"ng-update": { | ||
"packageGroup": ["@ngrx/signals"], | ||
"migrations": "./migrations/migration.json" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "signals", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "library", | ||
"sourceRoot": "modules/signals/src", | ||
"prefix": "ngrx", | ||
"targets": { | ||
"build-package": { | ||
"executor": "@angular-devkit/build-angular:ng-packagr", | ||
"options": { | ||
"tsConfig": "modules/signals/tsconfig.build.json", | ||
"project": "modules/signals/ng-package.json" | ||
} | ||
}, | ||
"build": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"parallel": false, | ||
"commands": [ | ||
{ | ||
"command": "nx build-package signals" | ||
}, | ||
{ | ||
"command": "yarn tsc -p modules/signals/tsconfig.schematics.json" | ||
}, | ||
{ | ||
"command": "cpy LICENSE dist/modules/signals" | ||
} | ||
] | ||
}, | ||
"outputs": ["{workspaceRoot}/dist/modules/signals"] | ||
}, | ||
"lint": { | ||
"executor": "@nx/linter:eslint", | ||
"options": { | ||
"lintFilePatterns": [ | ||
"modules/signals/*/**/*.ts", | ||
"modules/signals/*/**/*.html" | ||
] | ||
}, | ||
"outputs": ["{options.outputFile}"] | ||
}, | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"options": { | ||
"jestConfig": "modules/signals/jest.config.ts", | ||
"runInBand": true | ||
}, | ||
"outputs": ["{workspaceRoot}/coverage/modules/signals"] | ||
} | ||
}, | ||
"generators": {}, | ||
"tags": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { | ||
dasherize, | ||
decamelize, | ||
camelize, | ||
classify, | ||
underscore, | ||
group, | ||
capitalize, | ||
featurePath, | ||
pluralize, | ||
} from './utility/strings'; | ||
|
||
export { | ||
findNodes, | ||
getSourceNodes, | ||
getDecoratorMetadata, | ||
getContentOfKeyLiteral, | ||
insertAfterLastOccurrence, | ||
insertImport, | ||
addBootstrapToModule, | ||
addDeclarationToModule, | ||
addExportToModule, | ||
addImportToModule, | ||
addProviderToComponent, | ||
addProviderToModule, | ||
replaceImport, | ||
containsProperty, | ||
} from './utility/ast-utils'; | ||
|
||
export { | ||
Host, | ||
Change, | ||
NoopChange, | ||
InsertChange, | ||
RemoveChange, | ||
ReplaceChange, | ||
createReplaceChange, | ||
createChangeRecorder, | ||
commitChanges, | ||
} from './utility/change'; | ||
|
||
export { AppConfig, getWorkspace, getWorkspacePath } from './utility/config'; | ||
|
||
export { findComponentFromOptions } from './utility/find-component'; | ||
|
||
export { | ||
findModule, | ||
findModuleFromOptions, | ||
buildRelativePath, | ||
ModuleOptions, | ||
} from './utility/find-module'; | ||
|
||
export { findPropertyInAstObject } from './utility/json-utilts'; | ||
|
||
export { | ||
addReducerToState, | ||
addReducerToStateInterface, | ||
addReducerImportToNgModule, | ||
addReducerToActionReducerMap, | ||
omit, | ||
getPrefix, | ||
} from './utility/ngrx-utils'; | ||
|
||
export { getProjectPath, getProject, isLib } from './utility/project'; | ||
|
||
export const stringUtils = { | ||
dasherize, | ||
decamelize, | ||
camelize, | ||
classify, | ||
underscore, | ||
group, | ||
capitalize, | ||
featurePath, | ||
pluralize, | ||
}; | ||
|
||
export { updatePackage } from './utility/update'; | ||
|
||
export { parseName } from './utility/parse-name'; | ||
|
||
export { addPackageToPackageJson } from './utility/package'; | ||
|
||
export { platformVersion } from './utility/libs-version'; | ||
|
||
export { | ||
visitTSSourceFiles, | ||
visitNgModuleImports, | ||
visitNgModuleExports, | ||
visitComponents, | ||
visitDecorator, | ||
visitNgModules, | ||
visitTemplates, | ||
} from './utility/visitors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
displayName: 'Schematics Core', | ||
preset: '../../jest.preset.js', | ||
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'], | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
astTransformers: { | ||
before: [ | ||
'jest-preset-angular/build/InlineFilesTransformer', | ||
'jest-preset-angular/build/StripStylesTransformer', | ||
], | ||
}, | ||
}, | ||
}, | ||
coverageDirectory: '../../coverage/modules/schematics-core', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'Schematics Core', | ||
preset: '../../jest.preset.js', | ||
coverageDirectory: '../../coverage/modules/schematics-core', | ||
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', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'jest-preset-angular/setup-jest'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"stripInternal": true, | ||
"experimentalDecorators": true, | ||
"moduleResolution": "node", | ||
"downlevelIteration": true, | ||
"outDir": "../../dist/modules/schematics-score", | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"lib": ["es2018", "dom"], | ||
"skipLibCheck": true, | ||
"strict": true | ||
}, | ||
"include": ["**/*.ts"], | ||
"exclude": ["**/*.spec.ts", "test-setup.ts"], | ||
"angularCompilerOptions": { | ||
"skipMetadataEmit": true, | ||
"enableSummariesForJit": false, | ||
"enableIvy": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"], | ||
"target": "es2016" | ||
}, | ||
"files": ["test-setup.ts"], | ||
"include": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] | ||
} |
Oops, something went wrong.