@nera-static/core 4.16.0 → 4.16.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/render.js +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nera-static/core",
3
- "version": "4.16.0",
3
+ "version": "4.16.1",
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": {
@@ -63,8 +63,8 @@
63
63
  "dependencies": {
64
64
  "dotenv": "^18.0.4",
65
65
  "fs-readdir-recursive": "^1.1.0",
66
+ "js-beautify": "^2.0.3",
66
67
  "markdown-it": "^15.0.0",
67
- "pretty": "^2.0.0",
68
68
  "pug": "^3.0.2",
69
69
  "rimraf": "^6.0.1",
70
70
  "semver": "^7.8.5",
package/src/render.js CHANGED
@@ -3,7 +3,7 @@ import fssync from 'fs'
3
3
  import path from 'path'
4
4
  import { createHash } from 'crypto'
5
5
  import pug from 'pug'
6
- import pretty from 'pretty'
6
+ import beautify from 'js-beautify'
7
7
  import { rimraf } from 'rimraf'
8
8
  import dotenv from 'dotenv'
9
9
  import { makeLayeredResolver, resolveEntry } from './resolve.js'
@@ -14,6 +14,16 @@ dotenv.config({ quiet: true })
14
14
 
15
15
  const SUCCESS_COLOR = '\x1b[32m%s\x1b[0m'
16
16
 
17
+ // The defaults of the `pretty` package, which core used until 4.16.0: calling
18
+ // js-beautify 2 directly keeps the output and drops the deprecated `glob@10`
19
+ // that `pretty` pulled in through js-beautify 1.
20
+ const HTML_FORMAT = {
21
+ unformatted: ['code', 'pre', 'em', 'strong', 'span'],
22
+ indent_inner_html: true,
23
+ indent_char: ' ',
24
+ indent_size: 2,
25
+ }
26
+
17
27
  // --- Base-path URL rewriting (config `base_path` → `app.basePath`) ------------
18
28
  //
19
29
  // A site served from a subdirectory (e.g. GitHub *project* Pages under
@@ -512,7 +522,7 @@ export const createHtmlFiles = async (
512
522
  )
513
523
 
514
524
  await fs.mkdir(path.dirname(htmlPath), { recursive: true })
515
- await fs.writeFile(htmlPath, pretty(html), 'utf-8')
525
+ await fs.writeFile(htmlPath, beautify.html(html, HTML_FORMAT), 'utf-8')
516
526
 
517
527
  // Name the file actually written, as its path under `public/`
518
528
  // (`/de/index.html`), so every page gets a distinct line.