UNPKG

5.95 kBMarkdownView Raw
1[![Logo][jhipster-image]][jhipster-url]
2
3Greetings, Java Hipster!
4
5This is the JHipster Angular 2+ utilities library
6
7[![NPM version][npm-image]][npm-url]
8[![Azure DevOps Build Status][azure-devops-image]][azure-devops-url-main]
9[![Build Status][travis-image]][travis-url]
10[![Dependency Status][daviddm-image]][daviddm-url]
11
12This library is used by the code generated by the generator-jhipster: https://github.com/jhipster/generator-jhipster/. When releasing a new version of the generator-jhipster then this is tested with the specific version of the ng-jhipster referenced in the generated package.json file. If your application is generated by the older version of the generator-jhipster and you manually update ng-jhipster version in the package.json then this may and may not work. To use a newer version of the ng-jhipster, regenerate application with a newer version of the generator-jhipster which generates a right ng-jhipster version into package.json file.
13
14Full documentation and information is available on our website at [https://jhipster.tech/][jhipster-url]
15
16Please read our [guidelines](https://github.com/jhipster/generator-jhipster/blob/main/CONTRIBUTING.md#-submission-guidelines) before submitting an issue. If your issue is a bug, please use the bug template pre populated [here](https://github.com/jhipster/generator-jhipster/issues/new). For feature requests and queries you can use [this template][feature-template].
17
18[jhipster-image]: https://raw.githubusercontent.com/jhipster/jhipster.github.io/main/images/logo/logo-jhipster2x.png
19[jhipster-url]: https://jhipster.tech/
20[npm-image]: https://badge.fury.io/js/ng-jhipster.svg
21[npm-url]: https://npmjs.org/package/ng-jhipster
22[azure-devops-image]: https://dev.azure.com/jhipster/ng-jhipster/_apis/build/status/jhipster.ng-jhipster?branchName=main
23[azure-devops-url-main]: https://dev.azure.com/jhipster/ng-jhipster/_build
24[travis-image]: https://travis-ci.org/jhipster/ng-jhipster.svg?branch=main
25[travis-url]: https://travis-ci.org/jhipster/ng-jhipster
26[daviddm-image]: https://david-dm.org/jhipster/ng-jhipster.svg?theme=shields.io
27[daviddm-url]: https://david-dm.org/jhipster/ng-jhipster
28[feature-template]: https://github.com/jhipster/generator-jhipster/issues/new?body=*%20**Overview%20of%20the%20request**%0A%0A%3C!--%20what%20is%20the%20query%20or%20request%20--%3E%0A%0A*%20**Motivation%20for%20or%20Use%20Case**%20%0A%0A%3C!--%20explain%20why%20this%20is%20a%20required%20for%20you%20--%3E%0A%0A%0A*%20**Browsers%20and%20Operating%20System**%20%0A%0A%3C!--%20is%20this%20a%20problem%20with%20all%20browsers%20or%20only%20IE8%3F%20--%3E%0A%0A%0A*%20**Related%20issues**%20%0A%0A%3C!--%20has%20a%20similar%20issue%20been%20reported%20before%3F%20--%3E%0A%0A*%20**Suggest%20a%20Fix**%20%0A%0A%3C!--%20if%20you%20can%27t%20fix%20this%20yourself%2C%20perhaps%20you%20can%20point%20to%20what%20might%20be%0A%20%20causing%20the%20problem%20(line%20of%20code%20or%20commit)%20--%3E
29
30## Development setup
31
32You need NodeJS and NPM.
33
34### Fork the ng-jhipster project
35
36Go to the [ng-jhipster project](https://github.com/jhipster/ng-jhipster) and click on the "fork" button. You can then clone your own fork of the project, and start working on it.
37
38[Please read the Github forking documentation for more information](https://help.github.com/articles/fork-a-repo)
39
40### Build
41
42Run `npm install` to install all dependencies.
43
44Make some changes, run `npm run test` to run both eslint/tslint and unit tests.
45
46Build the library with `npm run build`.
47
48Package the library by running `npm pack` in the `dist` directory. This will create an archive `ng-jhipster-vX.Y.Z.tgz`.
49
50For testing, you will want to integrate this archive into an application generated by JHipster.
51
52Go to your generated JHipster application and run...
53
54 npm install path/to/ng-jhipster/dist/ng-jhipster-vX.Y.Z.tgz
55
56...so that your JHipster application uses the content of this archive as `ng-jhipster` dependency which is located in `node_modules/ng-jhipster`.
57
58### Quick development
59
60You can quickly test library changes in Angular application generated by JHipster in the following manner.
61
621. Generate Angular application using JHipster generator.
63
642. Actions in the `ng-jhipster` project.
65
66 - In the `ng-package.dev.json` change the value of the `dest` to some subfolder inside generated project, for example if using **Gradle** or **skipping server** then you can use `GeneratedAppRootFolder/build/dist/ng-jhipster` and if using **Maven** then use `target` subfolder instead of `build`.
67 For example, if the generated app and the `ng-jhipster` are siblings in the disk then you can use:
68
69 ```
70 "dest": "../generated-app-root-folder-name/build/dist/ng-jhipster",
71 ```
72
73 One note about this change. As Angular framework architecture excpects that in building app all blocks of the application are inside app root folder then you can't skip this step. If you don't do this change and in the generated app `tsconfig.json` file refer to `ng-jhipster` default destination folder like this `"ng-jhipster": ["../ng-jhipster/dist"]` then runtime errors will occur on running app.
74
75 - Run `npm run build:dev`
76
773. Actions in the generated application.
78
79 - In the `tsconfig.json` file, add the following entry into `compilerOptions.paths`:
80
81 ```
82 "ng-jhipster": ["build/dist/ng-jhipster"]
83 ```
84
85 - Optional step. If you are using some other subfolder than `build` or `target` for `ng-jhipster` build destination and this folder is not in `.eslintignore` then add this folder there (this suppresses ESLint errors for compiled `ng-jhipster` bundle)
86
87 - Run `npm start`
88
89Now on every change in `ng-jhipster` the following will happen automatically:
90
91- `ng-jhipster` rebuilds
92- generated app rebuilds using freshly built local `ng-jhipster`
93- generated app is reloaded in the browser and you can see and test changes made in the `ng-jhipster`