@nera-static/core 4.16.1 → 4.16.3
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 +2 -0
- package/package.json +2 -2
- package/src/theme.js +14 -5
package/README.md
CHANGED
|
@@ -54,6 +54,8 @@ Two things that are easy to miss:
|
|
|
54
54
|
|
|
55
55
|
The package is ESM (`"type": "module"`), requires **Node 20.19 or later** (Node 21 excluded), and exposes a barrel at the root plus per-module subpath exports.
|
|
56
56
|
|
|
57
|
+
On Node 20, and on Node 22 before 22.22.2, `npm install` prints `npm warn EBADENGINE` for `nopt` and `abbrev`. They come with `js-beautify` 2, which formats the HTML, and only its command-line tool uses them, never core, so the warning is harmless and every page renders the same.
|
|
58
|
+
|
|
57
59
|
```js
|
|
58
60
|
import { run } from '@nera-static/core'
|
|
59
61
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nera-static/core",
|
|
3
|
-
"version": "4.16.
|
|
3
|
+
"version": "4.16.3",
|
|
4
4
|
"description": "The Nera static site generator engine — the build pipeline and the layered theme/view resolver, importable by the Nera CLI, @nera-static/validate and tooling",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|
|
57
|
-
"url": "https://github.com/seebaermichi/nera"
|
|
57
|
+
"url": "git+https://github.com/seebaermichi/nera.git"
|
|
58
58
|
},
|
|
59
59
|
"bugs": {
|
|
60
60
|
"url": "https://github.com/seebaermichi/nera/issues"
|
package/src/theme.js
CHANGED
|
@@ -274,12 +274,21 @@ function checkPluginCompatibility(theme, themePkg, cwd) {
|
|
|
274
274
|
// The installed version of a dependency, resolved from the SITE (cwd) exactly
|
|
275
275
|
// like resolvePackageRoot — the plugins are the site's dependencies, not the
|
|
276
276
|
// generator's. Returns null when the package is not installed or unreadable.
|
|
277
|
+
//
|
|
278
|
+
// It walks the node_modules folders Node would search instead of resolving
|
|
279
|
+
// `<name>/package.json`: a package whose `exports` omits `./package.json` —
|
|
280
|
+
// every published plugin, whose `exports` lists only `.` — makes that resolve
|
|
281
|
+
// throw ERR_PACKAGE_PATH_NOT_EXPORTED, which silenced this check.
|
|
277
282
|
function installedVersion(name, cwd) {
|
|
278
283
|
const requireFromSite = createRequire(path.join(cwd, 'package.json'))
|
|
279
|
-
|
|
280
|
-
const pkgPath =
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
+
for (const dir of requireFromSite.resolve.paths(name) || []) {
|
|
285
|
+
const pkgPath = path.join(dir, name, 'package.json')
|
|
286
|
+
if (!fs.existsSync(pkgPath)) continue
|
|
287
|
+
try {
|
|
288
|
+
return JSON.parse(fs.readFileSync(pkgPath, 'utf-8')).version || null
|
|
289
|
+
} catch {
|
|
290
|
+
return null
|
|
291
|
+
}
|
|
284
292
|
}
|
|
293
|
+
return null
|
|
285
294
|
}
|