ud-components 0.1.0 → 0.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/README.md CHANGED
@@ -1,63 +1,66 @@
1
- # UdComponents
1
+ # ud-components
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
3
+ A shared Angular component library with components, directives, pipes, services, enums, interfaces, and utilities.
4
4
 
5
- ## Code scaffolding
6
-
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
5
+ ## Installation
8
6
 
9
7
  ```bash
10
- ng generate component component-name
8
+ npm install ud-components
11
9
  ```
12
10
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
-
15
- ```bash
16
- ng generate --help
17
- ```
11
+ ## Setup
18
12
 
19
- ## Building
13
+ ### 1. Fonts
20
14
 
21
- To build the library, run:
15
+ Add the following to your app's `index.html` `<head>`. The library uses **Sora** and **DM Sans** from Google Fonts:
22
16
 
23
- ```bash
24
- ng build ud-components
17
+ ```html
18
+ <link rel="preconnect" href="https://fonts.googleapis.com">
19
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
20
+ <link href="https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap" rel="stylesheet">
25
21
  ```
26
22
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
23
+ ### 2. Global styles
28
24
 
29
- ### Publishing the Library
25
+ Import the library's global stylesheet in your `styles.scss` (or add it to the `styles` array in `angular.json`):
30
26
 
31
- Once the project is built, you can publish your library by following these steps:
27
+ ```scss
28
+ @use 'ud-components/styles/global';
29
+ ```
32
30
 
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/ud-components
36
- ```
31
+ ## Usage
37
32
 
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
33
+ All public symbols are available from the root import:
42
34
 
43
- ## Running unit tests
35
+ ```ts
36
+ import { SomeComponent, SomeEnum, SomeInterface } from 'ud-components';
37
+ ```
44
38
 
45
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
39
+ ### What's exported
46
40
 
47
- ```bash
48
- ng test
49
- ```
41
+ | Category | Examples |
42
+ |---|---|
43
+ | Components | `CarouselComponent`, `CustomTableComponent`, `EditViewComponent`, `KpiComponent`, `ModalComponent`, ... |
44
+ | Directives | `EditViewSectionDirective` |
45
+ | Enums | `Role`, `SnackbarType`, `ModalInputType`, `KpiType`, ... |
46
+ | Interfaces | `TableInterface`, `PageRequest`, `SummaryField`, `EditOptions`, ... |
47
+ | Pipes | `CapitalizePipe`, `PluralizePipe`, `SafePipe`, `SingularPipe` |
48
+ | Services | `TranslateWrapperService` |
49
+ | Utils | `CommonUtils`, `TimeOptionsUtils` |
50
50
 
51
- ## Running end-to-end tests
51
+ ## Building & Publishing
52
52
 
53
- For end-to-end (e2e) testing, run:
53
+ Use the `build:lib` script which builds the library and patches the dist `package.json` with sub-path exports required by Vite-based Angular projects:
54
54
 
55
55
  ```bash
56
- ng e2e
56
+ npm run build:lib
57
57
  ```
58
58
 
59
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
-
61
- ## Additional Resources
59
+ To publish a new version:
62
60
 
63
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
61
+ 1. Bump the version in `projects/ud-components/package.json`
62
+ 2. Run `npm run build:lib`
63
+ 3. Publish from the dist folder:
64
+ ```bash
65
+ cd dist/ud-components && npm publish
66
+ ```