eatmatic_common
v1.0.41
Published
Eatmatic common is a common library for Eatmatic and Eatmatic Admin containing - model - services - util
Downloads
8
Readme
README
Eatmatic common is a common library for Eatmatic and Eatmatic Client containing
- model
- services
- util
What is this repository for?
Eatmatic common is a common library used by
- Eatmatic
- Eatmatic admin
How do I get set up?
Checkout the Eatmatic common repo
git clone https://github.com/gongiskhan/eatmatic-common.git
Create a link to the nodel global repository
cd
sudo npm link
iain:~/development/eatmatic-common$ sudo npm link
[sudo] password for iain:
npm WARN @angular/[email protected] requires a peer of zone.js@~0.8.26 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/platform-browser-dynamic@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of zone.js@^0.8.0 but none is installed. You must install peer dependencies yourself.
....
....
....
audited 31680 packages in 7.6s
found 0 vulnerabilities
/usr/local/lib/node_modules/eatmatic_common -> /home/iain/development/eatmatic-common
Linking Eatmatic client to eatmatic common
iain:~/development/eatmatic-ionic/src/config$ npm link eatmatic_common
[sudo] password for iain:
/home/iain/development/eatmatic-ionic/node_modules/eatmatic_common -> /usr/local/lib/node_modules/eatmatic_common -> /home/iain/development/eatmatic-common
iain:~/development/eatmatic-ionic/src/config$ ionic serve
Linking Eatmatic admin to eatmatic common
iain:~/development/eatmatic-admin/$ sudo npm link eatmatic_common
[sudo] password for iain:
/home/iain/development/eatmatic-ionic/node_modules/eatmatic_common -> /usr/local/lib/node_modules/eatmatic_common -> /home/iain/development/eatmatic-common
iain:~/development/eatmatic-ionic/src/config$ ionic serve
[Development] Building the Dist folder
iain:~/development/eatmatic-admin/$ sudo npm run build
Verification that
Verify that for both eatmatic admin and eatmatic client projects that a symbolic link to the eatmatic common library is created
iain:~/development/eatmatic-ionic-admin$ cd node_modules/
iain:~/development/eatmatic-ionic-admin/node_modules$ ls -al eatmatic_common
lrwxrwxrwx 1 root root 57 Dec 5 08:57 eatmatic_common -> ../../../../../usr/local/lib/node_modules/eatmatic_common
iain:~/development/eatmatic-ionic-admin/node_modules$
Contribution guidelines
- Writing tests
- Writing docs
- Code review
Who do I talk to?
- Repo owner or admin
Gotchas
This section lists common errors issues which one may encounter
Circular dependencies
The following error was found when refactoring Eatmatic admin /client to use Eatmatic common library. The problem was difficult to find. Root cause of the problem was that some Eatmatic service classes have inter dependencies. The order in which service classes appear in Eatmatic common index.ts is important! The order should be children specified first (or those classes with no dependencies), then list of classes with dependencies specified next. Otherwise one would see the following error:
Error: Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
at syntaxError (http://localhost:8101/build/vendor.js:113430:17)
at http://localhost:8101/build/vendor.js:123368:40
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getProvidersMetadata (http://localhost:8101/build/vendor.js:123353:19)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8101/build/vendor.js:123072:106)
at JitCompiler._loadModules (http://localhost:8101/build/vendor.js:136260:51)
at JitCompiler._compileModuleAndComponents (http://localhost:8101/build/vendor.js:136241:36)
at JitCompiler.compileModuleAsync (http://localhost:8101/build/vendor.js:136201:37)
at CompilerImpl.compileModuleAsync (http://localhost:8101/build/vendor.js:111829:31)
at PlatformRef.bootstrapModule (http://localhost:8101/build/vendor.js:4801:25)