Devs ~ App dependencies - GeoscienceAustralia/egeodesy GitHub Wiki
-
src/client/app/system.config.ts,tools/config/seed.config.ts
- PRODUCTION: import all dependency files (blanket approach)
tools/config/seed.config.ts
-
PRODUCTION: mapping for name to file - at
SYSTEM_CONFIG_DEVdefinition - (for framework core dependendencies)
tools/config/project.config.ts
- PRODUCTION: mapping for name to file
- (for APP dependencies)
karma.conf.js
- TESTING: import all dependency files (blanket approach)
test-config.js
- TESTING: mapping for name to file
For every dependency added for dev / production, it needs to also be added for testing (ie. Karma)
This is based on the Jsonix work we did.
npm install <npm lib> --save
In the tools/config/project.config.ts add this to this.NPM_DEPENDENCIES = [ array:
{src: 'jsonix/jsonix.js', inject: 'libs'},
Do this once in a service.
# No specific imports
declare let Jsonix: any; # So we can work with as typescript
let context: any = new Jsonix.Context(jsonIxMappings, jsonIxOptions);
Add this to the karma.conf.js file files: [ array:
'node_modules/jsonix/jsonix.js',
We didn't do this for jsonix, however in some cases it may be necessary. Add an entry to test-config.js.