@edsis/angular 0.0.1 → 21.0.0

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 (46) hide show
  1. package/README.md +74 -178
  2. package/fesm2022/edsis-angular-sdk-access.mjs +1365 -0
  3. package/fesm2022/edsis-angular-sdk-access.mjs.map +1 -0
  4. package/fesm2022/edsis-angular-sdk-approval.mjs +1259 -0
  5. package/fesm2022/edsis-angular-sdk-approval.mjs.map +1 -0
  6. package/fesm2022/edsis-angular-sdk-auth.mjs +254 -0
  7. package/fesm2022/edsis-angular-sdk-auth.mjs.map +1 -0
  8. package/fesm2022/edsis-angular-sdk-employee.mjs +284 -0
  9. package/fesm2022/edsis-angular-sdk-employee.mjs.map +1 -0
  10. package/fesm2022/edsis-angular-sdk-health.mjs +96 -0
  11. package/fesm2022/edsis-angular-sdk-health.mjs.map +1 -0
  12. package/fesm2022/edsis-angular-sdk-shared.mjs +2740 -0
  13. package/fesm2022/edsis-angular-sdk-shared.mjs.map +1 -0
  14. package/fesm2022/edsis-angular-sdk-storage.mjs +288 -0
  15. package/fesm2022/edsis-angular-sdk-storage.mjs.map +1 -0
  16. package/fesm2022/edsis-angular-sdk-user.mjs +489 -0
  17. package/fesm2022/edsis-angular-sdk-user.mjs.map +1 -0
  18. package/fesm2022/edsis-angular-sdk.mjs +75 -0
  19. package/fesm2022/edsis-angular-sdk.mjs.map +1 -0
  20. package/fesm2022/edsis-angular.mjs +0 -5707
  21. package/fesm2022/edsis-angular.mjs.map +1 -1
  22. package/package.json +47 -46
  23. package/types/edsis-angular-sdk-access.d.ts +547 -0
  24. package/types/edsis-angular-sdk-approval.d.ts +638 -0
  25. package/types/edsis-angular-sdk-auth.d.ts +128 -0
  26. package/types/edsis-angular-sdk-employee.d.ts +159 -0
  27. package/types/edsis-angular-sdk-health.d.ts +35 -0
  28. package/types/edsis-angular-sdk-shared.d.ts +176 -0
  29. package/types/edsis-angular-sdk-storage.d.ts +102 -0
  30. package/types/edsis-angular-sdk-user.d.ts +189 -0
  31. package/types/edsis-angular-sdk.d.ts +26 -0
  32. package/types/edsis-angular.d.ts +1 -824
  33. package/src/lib/styles/USAGE.md +0 -238
  34. package/src/lib/styles/container.css +0 -38
  35. package/src/lib/styles/fonts/commit-mono/CommitMonoVariable.woff2 +0 -0
  36. package/src/lib/styles/fonts/commit-mono/commit-mono.css +0 -2
  37. package/src/lib/styles/fonts/inter/InterVariable-Italic.woff2 +0 -0
  38. package/src/lib/styles/fonts/inter/InterVariable.woff2 +0 -0
  39. package/src/lib/styles/fonts/inter/inter.css +0 -2
  40. package/src/lib/styles/icons/README.md +0 -313
  41. package/src/lib/styles/icons/lucide.svg +0 -9768
  42. package/src/lib/styles/icons/material-symbols.css +0 -48
  43. package/src/lib/styles/main.css +0 -24
  44. package/src/lib/styles/tailwind/component/card.css +0 -7
  45. package/src/lib/styles/tailwind/tailwind.css +0 -144
  46. package/src/lib/styles/theme.css +0 -406
package/README.md CHANGED
@@ -1,227 +1,123 @@
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/sdk`
6
+ - `@edsis/angular/sdk/shared`
7
+ - `@edsis/angular/sdk/access`
8
+ - `@edsis/angular/sdk/approval`
9
+ - `@edsis/angular/sdk/auth`
10
+ - `@edsis/angular/sdk/employee`
11
+ - `@edsis/angular/sdk/health`
12
+ - `@edsis/angular/sdk/storage`
13
+ - `@edsis/angular/sdk/user`
6
14
 
7
- Official package imports after publish are:
15
+ ## Generate and build
8
16
 
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.
17
+ Use the root workspace scripts so SDK generation and library packaging stay in sync:
19
18
 
20
19
  ```bash
21
- npm install @edsis/angular
20
+ bun run build:library
22
21
  ```
23
22
 
24
- Install the companion domain package when you also need auth, routes, or generated API clients:
23
+ That command runs:
25
24
 
26
25
  ```bash
27
- npm install @edsis/library
26
+ bun run gen:sdk
27
+ bunx ng build library
28
28
  ```
29
29
 
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`)
30
+ The packaged output is written to `dist/library`.
33
31
 
34
- ## Styles
32
+ ## Full release
35
33
 
36
- Import the shared stylesheet in your application:
34
+ Run the guarded release flow with:
37
35
 
38
- ```css
39
- @import '@edsis/angular/styles/main.css';
36
+ ```bash
37
+ bun run release:library
40
38
  ```
41
39
 
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
- ```
40
+ The script will:
49
41
 
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
- ```
42
+ - reject the release if the git worktree is dirty
43
+ - reject the release if the current branch still has commits that are not pushed, is behind, or is diverged from its upstream branch
44
+ - ask for a version bump using `X`, `Y`, or `Z`
45
+ - map `X` to major, `Y` to minor, and `Z` to patch, then increment the current version automatically
46
+ - ask for a final confirmation before continuing
47
+ - run `bun run build:library`
48
+ - commit the version bump and generated SDK updates with `update version ke {{version}}`
49
+ - push the commit
50
+ - publish `dist/library` to the public npm registry
80
51
 
81
- Domain and API features are published from the companion package:
52
+ For a non-interactive release, provide the bump and confirmation flags explicitly:
82
53
 
83
- ```ts
84
- import { AuthService } from '@edsis/library';
54
+ ```bash
55
+ bun run release:library --bump Z --yes
85
56
  ```
86
57
 
87
- ## Workspace Development
88
-
89
- Inside this repository, `tsconfig.json` exposes development-only aliases:
58
+ Preview the release plan without changing files:
90
59
 
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
- }
60
+ ```bash
61
+ bun run release:library:dry-run --bump Y --yes
100
62
  ```
101
63
 
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`
64
+ ## Versioning
118
65
 
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:
66
+ Update the publishable package version in `projects/library/package.json` with:
129
67
 
130
68
  ```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
- }
69
+ bun run version:library patch
70
+ bun run version:library minor
71
+ bun run version:library 1.2.3
72
+ bun run version:library prerelease --preid beta
164
73
  ```
165
74
 
166
- #### Persistence
167
-
168
- All settings are automatically:
75
+ The version script only updates the source package manifest. The built package in
76
+ `dist/library` picks up the version on the next `bun run build:library`.
169
77
 
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
78
+ ## Pack and publish locally
175
79
 
176
- ## 🎨 Design Tokens
80
+ Preview the npm tarball:
177
81
 
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`
82
+ ```bash
83
+ bun run pack:library
84
+ ```
189
85
 
190
- ### Typography
86
+ Publish to npm:
191
87
 
192
- ```css
193
- font-family: var(--font-sans); /* Inter */
194
- font-family: var(--font-mono); /* CommitMono */
88
+ ```bash
89
+ bun run publish:library
90
+ bun run publish:library --tag next
195
91
  ```
196
92
 
197
- Custom font weights:
93
+ Run a local publish dry-run:
198
94
 
199
- - `font-normal` - 450
200
- - `font-medium` - 550
201
- - `font-semibold` - 650
202
- - `font-bold` - 700
95
+ ```bash
96
+ bun run publish:library:dry-run
97
+ ```
203
98
 
204
- ## 📚 Documentation
99
+ `publish:library` publishes from `dist/library` and forces `--access public`.
205
100
 
206
- For detailed usage instructions, see:
101
+ 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
102
 
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
103
+ ```bash
104
+ bun run publish:library --provenance
105
+ ```
210
106
 
211
- ## 🔧 Building the Library
107
+ ## GitHub publish workflow
212
108
 
213
- ```bash
214
- # Build library
215
- ng build edsis-angular
109
+ The repository includes `.github/workflows/publish-library.yml`.
216
110
 
217
- # Build and watch
218
- ng build edsis-angular --watch
219
- ```
111
+ It supports:
220
112
 
221
- ## 📄 License
113
+ - pushing a tag named `library-vX.Y.Z`
114
+ - manual `workflow_dispatch` runs with an npm tag and optional dry-run
222
115
 
223
- Private library for ETOS projects.
116
+ The workflow expects the `NPM_TOKEN` repository secret to be configured. On tag
117
+ pushes, the tag version must match `projects/library/package.json`.
224
118
 
225
- ## 🤝 Contributing
119
+ Recommended local release flow:
226
120
 
227
- This is a workspace library. Make changes in `projects/library/angular/src/lib/styles/` and test in the demo app.
121
+ 1. Run `bun run release:library`.
122
+ 2. Select `X`, `Y`, or `Z`, then confirm the computed version.
123
+ 3. Let the script build, commit, push, and publish the package.