@rangertechnologies/fusion-ui 0.1.9 → 0.1.11
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,93 +1,89 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- MR 10NOV26 Add local testing, build, and consumer integration documentation to README.md -->
|
|
2
|
+
# `@rangertechnologies/fusion-ui`
|
|
2
3
|
|
|
4
|
+
Shared Angular component library for the Fusion platform and micro-frontends (Host & MFEs).
|
|
3
5
|
|
|
6
|
+
---
|
|
4
7
|
|
|
5
|
-
##
|
|
8
|
+
## Prerequisites & Setup
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
1. **Install dependencies:**
|
|
11
|
+
```bash
|
|
12
|
+
npm install
|
|
13
|
+
```
|
|
14
|
+
2. **Install Playwright Chromium browser (required for Vitest browser mode & E2E tests):**
|
|
15
|
+
```bash
|
|
16
|
+
npx playwright install chromium
|
|
17
|
+
```
|
|
8
18
|
|
|
9
|
-
|
|
19
|
+
---
|
|
10
20
|
|
|
11
|
-
##
|
|
21
|
+
## Available Scripts
|
|
12
22
|
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
| Command | Description |
|
|
24
|
+
| :--- | :--- |
|
|
25
|
+
| `npm run build` | Builds the Angular library using `ng-packagr -p ng-package.json` into `dist/` |
|
|
26
|
+
| `npm run pack` | Builds the library and generates a `.tgz` package tarball inside `dist/` |
|
|
27
|
+
| `npm test` | Runs unit and component tests once using Vitest (`vitest run`) |
|
|
28
|
+
| `npm run test:watch` | Runs Vitest in interactive watch mode (`vitest`) |
|
|
29
|
+
| `npm run test:e2e` | Runs Playwright E2E regression tests (`playwright test`) |
|
|
15
30
|
|
|
16
|
-
|
|
17
|
-
cd existing_repo
|
|
18
|
-
git remote add origin https://gitlab.mcodellp.com/rangertech/fusionapp/library/fusion-ui.git
|
|
19
|
-
git branch -M master
|
|
20
|
-
git push -uf origin master
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Integrate with your tools
|
|
24
|
-
|
|
25
|
-
- [ ] [Set up project integrations](https://gitlab.mcodellp.com/rangertech/fusionapp/library/fusion-ui/-/settings/integrations)
|
|
26
|
-
|
|
27
|
-
## Collaborate with your team
|
|
28
|
-
|
|
29
|
-
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
|
30
|
-
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
31
|
-
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
32
|
-
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
33
|
-
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
34
|
-
|
|
35
|
-
## Test and Deploy
|
|
31
|
+
---
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
## 1. Running Automated Tests Inside `fusion-ui`
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
42
|
-
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
43
|
-
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
35
|
+
### Unit & Component Tests (Vitest)
|
|
36
|
+
Unit and component specs (`src/**/*.spec.ts`) run in real headless Chromium via `@vitest/browser` and Playwright (configured in `vitest.config.ts`):
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
- **Single run:**
|
|
39
|
+
```bash
|
|
40
|
+
npm test
|
|
41
|
+
```
|
|
42
|
+
- **Watch mode (for active development):**
|
|
43
|
+
```bash
|
|
44
|
+
npm run test:watch
|
|
45
|
+
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
### E2E Regression Tests (Playwright)
|
|
48
|
+
End-to-end regression specs (`./e2e`) are configured in `playwright.config.ts`:
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
|
54
|
-
|
|
55
|
-
## Name
|
|
56
|
-
Choose a self-explaining name for your project.
|
|
57
|
-
|
|
58
|
-
## Description
|
|
59
|
-
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
60
|
-
|
|
61
|
-
## Badges
|
|
62
|
-
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
63
|
-
|
|
64
|
-
## Visuals
|
|
65
|
-
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
50
|
+
```bash
|
|
51
|
+
npm run test:e2e
|
|
52
|
+
```
|
|
66
53
|
|
|
67
|
-
|
|
68
|
-
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
54
|
+
---
|
|
69
55
|
|
|
70
|
-
##
|
|
71
|
-
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
56
|
+
## 2. Testing the Library in a Local Consumer App (Host / MFE)
|
|
72
57
|
|
|
73
|
-
|
|
74
|
-
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
58
|
+
Because `@rangertechnologies/fusion-ui` is built with `ng-packagr` (`ng-package.json`), always test against the compiled `dist/` output rather than raw `src/` files to avoid duplicate `@angular/core` instances or peer-dependency resolution issues.
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
60
|
+
### Option A: Using `npm run pack` (Recommended — Closest to Production)
|
|
78
61
|
|
|
79
|
-
|
|
80
|
-
|
|
62
|
+
1. **Build and pack the library in `fusion-ui`:**
|
|
63
|
+
```bash
|
|
64
|
+
npm run pack
|
|
65
|
+
```
|
|
66
|
+
This compiles the library into `dist/` and produces `dist/rangertechnologies-fusion-ui-<version>.tgz` (e.g., `dist/rangertechnologies-fusion-ui-0.1.11.tgz`).
|
|
81
67
|
|
|
82
|
-
|
|
68
|
+
2. **Install the tarball in your local consumer app (Host or MFE):**
|
|
69
|
+
```bash
|
|
70
|
+
cd /path/to/your-consumer-app
|
|
71
|
+
npm install /Users/ranger/Programs/rangertech/fusionapp/library/fusion-ui/dist/rangertechnologies-fusion-ui-0.1.11.tgz
|
|
72
|
+
```
|
|
83
73
|
|
|
84
|
-
|
|
74
|
+
### Option B: Live Reload / Watch Mode (For Active Development)
|
|
85
75
|
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
1. **Watch and rebuild `fusion-ui` on file changes:**
|
|
77
|
+
```bash
|
|
78
|
+
npx ng-packagr -p ng-package.json --watch
|
|
79
|
+
```
|
|
88
80
|
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
2. **Link the built `dist/` folder to your consumer app:**
|
|
82
|
+
```bash
|
|
83
|
+
cd /Users/ranger/Programs/rangertech/fusionapp/library/fusion-ui/dist
|
|
84
|
+
npm link
|
|
91
85
|
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
cd /path/to/your-consumer-app
|
|
87
|
+
npm link @rangertechnologies/fusion-ui
|
|
88
|
+
```
|
|
89
|
+
> **Note:** When using `npm link`, ensure `"preserveSymlinks": true` is set under your build options in the consumer app's `angular.json` so Angular resolves peer dependencies (`@angular/core`, `@angular/material`, etc.) from the consumer app's `node_modules`.
|