@nera-static/core 4.16.2 → 4.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nera-static/core",
3
- "version": "4.16.2",
3
+ "version": "4.16.4",
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/render.js CHANGED
@@ -347,10 +347,11 @@ export function ignoreFiles(ignoreList, filePath, sourceRoot) {
347
347
  }
348
348
 
349
349
  // OS and editor clutter that never belongs in public/, matched against a file's
350
- // basename. The list cpy (via the `junk` package) skipped by default; kept so
351
- // replacing cpy changes nothing a site ships.
350
+ // basename. The list cpy (via the `junk` package) skipped by default, plus the
351
+ // `.gitkeep`/`.keep` markers that keep an empty folder in git (`nera new`
352
+ // ships `theme/assets/.gitkeep`); a marker is never content to serve.
352
353
  const JUNK =
353
- /^npm-debug\.log$|^\..*\.swp$|^\.DS_Store$|^\.AppleDouble$|^\.LSOverride$|^Icon\r$|^\._.*|^\.Spotlight-V100(?:$|\/)|\.Trashes|^__MACOSX$|~$|^Thumbs\.db$|^ehthumbs\.db$|^[Dd]esktop\.ini$|@eaDir$/
354
+ /^\.gitkeep$|^\.keep$|^npm-debug\.log$|^\..*\.swp$|^\.DS_Store$|^\.AppleDouble$|^\.LSOverride$|^Icon\r$|^\._.*|^\.Spotlight-V100(?:$|\/)|\.Trashes|^__MACOSX$|~$|^Thumbs\.db$|^ehthumbs\.db$|^[Dd]esktop\.ini$|@eaDir$/
354
355
 
355
356
  // Every file under `dir`, dotfiles included, junk excluded. Symlinks are
356
357
  // followed like cpy's glob did (a linked directory is walked, a dangling link
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
- try {
280
- const pkgPath = requireFromSite.resolve(`${name}/package.json`)
281
- return JSON.parse(fs.readFileSync(pkgPath, 'utf-8')).version || null
282
- } catch {
283
- return null
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
  }