@nowline/embed 0.0.0-dev.20261016135659.g7e263e2 → 0.0.0-dev.20261016141905.g9cdb033

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/dist/meta.json CHANGED
@@ -5378,13 +5378,18 @@
5378
5378
  "format": "esm"
5379
5379
  },
5380
5380
  "../core/dist/language/include-resolver.js": {
5381
- "bytes": 21549,
5381
+ "bytes": 23037,
5382
5382
  "imports": [
5383
5383
  {
5384
5384
  "path": "../../node_modules/.pnpm/langium@4.4.0/node_modules/langium/lib/index.js",
5385
5385
  "kind": "import-statement",
5386
5386
  "original": "langium"
5387
5387
  },
5388
+ {
5389
+ "path": "../core/dist/diagnostics/index.js",
5390
+ "kind": "import-statement",
5391
+ "original": "../diagnostics/index.js"
5392
+ },
5388
5393
  {
5389
5394
  "path": "../core/dist/generated/ast.js",
5390
5395
  "kind": "import-statement",
@@ -10000,7 +10005,7 @@
10000
10005
  "format": "esm"
10001
10006
  },
10002
10007
  "../browser/dist/diagnostic-row.js": {
10003
- "bytes": 3802,
10008
+ "bytes": 4103,
10004
10009
  "imports": [
10005
10010
  {
10006
10011
  "path": "../core/dist/index.js",
@@ -10335,7 +10340,7 @@
10335
10340
  "imports": [],
10336
10341
  "exports": [],
10337
10342
  "inputs": {},
10338
- "bytes": 3679461
10343
+ "bytes": 3682882
10339
10344
  },
10340
10345
  "dist/nowline.min.js": {
10341
10346
  "imports": [],
@@ -11243,7 +11248,7 @@
11243
11248
  "bytesInOutput": 375
11244
11249
  },
11245
11250
  "../core/dist/language/include-resolver.js": {
11246
- "bytesInOutput": 7268
11251
+ "bytesInOutput": 7670
11247
11252
  },
11248
11253
  "../core/dist/language/validator/support.js": {
11249
11254
  "bytesInOutput": 580
@@ -11303,7 +11308,7 @@
11303
11308
  "bytesInOutput": 2059
11304
11309
  },
11305
11310
  "../layout/dist/view-preset.js": {
11306
- "bytesInOutput": 5980
11311
+ "bytesInOutput": 5978
11307
11312
  },
11308
11313
  "../layout/dist/phases/date-window.js": {
11309
11314
  "bytesInOutput": 1118
@@ -11459,7 +11464,7 @@
11459
11464
  "bytesInOutput": 2184
11460
11465
  },
11461
11466
  "../browser/dist/diagnostic-row.js": {
11462
- "bytesInOutput": 1065
11467
+ "bytesInOutput": 1204
11463
11468
  },
11464
11469
  "../browser/dist/no-op-include-resolver.js": {
11465
11470
  "bytesInOutput": 189
@@ -11519,7 +11524,7 @@
11519
11524
  "bytesInOutput": 257
11520
11525
  }
11521
11526
  },
11522
- "bytes": 670757
11527
+ "bytes": 671296
11523
11528
  }
11524
11529
  }
11525
11530
  }
@@ -1,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261016135659.g7e263e2 sha=7e263e2 built=2026-10-16T13:52:55Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261016141905.g9cdb033 sha=9cdb033 built=2026-10-16T14:14:22Z */
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -28139,7 +28139,7 @@ function formatStartMismatch(childRelPath, parentStart, childStart) {
28139
28139
  return `Included "${childRelPath}" declares start:${childStart}, but this file has no start:. Both files must declare the same start date, or neither should.`;
28140
28140
  }
28141
28141
  function isRoutedResolveDiagnostic(d) {
28142
- return d.code !== void 0 || d.rule === "wave";
28142
+ return d.code !== void 0 || d.rule === "wave" || d.syntax !== void 0;
28143
28143
  }
28144
28144
  function emptyConfig() {
28145
28145
  return {
@@ -28168,8 +28168,10 @@ async function resolveIncludes(file, filePath, options) {
28168
28168
  const { nodeReadFile: nodeReadFile2 } = await Promise.resolve().then(() => (init_node_read_file(), node_read_file_exports));
28169
28169
  return nodeReadFile2(p);
28170
28170
  });
28171
+ const absPath = resolve("", filePath);
28171
28172
  const ctx = {
28172
28173
  services: options.services,
28174
+ rootAbs: absPath,
28173
28175
  diagnostics: [],
28174
28176
  resolving: [],
28175
28177
  processed: /* @__PURE__ */ new Map(),
@@ -28179,7 +28181,6 @@ async function resolveIncludes(file, filePath, options) {
28179
28181
  stubs: /* @__PURE__ */ new Set(),
28180
28182
  failedWaves: /* @__PURE__ */ new Set()
28181
28183
  };
28182
- const absPath = resolve("", filePath);
28183
28184
  const { config: config2, content } = await resolveFile(file, absPath, ctx);
28184
28185
  ctx.diagnostics.push(...runResolverWaveChecks({
28185
28186
  rootFile: file,
@@ -28212,6 +28213,8 @@ async function resolveFile(file, absPath, ctx) {
28212
28213
  ctx.processed.set(absPath, empty);
28213
28214
  return empty;
28214
28215
  }
28216
+ if (absPath !== ctx.rootAbs)
28217
+ ctx.diagnostics.push(...syntaxDiagnostics(file, absPath));
28215
28218
  ctx.resolving.push(absPath);
28216
28219
  ctx.files.set(file, absPath);
28217
28220
  const config2 = emptyConfig();
@@ -28266,7 +28269,8 @@ async function resolveFile(file, absPath, ctx) {
28266
28269
  });
28267
28270
  applyConfigMode(config2, childConfig, configMode, childAbsPath, ctx.diagnostics);
28268
28271
  applyRoadmapMode(content, childContent, childConfig, roadmapMode, childAbsPath, childRelPath, ctx.diagnostics);
28269
- if (roadmapMode === "isolate" && !childContent.roadmap) {
28272
+ const isParsed = !hasParseErrors(childFile);
28273
+ if (isParsed && roadmapMode === "isolate" && !childContent.roadmap) {
28270
28274
  ctx.diagnostics.push({
28271
28275
  severity: "error",
28272
28276
  message: `Cannot isolate "${childRelPath}": it has no roadmap declaration.`,
@@ -28274,7 +28278,7 @@ async function resolveFile(file, absPath, ctx) {
28274
28278
  line: inc.$cstNode?.range.start.line
28275
28279
  });
28276
28280
  }
28277
- if (roadmapMode !== "ignore" && childFile.roadmapDecl) {
28281
+ if (isParsed && roadmapMode !== "ignore" && childFile.roadmapDecl) {
28278
28282
  const parentStart = readStartProp(file.roadmapDecl);
28279
28283
  const childStart = readStartProp(childFile.roadmapDecl);
28280
28284
  if (parentStart !== childStart) {
@@ -28300,6 +28304,25 @@ async function resolveFile(file, absPath, ctx) {
28300
28304
  ctx.processed.set(absPath, result);
28301
28305
  return result;
28302
28306
  }
28307
+ function syntaxDiagnostics(file, absPath) {
28308
+ const doc = file.$document;
28309
+ if (!doc)
28310
+ return [];
28311
+ const out = [];
28312
+ for (const raw of collectDocumentDiagnostics(doc)) {
28313
+ if (raw.origin === "validation")
28314
+ continue;
28315
+ const line = raw.origin === "lexer" ? raw.error.line : raw.error.token?.startLine;
28316
+ out.push({
28317
+ severity: "error",
28318
+ message: raw.error.message,
28319
+ sourcePath: absPath,
28320
+ ...line !== void 0 && Number.isFinite(line) ? { line: line - 1 } : {},
28321
+ syntax: raw
28322
+ });
28323
+ }
28324
+ return out;
28325
+ }
28303
28326
  function getIncludeMode(inc, key) {
28304
28327
  const opt = inc.options.find((o) => o.key === key);
28305
28328
  if (!opt)
@@ -37021,6 +37044,11 @@ function fromLexerError(err, file) {
37021
37044
  };
37022
37045
  }
37023
37046
  function fromResolveDiagnostic(diag, locale) {
37047
+ if (diag.syntax?.origin === "lexer")
37048
+ return fromLexerError(diag.syntax.error, diag.sourcePath);
37049
+ if (diag.syntax?.origin === "parser") {
37050
+ return fromParserError(diag.syntax.error, diag.sourcePath);
37051
+ }
37024
37052
  const line = (diag.range?.start.line ?? diag.line ?? 0) + 1;
37025
37053
  const column = (diag.range?.start.character ?? 0) + 1;
37026
37054
  if (!isRoutedResolveDiagnostic(diag)) {
@@ -40621,8 +40649,8 @@ function effectiveTheme(theme, systemTheme) {
40621
40649
  }
40622
40650
 
40623
40651
  // src/index.ts
40624
- var version = true ? "0.0.0-dev.20261016135659.g7e263e2" : "0.0.0";
40625
- var sha = true ? "7e263e2" : "unknown";
40652
+ var version = true ? "0.0.0-dev.20261016141905.g9cdb033" : "0.0.0";
40653
+ var sha = true ? "9cdb033" : "unknown";
40626
40654
  var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
40627
40655
  var initialConfig = {
40628
40656
  theme: "auto",