-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export all libs as NPM package #676
Conversation
Affected libs:
|
@@ -1,5 +1,4 @@ | |||
import { Organization } from './organization.model' | |||
import _default from 'chart.js/dist/plugins/plugin.tooltip' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea what this line was doing here to be honest!!
243d28f
to
fcb9edc
Compare
69163b6
to
dae9cea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this nice PR @jahow with a great description and extensive documentation!
Maybe the PR description could also go into a package/readme.md
?
FYI, when testing, I needed to force npm install
because of peer dependency conflicts with gn-ui still in angular 16 and your demo app in angular 17. Nevertheless, I ended up with your demo app running and calling GN behind it, nice :-)
Generating a new app following the doc I still run into some error when trying to start it: ⠸ Building...✘ [ERROR] Could not resolve "react-native-fs" node_modules/alasql/dist/alasql.fs.js:26676:25:
. My app is a standalone app without any AppModule
for now. Not sure if this is related.
I've used yalc
to test this PR:
yalc publish
inside gn-ui's package/dist
yalc add geonetwork-ui@2.1.0-dev
inside the angular app
This is useful to avoid a direct dependency to the various openapi clients in data-access
Co-authored-by: tkohr <tobias.kohr@camptocamp.com>
3cdac10
to
21f5b40
Compare
I've added a README for the package folder as well as a README for the published package; it's now publicly accessible here: https://www.npmjs.com/package/geonetwork-ui?activeTab=readme Also added some doc for development workflow in a custom app. |
21f5b40
to
a631bee
Compare
...disable SSR and put gn-ui package last
e2fd62e
to
894d1e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional doc and its latest adaptions! Following it, I now get to use the package without forcing npm install
s. Really nice 😃
Similar to #592.
This PR introduces a
package
directory with:generate-package.js
node scriptindex.ts
file which serves as an entrypoint for the package compilationng-package.json
file which is used byng-packagr
package.json
describing the npm packagetsconfig.json
file used for the package compilationThe
generate-package.js
file does:libs
folder in thepackage
directory, keeping only relevant files (ts, css, html...)paths
property oftsconfig.base.json
; for instance:ng-packagr
does not support Typescript path aliases)ng-packagr
; this is necessary because Angular libraries have to be published according to the Angular Package Formatpackage/dist
; then the script also copies the sourcelibs
folder there as well so that consumers of the package can be redirected to the source file when inspecting itAn example usage of the generated package can be seen here: https://github.com/jahow/geonetwork-ui-custom-app
E.g.
Notes:
index.ts
fileTo do:
geonetwork-ui/ui-layout
?