@uxf/scripts 11.122.3 → 11.122.4
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 +219 -52
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,35 +1,73 @@
|
|
|
1
1
|
# @uxf/scripts
|
|
2
2
|
|
|
3
|
-
# @uxf/scripts
|
|
4
3
|
[](https://www.npmjs.com/package/@uxf/scripts)
|
|
5
4
|
[](https://www.npmjs.com/package/@uxf/scripts)
|
|
6
5
|
[](https://www.npmjs.com/package/@uxf/scripts)
|
|
7
6
|
[](https://www.npmjs.com/package/@uxf/scripts)
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
Collection of UXF command-line tools for CI pipelines and local project maintenance (releases, dependency checks, sitemap crawling, i18n namespace generation, dead-code detection, and more).
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
Reach for a specific binary from this package when you need one of the CI/maintenance tasks listed below. It is a **CLI-only** package — there is no importable API (`main` points to a non-existent `index.js`); consume it through its `bin` commands, not `import`/`require`.
|
|
13
|
+
|
|
14
|
+
Most binaries are already available in the UXF Docker images, so CI jobs can call them directly. Locally, run them with `npx <command>`.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
yarn add -D @uxf/scripts
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Requires **Node.js >= 24** (`engines.node`). No peer dependencies. Runtime dependencies (`axios`, `cheerio`, `dayjs`, `fast-glob`, `got`, `madge`, `robots-txt-parser`, `semver`, `yaml`, `yargs`) are bundled.
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
| Command | Purpose |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `uxf-release` | Generate release notes from Git commits, create a GitLab release, notify Slack / Google Chat. |
|
|
29
|
+
| `uxf-push-notifier` | Notify Google Chat when a merge request is merged into (or code is pushed to) the default branch. |
|
|
30
|
+
| `uxf-dependencies-check` | Detect version conflicts and missing/mismatched peer deps across `@uxf/*` packages. |
|
|
31
|
+
| `uxf-audit` | Print a JSON report of Node / Yarn / Next / React and installed `@uxf/*` versions. |
|
|
32
|
+
| `uxf-claude-sync` | Download global guidelines from a URL into a `CLAUDE.md` file. |
|
|
33
|
+
| `uxf-i18n-namespaces-gen` | Generate an `i18n-pages.json` mapping routes to the translation namespaces they use. |
|
|
34
|
+
| `uxf-unused` | Find (and optionally delete) unused files in a Next.js project. |
|
|
35
|
+
| `uxf-sitemap-check` | Crawl a sitemap and check all URLs for HTTP errors, duplicates, and missing pages. |
|
|
36
|
+
| `uxf-sitemap-meta-export` | Crawl a sitemap and export page meta tags (title, description, OG) to `export.csv`. |
|
|
37
|
+
| `uxf-lunch` | Post today's lunch menu to a Slack channel. |
|
|
38
|
+
|
|
39
|
+
Every command accepts `-h` / `--help`.
|
|
40
|
+
|
|
41
|
+
### uxf-release
|
|
42
|
+
|
|
43
|
+
Reads commits on `master` since the last Git tag, generates release notes (grouped by conventional-commit type, linking YouTrack issues), creates a GitLab release, and posts a summary to Slack and/or Google Chat. Warns when the range contains DB migration files.
|
|
44
|
+
|
|
9
45
|
```
|
|
10
|
-
UXF release helper
|
|
11
46
|
Usage:
|
|
12
47
|
uxf-release [options]
|
|
13
48
|
|
|
14
49
|
Environment variables:
|
|
15
|
-
GITLAB_TOKEN
|
|
16
|
-
CI_SERVER_URL
|
|
17
|
-
CI_PROJECT_ID
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Options
|
|
21
|
-
-p, --project-id GitLab project id (or use environment variable
|
|
22
|
-
CI_PROJECT_ID) [number]
|
|
23
|
-
-d, --dry-run Skip publishing and sending slack notification [boolean]
|
|
24
|
-
-h, --help Show help [boolean]
|
|
50
|
+
GITLAB_TOKEN - required
|
|
51
|
+
CI_SERVER_URL - required - set by GitLab CI
|
|
52
|
+
CI_PROJECT_ID - required - set by GitLab CI
|
|
53
|
+
SLACK_TOKEN - optional
|
|
54
|
+
GOOGLE_WEBHOOK_URL - optional
|
|
25
55
|
|
|
26
56
|
Options:
|
|
27
|
-
|
|
57
|
+
-t, --tag-prefix Git tag prefix [string]
|
|
58
|
+
-g, --google-chat-webhook Google Chat webhook URL [string]
|
|
59
|
+
-m, --message Message title [string]
|
|
60
|
+
-p, --project-id GitLab project id (or use CI_PROJECT_ID) [number]
|
|
61
|
+
-s, --slack-channel Slack channel for notification [string]
|
|
62
|
+
-d, --dry-run Skip publishing and notifications [boolean]
|
|
63
|
+
-h, --help Show help [boolean]
|
|
28
64
|
```
|
|
29
65
|
|
|
30
|
-
|
|
66
|
+
`--project-id` overrides `CI_PROJECT_ID`; `--google-chat-webhook` falls back to `GOOGLE_WEBHOOK_URL`.
|
|
31
67
|
|
|
32
|
-
|
|
68
|
+
#### Use in a GitLab pipeline (`.gitlab-ci.yml`)
|
|
69
|
+
|
|
70
|
+
Set `GITLAB_TOKEN` in the GitLab CI/CD variables, then:
|
|
33
71
|
|
|
34
72
|
```yaml
|
|
35
73
|
# .gitlab-ci.yml
|
|
@@ -37,55 +75,69 @@ stages:
|
|
|
37
75
|
- release
|
|
38
76
|
|
|
39
77
|
release:
|
|
40
|
-
image: node:
|
|
78
|
+
image: node:24
|
|
41
79
|
stage: release
|
|
42
80
|
before_script:
|
|
43
|
-
- yarn global add @uxf/
|
|
81
|
+
- yarn global add @uxf/scripts
|
|
44
82
|
script:
|
|
45
83
|
# ... deploy project ...
|
|
46
84
|
- uxf-release
|
|
47
85
|
```
|
|
48
86
|
|
|
49
|
-
|
|
87
|
+
### uxf-push-notifier
|
|
88
|
+
|
|
89
|
+
Runs in GitLab CI. If the current commit is the merge commit of a merged MR, it posts a Google Chat message with the MR title, author, approver, and who merged it; otherwise it posts the list of pushed commits. Requires `GITLAB_TOKEN` plus the standard GitLab CI variables (`CI_SERVER_URL`, `CI_PROJECT_ID`, `CI_COMMIT_SHA`, `CI_COMMIT_BEFORE_SHA`, `CI_COMMIT_REF_NAME`).
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Usage:
|
|
93
|
+
uxf-push-notifier [options]
|
|
94
|
+
|
|
95
|
+
Environment variables:
|
|
96
|
+
GITLAB_TOKEN - required
|
|
97
|
+
|
|
98
|
+
Options:
|
|
99
|
+
-g, --google-chat-webhook-url Target Google Chat webhook URL [string]
|
|
100
|
+
-h, --help Show help [boolean]
|
|
101
|
+
```
|
|
50
102
|
|
|
51
103
|
```yaml
|
|
52
104
|
stages:
|
|
53
105
|
- notify
|
|
54
106
|
|
|
55
107
|
notify-push:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
108
|
+
image: node:24
|
|
109
|
+
stage: notify
|
|
110
|
+
except: [schedules]
|
|
111
|
+
only:
|
|
112
|
+
- develop # default branch
|
|
113
|
+
script:
|
|
114
|
+
- yarn global add @uxf/scripts # already present in UXF Docker images
|
|
115
|
+
- uxf-push-notifier --google-chat-webhook-url=$GOOGLE_CHAT_WEBHOOK
|
|
64
116
|
```
|
|
65
117
|
|
|
66
|
-
|
|
118
|
+
### uxf-dependencies-check
|
|
67
119
|
|
|
68
120
|
All-in-one dependency health check for projects using `@uxf/*` packages. Runs two checks:
|
|
69
121
|
|
|
70
122
|
1. **Version conflict detection** — reports dependencies where the project and/or `@uxf/*` packages themselves resolve to different versions. Transitive-only duplicates (a dep pulled in by unrelated third-party packages at a different version) are ignored, since they don't affect `@uxf/*` compatibility.
|
|
71
|
-
2. **Peer dependency check** — verifies that all `peerDependencies` of installed `@uxf/*` packages are present and version-matched
|
|
123
|
+
2. **Peer dependency check** — verifies that all `peerDependencies` of installed `@uxf/*` packages are present and version-matched.
|
|
72
124
|
|
|
73
125
|
Supports **yarn**, **npm**, **pnpm**, and **bun**. The package manager is auto-detected from the lock file.
|
|
74
126
|
|
|
75
|
-
```
|
|
127
|
+
```
|
|
76
128
|
Usage:
|
|
77
129
|
uxf-dependencies-check [options]
|
|
78
130
|
|
|
79
131
|
Options:
|
|
80
|
-
--fix Auto-install missing/mismatched peer dependencies
|
|
81
|
-
--dry-run Show what would be installed without changes
|
|
82
|
-
-e, --exclude Packages to ignore in conflict check
|
|
83
|
-
-h, --help Show help
|
|
132
|
+
--fix Auto-install missing/mismatched peer dependencies [boolean]
|
|
133
|
+
--dry-run Show what would be installed without changes [boolean]
|
|
134
|
+
-e, --exclude Packages to ignore in conflict check [array]
|
|
135
|
+
-h, --help Show help [boolean]
|
|
84
136
|
```
|
|
85
137
|
|
|
86
138
|
Build-time dependencies (`yargs`, `fast-glob`) are automatically ignored in the conflict check.
|
|
87
139
|
|
|
88
|
-
|
|
140
|
+
#### Examples
|
|
89
141
|
|
|
90
142
|
```bash
|
|
91
143
|
# Run both checks (exits with code 1 if issues found)
|
|
@@ -101,7 +153,7 @@ npx uxf-dependencies-check --dry-run
|
|
|
101
153
|
npx uxf-dependencies-check --exclude lodash dayjs
|
|
102
154
|
```
|
|
103
155
|
|
|
104
|
-
|
|
156
|
+
#### Ignoring known conflicts
|
|
105
157
|
|
|
106
158
|
Transitive-only duplicates (caused by unrelated third-party packages, e.g. `@udecode/plate-floating` pulling an old `@floating-ui/react` alongside a newer one declared by an `@uxf/*` package) are filtered out automatically and do not need to be ignored.
|
|
107
159
|
|
|
@@ -118,31 +170,146 @@ For genuine declarer conflicts that you've consciously accepted — e.g. two `@u
|
|
|
118
170
|
|
|
119
171
|
Ignored conflicts are still printed as informational output but do **not** cause a non-zero exit code. The `--exclude` CLI flag hides packages completely (not printed at all).
|
|
120
172
|
|
|
121
|
-
|
|
173
|
+
#### What it checks
|
|
174
|
+
|
|
175
|
+
- Parses the lock file (`yarn.lock` / `package-lock.json` / `pnpm-lock.yaml` / `bun.lock`) to find dependencies with multiple installed versions.
|
|
176
|
+
- For each candidate, resolves the version actually seen by each *declarer* (the project itself and any `@uxf/*` package that directly declares the dep). A conflict is reported only when these declarers land on different versions — transitive-only duplicates from unrelated third-party packages are filtered out.
|
|
177
|
+
- Scans all `@uxf/*` packages in your `dependencies` / `devDependencies`.
|
|
178
|
+
- Reads each package's `peerDependencies` from `node_modules`.
|
|
179
|
+
- Skips `@uxf/*`, `react`, `react-dom`, and `next` (you manage these yourself).
|
|
180
|
+
- Reports missing dependencies and version mismatches.
|
|
181
|
+
- Distinguishes between prod and dev dependencies — peer deps required only by `devDependencies` are installed with `-D`.
|
|
182
|
+
- With `--fix`, auto-installs missing peer deps using the detected package manager.
|
|
122
183
|
|
|
123
|
-
|
|
124
|
-
- For each candidate, resolves the version actually seen by each *declarer* (the project itself and any `@uxf/*` package that directly declares the dep). A conflict is reported only when these declarers land on different versions — transitive-only duplicates from unrelated third-party packages are filtered out
|
|
125
|
-
- Scans all `@uxf/*` packages in your `dependencies` / `devDependencies`
|
|
126
|
-
- Reads each package's `peerDependencies` from `node_modules`
|
|
127
|
-
- Skips `@uxf/*`, `react`, `react-dom`, and `next` (you manage these yourself)
|
|
128
|
-
- Reports missing dependencies and version mismatches
|
|
129
|
-
- Distinguishes between prod and dev dependencies — peer deps required only by `devDependencies` are installed with `-D`
|
|
130
|
-
- With `--fix`, auto-installs missing peer deps using the detected package manager
|
|
184
|
+
### uxf-audit
|
|
131
185
|
|
|
132
|
-
|
|
186
|
+
Prints a JSON report of the current environment to stdout: Node, Yarn, Next, React, and react-dom versions plus the resolved version of every installed `@uxf/*` package (duplicates are flagged with `isError: true`). Supports Yarn 1 and Yarn 4, auto-detected from `yarn -v`. Run it inside the target project. No options.
|
|
133
187
|
|
|
134
188
|
```bash
|
|
135
|
-
|
|
189
|
+
npx uxf-audit
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### uxf-claude-sync
|
|
193
|
+
|
|
194
|
+
Downloads content from a URL and writes it under a `# Global guidelines` heading in the target file (default `CLAUDE.md`). If the heading exists, the content below it is replaced; otherwise the section is appended (or a new file is created).
|
|
195
|
+
|
|
196
|
+
```
|
|
136
197
|
Usage:
|
|
137
|
-
uxf-
|
|
198
|
+
uxf-claude-sync [options]
|
|
199
|
+
|
|
200
|
+
Options:
|
|
201
|
+
--url Global guidelines URL [string]
|
|
202
|
+
--fileName Target file name (default: CLAUDE.md) [string]
|
|
203
|
+
-h, --help Show help
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### uxf-i18n-namespaces-gen
|
|
207
|
+
|
|
208
|
+
Walks a Next.js pages directory, follows each page's import graph (including `@uxf/*` packages and `tsconfig` path aliases), collects the translation namespaces referenced by `t(...)` calls and `<Trans>` components, and writes a route → namespaces map to a JSON file.
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
Usage:
|
|
212
|
+
uxf-i18n-namespaces-gen [options]
|
|
213
|
+
|
|
214
|
+
Options:
|
|
215
|
+
-i, --include Path prefixes to limit traversal to [array] [default: []]
|
|
216
|
+
-o, --output Output file [default: "i18n-pages.json"]
|
|
217
|
+
-n, --defaultNamespace Namespaces applied to every page [array] [default: ["common"]]
|
|
218
|
+
-p, --pagesDirectory Pages directory [default: "src/pages"]
|
|
219
|
+
-h, --help Show help
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Namespaces found on `/_app` are merged into the global `*` entry.
|
|
223
|
+
|
|
224
|
+
### uxf-unused
|
|
225
|
+
|
|
226
|
+
Finds files in a Next.js project that are not reachable from the pages import graph, prints them, and (with `--removeFiles`) deletes them. Use `--debug` to dump intermediate JSON files (`uxf-unused-*.json`) into the working directory.
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
Usage:
|
|
230
|
+
uxf-unused [options]
|
|
231
|
+
|
|
232
|
+
Options:
|
|
233
|
+
-p, --pagesDirectory Glob of page entry points
|
|
234
|
+
[default: "src/pages/**/*.(ts|tsx)"]
|
|
235
|
+
-f, --allFilesDirectory Glob of all candidate files
|
|
236
|
+
[default: "src/**/*.(ts|tsx)"]
|
|
237
|
+
-r, --removeFiles Delete the unused files [boolean] [default: false]
|
|
238
|
+
-d, --debug Write intermediate JSON files [boolean] [default: false]
|
|
239
|
+
-h, --help Show help
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### uxf-sitemap-check
|
|
243
|
+
|
|
244
|
+
Crawls a sitemap and requests every URL, reporting HTTP errors, duplicate sitemap entries, and (optionally) indexable pages missing from the sitemap. Can also follow nested page links and images. Sends a summary to Google Chat when errors are found and exits with code 1.
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
Usage:
|
|
248
|
+
uxf-sitemap-check [options]
|
|
138
249
|
|
|
139
250
|
Environment variables:
|
|
140
|
-
|
|
251
|
+
HTTP_USERNAME - optional
|
|
252
|
+
HTTP_PASSWORD - optional
|
|
253
|
+
|
|
254
|
+
Options:
|
|
255
|
+
--url Sitemap URL (required) [string]
|
|
256
|
+
-u, --http-username Basic-auth username (or HTTP_USERNAME) [string]
|
|
257
|
+
-p, --http-password Basic-auth password (or HTTP_PASSWORD) [string]
|
|
258
|
+
--skip Number of leading URLs to skip [number]
|
|
259
|
+
--with-nested Also test links found on each page [boolean]
|
|
260
|
+
--with-images Also test images found on each page [boolean]
|
|
261
|
+
--check-missing Report indexable pages missing from the
|
|
262
|
+
sitemap (requires --with-nested) [boolean]
|
|
263
|
+
--google-chat-webhook-url Where to send the results [string]
|
|
264
|
+
-h, --help Show help [boolean]
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### uxf-sitemap-meta-export
|
|
141
268
|
|
|
142
|
-
|
|
143
|
-
|
|
269
|
+
Crawls a sitemap and writes a semicolon-separated `export.csv` (columns: `url;title;og:title;description;og:description`) into the working directory. The sitemap URL is taken from `--url` or the `SITEMAP_URL` environment variable.
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
Usage:
|
|
273
|
+
uxf-sitemap-meta-export [options]
|
|
274
|
+
|
|
275
|
+
Environment variables:
|
|
276
|
+
SITEMAP_URL - required (or use --url)
|
|
277
|
+
HTTP_USERNAME - optional
|
|
278
|
+
HTTP_PASSWORD - optional
|
|
279
|
+
SLACK_WEBHOOK_URL - optional
|
|
280
|
+
|
|
281
|
+
Options:
|
|
282
|
+
--url Sitemap URL (or use SITEMAP_URL) [string]
|
|
283
|
+
-u, --http-username Basic-auth username (or HTTP_USERNAME) [string]
|
|
284
|
+
-p, --http-password Basic-auth password (or HTTP_PASSWORD) [string]
|
|
285
|
+
-d, --dry-run Skip the Slack notification [boolean]
|
|
144
286
|
-h, --help Show help [boolean]
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### uxf-lunch
|
|
290
|
+
|
|
291
|
+
Fetches the daily menu (Hotel Radnice) and posts it as a formatted message to a Slack channel.
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
Usage:
|
|
295
|
+
uxf-lunch [options]
|
|
296
|
+
|
|
297
|
+
Environment variables:
|
|
298
|
+
SLACK_TOKEN - required
|
|
145
299
|
|
|
146
300
|
Options:
|
|
147
|
-
|
|
301
|
+
--slack-channel Slack channel (required) [string]
|
|
302
|
+
-h, --help Show help
|
|
148
303
|
```
|
|
304
|
+
|
|
305
|
+
## Gotchas
|
|
306
|
+
|
|
307
|
+
- **CLI-only, no importable API.** `main` references a `index.js` that is not shipped; use the `bin` commands.
|
|
308
|
+
- **CI-oriented defaults.** `uxf-release`, `uxf-push-notifier`, and `uxf-sitemap-meta-export` expect GitLab CI / environment variables and mostly make sense inside a pipeline.
|
|
309
|
+
- **`uxf-sitemap-check --check-missing`** only works together with `--with-nested`; used alone it exits with code 1.
|
|
310
|
+
- **`uxf-unused --removeFiles` deletes files** on disk — run without it (or with `--debug`) first to review the list.
|
|
311
|
+
- **`uxf-merge-requests-notifier`** exists in the source tree but is **not** exposed as a `bin` command; it is run internally via the package's `run:mr-notifier` npm script and is not installed for consumers.
|
|
312
|
+
|
|
313
|
+
## Links
|
|
314
|
+
|
|
315
|
+
- [npm package](https://www.npmjs.com/package/@uxf/scripts)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/scripts",
|
|
3
|
-
"version": "11.122.
|
|
3
|
+
"version": "11.122.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"@types/react-dom": "18.3.7",
|
|
51
51
|
"@types/semver": "^7.7.1",
|
|
52
52
|
"@uxf/core": "11.114.0",
|
|
53
|
-
"@uxf/ui": "11.122.
|
|
53
|
+
"@uxf/ui": "11.122.4"
|
|
54
54
|
}
|
|
55
55
|
}
|