This project was generated with Angular CLI version 1.7 using Guavus workspace.
Guavus Schematics is internal open source toolkit for kick start Angular applications with basic understanding of guavus application flow.
Guavus Schematics is designed to help you create and build Guavus Angular applications faster. It provides an opinionated approach to application project structure and patterns. It adds blueprints for common patterns used in Guavus Angular application
This has been drived from Nrwl Nx. Feel free to watch introductory video on thier website Watch a 5-minute video on how to get started with Nx.
The modifcation and change to standard Nrwl Nx workspace to craete a GVS-worskpace can be found here
Guavus workspace will create a workspace along with start application. To generate a new applications
npm install -g @guavus/gvs-workspace
and then create-gvs-workspace <project-name>
. When using Guavus workspace, you can create multiple applications and libraries in the same CLI workspace. Read original Nx documnetation here.
Run npm start
for a dev server of primary application. Navigate to http://localhost:1986/
. The app will automatically reload if you change any of the source files.
For all otther application you can run ng serve --app=myapp --port=<appport>
and Navigate to http://localhost:appport/
. The app will automatically reload if you change any of the source files.
Run npm run start:aot
for a dev server of primary application. Navigate to http://localhost:1986/
. The app will automatically reload if you change any of the source files.
For all other application you can run ng serve --aot --app=myapp --port=<app-port>
and Navigate to http://localhost:app-port/
. The app will automatically reload if you change any of the source files.
Run npm run start:prod
for a server of primary application with prod artifacts. Navigate to http://localhost:8843/
. The app will not automatically reload if you change any of the source files.
For all other application you need to create a bs-config.js
file replica and update the file locations and port infirmation. Add a new script in package.json. In future when we support multiple application OOTB then we will automate this changes
Run ng generate component component-name --app=myapp
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module|json
.
Run npm run build
to build the project. The build artifacts will be stored in the dist/apps/<app-name>
directory. Use the npm run build:prod
for a production build. Prod will be AoT by default
npm run build:prod
will generate an AoT build. To generate a dev AoT build use ng build --aot
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via ng serve
.
Prerequesites:
Install Docker on your machine. Add artifacts.ggn.in.guavus.com:4245
in Docker Daemon registry.
Tested with Docker version 18.03.1-ce-mac65
- To make docker build, go to project folder and run:
npm run docker:build
- To test the image, run the command below to create a container
npm run docker:run
Note:
- currently, we are running the container on
port 4000
.
a.)If you have set baseHref to Non root location like "/{projectname}/" in that case we have enabled middleware proxy on port 8888 to redirect all request coming on host:8888/{projectname} to localhost:4000. b.)You might get an error that the port is already running, in that case, execute the following command to stop the running container:
docker stop <running-container-name>
OR check if some other service is running on that port.
- Before publishing to guavus gurgaon artifactory, login into docker
docker login artifacts.ggn.in.guavus.com:4245
- Publishing to guavus gurgaon artifactory
npm run docker:tag
npm run docker:push
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.