kss-modern 1.2.0 → 1.2.2

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.
@@ -3,8 +3,8 @@ import process from 'node:process';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import fs from 'fs-extra';
5
5
  import { glob } from 'tinyglobby';
6
- import { l as logger, s as sanitizeSpecialCharacters, I as INSERT_VITE_PUG_TAG_RE, P as PUG_SRC_RE, a as PUG_ERROR_OVERLAY_TAG, c as compileMarkup, p as pugErrorFile, b as slugify, d as sectionSanitizeId, e as stripPugErrorOverlay, f as ensureStartingSlash, g as generateId, r as replaceWrapperContent, h as htmlToSearchText } from '../shared/kss-modern.B6jgUPtu.mjs';
7
- export { i as createLogger } from '../shared/kss-modern.B6jgUPtu.mjs';
6
+ import { l as logger, s as sanitizeSpecialCharacters, I as INSERT_VITE_PUG_TAG_RE, P as PUG_SRC_RE, a as PUG_ERROR_OVERLAY_TAG, c as compileMarkup, p as pugErrorFile, b as slugify, d as sectionSanitizeId, e as stripPugErrorOverlay, f as ensureStartingSlash, g as generateId, r as replaceWrapperContent, h as htmlToSearchText } from '../shared/kss-modern.BQiL0d8K.mjs';
7
+ export { i as createLogger } from '../shared/kss-modern.BQiL0d8K.mjs';
8
8
  import htmlLang from '@shikijs/langs/html';
9
9
  import markdownLang from '@shikijs/langs/markdown';
10
10
  import scssLang from '@shikijs/langs/scss';
@@ -1252,7 +1252,7 @@ async function generateFullPageFile(data) {
1252
1252
  <meta name="theme-color" media="(prefers-color-scheme: light)" content="${data.theme.light}">
1253
1253
  <meta name="theme-color" media="(prefers-color-scheme: dark)" content="${data.theme.dark}">
1254
1254
  ` : `<meta name="theme-color" content="${data.theme}">`}
1255
- <script type="module" src="/styleguide-assets/fullpage-CGBSSxKh.js"><\/script>
1255
+ <script type="module" src="/styleguide-assets/fullpage-Ck0nyq2C.js"><\/script>
1256
1256
  ${computedStyleTags}
1257
1257
  </head>
1258
1258
  <body${data.page.bodyclass ? ` class="${data.page.bodyclass}"` : ""}>
@@ -2059,7 +2059,7 @@ async function generatePreviewFile(data) {
2059
2059
  <meta name="theme-color" media="(prefers-color-scheme: light)" content="${data.theme.light}">
2060
2060
  <meta name="theme-color" media="(prefers-color-scheme: dark)" content="${data.theme.dark}">
2061
2061
  ` : `<meta name="theme-color" content="${data.theme}">`}
2062
- <link rel="stylesheet" type="text/css" href="/styleguide-assets/kss-modern-3dYdkdaU.css">
2062
+ <link rel="stylesheet" type="text/css" href="/styleguide-assets/kss-modern-DeXoMEvT.css">
2063
2063
  <script>
2064
2064
  //#region client/lib/iframe-resize.ts
2065
2065
  var e = [
@@ -2212,7 +2212,7 @@ document.addEventListener("DOMContentLoaded", () => {
2212
2212
  //#endregion
2213
2213
  ;
2214
2214
  <\/script>
2215
- <script type="module" src="/styleguide-assets/preview-B-NERQ5n.js"><\/script>
2215
+ <script type="module" src="/styleguide-assets/preview-CHOmMvuB.js"><\/script>
2216
2216
  <link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
2217
2217
  <link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-600-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
2218
2218
  <link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-300-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
@@ -1,5 +1,5 @@
1
1
  import { parentPort } from 'node:worker_threads';
2
- import { c as compileMarkup, p as pugErrorFile } from '../../shared/kss-modern.B6jgUPtu.mjs';
2
+ import { c as compileMarkup, p as pugErrorFile } from '../../shared/kss-modern.BQiL0d8K.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'node:path';
@@ -147,22 +147,25 @@ function getBiome() {
147
147
  })();
148
148
  return biomePromise;
149
149
  }
150
- async function biomeFormat(content) {
150
+ async function biomeFormat(content, sectionId) {
151
+ const filePath = "example.html";
151
152
  try {
152
153
  const { biome, projectKey } = await getBiome();
153
- const result = biome.formatContent(projectKey, content, {
154
- filePath: "example.html"
155
- });
156
- const hasFatalErrors = result.diagnostics?.some(
154
+ const result = biome.formatContent(projectKey, content, { filePath });
155
+ const fatalDiagnostics = result.diagnostics?.filter(
157
156
  (diag) => diag.severity === "fatal" || diag.severity === "error"
158
157
  );
159
- if (hasFatalErrors) {
160
- logger.warn("Biome HTML formatting has errors, falling back to original content");
158
+ if (fatalDiagnostics?.length) {
159
+ const rendered = biome.printDiagnostics(fatalDiagnostics, { filePath, fileSource: content });
160
+ logger.warn(
161
+ `Biome HTML formatting failed for section ${sectionId}, using unformatted markup:
162
+ ${rendered}`
163
+ );
161
164
  return content;
162
165
  }
163
166
  return result.content;
164
167
  } catch (error) {
165
- logger.warn("Biome HTML formatting not supported or failed:", error);
168
+ logger.warn(`Biome HTML formatting not supported or failed for section ${sectionId}:`, error);
166
169
  return content;
167
170
  }
168
171
  }
@@ -195,7 +198,7 @@ function compilePugFile(pugFilePath, mode, sectionId, extraLocals = {}) {
195
198
  compileDebug: false
196
199
  });
197
200
  const dependencies = [path.resolve(pugFilePath), ...pugFn.dependencies.map((dep) => path.resolve(dep))];
198
- const html = pugFn({ ...extraLocals, useId: createUseId(sectionId) });
201
+ const html = pugFn({ modifierClass: "{{modifier_class}}", ...extraLocals, useId: createUseId(sectionId) });
199
202
  return { html, dependencies };
200
203
  }
201
204
  async function expandVitePugTags(contentDir, mode, html, sectionId) {
@@ -242,7 +245,7 @@ async function compileMarkup(contentDir, mode, html, sectionId) {
242
245
  result = expanded.html;
243
246
  dependencies.push(...expanded.dependencies);
244
247
  if (mode === "production") {
245
- result = await biomeFormat(result);
248
+ result = await biomeFormat(result, sectionId);
246
249
  }
247
250
  result = fixAccessibilityIssues(result);
248
251
  return { html: result, dependencies: [...new Set(dependencies)] };
@@ -1,10 +1,10 @@
1
1
  {
2
- "_animate-DRGZltJ3.js": {
3
- "file": "animate-DRGZltJ3.js",
2
+ "_animate-x_9xNIEv.js": {
3
+ "file": "animate-x_9xNIEv.js",
4
4
  "name": "animate"
5
5
  },
6
- "_code-highlight-BygtMiLu.js": {
7
- "file": "code-highlight-BygtMiLu.js",
6
+ "_code-highlight-Fm7cxf-E.js": {
7
+ "file": "code-highlight-Fm7cxf-E.js",
8
8
  "name": "code-highlight"
9
9
  },
10
10
  "_rolldown-runtime-B1bRi_D7.js": {
@@ -24,7 +24,7 @@
24
24
  "name": "utils"
25
25
  },
26
26
  "client/fullpage.ts": {
27
- "file": "fullpage-CGBSSxKh.js",
27
+ "file": "fullpage-Ck0nyq2C.js",
28
28
  "name": "fullpage",
29
29
  "src": "client/fullpage.ts",
30
30
  "isEntry": true,
@@ -38,12 +38,12 @@
38
38
  ]
39
39
  },
40
40
  "client/lib/clipboard.ts": {
41
- "file": "clipboard-0X6xnPVo.js",
41
+ "file": "clipboard-BUvXbiCa.js",
42
42
  "name": "clipboard",
43
43
  "src": "client/lib/clipboard.ts",
44
44
  "isDynamicEntry": true,
45
45
  "imports": [
46
- "_animate-DRGZltJ3.js",
46
+ "_animate-x_9xNIEv.js",
47
47
  "_signal-ZVBNTRLw.js",
48
48
  "_utils-DrMb1LbR.js"
49
49
  ]
@@ -55,23 +55,23 @@
55
55
  "isDynamicEntry": true
56
56
  },
57
57
  "client/lib/html-validator.ts": {
58
- "file": "html-validator-CeH3wXbU.js",
58
+ "file": "html-validator-Cq21EQMK.js",
59
59
  "name": "html-validator",
60
60
  "src": "client/lib/html-validator.ts",
61
61
  "isDynamicEntry": true,
62
62
  "imports": [
63
- "_code-highlight-BygtMiLu.js",
63
+ "_code-highlight-Fm7cxf-E.js",
64
64
  "_utils-DrMb1LbR.js",
65
65
  "_shared-hGcWlnRM.js"
66
66
  ]
67
67
  },
68
68
  "client/lib/icons.ts": {
69
- "file": "icons-Do1H6FzJ.js",
69
+ "file": "icons-C6KKEuT_.js",
70
70
  "name": "icons",
71
71
  "src": "client/lib/icons.ts",
72
72
  "isDynamicEntry": true,
73
73
  "imports": [
74
- "_animate-DRGZltJ3.js",
74
+ "_animate-x_9xNIEv.js",
75
75
  "_utils-DrMb1LbR.js"
76
76
  ]
77
77
  },
@@ -82,13 +82,13 @@
82
82
  "isEntry": true
83
83
  },
84
84
  "client/preview.ts": {
85
- "file": "preview-B-NERQ5n.js",
85
+ "file": "preview-CHOmMvuB.js",
86
86
  "name": "preview",
87
87
  "src": "client/preview.ts",
88
88
  "isEntry": true,
89
89
  "imports": [
90
- "_animate-DRGZltJ3.js",
91
- "_code-highlight-BygtMiLu.js",
90
+ "_animate-x_9xNIEv.js",
91
+ "_code-highlight-Fm7cxf-E.js",
92
92
  "_signal-ZVBNTRLw.js",
93
93
  "_utils-DrMb1LbR.js",
94
94
  "_shared-hGcWlnRM.js"
@@ -110,7 +110,7 @@
110
110
  ]
111
111
  },
112
112
  "node_modules/html-validate/dist/esm/browser.js": {
113
- "file": "browser-BgMZpraI.js",
113
+ "file": "browser-nU7CpeVb.js",
114
114
  "name": "browser",
115
115
  "src": "node_modules/html-validate/dist/esm/browser.js",
116
116
  "isDynamicEntry": true,
@@ -119,7 +119,7 @@
119
119
  ]
120
120
  },
121
121
  "style.css": {
122
- "file": "kss-modern-3dYdkdaU.css",
122
+ "file": "kss-modern-DeXoMEvT.css",
123
123
  "src": "style.css"
124
124
  }
125
125
  }