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(store): add provideStore and provideState functions for standalone APIs #3539

Merged
merged 7 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
- write_master_hash
- run:
name: Run Affected E2E Tests
command: yarn nx affected --target=e2e --base=$(cat ~/project/master.txt) --head=$CIRCLE_SHA1 --parallel --exclude=docs-app
command: yarn nx affected --target=e2e --base=$(cat ~/project/master.txt) --head=$CIRCLE_SHA1 --parallel=1 --exclude=docs-app

deploy:
<<: *run_in_node
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ example-dist/
*.tgz
modules/*/schematics-core/testing
!modules/schematics-core/testing

.angular
121 changes: 121 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,127 @@
"schematics": {},
"tags": []
},
"standalone-app": {
"projectType": "application",
"root": "projects/standalone-app",
"sourceRoot": "projects/standalone-app/src",
"prefix": "ngrx",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/projects/standalone-app",
"index": "projects/standalone-app/src/index.html",
"main": "projects/standalone-app/src/main.ts",
"polyfills": "projects/standalone-app/src/polyfills.ts",
"tsConfig": "projects/standalone-app/tsconfig.app.json",
"assets": [
"projects/standalone-app/src/favicon.ico",
"projects/standalone-app/src/assets"
],
"styles": ["projects/standalone-app/src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "projects/standalone-app/src/environments/environment.ts",
"with": "projects/standalone-app/src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "standalone-app:build:production"
},
"development": {
"browserTarget": "standalone-app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "standalone-app:build"
}
},
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"projects/standalone-app/**/*.ts",
"projects/standalone-app/**/*.html"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"outputs": ["coverage/projects/standalone-app"],
"options": {
"jestConfig": "projects/standalone-app/jest.config.ts",
"passWithNoTests": true
}
}
},
"tags": []
},
"standalone-app-e2e": {
"root": "projects/standalone-app-e2e",
"sourceRoot": "projects/standalone-app-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "projects/standalone-app-e2e/cypress.json",
"devServerTarget": "standalone-app:serve:development"
},
"configurations": {
"production": {
"devServerTarget": "standalone-app:serve:production"
}
}
},
"lint": {
"builder": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["projects/standalone-app-e2e/**/*.{js,ts}"]
}
}
},
"tags": [],
"implicitDependencies": ["standalone-app"]
},
"store": {
"projectType": "library",
"root": "modules/store",
Expand Down
2 changes: 1 addition & 1 deletion modules/store/spec/store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ActionReducer,
Action,
} from '../';
import { StoreConfig } from '../src/store_module';
import { StoreConfig } from '../src/store_config';
import { combineReducers } from '../src/utils';
import {
counterReducer,
Expand Down
9 changes: 6 additions & 3 deletions modules/store/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ export {
StoreModule,
StoreRootModule,
StoreFeatureModule,
RootStoreConfig,
StoreConfig,
FeatureSlice,
} from './store_module';
export { RootStoreConfig, StoreConfig, FeatureSlice } from './store_config';
export {
provideStore,
provideState,
FEATURE_STATE_PROVIDER,
} from './provide_store';
export { ReducerTypes, on, createReducer } from './reducer_creator';
Loading