@edsis/angular 0.0.2 → 21.0.1

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.
Files changed (49) hide show
  1. package/README.md +77 -178
  2. package/fesm2022/edsis-angular-auth.mjs +992 -0
  3. package/fesm2022/edsis-angular-auth.mjs.map +1 -0
  4. package/fesm2022/edsis-angular-sdk-access.mjs +1365 -0
  5. package/fesm2022/edsis-angular-sdk-access.mjs.map +1 -0
  6. package/fesm2022/edsis-angular-sdk-approval.mjs +1259 -0
  7. package/fesm2022/edsis-angular-sdk-approval.mjs.map +1 -0
  8. package/fesm2022/edsis-angular-sdk-auth.mjs +254 -0
  9. package/fesm2022/edsis-angular-sdk-auth.mjs.map +1 -0
  10. package/fesm2022/edsis-angular-sdk-employee.mjs +284 -0
  11. package/fesm2022/edsis-angular-sdk-employee.mjs.map +1 -0
  12. package/fesm2022/edsis-angular-sdk-health.mjs +96 -0
  13. package/fesm2022/edsis-angular-sdk-health.mjs.map +1 -0
  14. package/fesm2022/edsis-angular-sdk-shared.mjs +2740 -0
  15. package/fesm2022/edsis-angular-sdk-shared.mjs.map +1 -0
  16. package/fesm2022/edsis-angular-sdk-storage.mjs +288 -0
  17. package/fesm2022/edsis-angular-sdk-storage.mjs.map +1 -0
  18. package/fesm2022/edsis-angular-sdk-user.mjs +489 -0
  19. package/fesm2022/edsis-angular-sdk-user.mjs.map +1 -0
  20. package/fesm2022/edsis-angular-sdk.mjs +75 -0
  21. package/fesm2022/edsis-angular-sdk.mjs.map +1 -0
  22. package/fesm2022/edsis-angular.mjs +0 -5707
  23. package/fesm2022/edsis-angular.mjs.map +1 -1
  24. package/package.json +51 -46
  25. package/types/edsis-angular-auth.d.ts +117 -0
  26. package/types/edsis-angular-sdk-access.d.ts +547 -0
  27. package/types/edsis-angular-sdk-approval.d.ts +638 -0
  28. package/types/edsis-angular-sdk-auth.d.ts +128 -0
  29. package/types/edsis-angular-sdk-employee.d.ts +159 -0
  30. package/types/edsis-angular-sdk-health.d.ts +35 -0
  31. package/types/edsis-angular-sdk-shared.d.ts +176 -0
  32. package/types/edsis-angular-sdk-storage.d.ts +102 -0
  33. package/types/edsis-angular-sdk-user.d.ts +189 -0
  34. package/types/edsis-angular-sdk.d.ts +26 -0
  35. package/types/edsis-angular.d.ts +1 -824
  36. package/src/lib/styles/USAGE.md +0 -238
  37. package/src/lib/styles/container.css +0 -38
  38. package/src/lib/styles/fonts/commit-mono/CommitMonoVariable.woff2 +0 -0
  39. package/src/lib/styles/fonts/commit-mono/commit-mono.css +0 -2
  40. package/src/lib/styles/fonts/inter/InterVariable-Italic.woff2 +0 -0
  41. package/src/lib/styles/fonts/inter/InterVariable.woff2 +0 -0
  42. package/src/lib/styles/fonts/inter/inter.css +0 -2
  43. package/src/lib/styles/icons/README.md +0 -313
  44. package/src/lib/styles/icons/lucide.svg +0 -9768
  45. package/src/lib/styles/icons/material-symbols.css +0 -48
  46. package/src/lib/styles/main.css +0 -24
  47. package/src/lib/styles/tailwind/component/card.css +0 -7
  48. package/src/lib/styles/tailwind/tailwind.css +0 -144
  49. package/src/lib/styles/theme.css +0 -406
package/README.md CHANGED
@@ -1,227 +1,126 @@
1
1
  # @edsis/angular
2
2
 
3
- Reusable Angular UI library for themes, navigation/layout primitives, and icons.
3
+ Angular library package for Edsis, including the generated SDK entry points:
4
4
 
5
- ## Publish Surface
5
+ - `@edsis/angular/auth`
6
+ - `@edsis/angular/sdk`
7
+ - `@edsis/angular/sdk/shared`
8
+ - `@edsis/angular/sdk/access`
9
+ - `@edsis/angular/sdk/approval`
10
+ - `@edsis/angular/sdk/auth`
11
+ - `@edsis/angular/sdk/employee`
12
+ - `@edsis/angular/sdk/health`
13
+ - `@edsis/angular/sdk/storage`
14
+ - `@edsis/angular/sdk/user`
6
15
 
7
- Official package imports after publish are:
16
+ ## Generate and build
8
17
 
9
- - `@edsis/angular` for all UI exports and shared helpers
10
- - `@edsis/angular/styles/main.css` for the shared stylesheet
11
-
12
- Domain routes, auth helpers, and generated API clients live in `@edsis/library`.
13
-
14
- Category-style imports such as `@edsis/angular/components` or `@edsis/angular/themes` are not published secondary entry points. Those paths only work inside this monorepo because the workspace `tsconfig.json` defines development aliases.
15
-
16
- ## Installation
17
-
18
- The package is published publicly to npm.
18
+ Use the root workspace scripts so SDK generation and library packaging stay in sync:
19
19
 
20
20
  ```bash
21
- npm install @edsis/angular
21
+ bun run build:library
22
22
  ```
23
23
 
24
- Install the companion domain package when you also need auth, routes, or generated API clients:
24
+ That command runs:
25
25
 
26
26
  ```bash
27
- npm install @edsis/library
27
+ bun run gen:sdk
28
+ bunx ng build library
28
29
  ```
29
30
 
30
- Peer dependencies expected by the published package:
31
-
32
- - Angular 21 (`@angular/core`, `@angular/common`, `@angular/forms`, `@angular/router`, `@angular/cdk`, `@angular/material`, `@angular/animations`)
31
+ The packaged output is written to `dist/library`, including the reusable `@edsis/angular/auth` entry point.
33
32
 
34
- ## Styles
33
+ ## Full release
35
34
 
36
- Import the shared stylesheet in your application:
35
+ Run the guarded release flow with:
37
36
 
38
- ```css
39
- @import '@edsis/angular/styles/main.css';
37
+ ```bash
38
+ bun run release:library
40
39
  ```
41
40
 
42
- Or register it in `angular.json`:
43
-
44
- ```json
45
- {
46
- "styles": ["node_modules/@edsis/angular/styles/main.css", "src/styles.css"]
47
- }
48
- ```
41
+ The script will:
49
42
 
50
- ## Production Usage
51
-
52
- ```ts
53
- import { Component, inject } from '@angular/core';
54
- import { LucideIcon, ThemeService, type ColorScheme } from '@edsis/angular';
55
-
56
- @Component({
57
- selector: 'app-root',
58
- imports: [LucideIcon],
59
- template: `
60
- <icon>heart</icon>
61
- <button type="button" (click)="toggleTheme()">Toggle theme</button>
62
- `,
63
- })
64
- export class AppComponent {
65
- private readonly themeService = inject(ThemeService);
66
-
67
- toggleTheme(): void {
68
- this.themeService.toggleTheme();
69
- }
70
-
71
- useSystemTheme(): void {
72
- this.themeService.setTheme('system');
73
- }
74
-
75
- setScheme(scheme: ColorScheme): void {
76
- this.themeService.setScheme(scheme);
77
- }
78
- }
79
- ```
43
+ - reject the release if the git worktree is dirty
44
+ - reject the release if the current branch still has commits that are not pushed, is behind, or is diverged from its upstream branch
45
+ - ask for a version bump using `X`, `Y`, or `Z`
46
+ - map `X` to major, `Y` to minor, and `Z` to patch, then increment the current version automatically
47
+ - ask for a final confirmation before continuing
48
+ - run `bun run build:library`
49
+ - commit the version bump and generated SDK updates with `update version ke {{version}}`
50
+ - push the commit
51
+ - publish `dist/library` to the public npm registry
80
52
 
81
- Domain and API features are published from the companion package:
53
+ For a non-interactive release, provide the bump and confirmation flags explicitly:
82
54
 
83
- ```ts
84
- import { AuthService } from '@edsis/library';
55
+ ```bash
56
+ bun run release:library --bump Z --yes
85
57
  ```
86
58
 
87
- ## Workspace Development
88
-
89
- Inside this repository, `tsconfig.json` exposes development-only aliases:
59
+ Preview the release plan without changing files:
90
60
 
91
- ```json
92
- {
93
- "compilerOptions": {
94
- "paths": {
95
- "@edsis/angular": ["./projects/library/angular/src/public-api"],
96
- "@edsis/angular/*": ["./projects/library/angular/src/lib/*"]
97
- }
98
- }
99
- }
61
+ ```bash
62
+ bun run release:library:dry-run --bump Y --yes
100
63
  ```
101
64
 
102
- That means imports like `@edsis/angular/themes` are valid while developing in this workspace, but they should not be documented as published package entry points.
103
-
104
- ## Theme Bootstrapping
105
-
106
- `ThemeService` reads settings in this order:
107
-
108
- 1. localStorage values if they exist
109
- 2. HTML `data-*` attributes if storage is empty
110
- 3. built-in defaults if neither source is present
111
-
112
- Supported attributes on `<html>`:
113
-
114
- - `data-theme`
115
- - `data-scheme`
116
- - `data-container`
117
- - `data-layout`
65
+ ## Versioning
118
66
 
119
- Built-in defaults when no persisted or HTML values are available:
120
-
121
- - `data-theme="light"`
122
- - `data-container="boxed"`
123
- - `data-scheme="blue"`
124
- - `data-layout="vertical"`
125
-
126
- ## Library Development
127
-
128
- Useful commands from the workspace root:
67
+ Update the publishable package version in `projects/library/package.json` with:
129
68
 
130
69
  ```bash
131
- npm run build:lib
132
- npx ng test edsis-angular --watch=false
133
- npm run lint
134
- ```
135
-
136
- ### Reactive Signals
137
-
138
- All settings are exposed as Angular signals for reactive updates:
139
-
140
- ```typescript
141
- import { Component, inject, computed } from '@angular/core';
142
- import { ThemeService } from '@edsis/angular';
143
-
144
- @Component({
145
- template: `
146
- <div>
147
- <p>Current theme: {{ currentTheme() }}</p>
148
- <p>Is dark mode: {{ isDark() }}</p>
149
- <p>Scheme color: {{ schemeColor() }}</p>
150
- </div>
151
- `,
152
- })
153
- export class MyComponent {
154
- themeService = inject(ThemeService);
155
-
156
- // Direct access to signals
157
- currentTheme = this.themeService.theme;
158
- currentResolvedTheme = this.themeService.resolvedTheme;
159
-
160
- // Computed signals
161
- isDark = computed(() => this.themeService.resolvedTheme() === 'dark');
162
- schemeColor = computed(() => this.themeService.getCurrentSchemeColor());
163
- }
70
+ bun run version:library patch
71
+ bun run version:library minor
72
+ bun run version:library 1.2.3
73
+ bun run version:library prerelease --preid beta
164
74
  ```
165
75
 
166
- #### Persistence
167
-
168
- All settings are automatically:
76
+ The version script only updates the source package manifest. The built package in
77
+ `dist/library` picks up the version on the next `bun run build:library`.
169
78
 
170
- - ✅ Saved to `localStorage` on change
171
- - ✅ Loaded from `localStorage` on app init
172
- - ✅ Applied to DOM via `data-*` attributes
173
- - ✅ `data-theme="system"` follows the OS light/dark preference
174
- - ✅ Synced across tabs/windows
79
+ ## Pack and publish locally
175
80
 
176
- ## 🎨 Design Tokens
81
+ Preview the npm tarball:
177
82
 
178
- ### Theme Colors
179
-
180
- - `--background` / `bg-background`
181
- - `--foreground` / `text-foreground`
182
- - `--card` / `bg-card`
183
- - `--primary` / `bg-primary`
184
- - `--secondary` / `bg-secondary`
185
- - `--muted` / `bg-muted`
186
- - `--accent` / `bg-accent`
187
- - `--destructive` / `bg-destructive`
188
- - `--border` / `border-border`
83
+ ```bash
84
+ bun run pack:library
85
+ ```
189
86
 
190
- ### Typography
87
+ Publish to npm:
191
88
 
192
- ```css
193
- font-family: var(--font-sans); /* Inter */
194
- font-family: var(--font-mono); /* CommitMono */
89
+ ```bash
90
+ bun run publish:library
91
+ bun run publish:library --tag next
195
92
  ```
196
93
 
197
- Custom font weights:
94
+ Run a local publish dry-run:
198
95
 
199
- - `font-normal` - 450
200
- - `font-medium` - 550
201
- - `font-semibold` - 650
202
- - `font-bold` - 700
96
+ ```bash
97
+ bun run publish:library:dry-run
98
+ ```
203
99
 
204
- ## 📚 Documentation
100
+ `publish:library` publishes from `dist/library` and forces `--access public`.
205
101
 
206
- For detailed usage instructions, see:
102
+ For local publishes, the script does not add `--provenance` by default because npm provenance generation is not supported outside compatible CI providers. If you need provenance in a supported CI environment, pass it explicitly:
207
103
 
208
- - [USAGE.md](./src/lib/styles/USAGE.md) - Complete usage guide
209
- - [Lucide Icons README](./src/lib/styles/icons/README.md) - Legacy sprite usage details
104
+ ```bash
105
+ bun run publish:library --provenance
106
+ ```
210
107
 
211
- ## 🔧 Building the Library
108
+ ## GitHub publish workflow
212
109
 
213
- ```bash
214
- # Build library
215
- ng build edsis-angular
110
+ The repository includes `.github/workflows/publish-library.yml`.
216
111
 
217
- # Build and watch
218
- ng build edsis-angular --watch
219
- ```
112
+ It supports:
220
113
 
221
- ## 📄 License
114
+ - pushing a tag named `library-vX.Y.Z`
115
+ - manual `workflow_dispatch` runs with an npm tag and optional dry-run
222
116
 
223
- Private library for ETOS projects.
117
+ The workflow uses npm trusted publishing via GitHub Actions OIDC, so it does
118
+ not require a repository `NPM_TOKEN` secret. The npm package must be configured
119
+ to trust this repository workflow as a publisher. On tag pushes, the tag
120
+ version must match `projects/library/package.json`.
224
121
 
225
- ## 🤝 Contributing
122
+ Recommended local release flow:
226
123
 
227
- This is a workspace library. Make changes in `projects/library/angular/src/lib/styles/` and test in the demo app.
124
+ 1. Run `bun run release:library`.
125
+ 2. Select `X`, `Y`, or `Z`, then confirm the computed version.
126
+ 3. Let the script build, commit, push, and publish the package.