opsfuse-ui 0.1.0 → 0.1.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.
- package/.claude/skills/opsfuse-setup/SKILL.md +0 -56
- package/README.md +2 -213
- package/package.json +1 -1
|
@@ -29,59 +29,8 @@ Before touching anything, understand what you're working with:
|
|
|
29
29
|
|
|
30
30
|
### 1a. Install the package
|
|
31
31
|
|
|
32
|
-
Pick **one** install method. Submodule is preferred when the host repo should pin a specific library revision alongside application code.
|
|
33
|
-
|
|
34
|
-
#### Option A — Git submodule (recommended for monorepos / pinned source)
|
|
35
|
-
|
|
36
|
-
From the **host app** repository root:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
git submodule add git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git packages/ui
|
|
40
|
-
git submodule update --init --recursive
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Add to the host `package.json`:
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"opsfuse-ui": "file:packages/ui"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Install with the detected package manager (`npm install`, `pnpm install`, etc.). On fresh clones of the host repo, run `git submodule update --init --recursive` before install.
|
|
54
|
-
|
|
55
|
-
**Pull / update submodule in the host app** (from host repo root unless noted):
|
|
56
|
-
|
|
57
|
-
| Situation | Commands |
|
|
58
|
-
| --------- | -------- |
|
|
59
|
-
| Fresh clone | `git submodule update --init --recursive` → `npm install` |
|
|
60
|
-
| After `git pull` on host (submodule SHA may have changed) | `git submodule update --init --recursive` → `cd packages/ui && npm run build:lib` → `npm install` in host if `packages/ui/package.json` changed |
|
|
61
|
-
| Pull host + sync submodules together | `git pull --recurse-submodules` (or `git config submodule.recurse true` then `git pull`) → rebuild in `packages/ui` |
|
|
62
|
-
| Bump library to latest remote | `cd packages/ui` → `git fetch` → `git checkout main` → `git pull` → `cd ../..` → `git add packages/ui` → commit → `npm run build:lib` in `packages/ui` → `npm install` in host if needed |
|
|
63
|
-
|
|
64
|
-
The host records which library commit is pinned; always commit `packages/ui` when intentionally upgrading the submodule.
|
|
65
|
-
|
|
66
|
-
#### Option B — Registry or git dependency
|
|
67
|
-
|
|
68
|
-
Use the detected package manager:
|
|
69
|
-
|
|
70
32
|
```bash
|
|
71
|
-
# npm (registry)
|
|
72
33
|
npm install opsfuse-ui
|
|
73
|
-
|
|
74
|
-
# yarn
|
|
75
|
-
yarn add opsfuse-ui
|
|
76
|
-
|
|
77
|
-
# pnpm
|
|
78
|
-
pnpm add opsfuse-ui
|
|
79
|
-
|
|
80
|
-
# bun
|
|
81
|
-
bun add opsfuse-ui
|
|
82
|
-
|
|
83
|
-
# From private Git repo (internal, not submodule)
|
|
84
|
-
npm install git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git#main
|
|
85
34
|
```
|
|
86
35
|
|
|
87
36
|
**Peer dependencies** — opsfuse-ui requires `react` and `react-dom` (same major version). Verify they are already installed. Do not add them if they already exist.
|
|
@@ -170,15 +119,10 @@ If the host app uses Tailwind v4, point content at the built bundle so utility c
|
|
|
170
119
|
// tailwind.config.js or @source in your CSS
|
|
171
120
|
content: [
|
|
172
121
|
"./src/**/*.{js,ts,jsx,tsx}",
|
|
173
|
-
// npm / git dependency:
|
|
174
122
|
"./node_modules/opsfuse-ui/dist/index.js",
|
|
175
|
-
// git submodule at packages/ui:
|
|
176
|
-
"./packages/ui/dist/index.js",
|
|
177
123
|
],
|
|
178
124
|
```
|
|
179
125
|
|
|
180
|
-
Use the path that matches how opsfuse-ui was installed (only one of the library paths is needed).
|
|
181
|
-
|
|
182
126
|
---
|
|
183
127
|
|
|
184
128
|
## PHASE 3 — Theme Selection
|
package/README.md
CHANGED
|
@@ -100,106 +100,15 @@ import { Recharts } from "opsfuse-ui/recharts";
|
|
|
100
100
|
|
|
101
101
|
**TypeScript:** use `moduleResolution` `"bundler"` or `"node16"` / `"nodenext"` so `package.json` `exports` resolve correctly.
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
## Install as a git submodule
|
|
106
|
-
|
|
107
|
-
Use a submodule when you want the library source pinned in your repo (for example at `packages/ui`) instead of pulling from the npm registry or a one-off git dependency.
|
|
108
|
-
|
|
109
|
-
From your **host app** repository root:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
git submodule add git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git packages/ui
|
|
113
|
-
git submodule update --init --recursive
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Wire the submodule into the host app’s `package.json`:
|
|
117
|
-
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"dependencies": {
|
|
121
|
-
"opsfuse-ui": "file:packages/ui"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Then install in the host app:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
npm install
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
The `prepare` script in this repo runs `build:lib`, so `dist/` is produced on install. If you clone the host repo later, initialize submodules before installing:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
git submodule update --init --recursive
|
|
136
|
-
npm install
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Update and pull in the host app
|
|
140
|
-
|
|
141
|
-
The host repo stores a **commit SHA** for `packages/ui`. Pulling the host app does not always check out that commit inside the submodule unless you sync submodules explicitly.
|
|
142
|
-
|
|
143
|
-
**After `git pull` on the host** (teammate bumped the submodule, or you switched branches):
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
# From the host app repository root
|
|
147
|
-
git submodule update --init --recursive
|
|
148
|
-
cd packages/ui && npm run build:lib
|
|
149
|
-
cd ../.. && npm install # if packages/ui/package.json or lockfile changed
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**Pull host + sync submodules in one step** (optional; set once per machine):
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
git config submodule.recurse true
|
|
156
|
-
git pull
|
|
157
|
-
cd packages/ui && npm run build:lib
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Or a single pull without changing config:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
git pull --recurse-submodules
|
|
164
|
-
cd packages/ui && npm run build:lib
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**Bump `packages/ui` to the latest library** (you choose the new commit and record it in the host repo):
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
cd packages/ui
|
|
171
|
-
git fetch origin
|
|
172
|
-
git checkout main # or a tag / commit you want to pin
|
|
173
|
-
git pull origin main
|
|
174
|
-
cd ../..
|
|
175
|
-
git add packages/ui
|
|
176
|
-
git commit -m "chore: bump opsfuse-ui submodule"
|
|
177
|
-
cd packages/ui && npm run build:lib
|
|
178
|
-
cd ../.. && npm install # if library dependencies changed
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
**Fresh clone of the host app:**
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
git clone <host-repo-url>
|
|
185
|
-
cd <host-app>
|
|
186
|
-
git submodule update --init --recursive
|
|
187
|
-
npm install
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Imports, styles, fonts, and `OpsfuseThemeProvider` are the same as in [Install in an application](#install-in-an-application) above (`import "opsfuse-ui/..."`, etc.).
|
|
191
|
-
|
|
192
|
-
**Tailwind v4 content** — if you scan the library for classes, point at the submodule build output instead of `node_modules`:
|
|
103
|
+
**Tailwind v4 content** — if you scan the library for classes, include the built bundle:
|
|
193
104
|
|
|
194
105
|
```js
|
|
195
106
|
content: [
|
|
196
107
|
"./src/**/*.{js,ts,jsx,tsx}",
|
|
197
|
-
"./
|
|
108
|
+
"./node_modules/opsfuse-ui/dist/index.js",
|
|
198
109
|
],
|
|
199
110
|
```
|
|
200
111
|
|
|
201
|
-
**Claude Code skills** — the `postinstall` script copies skills into the host app’s `.claude/skills/` when you `npm install` the `file:` dependency.
|
|
202
|
-
|
|
203
112
|
---
|
|
204
113
|
|
|
205
114
|
## Claude Code Skills
|
|
@@ -212,130 +121,10 @@ Available skills:
|
|
|
212
121
|
- `/color-theme` — Design token and typography guide
|
|
213
122
|
- `/ui-consistency` — Best practices and mandatory code patterns
|
|
214
123
|
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## Use the library locally (path / link)
|
|
218
|
-
|
|
219
|
-
For a copy tracked in git at a fixed path (`packages/ui`), use [Install as a git submodule](#install-as-a-git-submodule) instead of a manual relative path.
|
|
220
|
-
|
|
221
|
-
1. In this repo, build the package:
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
npm run build:lib
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
2. In the **host app**, depend on the folder (adjust the relative path):
|
|
228
|
-
|
|
229
|
-
**package.json**
|
|
230
|
-
|
|
231
|
-
```json
|
|
232
|
-
{
|
|
233
|
-
"dependencies": {
|
|
234
|
-
"opsfuse-ui": "file:../opsfuse-ui"
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Then run `npm install` in the host app.
|
|
240
|
-
|
|
241
|
-
**Alternative — `npm link`**
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
cd opsfuse-ui && npm run build:lib && npm link
|
|
245
|
-
cd ../your-host-app && npm link opsfuse-ui
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
If you see duplicate React errors, prefer `file:` or align `react` / `react-dom` versions; restart the host dev server after rebuilding the library.
|
|
249
|
-
|
|
250
|
-
3. After changing this library, run `npm run build:lib` again; the host picks up the new `dist/` on the next install or when the link updates.
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## Install directly from Git
|
|
255
|
-
|
|
256
|
-
If you install from a Git URL, use `git+https` (or `git+ssh`) instead of a plain `https://...git` URL. A plain URL may be treated as a tarball endpoint and fail with `TAR_BAD_ARCHIVE`.
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
npm install git+https://code.opsfuse.com/mockinterview/opsfuse-ui.git#main
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
Notes:
|
|
263
|
-
|
|
264
|
-
- This repository now has a `prepare` script, so npm builds the library (`dist/`) when installing from git.
|
|
265
|
-
- The git host must be accessible/authenticated from the host app environment.
|
|
266
|
-
- Git installs are best for internal/dev usage; for stable consumer installs, prefer the GitLab npm registry flow below.
|
|
267
|
-
|
|
268
|
-
---
|
|
269
|
-
|
|
270
|
-
## Publish and install from GitLab (Package Registry)
|
|
271
|
-
|
|
272
|
-
Use the [GitLab npm registry](https://docs.gitlab.com/ee/user/packages/npm_registry/) for your project or group. URLs below use placeholders—replace with your GitLab instance URL, project ID, or group path.
|
|
273
|
-
|
|
274
|
-
### Publish (this repo)
|
|
275
|
-
|
|
276
|
-
1. Choose a registry URL:
|
|
277
|
-
|
|
278
|
-
- **Project:** `https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/`
|
|
279
|
-
- **Group:** `https://gitlab.example.com/api/v4/groups/<GROUP_ID>/-/packages/npm/`
|
|
280
|
-
|
|
281
|
-
2. **Bump version** in `package.json` (GitLab rejects duplicate versions).
|
|
282
|
-
|
|
283
|
-
3. Authenticate, then publish:
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
npm run build:lib
|
|
287
|
-
npm publish --registry=https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
Use a [GitLab deploy token](https://docs.gitlab.com/ee/user/project/deploy_tokens/) or [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) with scopes `read_package_registry` / `write_package_registry` as required. For CI, use `CI_JOB_TOKEN` with a [CI/CD job token](https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html) allowed to access the registry.
|
|
291
|
-
|
|
292
|
-
Optional **publishConfig** in this package’s `package.json` so you do not pass `--registry` each time:
|
|
293
|
-
|
|
294
|
-
```json
|
|
295
|
-
"publishConfig": {
|
|
296
|
-
"registry": "https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/"
|
|
297
|
-
}
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
For a **scoped** name (e.g. `@company/opsfuse-ui`), set `name` and scope in `.npmrc` on the consumer as shown below; the registry URL pattern is the same idea for project or group.
|
|
301
|
-
|
|
302
|
-
### Install in the host app (GitLab)
|
|
303
|
-
|
|
304
|
-
1. In the **host app**, add a **`.npmrc`** next to `package.json` (use the same registry base URL you publish to):
|
|
305
|
-
|
|
306
|
-
```ini
|
|
307
|
-
; Project registry example
|
|
308
|
-
registry=https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/
|
|
309
|
-
|
|
310
|
-
; For private registry auth (choose one approach)
|
|
311
|
-
//gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/npm/:_authToken=${GITLAB_TOKEN}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
For **local development**, set `GITLAB_TOKEN` to a personal access token or deploy token with `read_package_registry`. In **GitLab CI**, use `CI_JOB_TOKEN` if your job is allowed to pull packages from that project.
|
|
315
|
-
|
|
316
|
-
2. Install:
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
npm install opsfuse-ui
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
If the package is **scoped** (e.g. `@company/opsfuse-ui`), configure the scope in `.npmrc`:
|
|
323
|
-
|
|
324
|
-
```ini
|
|
325
|
-
@company:registry=https://gitlab.example.com/api/v4/groups/<GROUP_ID>/-/packages/npm/
|
|
326
|
-
//gitlab.example.com/api/v4/groups/<GROUP_ID>/-/packages/npm/:_authToken=${GITLAB_TOKEN}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
Then `npm install @company/opsfuse-ui`.
|
|
330
|
-
|
|
331
|
-
See GitLab’s docs for [npm authentication](https://docs.gitlab.com/ee/user/packages/npm_registry/#authenticate-with-the-registry) and [troubleshooting](https://docs.gitlab.com/ee/user/packages/npm_registry/) (401/403, token scopes, duplicate versions).
|
|
332
|
-
|
|
333
124
|
### IDE (VS Code / Cursor) — completions and auto-imports
|
|
334
125
|
|
|
335
126
|
TypeScript only suggests symbols from packages that are **listed in the host app’s `package.json`** (`dependencies` or `devDependencies`). Add `opsfuse-ui` there, then run **“TypeScript: Restart TS Server”** after install or upgrades.
|
|
336
127
|
|
|
337
|
-
If you use a **`file:`** path or **`npm link`**, run **`npm run build:lib`** in this repo first so **`dist/index.d.ts`** exists; without it, the editor has nothing to load.
|
|
338
|
-
|
|
339
128
|
Optional: set **`typescript.preferences.includePackageJsonAutoImports`** to **`on`** if you want broader auto-import behavior (the default **`auto`** only considers direct `package.json` dependencies).
|
|
340
129
|
|
|
341
130
|
---
|