@zambon-dev/shared 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/README.md +107 -0
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
23
23
|
|
|
24
24
|
### ⚠ Breaking Changes / Migration
|
|
25
25
|
|
|
26
|
+
## [2.1.2] - 2026-09-20
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Declared `rxjs` and `@angular/platform-browser` in `peerDependencies`. `DomSanitizer` is used by
|
|
31
|
+
`ExternalContentComponent` and `BypassHtmlSanitizerPipe`, but neither package was declared.
|
|
32
|
+
- Added a README to the published package.
|
|
33
|
+
|
|
26
34
|
## [2.1.1] - 2026-09-15
|
|
27
35
|
|
|
28
36
|
### Fixed
|
|
@@ -321,7 +329,8 @@ URL) in `AppConfig`, and implement a hub that pushes the notification list to cl
|
|
|
321
329
|
available via [GitHub Releases](https://github.com/RicardoZambon/ZLibraries/releases) and the
|
|
322
330
|
`shared-v*` tags.
|
|
323
331
|
|
|
324
|
-
[Unreleased]: https://github.com/RicardoZambon/ZLibraries/compare/shared-v2.1.
|
|
332
|
+
[Unreleased]: https://github.com/RicardoZambon/ZLibraries/compare/shared-v2.1.2...HEAD
|
|
333
|
+
[2.1.2]: https://github.com/RicardoZambon/ZLibraries/releases/tag/shared-v2.1.2
|
|
325
334
|
[2.1.1]: https://github.com/RicardoZambon/ZLibraries/releases/tag/shared-v2.1.1
|
|
326
335
|
[2.1.0]: https://github.com/RicardoZambon/ZLibraries/releases/tag/shared-v2.1.0
|
|
327
336
|
[2.0.0]: https://github.com/RicardoZambon/ZLibraries/releases/tag/shared-v2.0.0
|
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# @zambon-dev/shared
|
|
2
|
+
|
|
3
|
+
Shared Angular services, utilities, and styles for Zambon applications.
|
|
4
|
+
|
|
5
|
+
This is the top layer of [ZLibraries](https://github.com/RicardoZambon/ZLibraries). It supplies
|
|
6
|
+
authentication, layouts, history features and cross-cutting services, and builds on both
|
|
7
|
+
[`@zambon-dev/library`](https://www.npmjs.com/package/@zambon-dev/library) and
|
|
8
|
+
[`@zambon-dev/framework`](https://www.npmjs.com/package/@zambon-dev/framework).
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @zambon-dev/shared
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Peer dependencies
|
|
17
|
+
|
|
18
|
+
All peers must be present in the consuming application:
|
|
19
|
+
|
|
20
|
+
| Package | Range |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `@angular/common` | `^19.1.0` |
|
|
23
|
+
| `@angular/core` | `^19.1.0` |
|
|
24
|
+
| `@angular/forms` | `^19.1.0` |
|
|
25
|
+
| `@angular/platform-browser` | `^19.1.0` |
|
|
26
|
+
| `@angular/router` | `^19.1.0` |
|
|
27
|
+
| `@auth0/angular-jwt` | `^5.2.0` |
|
|
28
|
+
| `@microsoft/signalr` | `^10.0.0` |
|
|
29
|
+
| `@ngx-translate/core` | `^16.0.4` |
|
|
30
|
+
| `@zambon-dev/framework` | `^1.0.0` |
|
|
31
|
+
| `@zambon-dev/library` | `^1.0.0` |
|
|
32
|
+
| `ngx-translate-multi-http-loader` | `^19.0.2` |
|
|
33
|
+
| `rxjs` | `^7.8.0` |
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
### Authentication
|
|
38
|
+
|
|
39
|
+
`SharedAuthModule` bundles the guard and HTTP interceptors. `AuthenticationService` handles sign-in, token
|
|
40
|
+
storage (`localStorage` or `sessionStorage` depending on "remember me") and refresh.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { AuthenticationService } from '@zambon-dev/shared';
|
|
44
|
+
|
|
45
|
+
const service = inject(AuthenticationService);
|
|
46
|
+
await firstValueFrom(service.authenticate(username, password, rememberMe));
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Route protection uses the exported guard:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { AuthGuard } from '@zambon-dev/shared';
|
|
53
|
+
|
|
54
|
+
export const routes: Routes = [
|
|
55
|
+
{ path: 'orders', component: OrdersComponent, canActivate: [AuthGuard] },
|
|
56
|
+
];
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Unauthenticated visitors are redirected to `/login` with a `returnUrl` query parameter.
|
|
60
|
+
|
|
61
|
+
### Layouts and features
|
|
62
|
+
|
|
63
|
+
`MainLayoutComponent` provides the application shell. Self-contained features ship with their own routes —
|
|
64
|
+
for example `externalContentRoutes` for `ExternalContentComponent`.
|
|
65
|
+
|
|
66
|
+
## Styles
|
|
67
|
+
|
|
68
|
+
```scss
|
|
69
|
+
@use '@zambon-dev/shared/styles' as shared;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
That entry point resolves to `styles/common.scss`; design tokens are separately reachable at
|
|
73
|
+
`@zambon-dev/shared/styles/variables`.
|
|
74
|
+
|
|
75
|
+
## Translations
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import translations from '@zambon-dev/shared/i18n/en.json';
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## What's included
|
|
82
|
+
|
|
83
|
+
**Services** — `AuthenticationService`, `ExternalContentService`, `ExternalUrlResolverService`,
|
|
84
|
+
`NotificationsService` (SignalR-backed), `OperationsHistoryService`, `ServicesHistoryService`
|
|
85
|
+
|
|
86
|
+
**Auth** — `SharedAuthModule`, route guards, HTTP interceptors
|
|
87
|
+
|
|
88
|
+
**Features** — external content, operations history, services history
|
|
89
|
+
|
|
90
|
+
**Layouts** — `MainLayoutComponent` and supporting shell components
|
|
91
|
+
|
|
92
|
+
Components, models and pipes are exported from the package root as well.
|
|
93
|
+
|
|
94
|
+
## Documentation
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm run storybook:shared
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Contributing
|
|
101
|
+
|
|
102
|
+
See the [workspace README](https://github.com/RicardoZambon/ZLibraries#readme) for the development setup,
|
|
103
|
+
and [CHANGELOG.md](./CHANGELOG.md) for release history.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT © Ricardo Zambon
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zambon-dev/shared",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Shared Angular services, utilities, and styles for Zambon applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -25,13 +25,15 @@
|
|
|
25
25
|
"@angular/common": "^19.1.0",
|
|
26
26
|
"@angular/core": "^19.1.0",
|
|
27
27
|
"@angular/forms": "^19.1.0",
|
|
28
|
+
"@angular/platform-browser": "^19.1.0",
|
|
28
29
|
"@angular/router": "^19.1.0",
|
|
29
30
|
"@auth0/angular-jwt": "^5.2.0",
|
|
30
31
|
"@microsoft/signalr": "^10.0.0",
|
|
32
|
+
"@ngx-translate/core": "^16.0.4",
|
|
31
33
|
"@zambon-dev/framework": "^1.0.0",
|
|
32
34
|
"@zambon-dev/library": "^1.0.0",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
+
"ngx-translate-multi-http-loader": "^19.0.2",
|
|
36
|
+
"rxjs": "^7.8.0"
|
|
35
37
|
},
|
|
36
38
|
"publishConfig": {
|
|
37
39
|
"access": "public"
|