@ape-egg/vibe-compiler 4.1.1 → 4.1.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.
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ape-egg/vibe-compiler",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Optional Rust compiler for Vibe — pre-renders, inlines components, and optimizes iterations. The runtime never needs it.",
|
|
6
6
|
"homepage": "https://vibe.korte.kim",
|
package/src/compiler/compile.rs
CHANGED
|
@@ -62,22 +62,7 @@ pub(crate) fn atomic_write(path: &Path, contents: &str) -> std::io::Result<()> {
|
|
|
62
62
|
// Can be used as class (.vibe-fouc) or attribute ([vibe-fouc])
|
|
63
63
|
const FOUC_CLASS_OR_ATTR: &str = "vibe-fouc";
|
|
64
64
|
|
|
65
|
-
// vibe's own CSS, emitted inline into every compiled page's <head> so it
|
|
66
|
-
// applies at parse time regardless of which stylesheets the consumer links.
|
|
67
|
-
// The rules are EXTRACTED from vibe.css itself at build time — the file
|
|
68
|
-
// (shipped as a sibling package in every layout, and next to this source in
|
|
69
|
-
// the repo) is the single source of truth; no CSS text lives here to drift.
|
|
70
|
-
// Split on the optional marker into two sheets:
|
|
71
|
-
// - the cover half is load-bearing and always emitted: [vibe-staged] gates
|
|
72
|
-
// route/key remount staging on every page, and the fouc/animation rules
|
|
73
|
-
// cover pages that keep the marker (--fouc-as-is);
|
|
74
|
-
// - the layout half is vibe's base styling (layout-transparent component
|
|
75
|
-
// wrappers), skipped by disableVibeCss.
|
|
76
|
-
// Comments and newlines are stripped at emission: style content survives
|
|
77
|
-
// minification verbatim, so the emitted form must already be newline-free.
|
|
78
65
|
const VIBE_CSS_FILE: &str = include_str!("../../../vibe/vibe.css");
|
|
79
|
-
// The marker literal is the one string shared with the file (and the vite
|
|
80
|
-
// plugin) — scripts/check-release.js holds it in lockstep.
|
|
81
66
|
const VIBE_CSS_OPTIONAL_MARKER: &str =
|
|
82
67
|
"/* vibe:optional — everything below is skipped by disableVibeCss */";
|
|
83
68
|
|
|
@@ -293,11 +278,6 @@ fn remove_fouc_prevention(html: String) -> String {
|
|
|
293
278
|
result
|
|
294
279
|
}
|
|
295
280
|
|
|
296
|
-
/// Inject vibe's CSS right after <head> — ahead of consumer stylesheets, so
|
|
297
|
-
/// their equal-specificity overrides still win the cascade. Idempotent
|
|
298
|
-
/// (recompiles and already-covered sources pass through); fragments without a
|
|
299
|
-
/// <head> are not pages and are left untouched. The cover sheet always emits;
|
|
300
|
-
/// the layout sheet honors disableVibeCss.
|
|
301
281
|
pub fn inject_vibe_css(html: String, disable_vibe_css: bool) -> String {
|
|
302
282
|
if html.contains("data-vibe-cover") {
|
|
303
283
|
return html;
|
|
@@ -1529,7 +1509,6 @@ impl Compiler {
|
|
|
1529
1509
|
output = remove_fouc_prevention(output);
|
|
1530
1510
|
}
|
|
1531
1511
|
|
|
1532
|
-
// vibe's CSS rides every compiled page, present at parse time
|
|
1533
1512
|
output = inject_vibe_css(output, self.config.disable_vibe_css);
|
|
1534
1513
|
|
|
1535
1514
|
// Write to output
|
|
@@ -1817,8 +1796,6 @@ impl Compiler {
|
|
|
1817
1796
|
} else {
|
|
1818
1797
|
shell_processed
|
|
1819
1798
|
};
|
|
1820
|
-
// Same sheets the page pipeline emits — the shell serves every route,
|
|
1821
|
-
// and [vibe-staged] gates its remount staging.
|
|
1822
1799
|
let shell_html = inject_vibe_css(shell_html, self.config.disable_vibe_css);
|
|
1823
1800
|
let shell_path = self.config.output.join("index.html");
|
|
1824
1801
|
atomic_write(&shell_path, &shell_html).map_err(|e| CompileError::WriteError {
|