stefanoslig / angular-ngrx-nx-realworld-example-app Goto Github PK
View Code? Open in Web Editor NEWReal world application built with Angular 18, NgRx 18, nrwl/nx 18
Home Page: https://angular-ngrx-nx.netlify.app/
License: MIT License
Real world application built with Angular 18, NgRx 18, nrwl/nx 18
Home Page: https://angular-ngrx-nx.netlify.app/
License: MIT License
Is it possible to have multiple dynamic-forms on the same page (component). It forms structure seems to get overridden by the latter form.
The placeholder of the email input shows: "Username". It suggests that the user can put in username. It would be better to replace it with "Email" because authentication with username is not supported.
I'm trying to run unit tests in this repository but they fail with some jest errors I can't solve. Reproduction steps:
git clone https://github.com/stefanoslig/angular-ngrx-nx-realworld-example-app.git ./
npm install
npm install -g nx
nx run-many --target=test --all
The result of running the tests is the following error:
โ Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'html')
at new JSDOMEnvironment (../../../node_modules/jest-environment-jsdom/build/index.js:72:44)
at async TestScheduler.scheduleTests (../../../node_modules/@jest/core/build/TestScheduler.js:317:13)
at async runJest (../../../node_modules/@jest/core/build/runJest.js:407:19)
at async _run10000 (../../../node_modules/@jest/core/build/cli/index.js:339:7)
at async runCLI (../../../node_modules/@jest/core/build/cli/index.js:190:3)`
After some googling I fixed this with running this command:
npm install --save-dev jest-environment-jsdom
But then I get errors like this:
โ Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers.
Here's what you can do:
โข If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
โข If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
โข To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
โข If you need a custom transformation specify a "transform" option in your config.
โข If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation
Details:
C:\Users\redzi\Documents\repos\angular-ngrx-nx-realworld-example-app-main\node_modules\rxjs\dist\esm5\index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { Observable } from './internal/Observable';
^^^^^^
SyntaxError: Unexpected token 'export'
at Runtime.createScriptFromCode (../../node_modules/jest-runner/node_modules/jest-runtime/build/index.js:1796:14)
at Object.<anonymous> (../../node_modules/@angular/core/fesm2020/core.mjs:7:69)
FAIL conduit apps/conduit/src/app/layout/footer/footer.component.spec.ts`
I presume it's an issue with something I'm doing or my setup since I've noticed CI/CD pipelines configured which would report this issue, but I've tried it on two PCs with the same results. What am I doing wrong?
Based on what I have done for the other libraries, I want to use the new features of NgRx in this lib as well
I noticed that articlesActions.favorite
and articlesActions.unfavorite
have effects in:
For this reason when user follows there steps:
Is it intended behavior? What would be the best clean solution to deal with this situation if we need to get rid off this duplicated request?
Hi Stefano...
I am debugging your app for learning purposes. Thumbs up, I think it's very well coded.
I have a question regarding your architecture choices:
Why are you creating an ArticleGuardService to only dispatch this.facade.loadArticle - why are you not just calling loadArticle and loadComments in ngOnInit of the article.component ?
Thanks!
Based on what I have done for the other libraries, I want to use the new features of NgRx in this lib as well
Thank you for your time creating this repo!
I suggest creating a second app for this repo so that the real world example is more true to real life. Please consider that one of the main motivations for using a mono repo is to reuse libraries in other apps, and seeing this in practice, I believe, would help users understand how to use nx in a multi application.
What are your opinions regarding my suggestion?
Thanks in advance
I found that the lib/core doesn't exist.
On the other hand, is only referred by 1 test and used (another import but doesn't use it)
A work around my suffice too
Thanks
turned out to be a reference issue... changed the core to auth and found the resource.
It seems to me that there are circular dependencies introduced in the project because api.service.ts references the environments that are inside the conduit app.
From my experience, we usually had the environments as a different folder in the root directory. I can upload a small PR to fix this!
Thanks for all this effort by the way, your repo is amazing.
Based on what I have done for the other libraries, I want to use the new features of NgRx in this lib as well
ERROR in node_modules/@types/jasmine/index.d.ts(14,18): error TS2300: Duplicate identifier 'describe'. node_modules/@types/jasmine/index.d.ts(15,18): error TS2300: Duplicate identifier 'fdescribe'. node_modules/@types/jasmine/index.d.ts(16,18): error TS2300: Duplicate identifier 'xdescribe'. node_modules/@types/jasmine/index.d.ts(25,18): error TS2300: Duplicate identifier 'it'. node_modules/@types/jasmine/index.d.ts(34,18): error TS2300: Duplicate identifier 'fit'. node_modules/@types/jasmine/index.d.ts(35,18): error TS2300: Duplicate identifier 'xit'. node_modules/@types/jasmine/index.d.ts(50,18): error TS2300: Duplicate identifier 'beforeEach'. node_modules/@types/jasmine/index.d.ts(57,18): error TS2300: Duplicate identifier 'afterEach'. node_modules/@types/jasmine/index.d.ts(65,18): error TS2300: Duplicate identifier 'beforeAll'. node_modules/@types/jasmine/index.d.ts(73,18): error TS2300: Duplicate identifier 'afterAll'. node_modules/@types/jasmine/index.d.ts(79,18): error TS2451: Cannot redeclare block-scoped variable 'expect'. node_modules/@types/jasmine/index.d.ts(85,18): error TS2451: Cannot redeclare block-scoped variable 'expect'. node_modules/@types/jasmine/index.d.ts(91,18): error TS2451: Cannot redeclare block-scoped variable 'expect'. node_modules/@types/jasmine/index.d.ts(96,18): error TS2451: Cannot redeclare block-scoped variable 'expect'. node_modules/@types/jasmine/index.d.ts(135,9): error TS2300: Duplicate identifier 'clock'. node_modules/@types/jasmine/index.d.ts(181,15): error TS2428: All declarations of 'ArrayContaining' must have identical type parameters. node_modules/@types/jasmine/index.d.ts(188,15): error TS2428: All declarations of 'ObjectContaining' must have identical type parameters. node_modules/@types/jasmine/index.d.ts(219,10): error TS2300: Duplicate identifier 'CustomEqualityTester'. node_modules/@types/jasmine/index.d.ts(228,10): error TS2300: Duplicate identifier 'CustomMatcherFactory'. node_modules/@types/jasmine/index.d.ts(710,16): error TS2451: Cannot redeclare block-scoped variable 'DEFAULT_TIMEOUT_INTERVAL'. node_modules/@types/jasminewd2/index.d.ts(9,18): error TS2300: Duplicate identifier 'it'. node_modules/@types/jasminewd2/index.d.ts(10,18): error TS2300: Duplicate identifier 'fit'. node_modules/@types/jasminewd2/index.d.ts(11,18): error TS2300: Duplicate identifier 'xit'. node_modules/@types/jasminewd2/index.d.ts(12,18): error TS2300: Duplicate identifier 'beforeEach'. node_modules/@types/jasminewd2/index.d.ts(13,18): error TS2300: Duplicate identifier 'afterEach'. node_modules/@types/jasminewd2/index.d.ts(14,18): error TS2300: Duplicate identifier 'beforeAll'. node_modules/@types/jasminewd2/index.d.ts(15,18): error TS2300: Duplicate identifier 'afterAll'. node_modules/@types/jest/index.d.ts(22,13): error TS2300: Duplicate identifier 'beforeAll'. node_modules/@types/jest/index.d.ts(23,13): error TS2300: Duplicate identifier 'beforeEach'. node_modules/@types/jest/index.d.ts(24,13): error TS2300: Duplicate identifier 'afterAll'. node_modules/@types/jest/index.d.ts(25,13): error TS2300: Duplicate identifier 'afterEach'. node_modules/@types/jest/index.d.ts(26,13): error TS2300: Duplicate identifier 'describe'. node_modules/@types/jest/index.d.ts(27,13): error TS2300: Duplicate identifier 'fdescribe'. node_modules/@types/jest/index.d.ts(28,13): error TS2300: Duplicate identifier 'xdescribe'. node_modules/@types/jest/index.d.ts(29,13): error TS2300: Duplicate identifier 'it'. node_modules/@types/jest/index.d.ts(30,13): error TS2300: Duplicate identifier 'fit'. node_modules/@types/jest/index.d.ts(31,13): error TS2300: Duplicate identifier 'xit'. node_modules/@types/jest/index.d.ts(35,15): error TS2451: Cannot redeclare block-scoped variable 'expect'. node_modules/@types/jest/index.d.ts(933,9): error TS2451: Cannot redeclare block-scoped variable 'DEFAULT_TIMEOUT_INTERVAL'. node_modules/@types/jest/index.d.ts(934,14): error TS2300: Duplicate identifier 'clock'. node_modules/@types/jest/index.d.ts(937,46): error TS2314: Generic type 'ArrayContaining<T>' requires 1 type argument(s). node_modules/@types/jest/index.d.ts(938,45): error TS2314: Generic type 'ObjectContaining<T>' requires 1 type argument(s). node_modules/@types/jest/index.d.ts(964,15): error TS2428: All declarations of 'ArrayContaining' must have identical type parameters. node_modules/@types/jest/index.d.ts(970,15): error TS2428: All declarations of 'ObjectContaining' must have identical type parameters. node_modules/@types/jest/index.d.ts(1078,9): error TS2374: Duplicate string index signature. node_modules/@types/jest/index.d.ts(1081,10): error TS2300: Duplicate identifier 'CustomMatcherFactory'. node_modules/@types/jest/index.d.ts(1089,10): error TS2300: Duplicate identifier 'CustomEqualityTester'. node_modules/@types/jest/index.d.ts(1098,9): error TS2687: All declarations of 'message' must have identical modifiers. node_modules/@types/jest/index.d.ts(1098,9): error TS2717: Subsequent property declarations must have the same type. Property 'message' must be of type 'string', but here has type 'string | (() => string)'. node_modules/@types/jest/index.d.ts(1103,9): error TS2375: Duplicate number index signature.
No console or network error, except that there is no request in network tab. Might be some lifecycle bug
https://angular-ngrx-nx.netlify.app/home
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | @types/marked |
|
npm | eslint-plugin-ngrx |
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@ngrx/component-store
, @ngrx/effects
, @ngrx/router-store
, @ngrx/signals
, @ngrx/store
, @ngrx/store-devtools
)@angular-eslint/eslint-plugin
, @angular-eslint/eslint-plugin-template
, @angular-eslint/template-parser
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
, @typescript-eslint/utils
)@nx/angular
, @nx/cypress
, @nx/eslint
, @nx/eslint-plugin
, @nx/jest
, @nx/workspace
, nx
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@types/jest
, jest
, jest-environment-jsdom
)@angular-devkit/architect
, @angular-devkit/build-angular
, @angular-devkit/core
, @angular-devkit/schematics
, @angular/cli
, @schematics/angular
)@angular/animations
, @angular/common
, @angular/compiler
, @angular/compiler-cli
, @angular/core
, @angular/forms
, @angular/language-service
, @angular/platform-browser
, @angular/platform-browser-dynamic
, @angular/router
, zone.js
).github/workflows/production.yml
actions/checkout v4
actions/setup-node v3
South-Paw/action-netlify-deploy v1.2.1
package.json
@angular/animations 18.0.0
@angular/common 18.0.0
@angular/compiler 18.0.0
@angular/core 18.0.0
@angular/forms 18.0.0
@angular/platform-browser 18.0.0
@angular/platform-browser-dynamic 18.0.0
@angular/router 18.0.0
@ngrx/component-store 18.0.0-beta.1
@ngrx/effects 18.0.0-beta.1
@ngrx/router-store 18.0.0-beta.1
@ngrx/signals ^18.0.0-rc.1
@ngrx/store 18.0.0-beta.1
@nx/angular 19.3.1
core-js 3.31.0
eslint-plugin-ngrx 2.1.4
marked 5.0.1
rxjs 7.8.1
tslib 2.6.2
zone.js 0.14.5
@angular-devkit/architect 0.1800.1
@angular-devkit/build-angular 18.0.1
@angular-devkit/core 18.0.1
@angular-devkit/schematics 18.0.1
@angular-eslint/eslint-plugin 18.0.1
@angular-eslint/eslint-plugin-template 18.0.1
@angular-eslint/template-parser 18.0.1
@angular/cli ~18.0.1
@angular/compiler-cli 18.0.0
@angular/language-service 18.0.0
@badeball/cypress-cucumber-preprocessor ^19.2.0
@bahmutov/cypress-esbuild-preprocessor ^2.2.0
@ngrx/store-devtools 18.0.0-beta.1
@nx/cypress 19.3.1
@nx/eslint 19.3.1
@nx/eslint-plugin 19.3.1
@nx/jest 19.3.1
@nx/workspace 19.3.1
@schematics/angular 18.0.1
@types/jest 29.5.4
@types/marked 4.3.1
@types/node 18.19.21
@typescript-eslint/eslint-plugin 7.8.0
@typescript-eslint/parser 7.8.0
@typescript-eslint/utils ^8.0.0-alpha.28
cypress 13.9.0
dotenv 10.0.0
eslint 8.57.0
eslint-config-prettier 9.0.0
eslint-plugin-cypress 2.14.0
eslint-plugin-rxjs ^5.0.3
husky 1.3.1
jasmine-marbles 0.9.2
jest 29.6.4
jest-environment-jsdom 29.6.4
jest-preset-angular 14.1.0
ng-mocks 14.13.0
nx 19.3.1
prettier 3.1.0
react ^18.2.0
react-dom ^18.2.0
ts-jest 29.1.1
ts-node 10.9.1
typescript 5.4.5
webpack 5.88.2
Hallo,
I downloaded your code an tried to run. The app is compiled well without any exception. When I open my browser with localhost:4200 app is not loaded. Opened my browser dev tools and see the exception:
Uncaught NullInjectorError: NullInjectorError: No provider for InjectionToken API_URL!
How can I fix?
Best Stefan
"ms-vscode.vscode-typescript-tslint-plugin" is still in the recommended plugins list for VSCode. I think this should be changed to the eslint plugin.
Hi,
I noticed that in your package.json, you are using ng build instead of nx build. I'm wondering if there's a specific reason for this choice, and whether switching to nx build would provide any benefits, such as utilizing Nx's caching capabilities. I am new to nx so I do not know.
Here is the relevant part of the package.json:
"scripts": {
"ng": "nx",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "nx workspace-lint && ng lint",
"e2e": "ng e2e",
"nx": "nx",
"affected:apps": "nx affected:apps",
"affected:libs": "nx affected:libs",
"affected:build": "nx affected:build",
"affected:e2e": "nx affected:e2e",
"affected:test": "nx affected:test",
"affected:lint": "nx affected:lint",
"affected:dep-graph": "nx affected:dep-graph",
"affected": "nx affected",
"format": "nx format:write",
"format:write": "nx format:write",
"format:check": "nx format:check",
"update": "ng update @nrwl/workspace",
"update:check": "ng update",
"dep-graph": "nx dep-graph",
"workspace-schematic": "nx workspace-schematic",
"help": "nx help",
"postinstall": "node ./decorate-angular-cli.js"
},
I'm not sure if opening an issue is the right way to ask this question, so I apologize if this is not the correct channel.
Thank you for your help!
I forked and ran the application in an effort to learn more about using Cypress in a real world app using NX and NGRX. I am getting a couple of linting and Jest errors when running npm run test
command. @stefanoslig Can you please help me?
PASS apps/conduit/src/app/layout/footer/footer.component.spec.ts
PASS apps/conduit/src/app/layout/navbar/navbar.component.spec.ts
FAIL apps/conduit/src/app/app.component.spec.ts
โ AppComponent โบ should create
Template parse errors:
The pipe 'ngrxPush' could not be found ("<conduit-navbar [isLoggedIn]="[ERROR ->]isLoggedIn$ | ngrxPush" [user]="user$ | ngrxPush"></conduit-navbar>
"): ng:///DynamicTestModule/AppComponent.html@0:30
The pipe 'ngrxPush' could not be found ("<conduit-navbar [isLoggedIn]="isLoggedIn$ | ngrxPush" [user]="[ERROR ->]user$ | ngrxPush"></conduit-navbar>
<router-outlet></router-outlet>
<conduit-footer></conduit-foote"): ng:///DynamicTestModule/AppComponent.html@0:62
at syntaxError (../../../packages/compiler/src/util.ts:100:17)
at TemplateParser.Object.<anonymous>.TemplateParser.parse (../../../packages/compiler/src/template_parser/template_parser.ts:106:13)
at JitCompiler.Object.<anonymous>.JitCompiler._parseTemplate (../../../packages/compiler/src/jit/compiler.ts:297:33)
at JitCompiler.Object.<anonymous>.JitCompiler._compileTemplate (../../../packages/compiler/src/jit/compiler.ts:275:11)
at ../../../packages/compiler/src/jit/compiler.ts:206:42
at Set.forEach (<anonymous>)
at JitCompiler.Object.<anonymous>.JitCompiler._compileComponents (../../../packages/compiler/src/jit/compiler.ts:206:15)
at ../../../packages/compiler/src/jit/compiler.ts:117:12
at Object.then (../../../packages/compiler/src/util.ts:89:74)
STR:
loadArticles
is being invoked on redirect to login pageloadArticles
is being invoked twiceRepeat steps 1 and 2.
I'm just wondering, why do you include all these libs in your tsconfig.app.json?
"include": [
"**/*.d.ts",
"../../libs/home/src/index.ts",
"../../libs/editor/src/index.ts",
"../../libs/settings/src/index.ts",
"../../libs/article/src/index.ts",
"../../libs/profile/src/index.ts"
],
Is the reason behind this, just to have all these modules included in the main bundle?
Or you just want the ready as soon as the apps is loaded?
Cause I think more elegant solution would be setting the preloadingStrategy to:
RouterModule.forRoot( routes, {
preloadingStrategy: PreloadAllModules
})
what do you think?
I have an issue while build the project
`$ ng serve --verbose
nx run conduit:serve --verbose
Cannot read properties of undefined (reading 'split')
TypeError: Cannot read properties of undefined (reading 'split')
at WorkspaceNodeModulesArchitectHost.resolveBuilder (/home/projects/ser/angular-ngrx-nx-realworld-example-app/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:110:55)
at ArchitectTargetJobRegistry._resolveBuilder (/home/projects/ser/angular-ngrx-nx-realworld-example-app/node_modules/@angular-devkit/architect/src/architect.js:101:54)
at MergeMapSubscriber.project (/home/projects/ser/angular-ngrx-nx-realworld-example-app/node_modules/@angular-devkit/architect/src/architect.js:161:25)
at MergeMapSubscriber._tryNext (/home/projects/ser/angular-ngrx-nx-realworld-example-app/node_modules/@angular-devkit/architect/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
at MergeMapSubscriber._next (/home/projects/ser/angular-ngrx-nx-realworld-example-app/node_modules/@angular-devkit/architect/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
at MergeMapSubscriber.Subscriber.next (/home/projects/ser/angular-ngrx-nx-realworld-example-app/node_modules/@angular-devkit/architect/node_modules/rxjs/internal/Subscriber.js:66:18)
at /home/projects/ser/angular-ngrx-nx-realworld-example-app/node_modules/@angular-devkit/architect/node_modules/rxjs/internal/util/subscribeToPromise.js:7:24
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
NX ERROR Running target "conduit:serve" failed
Failed tasks:
Hint: run the command with --verbose for more details.
`
$ node -v
v16.10.0
Hello guys i just clones and npm installed your app, but i'm getting the following compile error:
WARNING in Circular dependency detected:
libs\ngrx-forms\src\lib+state\ngrx-forms.actions.ts -> libs\ngrx-forms\src\lib+state\ngrx-forms.reducer.ts -> libs\ngrx-forms\src\lib+state\ngrx-forms.actions.ts
WARNING in Circular dependency detected:
libs\ngrx-forms\src\lib+state\ngrx-forms.reducer.ts -> libs\ngrx-forms\src\lib+state\ngrx-forms.actions.ts -> libs\ngrx-forms\src\lib+state\ngrx-forms.reducer.ts
WARNING in Circular dependency detected:
libs\profile\src\lib+state\profile.actions.ts -> libs\profile\src\lib+state\profile.reducer.ts -> libs\profile\src\lib+state\profile.actions.ts
WARNING in Circular dependency detected:
libs\profile\src\lib+state\profile.reducer.ts -> libs\profile\src\lib+state\profile.actions.ts -> libs\profile\src\lib+state\profile.reducer.ts
ERROR in F:/Workspaces/Source/angular-ngrx-nx-realworld-example-app/libs/editor/src/lib/+state/editor.actions.ts 36:12-23
"export 'ArticleData' was not found in '@angular-ngrx-nx-realworld-example-app/api'
ERROR in F:/Workspaces/Source/angular-ngrx-nx-realworld-example-app/libs/ngrx-forms/src/lib/+state/ngrx-forms.actions.ts 46:12-18
"export 'Errors' was not found in './ngrx-forms.reducer'
ERROR in F:/Workspaces/Source/angular-ngrx-nx-realworld-example-app/libs/profile/src/lib/+state/profile.actions.ts 30:12-19
"export 'Profile' was not found in './profile.reducer'
ERROR in F:/Workspaces/Source/angular-ngrx-nx-realworld-example-app/libs/profile/src/lib/+state/profile.actions.ts 57:12-19
"export 'Profile' was not found in './profile.reducer'
ERROR in F:/Workspaces/Source/angular-ngrx-nx-realworld-example-app/libs/profile/src/lib/+state/profile.actions.ts 84:12-19
"export 'Profile' was not found in './profile.reducer'
Thanks! in advance for help
If you want to compare apples with apples, you should really consider upgrading this example with angular universal.
Howto here => https://medium.com/@philip_lysenko/angular-universal-with-nrwl-nx-ca2996a7da2
First paint will be much better, download size should be too, only LoC will not improve.
`ERROR in libs/ngrx-forms/src/lib/+state/ngrx-forms.facade.ts:3:10 - error TS2305: Module '"./ngrx-forms.interfaces"' has no exported member 'NgrxFormsState'.
3 import { NgrxFormsState } from './ngrx-forms.interfaces';`
Subscribed observables should be unsubscribed after the component being destroyed. I would even prefer moving the observable subscribing to HTML template and subscribing using Async
pipe to guarantee unsubscribing will be managed automatically.
Based on what I have done for the other libraries, I want to use the new features of NgRx in this lib as well
Based on what I have done for the other libraries, I want to use the new features of NgRx in this lib as well
add
Hello!
Due to governance changes, we are now using the realworld.io
domain for the RealWorld demo (both client and API).
Requests from conduit.productionready.io
are redirected to api.realworld.io
, but such a redirection might lead to inconsistent responses.
We encourage domain change for the community.
If this repository is maintained anymore, we'll consider hosting a demo of your implementation in a few weeks with the domain change.
The demo link will be added to the RealWorld documentation.
Based on what I have done for the other libraries, I want to use the new features of NgRx in this lib as well
nx run conduit:test [existing outputs match the cache, left as is]
PASS conduit apps/conduit/src/app/layout/footer/footer.component.spec.ts
PASS conduit apps/conduit/src/app/layout/navbar/navbar.component.spec.ts
PASS conduit apps/conduit/src/app/app.component.spec.ts
โ Console
console.warn
@ngrx/store: The feature name "auth" does not exist in the state, therefore createFeatureSelector cannot access it. Be sure it is imported in a loaded module using StoreModule.forRoot('auth', ...) or StoreModule.forFeature('auth', ...). If the default state is intended to be undefined, as is the case with router state, this development-only warning message can be ignored.
at ../../modules/store/src/selector.ts:755:17
at ../../modules/store/src/selector.ts:574:64
at Array.map (<anonymous>)
at defaultStateFn (../../modules/store/src/selector.ts:574:52)
at ../../modules/store/src/selector.ts:718:30
at memoized (../../modules/store/src/selector.ts:101:33)
at ../../modules/store/src/selector.ts:574:64
at Array.map (<anonymous>)
Test Suites: 3 passed, 3 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 6.461 s
Ran all test suites.
Is there a reason why absolute imports are not configured in any examples on GitHub. I searched for real-world application. This repo looks great but for example in file:
/// angular-ngrx-nx-realworld-example-app/libs/article-list/src/index.ts
export { ArticleListModule } from './lib/article-list.module';
export * from './lib/+state/article-list.reducer';
export * from './lib/+state/article-list.actions';
export * from './lib/+state/article-list.facade';
Would it be possible to have something like this?
/// angular-ngrx-nx-realworld-example-app/libs/article-list/src/index.ts
export { ArticleListModule } from 'lib/article-list.module';
export * from 'lib/+state/article-list.reducer';
export * from 'lib/+state/article-list.actions';
export * from 'lib/+state/article-list.facade';
This may seem like a small change but it makes the code easier to read and easier to refactor. ๐ค
Edit: I guess I could just prepend the package @name but somehow that seems worse than ./lib
because @
looks like a 3rd party library.
Steps to reproduce:
git clone github.com:stefanoslig/angular-ngrx-nx-realworld-example-app.git ./
npm install
ng test
[email protected] test /Users/vuvgag/Repositories/vuvgag/math-checker
> ng test
> nx run conduit:test
PASS conduit apps/conduit/src/app/layout/footer/footer.component.spec.ts
PASS conduit apps/conduit/src/app/layout/navbar/navbar.component.spec.ts
PASS conduit apps/conduit/src/app/app.component.spec.ts
โ Console
console.warn
@ngrx/store: The feature name "auth" does not exist in the state, therefore createFeatureSelector cannot access it. Be sure it is imported in a loaded module using StoreModule.forRoot('auth', ...) or StoreModule.forFeature('auth', ...). If the default state is intended to be undefined, as is the case with router state, this development-only warning message can be ignored.
at ../../modules/store/src/selector.ts:755:17
at ../../modules/store/src/selector.ts:574:64
at Array.map (<anonymous>)
at defaultStateFn (../../modules/store/src/selector.ts:574:52)
at ../../modules/store/src/selector.ts:718:30
at memoized (../../modules/store/src/selector.ts:101:33)
at ../../modules/store/src/selector.ts:574:64
at Array.map (<anonymous>)
Test Suites: 3 passed, 3 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 2.055 s
Ran all test suites.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
> NX SUCCESS Running target "test" succeeded
Expected it to run all the tests from the libs folder. Tests continue to not run even when changing the code of a libs module.
Could you please add the LISENCE.txt.
Hello,
The name of articleListFeatureKey should be 'articles' and not 'article' otherwise the configuration is deleted when by the current article.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.