nodality 1.0.161 → 1.0.162
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/bin/nodality.js +86 -0
- package/layout/animator.js +1 -1
- package/layout/audio.js +1 -1
- package/layout/audionew.js +1 -1
- package/layout/base-2.js +1 -1
- package/layout/base.js +1 -1
- package/layout/beta-desktop-bar.js +1 -1
- package/layout/beta-mobile-bar.js +1 -1
- package/layout/box.js +1 -1
- package/layout/button.js +1 -1
- package/layout/cards.js +1 -1
- package/layout/center.js +1 -1
- package/layout/checkbox.js +1 -1
- package/layout/circle.js +1 -1
- package/layout/clean-row.js +1 -1
- package/layout/code.js +1 -1
- package/layout/container.js +1 -1
- package/layout/custom.js +1 -1
- package/layout/div-image.js +1 -1
- package/layout/dropdown-2025.js +1 -1
- package/layout/dropdown.js +1 -1
- package/layout/empty-element.js +1 -1
- package/layout/external-stylesheet.js +1 -1
- package/layout/flex-card.js +1 -1
- package/layout/flex-grid.js +1 -1
- package/layout/flex-row.js +1 -1
- package/layout/footer.js +1 -1
- package/layout/form-components/custom.js +1 -1
- package/layout/form-components/data-list.js +1 -1
- package/layout/form-components/floating-input.js +1 -1
- package/layout/form-components/form-all.js +1 -1
- package/layout/form-components/form.js +1 -1
- package/layout/form-components/image-picker.js +1 -1
- package/layout/form-components/picker.js +1 -1
- package/layout/form-components/radio.js +1 -1
- package/layout/form-components/radiogroup.js +1 -1
- package/layout/form-components/range.js +1 -1
- package/layout/free.js +1 -1
- package/layout/grid-new.js +1 -1
- package/layout/grid-switcher.js +1 -1
- package/layout/grid.js +1 -1
- package/layout/group.js +1 -1
- package/layout/header.js +1 -1
- package/layout/horizontal-scroller.js +1 -1
- package/layout/image-old.js +1 -1
- package/layout/image.js +1 -1
- package/layout/index.js +1 -1
- package/layout/label.js +1 -1
- package/layout/link.js +1 -1
- package/layout/list-OLD.js +1 -1
- package/layout/list.js +1 -1
- package/layout/meta-adder.js +1 -1
- package/layout/modal-2025.js +1 -1
- package/layout/modernwrap.js +1 -1
- package/layout/multiswitcher.js +1 -1
- package/layout/multiswitcherBeta.js +1 -1
- package/layout/nav-bar.js +1 -1
- package/layout/nav-factor/custom-div.js +1 -1
- package/layout/navBar-OLD.js +1 -1
- package/layout/new-flat-adder.js +1 -1
- package/layout/new-nav-bar.js +1 -1
- package/layout/offset-container.js +1 -1
- package/layout/polygon.js +1 -1
- package/layout/prerender-site.js +1 -1
- package/layout/prerender.js +1 -1
- package/layout/progress.js +1 -1
- package/layout/row.js +1 -1
- package/layout/saved-new-nav-bar.js +1 -1
- package/layout/scroll-video.js +1 -1
- package/layout/side-bar.js +1 -1
- package/layout/side-nav-bar.js +1 -1
- package/layout/simple-bar.js +1 -1
- package/layout/slider-2025.js +1 -1
- package/layout/spacer.js +1 -1
- package/layout/stack.js +1 -1
- package/layout/styler.js +1 -1
- package/layout/svg.js +1 -1
- package/layout/switcher.js +1 -1
- package/layout/table.js +1 -1
- package/layout/text-field.js +1 -1
- package/layout/text.js +1 -1
- package/layout/ulist.js +1 -1
- package/layout/video.js +1 -1
- package/layout/without-new.js +1 -1
- package/layout/wrap.js +1 -1
- package/layout/zoom-card.js +1 -1
- package/lib/card-getter.js +1 -1
- package/lib/designer.js +1 -1
- package/lib/element-mapper.js +1 -1
- package/lib/keyframe-animation.js +1 -1
- package/lib/link-getter.js +1 -1
- package/lib/scroll-video.js +1 -1
- package/lib/stacker.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/transform-anim.js +1 -1
- package/package.json +1 -1
package/bin/nodality.js
CHANGED
|
@@ -47,14 +47,88 @@ Prerender flags (all optional; fall through to nodality.config.json, then defaul
|
|
|
47
47
|
--tolerate-async Install uncaught/unhandledRejection handlers so a single page's
|
|
48
48
|
late throw (from a deferred animation/fetch timer) doesn't abort
|
|
49
49
|
the whole batch — useful for sites with span-animation entries.
|
|
50
|
+
--verbose Print every console.log() emitted by the library during render.
|
|
51
|
+
Default is quiet — only progress lines, page sizes, and the
|
|
52
|
+
final summary are shown. Use this when debugging.
|
|
50
53
|
|
|
51
54
|
Examples:
|
|
52
55
|
nodality prerender
|
|
53
56
|
nodality prerender --origin=https://example.com --tolerate-async
|
|
57
|
+
nodality prerender --verbose
|
|
54
58
|
`);
|
|
55
59
|
process.exit(1);
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Install a stdout filter that hides the library's internal debug
|
|
64
|
+
* chatter (OGA, MBO, BRIS, APPENDED-, 0P, TAGS SET, date stamps, raw
|
|
65
|
+
* object dumps, "Appending brand:" lines, etc.) during prerender.
|
|
66
|
+
* Progress banners from `prerenderSite` (page-name lines, `→ … KB`,
|
|
67
|
+
* `✅ Prerender done`) and our own `[nodality] …` banner pass through
|
|
68
|
+
* unmodified.
|
|
69
|
+
*
|
|
70
|
+
* Bypassed with --verbose (or NODALITY_VERBOSE=1) when you need the
|
|
71
|
+
* full chatter to debug a render that silently goes wrong.
|
|
72
|
+
*
|
|
73
|
+
* We hook process.stdout.write (not console.log) because the library
|
|
74
|
+
* has 100+ scattered console.log calls across 30 files, AND because
|
|
75
|
+
* jsdom's virtual console forwards differently than expected, AND
|
|
76
|
+
* because some output uses process.stdout.write directly. Filtering
|
|
77
|
+
* at the byte stream catches every path uniformly.
|
|
78
|
+
*/
|
|
79
|
+
function installLogFilter() {
|
|
80
|
+
const origWrite = process.stdout.write.bind(process.stdout);
|
|
81
|
+
|
|
82
|
+
// Strict whitelist: only lines matching one of these patterns
|
|
83
|
+
// survive. Everything else (dev markers, object dumps, stack traces
|
|
84
|
+
// from page scripts, HTML fragments leaking out of jsdom, media-
|
|
85
|
+
// query strings, date stamps, …) is dropped.
|
|
86
|
+
const ALLOW = [
|
|
87
|
+
/^\[nodality\]/, // our CLI banner
|
|
88
|
+
/^🌍/, // prerenderSite progress banner
|
|
89
|
+
/^✅/, /^❌/, /^⚠/, // status emojis
|
|
90
|
+
/^── /, // locale separators
|
|
91
|
+
/^ [a-z0-9\-]+\.html\s/, // page progress: " index.html ..."
|
|
92
|
+
/^→ /, // result lines
|
|
93
|
+
/^$/, // blank lines (preserve spacing)
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
function shouldDropLine(line) {
|
|
97
|
+
for (const rx of ALLOW) if (rx.test(line)) return false;
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Buffer partial lines so we can decide on line boundaries.
|
|
102
|
+
let buf = "";
|
|
103
|
+
|
|
104
|
+
process.stdout.write = function (chunk, encoding, cb) {
|
|
105
|
+
const s = typeof chunk === "string" ? chunk : chunk?.toString?.(encoding || "utf8") ?? "";
|
|
106
|
+
buf += s;
|
|
107
|
+
|
|
108
|
+
let out = "";
|
|
109
|
+
let nl;
|
|
110
|
+
while ((nl = buf.indexOf("\n")) !== -1) {
|
|
111
|
+
const line = buf.slice(0, nl);
|
|
112
|
+
buf = buf.slice(nl + 1);
|
|
113
|
+
if (!shouldDropLine(line)) out += line + "\n";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// A trailing buffer with no newline is a progress write like
|
|
117
|
+
// ` index.html ` from prerender-site.js. Pass it
|
|
118
|
+
// through so the user sees progress before the line completes.
|
|
119
|
+
// We only do this when the buffered fragment passes the page-
|
|
120
|
+
// progress check; otherwise hold until newline.
|
|
121
|
+
if (buf && /^ [a-z0-9\-]+\.html\s/.test(buf)) {
|
|
122
|
+
out += buf;
|
|
123
|
+
buf = "";
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (out) origWrite(out, encoding, cb);
|
|
127
|
+
else if (cb) cb();
|
|
128
|
+
return true;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
58
132
|
// ─── Flag parsing — minimal, no deps ────────────────────────────
|
|
59
133
|
|
|
60
134
|
function parseFlags(argv) {
|
|
@@ -145,6 +219,18 @@ async function runPrerender(rawArgs) {
|
|
|
145
219
|
flags["tolerate-async"] === "true" ||
|
|
146
220
|
fileConfig.tolerateAsyncErrors === true;
|
|
147
221
|
|
|
222
|
+
// Quiet by default; --verbose or NODALITY_VERBOSE=1 turns the
|
|
223
|
+
// library's internal chatter back on. Only install the filter once
|
|
224
|
+
// (the multi-locale fanout re-enters this function in the parent
|
|
225
|
+
// process for the no-locales path, but on the child path
|
|
226
|
+
// NODALITY_SSG_LOCALE is set and we still want the filter on).
|
|
227
|
+
const verbose =
|
|
228
|
+
flags.verbose === true ||
|
|
229
|
+
flags.verbose === "true" ||
|
|
230
|
+
process.env.NODALITY_VERBOSE === "1" ||
|
|
231
|
+
fileConfig.verbose === true;
|
|
232
|
+
if (!verbose) installLogFilter();
|
|
233
|
+
|
|
148
234
|
if (!origin) {
|
|
149
235
|
console.error(`[nodality] --origin not given and no "origin" in nodality.config.json.`);
|
|
150
236
|
process.exit(1);
|
package/layout/animator.js
CHANGED
package/layout/audio.js
CHANGED
package/layout/audionew.js
CHANGED
package/layout/base-2.js
CHANGED
package/layout/base.js
CHANGED
package/layout/box.js
CHANGED
package/layout/button.js
CHANGED
package/layout/cards.js
CHANGED
package/layout/center.js
CHANGED
package/layout/checkbox.js
CHANGED
package/layout/circle.js
CHANGED
package/layout/clean-row.js
CHANGED
package/layout/code.js
CHANGED
package/layout/container.js
CHANGED
package/layout/custom.js
CHANGED
package/layout/div-image.js
CHANGED
package/layout/dropdown-2025.js
CHANGED
package/layout/dropdown.js
CHANGED
package/layout/empty-element.js
CHANGED
package/layout/flex-card.js
CHANGED
package/layout/flex-grid.js
CHANGED
package/layout/flex-row.js
CHANGED
package/layout/footer.js
CHANGED
package/layout/free.js
CHANGED
package/layout/grid-new.js
CHANGED
package/layout/grid-switcher.js
CHANGED
package/layout/grid.js
CHANGED
package/layout/group.js
CHANGED
package/layout/header.js
CHANGED
package/layout/image-old.js
CHANGED
package/layout/image.js
CHANGED
package/layout/index.js
CHANGED
package/layout/label.js
CHANGED
package/layout/link.js
CHANGED
package/layout/list-OLD.js
CHANGED
package/layout/list.js
CHANGED
package/layout/meta-adder.js
CHANGED
package/layout/modal-2025.js
CHANGED
package/layout/modernwrap.js
CHANGED
package/layout/multiswitcher.js
CHANGED
package/layout/nav-bar.js
CHANGED
package/layout/navBar-OLD.js
CHANGED
package/layout/new-flat-adder.js
CHANGED
package/layout/new-nav-bar.js
CHANGED
package/layout/polygon.js
CHANGED
package/layout/prerender-site.js
CHANGED
package/layout/prerender.js
CHANGED
package/layout/progress.js
CHANGED
package/layout/row.js
CHANGED
package/layout/scroll-video.js
CHANGED
package/layout/side-bar.js
CHANGED
package/layout/side-nav-bar.js
CHANGED
package/layout/simple-bar.js
CHANGED
package/layout/slider-2025.js
CHANGED
package/layout/spacer.js
CHANGED
package/layout/stack.js
CHANGED
package/layout/styler.js
CHANGED
package/layout/svg.js
CHANGED
package/layout/switcher.js
CHANGED
package/layout/table.js
CHANGED
package/layout/text-field.js
CHANGED
package/layout/text.js
CHANGED
package/layout/ulist.js
CHANGED
package/layout/video.js
CHANGED
package/layout/without-new.js
CHANGED
package/layout/wrap.js
CHANGED
package/layout/zoom-card.js
CHANGED
package/lib/card-getter.js
CHANGED
package/lib/designer.js
CHANGED
package/lib/element-mapper.js
CHANGED
package/lib/link-getter.js
CHANGED
package/lib/scroll-video.js
CHANGED
package/lib/stacker.js
CHANGED
package/lib/theme.js
CHANGED
package/lib/transform-anim.js
CHANGED