@nera-static/test-utils 0.0.0-stage → 1.0.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/CHANGELOG.md +28 -0
- package/LICENSE +21 -0
- package/README.md +479 -2
- package/package.json +71 -5
- package/src/cli.js +182 -0
- package/src/console.js +24 -0
- package/src/contrast.js +34 -0
- package/src/core.js +26 -0
- package/src/files.js +128 -0
- package/src/html.js +126 -0
- package/src/index.js +10 -0
- package/src/publish-template.js +295 -0
- package/src/site.js +179 -0
- package/src/theme/contract.js +399 -0
- package/src/theme/coupling.js +136 -0
- package/src/theme/fixture.js +202 -0
- package/src/theme/index.js +9 -0
- package/src/theme/override.js +114 -0
- package/src/theme/plugin-classes.js +115 -0
- package/src/theme/subdirectory.js +165 -0
- package/src/theme/suite.js +150 -0
- package/src/theme/tokens.js +228 -0
- package/src/vitest.js +49 -0
- package/src/yaml.js +75 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.1] - 2026-11-27
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- The path check every suite's options share (a path below the repo root: not empty, not absolute, no `..` segment) is defined once, in `src/files.js`, instead of twice. No option is accepted or refused differently; it is not exported.
|
|
13
|
+
|
|
14
|
+
## [1.0.0] - 2026-11-27
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- First release: the shared test helpers, test suites and canonical vitest config of the Nera repos, as a devDependency. Three entry points: `@nera-static/test-utils` (helpers and `publishTemplateSuite`), `@nera-static/test-utils/theme` (fixture builds and the theme suites) and `@nera-static/test-utils/vitest` (the preset). ESM, Node.js 22.12.0 or later.
|
|
19
|
+
- Peer dependencies: `vitest` `^5.0.0`; `@nera-static/core` `^4.15.0` and `@nera-static/nera` `^1.11.0`, both optional and only resolved by the helpers that need them, with an install hint when they are missing. Two runtime dependencies: `cheerio`, for `$` and `jsonLd`, and `@nera-static/plugin-utils` `^1.8.0`, for `isPlainObject` and `escapeRegExp` in the option checks and `FRONTMATTER_OPTIONS` and `splitFrontmatter` in `frontmatter`.
|
|
20
|
+
- `neraConfig(test)` and `CANONICAL_TEST`: the canonical vitest `test` block (`include: ['test/**/*.test.js']`, `environment: 'node'`, `restoreMocks`, `unstubEnvs`, `unstubGlobals`), the caller's keys merged over it.
|
|
21
|
+
- File helpers: `tempDir(prefix)` (realpath'd, removed after the test file), `writeFiles(root, files)` (`null` removes, paths outside `root` refused), `listFiles(dir, extensions?)`, `captureConsole(method)`.
|
|
22
|
+
- YAML helpers on core's own `yaml` package: `parseYaml(text)`, `loadYaml(file)` and `frontmatter(file)`, which finds and parses a page's frontmatter with core's options and fence rule from `@nera-static/plugin-utils/frontmatter`.
|
|
23
|
+
- Site helpers: `makeSite({ files, plugins })` (a temp site with a `package.json`, `config/app.yaml` and layout, plugins under test as local plugins), `folders(root)`, `buildSite(root)` (core's `run()` from inside the site → `{ warnings, logs }`), `useSiteCwd(files)` for hook unit tests, `readPublic(root, rel)`.
|
|
24
|
+
- HTML readers: `pages`, `page`, `countTags`, `tags`, `attr`, `elementByClass`, `stripTags`, `$` (cheerio) and `jsonLd`; WCAG 2.2 `luminance(hex)` and `contrast(a, b)`.
|
|
25
|
+
- CLI helpers: `nera(cwd, args, { root })` → `{ code, stdout, stderr }` with the installed CLI, `scaffoldStarter(repoRoot, name, args)`, `expectCleanBuild(site)` (build, check and validate clean, text and JSON, stdout and stderr) and `STRICT_VALIDATE`.
|
|
26
|
+
- `publishTemplateSuite({ root, pluginName, templates, assets, bin })`: five cases for a plugin's `publish-template` bin (publishes every template, skips existing ones, overwrites with `--force`, refuses outside a Nera project, publishes into `theme/` on a themed site), plus three per asset.
|
|
27
|
+
- Theme fixture builds: `mirrorFixture`, `appendYaml`, `buildVariants` (in parallel, or from a warmed image cache) and `themeGlobalSetup` → `{ setup, teardown }`.
|
|
28
|
+
- Theme suites driven by a per-theme options object: `contractSuite`, `overrideSuite`, `couplingSuite`, `pluginClassesSuite`, `subdirectorySuite` and `tokensSuite`. Every failing case names the file, the offending value and what to change.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michael Becker
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,480 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nera-static/test-utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/seebaermichi/nera-test-utils/actions/workflows/test.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@nera-static/test-utils)
|
|
5
|
+
|
|
6
|
+
The shared test helpers, test suites and the canonical vitest config for the [Nera](https://github.com/seebaermichi/nera) static site generator's plugins, themes, starters and tools. Every Nera repo tests the same way with it: a throwaway site in a temp directory, built by the real engine, checked with the same readers, and the same standard cases for template publishing and theme contracts.
|
|
7
|
+
|
|
8
|
+
📖 **Documentation:** [nera.js.org](https://nera.js.org) · **Style guide:** [nera.js.org/docs/style-guide](https://nera.js.org/docs/style-guide/)
|
|
9
|
+
|
|
10
|
+
It is a **devDependency only**. Nothing a plugin, theme, starter or site ships at runtime may import it.
|
|
11
|
+
|
|
12
|
+
## 🚀 Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install --save-dev @nera-static/test-utils vitest
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Add the engine or the CLI only when your tests need them:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install --save-dev @nera-static/core # buildSite, parseYaml, loadYaml, frontmatter, the theme suites that read YAML
|
|
22
|
+
npm install --save-dev @nera-static/nera # nera(), scaffoldStarter, expectCleanBuild, buildVariants, themeGlobalSetup
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Peer dependency | Range | Needed by |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `vitest` | `^5.0.0` | everything (required) |
|
|
28
|
+
| `@nera-static/core` | `^4.15.0` (optional) | `buildSite`, `parseYaml`, `loadYaml`, `frontmatter`, `contractSuite`, `tokensSuite` |
|
|
29
|
+
| `@nera-static/nera` | `^1.11.0` (optional) | `nera`, `scaffoldStarter`, `expectCleanBuild`, `buildVariants`, `themeGlobalSetup` |
|
|
30
|
+
|
|
31
|
+
No module imports core or the CLI when it is loaded: a helper that needs one resolves it on its first call, from where npm installed it beside this package, and names the install command when it is missing. The YAML helpers use **core's own `yaml` package**, so a test parses exactly as the build does.
|
|
32
|
+
|
|
33
|
+
Two runtime dependencies: [`cheerio`](https://cheerio.js.org/), for `$` and `jsonLd`, because they need a real HTML parser (attributes in any order, nested markup), which the regular-expression readers below deliberately are not; and [`@nera-static/plugin-utils`](https://www.npmjs.com/package/@nera-static/plugin-utils) `^1.8.0`, whose `isPlainObject` and `escapeRegExp` the option checks and suites use, and whose `FRONTMATTER_OPTIONS` and `splitFrontmatter` `frontmatter` uses, so the fleet's generic helpers exist once. An option documented as an object must be a plain one (a literal, parsed YAML or `Object.create(null)`); a `Map` or a class instance throws like any other wrong value.
|
|
34
|
+
|
|
35
|
+
Requires Node.js 22.12.0 or later, like `@nera-static/core`, `@nera-static/nera` and `@nera-static/validate`. ESM only.
|
|
36
|
+
|
|
37
|
+
## Entry points
|
|
38
|
+
|
|
39
|
+
| Import | Holds |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `@nera-static/test-utils` | the helpers and `publishTemplateSuite` |
|
|
42
|
+
| `@nera-static/test-utils/theme` | fixture mirrors, variant builds, the theme `globalSetup` and the six theme suites |
|
|
43
|
+
| `@nera-static/test-utils/vitest` | `neraConfig`, the canonical vitest config |
|
|
44
|
+
|
|
45
|
+
## ⚙️ The vitest config
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
// vitest.config.js
|
|
49
|
+
import { neraConfig } from '@nera-static/test-utils/vitest'
|
|
50
|
+
|
|
51
|
+
export default neraConfig()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`neraConfig(test = {})` returns `defineConfig({ test })` with the canonical `test` block, `CANONICAL_TEST` (also exported):
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
{
|
|
58
|
+
include: ['test/**/*.test.js'],
|
|
59
|
+
environment: 'node',
|
|
60
|
+
restoreMocks: true,
|
|
61
|
+
unstubEnvs: true,
|
|
62
|
+
unstubGlobals: true,
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The keys you pass are merged over it, shallowly: a key you pass replaces the canonical value. Only add what the repo needs, with a comment saying why:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
export default neraConfig({
|
|
70
|
+
// every test builds a site with the real CLI
|
|
71
|
+
testTimeout: 60000,
|
|
72
|
+
globalSetup: ['test/global-setup.js'],
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Anything but a plain object throws a `TypeError`. `restoreMocks` is what puts `captureConsole` and `useSiteCwd` back after each test, so keep it.
|
|
77
|
+
|
|
78
|
+
## 🧰 Helpers
|
|
79
|
+
|
|
80
|
+
All from `@nera-static/test-utils`. Every helper checks its arguments and throws a message that says what it got and what to pass.
|
|
81
|
+
|
|
82
|
+
### Files
|
|
83
|
+
|
|
84
|
+
#### `tempDir(prefix = 'nera-test-')` → `string`
|
|
85
|
+
|
|
86
|
+
A fresh directory under `os.tmpdir()`, as its real path (`/private/var/…` on macOS, so it agrees with `process.cwd()` inside it). Removed after the test file, in an `afterAll` registered when the package loads. The prefix must not contain a path separator.
|
|
87
|
+
|
|
88
|
+
- Called outside a test file (a `globalSetup`, a script), the directory is **not** removed; remove it in your teardown.
|
|
89
|
+
- With `isolate: false` in the vitest config only the first test file's directories are removed.
|
|
90
|
+
|
|
91
|
+
#### `writeFiles(root, files)` → `root`
|
|
92
|
+
|
|
93
|
+
Writes `{ 'relative/path': content }` below the absolute `root`, creating parent directories. `content` is a string or a `Buffer`/`Uint8Array`; `null` removes the file or directory at that path (no error when it is already gone). A path that leaves `root` throws.
|
|
94
|
+
|
|
95
|
+
#### `listFiles(dir, extensions?)` → `string[]`
|
|
96
|
+
|
|
97
|
+
Every file below `dir`, recursively, as sorted relative paths with `/` separators on every platform. `extensions` (`['.html', '.css']`) keeps only those; without it, all files.
|
|
98
|
+
|
|
99
|
+
#### `captureConsole(method)` → `() => string[]`
|
|
100
|
+
|
|
101
|
+
Silences `console[method]` (`'log'`, `'info'`, `'warn'`, `'error'` or `'debug'`) with a `vi.spyOn` and returns a function giving the lines written so far, each call's arguments joined with a space (`console.warn('⚠️ x:', 'msg')` → `'⚠️ x: msg'`). Restored after the test by `restoreMocks`.
|
|
102
|
+
|
|
103
|
+
### YAML
|
|
104
|
+
|
|
105
|
+
These need `@nera-static/core` and use its `yaml` package.
|
|
106
|
+
|
|
107
|
+
#### `parseYaml(text)` → `unknown`
|
|
108
|
+
|
|
109
|
+
Parses YAML text as core reads `config/*.yaml`. `null` for an empty document.
|
|
110
|
+
|
|
111
|
+
#### `loadYaml(file)` → `unknown`
|
|
112
|
+
|
|
113
|
+
Reads and parses a YAML file. A parse error names the file.
|
|
114
|
+
|
|
115
|
+
#### `frontmatter(file)` → `object`
|
|
116
|
+
|
|
117
|
+
A Markdown page's frontmatter, found and parsed as core does: the block between a `---` first line and the next `---` line (or the end of the file), with core's options (unquoted dates become `Date` objects, `<<` merge keys work, a repeated key takes the last value). Fence rule and options are `splitFrontmatter` and `FRONTMATTER_OPTIONS` from `@nera-static/plugin-utils/frontmatter`, the parser is core's `yaml`. `{}` when the page has none. A parse error names the file.
|
|
118
|
+
|
|
119
|
+
### Sites
|
|
120
|
+
|
|
121
|
+
#### `makeSite({ files = {}, plugins = {} } = {})` → `string`
|
|
122
|
+
|
|
123
|
+
A throwaway Nera site in a `tempDir`, removed after the test file. It starts with:
|
|
124
|
+
|
|
125
|
+
| File | Content |
|
|
126
|
+
|---|---|
|
|
127
|
+
| `package.json` | `{ "name": "demo", "private": true, "type": "module" }` |
|
|
128
|
+
| `config/app.yaml` | `name: Demo`, `lang: en`, `origin: https://example.com/` |
|
|
129
|
+
| `views/layout.pug` | a page that renders `content` into `main` |
|
|
130
|
+
|
|
131
|
+
There is no default page: name your pages in `files`. `files` adds to the defaults or replaces them; `null` removes one. Each `plugins` entry `{ name: entryFile }` (an absolute path to an existing file) becomes the local plugin `plugins/<name>/index.js`, re-exporting your entry file, so core loads the plugin under test the way a site loads its own plugins.
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
import path from 'node:path'
|
|
135
|
+
import { beforeAll, expect, it } from 'vitest'
|
|
136
|
+
import { buildSite, makeSite, readPublic } from '@nera-static/test-utils'
|
|
137
|
+
|
|
138
|
+
const ENTRY = path.resolve(import.meta.dirname, '../index.js')
|
|
139
|
+
let site
|
|
140
|
+
let result
|
|
141
|
+
|
|
142
|
+
beforeAll(async () => {
|
|
143
|
+
site = makeSite({
|
|
144
|
+
plugins: { sitemap: ENTRY },
|
|
145
|
+
files: { 'pages/index.md': '---\nlayout: layout.pug\n---\n# Home\n' },
|
|
146
|
+
})
|
|
147
|
+
result = await buildSite(site)
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
it('lists the home page', () => {
|
|
151
|
+
expect(readPublic(site, 'sitemap.xml')).toContain('<loc>https://example.com/index.html</loc>')
|
|
152
|
+
expect(result.warnings).toEqual([])
|
|
153
|
+
})
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### `folders(root)` → `{ config, pages, views, assets, dist, plugins }`
|
|
157
|
+
|
|
158
|
+
The absolute folders core's `run()` takes for the site at `root`, as `nera build` passes them (`dist` is `public/`).
|
|
159
|
+
|
|
160
|
+
#### `buildSite(root)` → `Promise<{ warnings: string[], logs: string[] }>`
|
|
161
|
+
|
|
162
|
+
Builds the site with core's real `run()`, from inside `root` the way `nera build` runs it (plugins read their config relative to `process.cwd()`). `console.log` and `console.warn` are silenced and collected, each call's arguments joined with a space; `console.error` passes through. The working directory and the console are restored even when the build throws, and a test's own `captureConsole` is left untouched.
|
|
163
|
+
|
|
164
|
+
It changes the working directory, so it needs vitest's default `forks` pool; under `pool: 'threads'` it throws a message saying so.
|
|
165
|
+
|
|
166
|
+
#### `useSiteCwd(files = {})` → `string`
|
|
167
|
+
|
|
168
|
+
For unit tests of a hook that reads `config/<name>.yaml`: writes `files` into a fresh `tempDir` (no defaults) and points `process.cwd()` at it with a `vi.spyOn`. The real working directory never changes. Valid for one test: call it inside the test or in `beforeEach`.
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
it('reads the output from the config', () => {
|
|
172
|
+
useSiteCwd({ 'config/sitemap.yaml': 'output: map.xml\n' })
|
|
173
|
+
expect(readConfig().output).toBe('map.xml')
|
|
174
|
+
})
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### `readPublic(root, rel)` → `string`
|
|
178
|
+
|
|
179
|
+
A built file below the site's `public/`. A missing file throws, listing what the build wrote, or saying the site was never built.
|
|
180
|
+
|
|
181
|
+
### HTML
|
|
182
|
+
|
|
183
|
+
Core beautifies the HTML it writes, so the regular-expression readers are enough for attribute-level checks; `$` and `jsonLd` parse.
|
|
184
|
+
|
|
185
|
+
| Export | Returns |
|
|
186
|
+
|---|---|
|
|
187
|
+
| `pages(publicDir)` | every `.html` file below `publicDir` as `{ file, html }`, sorted by path, `file` `/`-separated |
|
|
188
|
+
| `page(publicDir, file)` | one built page's HTML |
|
|
189
|
+
| `countTags(html, name)` | the number of opening `<name>` tags (`<h1>` and `<h1 class="…">`, not `<h1x>`) |
|
|
190
|
+
| `tags(html, name)` | each opening `<name>` tag's attribute string (`' class="a"'`, `''` for a bare tag) |
|
|
191
|
+
| `attr(attrs, name)` | one attribute's value from such a string, `undefined` when it is missing |
|
|
192
|
+
| `elementByClass(html, tag, className)` | the inner HTML of the first `<tag>` with `className` among its classes (nested tags of the same name included), `undefined` when there is none |
|
|
193
|
+
| `stripTags(html)` | the text: tags removed, whitespace collapsed to single spaces |
|
|
194
|
+
| `$(html)` | `cheerio.load(html)` |
|
|
195
|
+
| `jsonLd(html)` | every `<script type="application/ld+json">` block, parsed, in document order; a block that is not valid JSON throws with its number and start |
|
|
196
|
+
|
|
197
|
+
### Colour contrast
|
|
198
|
+
|
|
199
|
+
| Export | Returns |
|
|
200
|
+
|---|---|
|
|
201
|
+
| `luminance(hex)` | the WCAG 2.2 relative luminance of a `#rrggbb` colour (either case), 0 to 1 |
|
|
202
|
+
| `contrast(a, b)` | the contrast ratio of two `#rrggbb` colours, in either order, 1 to 21 (text needs 4.5, large text 3) |
|
|
203
|
+
|
|
204
|
+
Short forms (`#fff`) and colour names throw; write them out. The sRGB threshold is the current 0.04045; the older 0.03928 gives the same result for every 8-bit colour.
|
|
205
|
+
|
|
206
|
+
### The CLI
|
|
207
|
+
|
|
208
|
+
These need `@nera-static/nera`.
|
|
209
|
+
|
|
210
|
+
#### `nera(cwd, args, { root = cwd } = {})` → `Promise<{ code, stdout, stderr }>`
|
|
211
|
+
|
|
212
|
+
Runs the installed `nera` CLI with `args` (`['build', '--check']`) in the existing absolute directory `cwd`, without colours (`NO_COLOR=1`, `FORCE_COLOR=0`). It never rejects on a non-zero exit: the exit code is part of the result. The CLI is the one installed for `root`, found from there upwards as Node resolves a package; pass your repo root when `cwd` has no `node_modules` of its own.
|
|
213
|
+
|
|
214
|
+
#### `scaffoldStarter(repoRoot, name, args = [])` → `Promise<string>`
|
|
215
|
+
|
|
216
|
+
For a starter repo: runs `nera new <name> --starter <repoRoot> --yes --no-install ...args` (offline) in a fresh `tempDir` and links `repoRoot/node_modules` into the new site, so it builds with the CLI, theme and plugins the repo installed. Returns the site root. A failing `nera new` throws with both output streams. From a `globalSetup`, remove `path.dirname(site)` in the teardown.
|
|
217
|
+
|
|
218
|
+
```js
|
|
219
|
+
const site = await scaffoldStarter(ROOT, 'bakery', ['--name', 'Brot & Zeit', '--lang', 'de'])
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### `expectCleanBuild(site, options = {})` → `Promise<void>`
|
|
223
|
+
|
|
224
|
+
Asserts that the site builds, checks and validates clean: `nera build --check` and `nera validate` exit 0 and print "No problems found", their `--json` forms report `{ ok: true, results: [] }`, and neither stdout nor stderr holds a warning, a deprecation, an error mark (`⚠`, `❌`) or "Views folder not found". Each failure names the command, the site and its full output. `options` (`{ root }`) goes to `nera()`.
|
|
225
|
+
|
|
226
|
+
#### `STRICT_VALIDATE`
|
|
227
|
+
|
|
228
|
+
A `config/validate.yaml` that sets every output rule to `error` and names the English imprint (`/imprint.html`) and privacy (`/privacy.html`) pages. Write it into a site before `expectCleanBuild(site)` to prove the site stays clean under the strictest settings:
|
|
229
|
+
|
|
230
|
+
```js
|
|
231
|
+
fs.writeFileSync(path.join(site, 'config/validate.yaml'), STRICT_VALIDATE)
|
|
232
|
+
await expectCleanBuild(site)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## 📦 `publishTemplateSuite`
|
|
236
|
+
|
|
237
|
+
For a plugin that ships templates and an `npm run publish-template` script. One call replaces the whole `test/publish-template.test.js`:
|
|
238
|
+
|
|
239
|
+
```js
|
|
240
|
+
// test/publish-template.test.js
|
|
241
|
+
import path from 'node:path'
|
|
242
|
+
import { publishTemplateSuite } from '@nera-static/test-utils'
|
|
243
|
+
|
|
244
|
+
publishTemplateSuite({
|
|
245
|
+
root: path.resolve(import.meta.dirname, '..'),
|
|
246
|
+
pluginName: 'plugin-search',
|
|
247
|
+
templates: ['search.pug'],
|
|
248
|
+
assets: [{ from: 'views/search.js', to: 'js/search.js' }],
|
|
249
|
+
})
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
| Option | Default | Meaning |
|
|
253
|
+
|---|---|---|
|
|
254
|
+
| `root` | (required) | absolute root of the plugin repo |
|
|
255
|
+
| `pluginName` | (required) | the vendor folder: templates land in `views/vendor/<pluginName>/` |
|
|
256
|
+
| `templates` | (required) | the published templates, relative to `<root>/views/`, at least one |
|
|
257
|
+
| `assets` | `[]` | `{ from, to }` files the bin copies into the site's assets folder: `from` relative to `root`, `to` relative to the assets folder |
|
|
258
|
+
| `bin` | `'bin/publish-template.js'` | the script `npm run publish-template` runs, relative to `root` |
|
|
259
|
+
|
|
260
|
+
It registers `describe('publish-template')` with one test per case. Each runs the real bin (`node <bin>`) in a fresh temporary Nera project:
|
|
261
|
+
|
|
262
|
+
1. publishes every template to `views/vendor/<pluginName>`, byte for byte (a listed template missing from `views/` fails too);
|
|
263
|
+
2. skips existing templates without `--force` (exit 0, the site's copies untouched);
|
|
264
|
+
3. overwrites existing templates with `--force`;
|
|
265
|
+
4. refuses to publish outside a Nera project (a `package.json` without `config/app.yaml` and `pages/`, run with `--force`): a non-zero exit and no file written;
|
|
266
|
+
5. publishes into `theme/` on a themed site (templates under `theme/views/vendor/…`, assets under `theme/assets/…`, nothing new in the root `views/` or `assets/`).
|
|
267
|
+
|
|
268
|
+
Each `assets` entry adds three: copies it to `assets/<to>`, skips an existing copy, overwrites it with `--force`. Bad options throw when the suite is registered. A bin that publishes through `publishTemplates` and `publishAsset` of `@nera-static/plugin-utils` 1.5.0 or later and passes `force: process.argv.includes('--force')` to them passes every case.
|
|
269
|
+
|
|
270
|
+
## 🎨 Themes (`@nera-static/test-utils/theme`)
|
|
271
|
+
|
|
272
|
+
A theme repo tests a committed fixture site (`test/site/`, with `theme: ../..`), built in several variants once per run.
|
|
273
|
+
|
|
274
|
+
### Fixture builds
|
|
275
|
+
|
|
276
|
+
#### `mirrorFixture({ root, name, mutate, fixture = 'test/site', cache = false })` → `{ base, site }`
|
|
277
|
+
|
|
278
|
+
Copies the fixture into a fresh temp mirror of the repo: `base` holds symlinks to the repo's `views/`, `assets/`, `config/`, `package.json` and `node_modules/` (those that exist), and `site` the copied fixture at the same relative path, so `theme: ../..` and plugin lookups resolve as in the repo and the fixture's own `public/` is never touched. Not copied: `public/`, `node_modules/`, plugin-search's `theme/assets/search-index*.json` and, unless `cache` is `true`, the image cache `.nera-cache/`. `mutate(site)` then changes the copy; it must be synchronous (a returned promise throws), and a `mutate` that throws removes the mirror. Removed after the test file; from a `globalSetup`, remove `base` yourself.
|
|
279
|
+
|
|
280
|
+
#### `appendYaml(site, file, text)`
|
|
281
|
+
|
|
282
|
+
Appends raw YAML lines to `<site>/config/<file>` (later keys win). A missing file throws.
|
|
283
|
+
|
|
284
|
+
#### `buildVariants({ root, variants, warmCache = false, fixture = 'test/site' })` → `Promise<Record<string, Build>>`
|
|
285
|
+
|
|
286
|
+
Builds each variant in its own mirror. `variants` is `{ name: mutate | null }` (`null`: the fixture as committed). Each `Build` is `{ name, base, site, public, build, validate, check }`, where `build`, `validate` and `check` are the `nera()` results of `nera build`, `nera validate --json` and `nera check --json`. A failing build is a result, not an error; when a variant cannot be made at all, every mirror made so far is removed and the error is thrown.
|
|
287
|
+
|
|
288
|
+
Without `warmCache` all variants build in parallel, without the fixture's `.nera-cache/`. With `warmCache: true` (themes whose image cache takes minutes to fill cold) every mirror gets a copy of the fixture's cache, the first variant builds alone, its cache is copied back into the fixture (keep `.nera-cache/` git-ignored and cache it in CI), and the others then build from it in parallel.
|
|
289
|
+
|
|
290
|
+
#### `themeGlobalSetup({ key = 'builds', ...buildVariantsOptions })` → `{ setup, teardown }`
|
|
291
|
+
|
|
292
|
+
A vitest `globalSetup` that runs `buildVariants` once before any test file and hands the result to the tests as `inject(key)`; `teardown` removes every mirror.
|
|
293
|
+
|
|
294
|
+
```js
|
|
295
|
+
// test/global-setup.js
|
|
296
|
+
import path from 'node:path'
|
|
297
|
+
import { appendYaml, themeGlobalSetup } from '@nera-static/test-utils/theme'
|
|
298
|
+
|
|
299
|
+
export const { setup, teardown } = themeGlobalSetup({
|
|
300
|
+
root: path.resolve(import.meta.dirname, '..'),
|
|
301
|
+
variants: {
|
|
302
|
+
default: null,
|
|
303
|
+
sub: (site) => appendYaml(site, 'app.yaml', 'base_path: /sub'),
|
|
304
|
+
},
|
|
305
|
+
})
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
```js
|
|
309
|
+
// vitest.config.js
|
|
310
|
+
export default neraConfig({
|
|
311
|
+
// the variants are built once, before the test files
|
|
312
|
+
globalSetup: ['test/global-setup.js'],
|
|
313
|
+
})
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### The theme suites
|
|
317
|
+
|
|
318
|
+
Each suite registers one `describe` with one test per case, and every failure names the file, selector or value and what to change. The build suites take the `public` directories of a `buildVariants` result; the source suites take the repo `root` and the theme's own lists. Nothing about a particular theme is a default except file locations. A missing file or an empty build is a failing case, not a crash; bad options throw when the suite is registered.
|
|
319
|
+
|
|
320
|
+
```js
|
|
321
|
+
// test/override.test.js
|
|
322
|
+
import { inject } from 'vitest'
|
|
323
|
+
import { overrideSuite } from '@nera-static/test-utils/theme'
|
|
324
|
+
|
|
325
|
+
const builds = inject('builds')
|
|
326
|
+
|
|
327
|
+
overrideSuite({
|
|
328
|
+
overridden: builds.default.public,
|
|
329
|
+
fallback: builds.noplugins.public,
|
|
330
|
+
marker: '<!-- fixture: footer-extra override-->',
|
|
331
|
+
minPages: 34,
|
|
332
|
+
})
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
#### `overrideSuite(options)`: `describe('Per-file override')`
|
|
336
|
+
|
|
337
|
+
| Option | Default | Meaning |
|
|
338
|
+
|---|---|---|
|
|
339
|
+
| `overridden` | (required) | `public/` of the build whose fixture overrides the footer partial |
|
|
340
|
+
| `fallback` | | `public/` of a build without the override |
|
|
341
|
+
| `marker` | (required) | the exact text the fixture's override prints |
|
|
342
|
+
| `footerClass` | `'site-footer'` | the footer's class |
|
|
343
|
+
| `before` | `[]` | classes inside the footer that render before the override |
|
|
344
|
+
| `after` | `['site-footer__legal', 'site-footer__copy']` | classes inside the footer that render after it |
|
|
345
|
+
| `minPages` | `1` | the fewest pages the overridden build renders |
|
|
346
|
+
|
|
347
|
+
Cases: renders the override inside `footer.<footerClass>` on every page (once, after each `before` class, before each `after` class, on at least `minPages` pages); with `fallback`, falls back to the theme's own partial (no marker, every `after` class present).
|
|
348
|
+
|
|
349
|
+
#### `subdirectorySuite(options)`: `describe('Subdirectory deploy')`
|
|
350
|
+
|
|
351
|
+
| Option | Default | Meaning |
|
|
352
|
+
|---|---|---|
|
|
353
|
+
| `publicDir` | (required) | `public/` of the build with `base_path` |
|
|
354
|
+
| `basePath` | (required) | that `base_path`, e.g. `'/sub'` |
|
|
355
|
+
| `minUrls` | `1` | the fewest local `href`/`src` values over all pages |
|
|
356
|
+
| `stylesheet` | `'css/theme.css'` | the theme's stylesheet, relative to `public/` |
|
|
357
|
+
| `brandClass` | `'site-header__brand'` | the class of the header's home link |
|
|
358
|
+
| `groups` | `[]` | `{ tag, className, links?, optional? }`: elements whose links must all start with the base path; `links` their exact number, `optional` when not every page has the element |
|
|
359
|
+
| `fonts` | | `{ dir, count? }`: where the theme's fonts land below `public/`, and how many the stylesheet names |
|
|
360
|
+
|
|
361
|
+
Cases: prefixes every local `href` and `src` (`http(s):`, `//`, `data:`, `mailto:`, `tel:` and `#` excepted, at least `minUrls` of them) and every `srcset` candidate with the base path; links the stylesheet first, the brand link and each group's links under the base path; with `fonts`, every font the built stylesheet names exists below `public/<dir>/`.
|
|
362
|
+
|
|
363
|
+
#### `tokensSuite(options)`: `describe('Tokens')`
|
|
364
|
+
|
|
365
|
+
| Option | Default | Meaning |
|
|
366
|
+
|---|---|---|
|
|
367
|
+
| `root` | (required) | absolute root of the theme repo |
|
|
368
|
+
| `defaults` | (required) | `public/` of the fixture as committed |
|
|
369
|
+
| `overrides` | (required) | `public/` of the variant that overrides a token |
|
|
370
|
+
| `prefix` | (required) | the custom-property prefix, e.g. `'--theme'` (`<prefix>-<group>-<name>`, `_` becomes `-`) |
|
|
371
|
+
| `override` | (required) | `{ token: 'group.name', value }` the variant sets |
|
|
372
|
+
| `injected` | | a site token `{ token, value }` whose value holds `}` and must not be emitted |
|
|
373
|
+
| `config` | `'config/theme.yaml'` | the theme's config, relative to `root` |
|
|
374
|
+
| `css` | `'assets/css/theme.css'` | the stylesheet, relative to `root`; `null` skips its two cases |
|
|
375
|
+
| `ignoreLocals` | `['--nera-']` | local property prefixes the "applies" case skips |
|
|
376
|
+
|
|
377
|
+
Cases: reads its defaults from the config; emits every default in one `:root` rule on every page; emits the site's override and keeps every other token at its default; with `injected`, does not emit a value containing `}`; unless `css: null`, the stylesheet reads every token as `var(<prop>, <the same default>)` and no unknown one, and applies every local property that reads a token.
|
|
378
|
+
|
|
379
|
+
#### `contractSuite(options)`: `describe('Contract present')`
|
|
380
|
+
|
|
381
|
+
Read from `views/`, the config (through core's YAML parser) and the stylesheet. View paths are relative to `views/`.
|
|
382
|
+
|
|
383
|
+
| Option | Default | Meaning |
|
|
384
|
+
|---|---|---|
|
|
385
|
+
| `root` | (required) | absolute root of the theme repo |
|
|
386
|
+
| `views` | (required) | views and partials that must exist |
|
|
387
|
+
| `seams` | (required) | seams that must exist, with `//-` comments only |
|
|
388
|
+
| `filledSeams` | `[]` | seams of `seams` whose default markup is part of the contract (they only have to exist) |
|
|
389
|
+
| `withdrawnSeams` | `[]` | seams that must not exist |
|
|
390
|
+
| `pageTypes` | (required) | page types, e.g. `'pages/home.pug'` |
|
|
391
|
+
| `blocks` | (required) | blocks the layout defines, e.g. `['head', 'header', 'main', 'footer', 'scripts']` |
|
|
392
|
+
| `helpers` | (required) | functions the helpers file defines |
|
|
393
|
+
| `globals` | `[]` | other top-level names `views/` may declare |
|
|
394
|
+
| `keys` | (required) | the config's top-level keys |
|
|
395
|
+
| `tokens` | (required) | `{ group: [names] }`, exactly the token names per group |
|
|
396
|
+
| `values` | `{}` | defaults by dotted key (`'tokens.color'`), each deep-equal to its value or matching its RegExp |
|
|
397
|
+
| `tKeys` | (required) | UI string keys that go through `t()` |
|
|
398
|
+
| `classes` | (required) | public classes written in `views/` |
|
|
399
|
+
| `computedClasses` | `{}` | classes of `classes` built at render time → the source string(s) or RegExp(s) in `views/` that build them |
|
|
400
|
+
| `absentClasses` | `[]` | classes neither rendered in `views/` (comment lines aside) nor styled |
|
|
401
|
+
| `pluginData` | `[]` | plugin data names no view reads as `meta.`, `app.`, `item.meta.` or `page.meta.<name>` |
|
|
402
|
+
| `contentOutputOnly` | `false` | `content` may only be output or tested, never parsed |
|
|
403
|
+
| `layout` | `'layouts/layout.pug'` | the layout |
|
|
404
|
+
| `helpersFile` | `'partials/helpers.pug'` | the helpers |
|
|
405
|
+
| `config` | `'config/theme.yaml'` | the config, relative to `root` |
|
|
406
|
+
| `css` | `'assets/css/theme.css'` | the stylesheet, relative to `root` |
|
|
407
|
+
|
|
408
|
+
Cases: ships every view and partial; ships every seam empty (and no withdrawn seam); ships every page type, each extending the layout and filling `block main`; the layout defines every block; the helpers file defines the helpers and `views/` no other top-level name than them and `globals`; ships no `views/vendor/`; the config declares every key and exactly the listed tokens (non-empty scalars without `<>{};`); with `values`, keeps those defaults; uses every public class in `views/`; with `absentClasses`, uses none of them; with `pluginData`, reads no plugin data; with `contentOutputOnly`, outputs `content` without parsing it; passes every UI string through `t()`.
|
|
409
|
+
|
|
410
|
+
#### `couplingSuite(options)`: `describe('No unlisted plugin coupling')`
|
|
411
|
+
|
|
412
|
+
Read from the stylesheet, comments and at-rule preludes aside.
|
|
413
|
+
|
|
414
|
+
| Option | Default | Meaning |
|
|
415
|
+
|---|---|---|
|
|
416
|
+
| `root` | (required) | absolute root of the theme repo |
|
|
417
|
+
| `classes` | (required) | the theme's public classes |
|
|
418
|
+
| `plugins` | `[]` | the plugin classes the theme styles: the `pluginClassesSuite` map, or a flat list |
|
|
419
|
+
| `minClasses` | `1` | the fewest classes the stylesheet selects |
|
|
420
|
+
| `scopes` | `{}` | plugin BEM block → the theme class it is styled under, e.g. `{ nav: '.site-header__nav' }` |
|
|
421
|
+
| `unstyled` | `[]` | plugin elements that must stay unstyled, e.g. `['contact-form__decoy']` |
|
|
422
|
+
| `css` | `'assets/css/theme.css'` | the stylesheet, relative to `root` |
|
|
423
|
+
|
|
424
|
+
Cases: uses only public classes and listed plugin classes (at least `minClasses`); with `scopes`, styles each block only under its theme class; with `unstyled`, never styles those elements, and no rule below their block has a classless subject.
|
|
425
|
+
|
|
426
|
+
#### `pluginClassesSuite(options)`: `describe('Plugin classes exist')`
|
|
427
|
+
|
|
428
|
+
Read from the plugin packages in `<root>/node_modules`.
|
|
429
|
+
|
|
430
|
+
| Option | Default | Meaning |
|
|
431
|
+
|---|---|---|
|
|
432
|
+
| `root` | (required) | absolute root of the theme repo |
|
|
433
|
+
| `plugins` | (required) | `{ '<package>': { range: '^x.y.z', classes } }`: the caret peer floor and the classes the theme styles |
|
|
434
|
+
| `computed` | `{}` | `{ <class>: RegExp }` for listed classes a plugin builds at render time, matched by the source that builds them |
|
|
435
|
+
|
|
436
|
+
Two cases per plugin: installed at the major.minor of its floor, with a patch at or above the floor's; every listed class is in the package's `.pug`, `.js` or `.css` files as a whole name.
|
|
437
|
+
|
|
438
|
+
## Moving a repo onto test-utils
|
|
439
|
+
|
|
440
|
+
| Before | After |
|
|
441
|
+
|---|---|
|
|
442
|
+
| `vitest.config.js` with its own `test` block | `export default neraConfig({ /* only the extras */ })` |
|
|
443
|
+
| sitemap-style `test/helpers.js`: `tempDir`, `write`, `build` | `tempDir`, `writeFiles(root, files)`, `makeSite` + `buildSite(root)` |
|
|
444
|
+
| structured-data's `site(files)` | `makeSite({ files, plugins: { name: entry } })` + `buildSite` |
|
|
445
|
+
| `process.chdir` + writing `config/<name>.yaml` in a hook test | `useSiteCwd({ 'config/<name>.yaml': … })` |
|
|
446
|
+
| a spy on `console.warn` | `captureConsole('warn')`, or the `warnings` of `buildSite` |
|
|
447
|
+
| the themes' `test/helpers/html.js` | the HTML readers from `@nera-static/test-utils` (same behaviour) |
|
|
448
|
+
| the themes' `makeSite(name, mutate)`, `appendYaml`, `buildVariant` | `mirrorFixture`, `appendYaml`, `buildVariants` from `./theme` |
|
|
449
|
+
| the themes' `test/global-setup.js` | `export const { setup, teardown } = themeGlobalSetup({ root, variants })`; the variants stay yours |
|
|
450
|
+
| the themes' and starters' `parseYaml`, `loadYaml`, `frontmatter` | the same names from `@nera-static/test-utils` (core's parser and options) |
|
|
451
|
+
| a starter's `nera(args, cwd)` with `execFileSync` | `await nera(cwd, args, { root })` |
|
|
452
|
+
| a starter's scaffold and "builds clean" tests | `scaffoldStarter`, `STRICT_VALIDATE`, `await expectCleanBuild(site)` |
|
|
453
|
+
| `test/publish-template.test.js` | `publishTemplateSuite({ root, pluginName, templates, assets? })` |
|
|
454
|
+
| the themes' contract, override, coupling, plugin-class, subdirectory and token tests | the six suites; the theme's lists (`test/helpers/contract.js`) stay in the repo |
|
|
455
|
+
| a contrast helper | `contrast(a, b)`, `luminance(hex)` |
|
|
456
|
+
|
|
457
|
+
Where test-utils is stricter than the copies, a red test after the move is a real finding, not a reason to change the options:
|
|
458
|
+
|
|
459
|
+
- `expectCleanBuild` checks the exit codes and stderr as well; the `execFileSync` copies read stdout only, so a plugin's `console.warn` never failed them.
|
|
460
|
+
- `publishTemplateSuite` runs the refuse case with `--force` and covers `--force` for every plugin; `overrideSuite` with `fallback` requires every `after` class, not just one.
|
|
461
|
+
- `tokensSuite` checks every page and the stylesheet for every theme; `contractSuite` checks every token value; `pluginClassesSuite` catches an installed patch below the floor.
|
|
462
|
+
|
|
463
|
+
It is looser in three places:
|
|
464
|
+
|
|
465
|
+
- `overrideSuite`'s `minPages` and `couplingSuite`'s `minClasses` are floors, where some copies compared an exact count.
|
|
466
|
+
- `pluginClassesSuite` accepts an installed patch above the floor, where a copy required the floor exactly.
|
|
467
|
+
- `listFiles` takes its extensions optionally and returns `/` paths on every platform.
|
|
468
|
+
|
|
469
|
+
## 🧪 Development
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
npx vitest run
|
|
473
|
+
npm run lint
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
`npm test` runs the suite once, `npm run test:watch` in watch mode. The package tests itself with its own preset and helpers: every helper has a test in `test/<module>.test.js`, and every suite runs against a passing and a failing temp fixture for each case it generates.
|
|
477
|
+
|
|
478
|
+
## 📦 License
|
|
479
|
+
|
|
480
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@nera-static/test-utils",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Shared test helpers, test suites and the canonical vitest preset for Nera plugins, themes, starters and tools.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.js",
|
|
8
|
+
"./theme": "./src/theme/index.js",
|
|
9
|
+
"./vitest": "./src/vitest.js",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src",
|
|
14
|
+
"CHANGELOG.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"lint": "eslint .",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"test:watch": "vitest",
|
|
20
|
+
"prepare": "husky"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"nera",
|
|
24
|
+
"static-site-generator",
|
|
25
|
+
"testing",
|
|
26
|
+
"vitest",
|
|
27
|
+
"test-helpers"
|
|
28
|
+
],
|
|
29
|
+
"author": "Michael Becker",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/seebaermichi/nera-test-utils.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/seebaermichi/nera-test-utils/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/seebaermichi/nera-test-utils#readme",
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=22.12.0"
|
|
44
|
+
},
|
|
45
|
+
"sideEffects": [
|
|
46
|
+
"./src/files.js"
|
|
47
|
+
],
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@nera-static/core": "^4.15.0",
|
|
50
|
+
"@nera-static/nera": "^1.11.0",
|
|
51
|
+
"vitest": "^5.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@nera-static/core": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"@nera-static/nera": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@nera-static/core": "^4.19.1",
|
|
63
|
+
"@nera-static/nera": "^1.30.0",
|
|
64
|
+
"eslint": "^10.16.0",
|
|
65
|
+
"husky": "^9.1.7",
|
|
66
|
+
"vitest": "^5.1.2"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@nera-static/plugin-utils": "^1.8.0",
|
|
70
|
+
"cheerio": "^1.2.0"
|
|
71
|
+
}
|
|
72
|
+
}
|