The documentation in this section is intended for developers that work on the pfe itself.
If you want to contribute, you might be interested in the following information.
To access the documentation - which is the basis to contribute to this library - clone this project and run the following commands:
# Install all dependencies
npm install
# Run the viewer to access the documentation
npm start
This will start a local webserver serving the documentation which is using the integrated sources of the library. This allows you to extend the library and the documentation at the same time.
Run the following script to build the viewer application.
npm run build
This will create deployable build in the folder dist
.
Run the following script to build the library:
npm run bundle-lib
It will create the build in dist
ready to be published.
This is powered by ng-packagr which generates the necessary bundles to be consumed by most build systems.
The PFE uses a release process which is integrated into the GDF Jenkins.
There are two different types of releases:
main
branchThe release process itself relies on commit-and-tag-version
with conventional commits
to determine the version number and to generate the changelog. That means, the usage of commit messages compatible with conventional commits
is mandatory.
main
CHANGELOG.md
file.main
state.CHANGELOG.md
file.The following graphic shows the release process:
This ticket contains more details on how the process was implemented.
The documentation can be rebuilt with the following cmd:
npm run docs
For testing/development of NGX-PFE is it often helpful to integrate it with a real application locally.
To do this, follow these steps:
npm install
npm install -g install-local
(if permission denied, tried it as superuser sudo
)install-local ..\{your-ngx-library}\dist\lib
This approach also works for connecting ngx-xtra library with other applications.
Unfortunately, the angular cli currently doesn't support source maps for code under node_modules. This makes it difficult to debug library issues that are located in the library.
The following workaround can be used for debugging: (This is suitable for all libraries, not just the pfe)
tsconfig.json
of the app where the library is integrated. Example configuration: "compilerOptions": {
"baseUrl": "./",
"paths": {
"@allianz/ngx-pfe": ["./ngx-pfe/library/public-api", "./src/ngx-pfe/library/public-api"],
"@allianz/ngx-pfe/*": ["./ngx-pfe/library/public-api", "./src/ngx-pfe/library/public-api"]
}
}
It might be, that the relative path doesn't work. Then an absolute one needs to be used.
Under windows \\
might need to be used in that path.
src/library/*
or the location, where typescript is searching for the files.See also: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
Some common issues with this approach:
If this error occurs during the build:
ERROR in src\app\app.module.ts(261,16): Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'InjectionToken' was called in 'NGX_PFE_CONFIGURATION' 'NGX_PFE_CONFIGURATION' references 'NGX_PFE_CONFIGURATION'
'NGX_PFE_CONFIGURATION' calls 'InjectionToken' at ngx-pfe\library\models\ngx-pfe-module-configuration.model.ts(4,85).
the following mapping needs to be added to the tsconfig:
"@angular/*": ["<absolute path to>\\node_modules\\@angular\\*"]
The angular compile might throw a warning that the case of the mapping path differs from other references. Make sure, that the mapping path in the tsconfig matches the output of the compiler.
You will notice some dependencies of the viewer application (not the library of course) from [Clarity][clarity]. This is a UI framework like Angular Material Design or Bootstrap and supports our viewer with elements like sidebar, sourcecode component and header navigation. These are parts not available in Patternlab in this form. We are happy to use it at the moment but in the long-term we want to create a viewer fully based on ndbx styles.
The usage of the clarity framework in combination with Patternlab means that there are two CSS frameworks in one place, which caused some problems and collisions in the past. We created a custom build of clarity's css to minimize any problems.