Skip to content

Commit

Permalink
feat(package): add a README to the published package
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Nov 20, 2023
1 parent f86b089 commit 21f5b40
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
55 changes: 55 additions & 0 deletions package/README.package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# GeoNetwork-UI NPM Package

## What is it?

This package contains many of the features available in the [GeoNetwork-UI project](https://github.com/geonetwork/geonetwork-ui).

Its contents are:

- all the libraries in the `libs` folder
- all translations
- various configuration files

This package _does not_ contain:

- applications (Datahub, etc.)
- unit and E2E tests
- docker composition
- documentation
- anything related to [NX](https://nx.dev/)

## How can I use it?

This is what using this package looks like in an Angular application:

```ts
// ...
import {
UiElementsModule,
UiInputsModule,
UiWidgetsModule,
provideRepositoryUrl,
ThemeService
} from 'geonetwork-ui'

@NgModule({
imports: [
// ...
UiWidgetsModule,
UiElementsModule,
UiInputsModule,
],
providers: [
// ...
provideRepositoryUrl('http://localhost:8080/geonetwork/srv/api'),
],
bootstrap: [AppComponent],
})
export class AppModule {
constructor() {
ThemeService.applyCssVariables('#e73f51', '#c2e9dc', '#212029', '#fdfbff');
}
}
```

Please read the documentation on [how to create a Custom Application](https://geonetwork.github.io/geonetwork-ui/main/docs/guide/custom-app.html) for more information!
4 changes: 4 additions & 0 deletions package/generate-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ copySourceDirectories()
)
await copyFile(path.join(CURRENT_DIR_PATH, 'style.css'), PACKAGE_DIST_PATH)
await copyFile(path.join(CURRENT_DIR_PATH, 'index.ts'), PACKAGE_DIST_PATH)
await fs.cp(
path.join(CURRENT_DIR_PATH, 'README.package.md'),
path.join(PACKAGE_DIST_PATH, 'README.md')
)
await fs.cp(LIBS_DEST_PATH, path.join(PACKAGE_DIST_PATH, 'src/libs'), {
recursive: true,
})
Expand Down
3 changes: 3 additions & 0 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"./tailwind.base.config.js": "./tailwind.base.config.js",
"./style.css": "./style.css"
},
"repository": {
"url": "https://github.com/geonetwork/geonetwork-ui"
},
"peerDependencies": {
"@angular/animations": "16.x || 17.x",
"@angular/cdk": "16.x || 17.x",
Expand Down

0 comments on commit 21f5b40

Please sign in to comment.