@jk2908/cxx 0.3.3 → 0.3.4

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.
@@ -81,10 +81,9 @@ var defaultLevel = process.env["NODE_ENV"] === "production" ? "error" : "info";
81
81
 
82
82
  class Logger {
83
83
  name;
84
- #level;
85
- constructor(level, name) {
84
+ #level = defaultLevel;
85
+ constructor(name) {
86
86
  this.name = name;
87
- this.#level = level ?? defaultLevel;
88
87
  }
89
88
  static toError(err) {
90
89
  return err instanceof Error ? err : new Error(String(err), { cause: err });
@@ -151,7 +150,6 @@ ${Logger.print(entry.error)}` : "";
151
150
  }
152
151
 
153
152
  // src/next/index.ts
154
- var import_promises2 = __toESM(require("node:fs/promises"));
155
153
  var import_node_path2 = __toESM(require("node:path"));
156
154
  var import_node_url = require("node:url");
157
155
 
@@ -212,6 +210,7 @@ function pascalise(str) {
212
210
  }
213
211
 
214
212
  // src/build.ts
213
+ var logger = new Logger(NAME);
215
214
  var decoder = new TextDecoder;
216
215
  var encoder = new TextEncoder;
217
216
  var collectCache = new LruCache;
@@ -352,29 +351,21 @@ async function writeRenderedTypes(tags) {
352
351
  var PARTIAL_DIR = import_node_path.default.join(GENERATED_DIR, "tags");
353
352
  var REBUILD_WAIT = 100;
354
353
  var rebuildTimer = null;
355
- var rebuildError = null;
356
354
  function partialPath(filePath) {
357
355
  return import_node_path.default.join(PARTIAL_DIR, `${import_node_crypto.createHash("sha1").update(filePath).digest("hex")}.json`);
358
356
  }
359
- async function partialDirMtime() {
360
- try {
361
- return (await import_promises.default.stat(PARTIAL_DIR)).mtimeMs;
362
- } catch (err) {
363
- if (isENOENT(err))
364
- return 0;
365
- throw err;
366
- }
367
- }
368
357
  async function readPartials() {
369
358
  let entries;
370
359
  try {
371
360
  entries = await import_promises.default.readdir(PARTIAL_DIR);
372
361
  } catch (err) {
373
362
  if (isENOENT(err))
374
- return new Map;
363
+ return { tags: new Map, duplicates: [] };
375
364
  throw err;
376
365
  }
377
366
  const tags = new Map;
367
+ const fileByTag = new Map;
368
+ const duplicates = [];
378
369
  for (const entry of entries) {
379
370
  if (!entry.endsWith(".json"))
380
371
  continue;
@@ -385,19 +376,28 @@ async function readPartials() {
385
376
  } catch {
386
377
  continue;
387
378
  }
379
+ let source;
388
380
  try {
389
- await import_promises.default.access(parsed.file);
381
+ source = await import_promises.default.readFile(parsed.file, "utf-8");
390
382
  } catch {
391
383
  await import_promises.default.rm(partial, { force: true });
392
384
  continue;
393
385
  }
386
+ if (!source.includes("cxx")) {
387
+ await import_promises.default.rm(partial, { force: true });
388
+ continue;
389
+ }
394
390
  for (const [name, classes] of Object.entries(parsed.tags)) {
395
- if (tags.has(name))
396
- throw new DuplicateTagError(name);
391
+ const existing = fileByTag.get(name);
392
+ if (existing) {
393
+ duplicates.push({ tag: name, files: [existing, parsed.file] });
394
+ continue;
395
+ }
396
+ fileByTag.set(name, parsed.file);
397
397
  tags.set(name, classes);
398
398
  }
399
399
  }
400
- return tags;
400
+ return { tags, duplicates };
401
401
  }
402
402
  function writeTypesForFile(filePath, tags) {
403
403
  return enqueueWrite(async () => {
@@ -408,8 +408,8 @@ function writeTypesForFile(filePath, tags) {
408
408
  } else {
409
409
  await writeFileAtomic(partial, JSON.stringify({ file: filePath, tags: Object.fromEntries(tags) }));
410
410
  }
411
- }).then(() => {
412
- scheduleRebuild();
411
+ }).then(() => scheduleRebuild()).catch((err) => {
412
+ logger.error(`failed to write types for ${filePath}`, err);
413
413
  });
414
414
  }
415
415
  function scheduleRebuild() {
@@ -418,7 +418,7 @@ function scheduleRebuild() {
418
418
  rebuildTimer = setTimeout(() => {
419
419
  rebuildTimer = null;
420
420
  flushTypes().catch((err) => {
421
- rebuildError = err;
421
+ logger.error("failed to generate types", err);
422
422
  });
423
423
  }, REBUILD_WAIT);
424
424
  }
@@ -428,23 +428,30 @@ function flushTypes() {
428
428
  rebuildTimer = null;
429
429
  }
430
430
  return enqueueWrite(async () => {
431
- let before = await partialDirMtime();
432
- for (let attempt = 0;attempt < 3; attempt++) {
433
- await writeRenderedTypes(await readPartials());
434
- const after = await partialDirMtime();
435
- if (after === before)
436
- return;
437
- before = after;
431
+ const { tags, duplicates } = await readPartials();
432
+ await writeRenderedTypes(tags);
433
+ for (const duplicate of duplicates) {
434
+ logger.error(`Tag "${duplicate.tag}" is defined in multiple files: ${duplicate.files.join(", ")}`);
438
435
  }
439
436
  });
440
437
  }
441
- function takeRebuildError() {
442
- const err = rebuildError;
443
- rebuildError = null;
444
- return err;
438
+ var SOURCE_EXTENSIONS = new Set([".js", ".jsx", ".ts", ".tsx"]);
439
+ var SKIP_DIRS = new Set(["node_modules", "dist", "build", "coverage", "out"]);
440
+ async function refreshFile(file, config) {
441
+ let source;
442
+ try {
443
+ source = await import_promises.default.readFile(file, "utf-8");
444
+ } catch (err) {
445
+ if (!isENOENT(err))
446
+ throw err;
447
+ await writeTypesForFile(file, new Map);
448
+ return;
449
+ }
450
+ const tags = source.includes("cxx") ? collect(source, file, config).tags : new Map;
451
+ await writeTypesForFile(file, tags);
445
452
  }
446
453
  function tagsToType(tags) {
447
- return [...tags].toSorted(([a], [b]) => a.localeCompare(b)).map(([tag, classes]) => {
454
+ return [...tags].toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([tag, classes]) => {
448
455
  const union = classes.length > 0 ? classes.toSorted((a, b) => a.length - b.length).map((c) => `'${c}'`).join(" | ") : "never";
449
456
  return ` export type ${tag} = ${union}`;
450
457
  }).join(`
@@ -452,6 +459,7 @@ function tagsToType(tags) {
452
459
  }
453
460
 
454
461
  // src/next/index.ts
462
+ var typeLogger = new Logger("cxx");
455
463
  var nextDir = import_node_path2.default.dirname(import_node_url.fileURLToPath("file:///Users/jeromekenway/Documents/dev.nosync/me/repo/cxx/packages/cxx/src/next/index.ts"));
456
464
  var loader = import_node_path2.default.join(nextDir, "cxx-loader.cjs");
457
465
  var watchedFiles = new Map;
@@ -469,32 +477,19 @@ async function onEvent(event, filePath) {
469
477
  const watched = watchedFiles.get(filePath);
470
478
  if (!watched)
471
479
  return;
472
- const { pluginConfig, logger } = watched;
480
+ const { pluginConfig, logger: logger2 } = watched;
473
481
  if (event === "delete") {
474
482
  await writeTypesForFile(filePath, new Map);
475
- logger.info(`updated types from ${filePath}`);
476
- return;
477
- }
478
- let source;
479
- try {
480
- source = await import_promises2.default.readFile(filePath, "utf-8");
481
- } catch (err) {
482
- if (!isENOENT(err))
483
- throw err;
484
- await writeTypesForFile(filePath, new Map);
485
- logger.info(`updated types from ${filePath}`);
486
- return;
483
+ } else {
484
+ await refreshFile(filePath, pluginConfig);
487
485
  }
488
- const tags = source.includes("cxx") ? collect(source, filePath, pluginConfig).tags : new Map;
489
- await writeTypesForFile(filePath, tags);
490
- logger.info(`updated types from ${filePath}`);
486
+ logger2.info(`updated types from ${filePath}`);
491
487
  }
492
- function ensureWatcher(pluginConfig, logger) {
493
- watcherLogger = logger;
488
+ function ensureWatcher(pluginConfig, logger2) {
489
+ watcherLogger = logger2;
494
490
  if (subscriptionPromise)
495
491
  return;
496
492
  const root = pluginConfig.watch?.root ?? process.cwd();
497
- const ignore = [...DEFAULT_IGNORE, ...pluginConfig.watch?.ignore ?? []];
498
493
  subscriptionPromise = (async () => {
499
494
  const { subscribe } = await import("@parcel/watcher");
500
495
  subscription = await subscribe(root, (watchErr, events) => {
@@ -510,7 +505,7 @@ function ensureWatcher(pluginConfig, logger) {
510
505
  watcherLogger?.error(`failed to update types from ${filePath}`, err);
511
506
  });
512
507
  }
513
- }, { ignore });
508
+ }, { ignore: DEFAULT_IGNORE });
514
509
  registerCleanup();
515
510
  })().catch((err) => {
516
511
  watcherLogger?.error("failed to start cxx watcher", err);
@@ -539,17 +534,14 @@ function registerCleanup() {
539
534
  process.once("SIGINT", () => void shutdown("SIGINT"));
540
535
  process.once("SIGTERM", () => void shutdown("SIGTERM"));
541
536
  }
542
- function processFile(source, filePath, pluginConfig, logger) {
537
+ function processFile(source, filePath, pluginConfig, logger2) {
543
538
  const resolvedFilePath = import_node_path2.default.resolve(filePath);
544
539
  if (!source.includes("cxx") || /[\\/]node_modules[\\/]/.test(resolvedFilePath)) {
545
540
  return { template: source, tags: new Map, map: null };
546
541
  }
547
- const priorError = takeRebuildError();
548
- if (priorError)
549
- throw priorError;
550
542
  if (process.env["NODE_ENV"] !== "production") {
551
- watchedFiles.set(resolvedFilePath, { pluginConfig, logger });
552
- ensureWatcher(pluginConfig, logger);
543
+ watchedFiles.set(resolvedFilePath, { pluginConfig, logger: logger2 });
544
+ ensureWatcher(pluginConfig, logger2);
553
545
  }
554
546
  const result = collect(source, resolvedFilePath, pluginConfig);
555
547
  writeTypesForFile(resolvedFilePath, result.tags);
@@ -559,8 +551,8 @@ function processFile(source, filePath, pluginConfig, logger) {
559
551
  // src/next/cxx-loader.js
560
552
  var loader2 = function(source) {
561
553
  const { pluginConfig } = this.getOptions();
562
- const logger = new Logger;
563
- const { template, map } = processFile(source, this.resourcePath, pluginConfig, logger);
554
+ const logger2 = new Logger;
555
+ const { template, map } = processFile(source, this.resourcePath, pluginConfig, logger2);
564
556
  if (map && typeof this.callback === "function") {
565
557
  this.callback(null, template, map);
566
558
  return;
@@ -569,4 +561,4 @@ var loader2 = function(source) {
569
561
  };
570
562
  var cxx_loader_default = loader2;
571
563
 
572
- //# debugId=57CAE560E6EB2D4464756E2164756E21
564
+ //# debugId=61C93031E060481B64756E2164756E21
@@ -2,15 +2,15 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/logger.ts", "../../src/next/index.ts", "../../src/build.ts", "../../src/config.ts", "../../src/lru.ts", "../../src/utils.ts", "../../src/next/cxx-loader.js"],
4
4
  "sourcesContent": [
5
- "const LEVELS = {\n\tdebug: 0,\n\tinfo: 1,\n\twarn: 2,\n\terror: 3,\n\tfatal: 4,\n} as const\n\nexport type LogLevel = keyof typeof LEVELS\n\nconst defaultLevel: LogLevel = process.env['NODE_ENV'] === 'production' ? 'error' : 'info'\n\ntype LogEntry = {\n\tts: number\n\tlevel: LogLevel\n\tmessage: string\n\terror?:\n\t\t| Error\n\t\t| {\n\t\t\t\tmessage: string\n\t\t\t\tstack?: string\n\t\t\t\tcause?: unknown\n\t\t }\n}\n\n/**\n * Log messages with different severity levels.\n */\nexport class Logger {\n\t#level: LogLevel\n\n\tconstructor(\n\t\tlevel?: LogLevel,\n\t\tpublic name?: string,\n\t) {\n\t\tthis.#level = level ?? defaultLevel\n\t}\n\n\t/**\n\t * Convert a value to an Error instance.\n\t */\n\tstatic toError(err: unknown) {\n\t\treturn err instanceof Error ? err : new Error(String(err), { cause: err })\n\t}\n\n\t/**\n\t * Stringify the error for logging.\n\t */\n\tstatic print(err: unknown) {\n\t\tif (err instanceof Error) {\n\t\t\treturn err.message + (err.stack ? `\\n${err.stack}` : '')\n\t\t}\n\n\t\t// for plain objects, attempt to stringify with indentation\n\t\t// for readability\n\t\tif (typeof err === 'object' && err !== null) {\n\t\t\ttry {\n\t\t\t\treturn JSON.stringify(err, null, 2)\n\t\t\t} catch {\n\t\t\t\t// if stringify fails (e.g. circular reference), fall back\n\t\t\t\t// to basic string conversion\n\t\t\t\treturn String(err)\n\t\t\t}\n\t\t}\n\n\t\treturn String(err)\n\t}\n\n\tset level(level: LogLevel) {\n\t\tthis.#level = level\n\t}\n\n\tget level() {\n\t\treturn this.#level\n\t}\n\n\t/**\n\t * Log a message with a specific level.\n\t */\n\tlog(level: LogLevel, message: string, error?: Error) {\n\t\tif (LEVELS[level] < LEVELS[this.level]) return\n\n\t\tconst entry: LogEntry = {\n\t\t\tts: Date.now(),\n\t\t\tlevel,\n\t\t\tmessage,\n\t\t}\n\n\t\tif (level === 'error' || level === 'fatal') {\n\t\t\tentry.error = error ? Logger.toError(error) : new Error(message)\n\t\t}\n\n\t\tconst line = `${this.name ? `[${this.name}]` : ''} [${entry.ts}] [${level.toUpperCase()}] ${message}`\n\t\tconst extra = entry.error ? `\\n${Logger.print(entry.error)}` : ''\n\n\t\tif (level === 'warn') {\n\t\t\tconsole.warn(line, extra)\n\t\t\treturn\n\t\t}\n\n\t\tif (level === 'error' || level === 'fatal') {\n\t\t\tconsole.error(line, extra)\n\t\t\treturn\n\t\t}\n\n\t\tconsole.log(line, extra)\n\t}\n\n\t/**\n\t * Log a debug message.\n\t */\n\tdebug(...messages: string[]) {\n\t\tthis.log('debug', messages.join(' '))\n\t}\n\n\t/**\n\t * Log an info message.\n\t */\n\tinfo(...messages: string[]) {\n\t\tthis.log('info', messages.join(' '))\n\t}\n\n\t/**\n\t * Log a warning message.\n\t */\n\twarn(...messages: string[]) {\n\t\tthis.log('warn', messages.join(' '))\n\t}\n\n\t/**\n\t * Log an error message.\n\t */\n\terror(message: string, error?: unknown) {\n\t\tthis.log('error', message, error === undefined ? undefined : Logger.toError(error))\n\t}\n\n\t/**\n\t * Log a fatal error message.\n\t */\n\tfatal(message: string, error?: unknown) {\n\t\tthis.log('fatal', message, error === undefined ? undefined : Logger.toError(error))\n\t}\n}\n",
6
- "import type { AsyncSubscription, Event } from '@parcel/watcher'\nimport type { NextConfig } from 'next'\n\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport type { Logger } from '../logger.js'\nimport type { PluginConfig } from '../types.js'\nimport { collect, isENOENT, takeRebuildError, writeTypesForFile } from '../build.js'\nimport { GENERATED_DIR } from '../config.js'\n\nconst nextDir = path.dirname(fileURLToPath(import.meta.url))\nconst loader = path.join(nextDir, 'cxx-loader.cjs')\n\n// keep the exact file inputs and their config so a single recursive watcher can filter events\nconst watchedFiles = new Map<string, { pluginConfig: PluginConfig; logger: Logger }>()\n\nlet subscription: AsyncSubscription | null = null\nlet subscriptionPromise: Promise<void> | null = null\nlet cleanupRegistered = false\nlet watcherLogger: Logger | null = null\n\n// a single recursive watch avoids overlapping per-directory watchers; ignore the parts of the\n// tree that never contain source we transform\nconst DEFAULT_IGNORE = [\n\t'**/node_modules/**',\n\t'**/.next/**',\n\t`**/${GENERATED_DIR}/**`,\n\t'**/.git/**',\n]\n\nasync function onEvent(event: Event['type'], filePath: string) {\n\tconst watched = watchedFiles.get(filePath)\n\tif (!watched) return\n\n\tconst { pluginConfig, logger } = watched\n\n\tif (event === 'delete') {\n\t\tawait writeTypesForFile(filePath, new Map())\n\t\tlogger.info(`updated types from ${filePath}`)\n\n\t\treturn\n\t}\n\n\tlet source: string\n\n\ttry {\n\t\tsource = await fs.readFile(filePath, 'utf-8')\n\t} catch (err) {\n\t\tif (!isENOENT(err)) throw err\n\n\t\tawait writeTypesForFile(filePath, new Map())\n\t\tlogger.info(`updated types from ${filePath}`)\n\n\t\treturn\n\t}\n\n\tconst tags = source.includes('cxx')\n\t\t? collect(source, filePath, pluginConfig).tags\n\t\t: new Map()\n\n\tawait writeTypesForFile(filePath, tags)\n\tlogger.info(`updated types from ${filePath}`)\n}\n\n/**\n * Start the watcher lazily, on the first file we actually process, so merely importing this module\n * has no side effects.\n */\nfunction ensureWatcher(pluginConfig: PluginConfig, logger: Logger) {\n\twatcherLogger = logger\n\n\tif (subscriptionPromise) return\n\n\tconst root = pluginConfig.watch?.root ?? process.cwd()\n\tconst ignore = [...DEFAULT_IGNORE, ...(pluginConfig.watch?.ignore ?? [])]\n\n\tsubscriptionPromise = (async () => {\n\t\t// lazily imported so the native module is only loaded when watching is needed\n\t\tconst { subscribe } = await import('@parcel/watcher')\n\n\t\tsubscription = await subscribe(\n\t\t\troot,\n\t\t\t(watchErr, events) => {\n\t\t\t\tif (watchErr) {\n\t\t\t\t\twatcherLogger?.error(`failed to watch ${root}`, watchErr)\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const event of events) {\n\t\t\t\t\tconst filePath = path.resolve(event.path)\n\t\t\t\t\tif (!watchedFiles.has(filePath)) continue\n\n\t\t\t\t\tvoid onEvent(event.type, filePath).catch(err => {\n\t\t\t\t\t\twatcherLogger?.error(`failed to update types from ${filePath}`, err)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ ignore },\n\t\t)\n\n\t\tregisterCleanup()\n\t})().catch(err => {\n\t\twatcherLogger?.error('failed to start cxx watcher', err)\n\t\tsubscriptionPromise = null\n\t})\n}\n\n/**\n * Close all active Parcel subscriptions.\n */\nasync function cleanup() {\n\tconst active = subscription\n\n\tsubscription = null\n\tsubscriptionPromise = null\n\twatchedFiles.clear()\n\n\tif (active) await active.unsubscribe()\n}\n\n/**\n * Restore the host process's default signal behaviour instead of forcing an exit from a library.\n */\nasync function shutdown(signal: NodeJS.Signals) {\n\ttry {\n\t\tawait cleanup()\n\t} finally {\n\t\t// our `once` handlers have already been removed, so re-raising lets Node terminate as usual\n\t\tprocess.kill(process.pid, signal)\n\t}\n}\n\nfunction registerCleanup() {\n\tif (cleanupRegistered) return\n\n\tcleanupRegistered = true\n\tprocess.once('SIGINT', () => void shutdown('SIGINT'))\n\tprocess.once('SIGTERM', () => void shutdown('SIGTERM'))\n}\n\n/**\n * Transform one module and, in development, register it with the shared watcher state.\n */\nexport function processFile(\n\tsource: string,\n\tfilePath: string,\n\tpluginConfig: PluginConfig,\n\tlogger: Logger,\n) {\n\tconst resolvedFilePath = path.resolve(filePath)\n\n\t// skip files that cannot contain a template, including node_modules\n\tif (!source.includes('cxx') || /[\\\\/]node_modules[\\\\/]/.test(resolvedFilePath)) {\n\t\treturn { template: source, tags: new Map(), map: null }\n\t}\n\n\t// surface a duplicate-tag error from a previous background rebuild\n\tconst priorError = takeRebuildError()\n\tif (priorError) throw priorError\n\n\tif (process.env['NODE_ENV'] !== 'production') {\n\t\twatchedFiles.set(resolvedFilePath, { pluginConfig, logger })\n\t\tensureWatcher(pluginConfig, logger)\n\t}\n\n\tconst result = collect(source, resolvedFilePath, pluginConfig)\n\n\tvoid writeTypesForFile(resolvedFilePath, result.tags)\n\n\treturn result\n}\n\nconst TURBOPACK_GLOB = '*.{tsx,jsx,ts,js}'\n\nexport function withCxx(nextConfig: NextConfig = {}, pluginConfig: PluginConfig = {}) {\n\tconst watchRoot =\n\t\tpluginConfig.watch?.root ?? nextConfig.turbopack?.root ?? process.cwd()\n\n\tconst loaderItem = {\n\t\tloader,\n\t\toptions: {\n\t\t\tpluginConfig: {\n\t\t\t\t...pluginConfig,\n\t\t\t\twatch: { ...pluginConfig.watch, root: watchRoot },\n\t\t\t},\n\t\t},\n\t}\n\n\tconst currentRule = nextConfig.turbopack?.rules?.[TURBOPACK_GLOB]\n\tconst userWebpack = nextConfig.webpack\n\n\treturn {\n\t\t...nextConfig,\n\t\tturbopack: {\n\t\t\t...nextConfig.turbopack,\n\t\t\trules: {\n\t\t\t\t...nextConfig.turbopack?.rules,\n\t\t\t\t[TURBOPACK_GLOB]: Array.isArray(currentRule)\n\t\t\t\t\t? [...currentRule, loaderItem]\n\t\t\t\t\t: currentRule\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t...currentRule,\n\t\t\t\t\t\t\t\tloaders: [...(currentRule.loaders ?? []), loaderItem],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: { loaders: [loaderItem] },\n\t\t\t},\n\t\t},\n\t\t// webpack builds (Next without `--turbopack`) would otherwise silently skip the transform\n\t\twebpack(config: unknown, context: unknown) {\n\t\t\tconst next = (\n\t\t\t\tuserWebpack ? userWebpack(config as never, context as never) : config\n\t\t\t) as {\n\t\t\t\tmodule?: { rules?: unknown[] }\n\t\t\t}\n\n\t\t\tnext.module ??= {}\n\t\t\tnext.module.rules ??= []\n\t\t\tnext.module.rules.push({\n\t\t\t\ttest: /\\.[jt]sx?$/,\n\t\t\t\texclude: /node_modules/,\n\t\t\t\tenforce: 'pre',\n\t\t\t\tuse: [loaderItem],\n\t\t\t})\n\n\t\t\treturn next\n\t\t},\n\t}\n}\n",
7
- "import { createHash } from 'node:crypto'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { transform } from 'lightningcss'\nimport MagicString, { type SourceMap } from 'magic-string'\n\nimport type { PluginConfig, Tags } from './types.js'\nimport { AUTOGEN_MSG, GENERATED_DIR, PKG_NAME } from './config.js'\nimport { LruCache } from './lru.js'\nimport { pascalise } from './utils.js'\n\n// decode bytes to a string, then stringify into a safe literal. `${bytes}` only\n// works by accident for Buffer; a plain Uint8Array stringifies as `97,123,125`\nconst decoder = new TextDecoder()\nconst encoder = new TextEncoder()\n\n/**\n * LRU cache of `collect` results by file id + last seen source + config so watcher and transform\n * can reuse the same parsed template/tags.\n */\nconst collectCache = new LruCache<{\n\tsource: string\n\tconfig: string\n\ttemplate: string\n\ttags: Tags\n\tmap: SourceMap | null\n}>()\n\n/**\n * Serialises type file writes inside a single process so overlapping writes can't interleave or\n * land out of order.\n */\nlet writeChain: Promise<void> = Promise.resolve()\n\n/**\n * Returns whether the error was caused by a missing file or directory.\n */\nexport function isENOENT(err: unknown) {\n\treturn err instanceof Error && 'code' in err && err.code === 'ENOENT'\n}\n\n/**\n * Write a file by writing to a unique temporary file and renaming it into place, so concurrent\n * writers never observe a partial file. The temp file is cleaned up if the rename fails.\n */\nasync function writeFileAtomic(filePath: string, content: string) {\n\tconst tmp = `${filePath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`\n\n\tawait fs.writeFile(tmp, content)\n\n\ttry {\n\t\tawait fs.rename(tmp, filePath)\n\t} catch (err) {\n\t\tawait fs.rm(tmp, { force: true })\n\t\tthrow err\n\t}\n}\n\n/**\n * Run a write task after all previously queued writes have settled. A rejection doesn't break the\n * chain for later tasks.\n */\nfunction enqueueWrite<T>(task: () => Promise<T>) {\n\t// wait for the previous write to finish, then run this one, even if the previous one failed\n\tconst run = writeChain.then(task, task)\n\n\t// move the queue on to this write, but turn either outcome into success so it never rejects\n\twriteChain = run.then(\n\t\t() => undefined,\n\t\t() => undefined,\n\t)\n\n\t// return the real promise, so the caller still sees this write's value or error\n\treturn run\n}\n\n/**\n * Write a file only if the content differs from what is already on disk, so watchers are not woken\n * by a needless mtime change.\n */\nexport async function maybeWrite(filePath: string, content: string) {\n\ttry {\n\t\tif ((await fs.readFile(filePath, 'utf-8')) === content) return false\n\t} catch (err) {\n\t\tif (!isENOENT(err)) throw err\n\t}\n\n\tawait writeFileAtomic(filePath, content)\n\n\treturn true\n}\n\n// matches `[css, classes, href] = cxx\\`...\\`` and `cxx.tag<T>('name')\\`...\\``\n// capture groups: 1 optional `export `, 2-4 assigned variable names, 5 plain\n// css body, 6 quote kind, 7 tag name, 8 tagged css body\nconst regex =\n\t/((?:export\\s+)?)(?:const|var|let)\\s*\\[(\\w*)\\s*,?\\s*(\\w*)\\s*,?\\s*(\\w*)\\s*\\]\\s*=\\s*cxx(?:\\s*`([\\s\\S]*?)`|\\s*\\.\\s*tag(?:\\s*<[^>]+>)?\\s*\\(\\s*(['\"])(.*?)\\6\\s*\\)\\s*`([\\s\\S]*?)`)/gm\n\nconst IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/\n\n/**\n * Hash transformed CSS into a stable href for style deduplication.\n */\nfunction hashCss(code: Uint8Array) {\n\treturn `cxx-${createHash('sha256').update(code).digest('base64url').slice(0, 12)}`\n}\n\nexport class DuplicateTagError extends Error {\n\tname = 'DuplicateTagError'\n\n\tconstructor(tag: string) {\n\t\tsuper(`Tag ${tag} has already been seen. Tags must be unique across your application`)\n\t}\n}\n\nexport class InvalidTagError extends Error {\n\tname = 'InvalidTagError'\n\n\tconstructor(tag: string) {\n\t\tsuper(\n\t\t\t`Tag \"${tag}\" does not map to a valid TypeScript identifier. ` +\n\t\t\t\t`Use letters, numbers, spaces, \"_\" or \"-\"`,\n\t\t)\n\t}\n}\n\n/**\n * Transform `cxx` templates in one source file and collect any exported tag types.\n */\nexport function collect(source: string, id: string, config: PluginConfig) {\n\tconst configKey = JSON.stringify(config)\n\n\t// reuse the last result when the source and config are unchanged\n\tconst cached = collectCache.get(id)\n\tif (cached?.source === source && cached.config === configKey) return cached\n\n\tconst tags: Tags = new Map()\n\tconst magic = new MagicString(source)\n\tlet matched = false\n\n\t// the regex is global, so reset its cursor before scanning\n\tregex.lastIndex = 0\n\n\tlet match: RegExpExecArray | null\n\n\t// walk every cxx template and replace it in place\n\twhile ((match = regex.exec(source))) {\n\t\tmatched = true\n\n\t\t// capture groups: export, three bindings, plain css, (quote), tag, tagged css\n\t\tconst [, exp, varOne, varTwo, varThree, plainCss, , tag, taggedCss] = match\n\t\tconst css = plainCss ?? taggedCss\n\t\tconst matchIndex = match.index\n\n\t\t// compile the CSS to minified CSS Modules, reporting the source line on failure\n\t\tconst { code, exports: classExports = {} } = (() => {\n\t\t\ttry {\n\t\t\t\treturn transform({\n\t\t\t\t\tminify: true,\n\t\t\t\t\tcssModules: true,\n\t\t\t\t\tfilename: id,\n\t\t\t\t\tcode: encoder.encode(css),\n\t\t\t\t})\n\t\t\t} catch (err) {\n\t\t\t\tconst line = source.slice(0, matchIndex).split('\\n').length\n\t\t\t\tthrow new Error(`Failed to compile cxx CSS at ${id}:${line}`, { cause: err })\n\t\t\t}\n\t\t})()\n\n\t\tconst href = hashCss(code)\n\t\t// map each class name to its generated (scoped) name\n\t\tconst styles = Object.fromEntries(\n\t\t\tObject.entries(classExports).map(([k, v]) => [k, v.name]),\n\t\t)\n\n\t\tif (tag) {\n\t\t\tconst suffix =\n\t\t\t\ttypeof config.typeSuffix === 'string'\n\t\t\t\t\t? config.typeSuffix\n\t\t\t\t\t: config.typeSuffix === false\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: 'Classes'\n\t\t\tconst tagWithSuffix = pascalise(`${tag}${suffix}`)\n\n\t\t\tif (!IDENTIFIER.test(tagWithSuffix)) throw new InvalidTagError(tag)\n\t\t\tif (tags.has(tagWithSuffix)) throw new DuplicateTagError(tagWithSuffix)\n\n\t\t\t// side effect but necessary\n\t\t\ttags.set(tagWithSuffix, Object.keys(styles))\n\t\t}\n\n\t\tconst statements: string[] = []\n\n\t\tif (varOne) {\n\t\t\tstatements.push(`${exp}const ${varOne} = ${JSON.stringify(decoder.decode(code))}`)\n\t\t}\n\n\t\tif (varTwo) {\n\t\t\tstatements.push(`${exp}const ${varTwo} = ${JSON.stringify(styles)}`)\n\t\t}\n\n\t\tif (varThree) {\n\t\t\tstatements.push(`${exp}const ${varThree} = ${JSON.stringify(href)}`)\n\t\t}\n\n\t\t// swap the template for the generated declarations, keeping the export keyword\n\t\tmagic.overwrite(matchIndex, matchIndex + match[0].length, statements.join('\\n'))\n\t}\n\n\tconst template = magic.toString()\n\t// only build a map when something was actually rewritten\n\tconst map = matched\n\t\t? magic.generateMap({ source: id, includeContent: true, hires: true })\n\t\t: null\n\tconst result = { source, config: configKey, template, tags, map }\n\n\tcollectCache.set(id, result)\n\n\treturn result\n}\n\n/**\n * Render the generated declaration file contents for a set of collected tags.\n */\nfunction renderTypes(tags: Tags) {\n\treturn [\n\t\tAUTOGEN_MSG,\n\t\t'',\n\t\t`import '${PKG_NAME}'`,\n\t\t'',\n\t\t`declare module '${PKG_NAME}' {`,\n\t\ttagsToType(tags),\n\t\t'}',\n\t\t'',\n\t].join('\\n')\n}\n\n/**\n * Write (or remove) the generated `index.d.ts` for a full tag surface.\n */\nasync function writeRenderedTypes(tags: Tags) {\n\tconst filePath = path.join(GENERATED_DIR, 'index.d.ts')\n\n\tif (!tags.size) {\n\t\tawait fs.rm(filePath, { force: true })\n\t\treturn\n\t}\n\n\tawait fs.mkdir(GENERATED_DIR, { recursive: true })\n\tawait maybeWrite(filePath, renderTypes(tags))\n}\n\nconst PARTIAL_DIR = path.join(GENERATED_DIR, 'tags')\n\n// wait this long after the last file before rebuilding, so a burst of files\n// only re-reads the partials once\nconst REBUILD_WAIT = 100\n\nlet rebuildTimer: ReturnType<typeof setTimeout> | null = null\nlet rebuildError: unknown = null\n\nfunction partialPath(filePath: string) {\n\treturn path.join(\n\t\tPARTIAL_DIR,\n\t\t`${createHash('sha1').update(filePath).digest('hex')}.json`,\n\t)\n}\n\n/**\n * The partial directory changes whenever any process adds, removes or overwrites a partial, so\n * its mtime tells us whether another writer moved while we were rebuilding.\n */\nasync function partialDirMtime() {\n\ttry {\n\t\treturn (await fs.stat(PARTIAL_DIR)).mtimeMs\n\t} catch (err) {\n\t\tif (isENOENT(err)) return 0\n\t\tthrow err\n\t}\n}\n\n/**\n * Read every per-file partial and merge them into one tag map. Partials whose source file no\n * longer exists are pruned so deleted files drop out of the types.\n */\nasync function readPartials() {\n\tlet entries: string[]\n\n\ttry {\n\t\tentries = await fs.readdir(PARTIAL_DIR)\n\t} catch (err) {\n\t\tif (isENOENT(err)) return new Map()\n\t\tthrow err\n\t}\n\n\tconst tags: Tags = new Map()\n\n\tfor (const entry of entries) {\n\t\tif (!entry.endsWith('.json')) continue\n\n\t\tconst partial = path.join(PARTIAL_DIR, entry)\n\t\tlet parsed: { file: string; tags: Record<string, string[]> }\n\n\t\ttry {\n\t\t\tparsed = JSON.parse(await fs.readFile(partial, 'utf-8'))\n\t\t} catch {\n\t\t\tcontinue\n\t\t}\n\n\t\ttry {\n\t\t\tawait fs.access(parsed.file)\n\t\t} catch {\n\t\t\tawait fs.rm(partial, { force: true })\n\t\t\tcontinue\n\t\t}\n\n\t\tfor (const [name, classes] of Object.entries(parsed.tags)) {\n\t\t\tif (tags.has(name)) throw new DuplicateTagError(name)\n\t\t\ttags.set(name, classes)\n\t\t}\n\t}\n\n\treturn tags\n}\n\n/**\n * Persist one file's tags to its own partial, then rebuild the shared types soon. Rebuilding is\n * debounced and serialised, so a large build does not re-read every partial per file.\n */\nexport function writeTypesForFile(filePath: string, tags: Tags) {\n\treturn enqueueWrite(async () => {\n\t\tawait fs.mkdir(PARTIAL_DIR, { recursive: true })\n\n\t\tconst partial = partialPath(filePath)\n\n\t\tif (!tags.size) {\n\t\t\tawait fs.rm(partial, { force: true })\n\t\t} else {\n\t\t\tawait writeFileAtomic(\n\t\t\t\tpartial,\n\t\t\t\tJSON.stringify({ file: filePath, tags: Object.fromEntries(tags) }),\n\t\t\t)\n\t\t}\n\t}).then(() => {\n\t\tscheduleRebuild()\n\t})\n}\n\nfunction scheduleRebuild() {\n\tif (rebuildTimer) clearTimeout(rebuildTimer)\n\n\trebuildTimer = setTimeout(() => {\n\t\trebuildTimer = null\n\t\tflushTypes().catch(err => {\n\t\t\trebuildError = err\n\t\t})\n\t}, REBUILD_WAIT)\n}\n\n/**\n * Rebuild `index.d.ts` from every partial now. If another writer touches a partial mid-rebuild,\n * rebuild once more so the final write reflects every partial. Bounded to avoid spinning.\n */\nexport function flushTypes() {\n\tif (rebuildTimer) {\n\t\tclearTimeout(rebuildTimer)\n\t\trebuildTimer = null\n\t}\n\n\treturn enqueueWrite(async () => {\n\t\tlet before = await partialDirMtime()\n\n\t\tfor (let attempt = 0; attempt < 3; attempt++) {\n\t\t\tawait writeRenderedTypes(await readPartials())\n\n\t\t\tconst after = await partialDirMtime()\n\t\t\tif (after === before) return\n\n\t\t\tbefore = after\n\t\t}\n\t})\n}\n\n/**\n * Return and clear any error from a background rebuild, so a caller can fail loudly.\n */\nexport function takeRebuildError() {\n\tconst err = rebuildError\n\trebuildError = null\n\treturn err\n}\n\n/**\n * Render collected tags as a module augmentation for the package entrypoint.\n */\nexport function tagsToType(tags: Tags) {\n\treturn [...tags]\n\t\t.toSorted(([a], [b]) => a.localeCompare(b))\n\t\t.map(([tag, classes]) => {\n\t\t\tconst union =\n\t\t\t\tclasses.length > 0\n\t\t\t\t\t? classes\n\t\t\t\t\t\t\t.toSorted((a, b) => a.length - b.length)\n\t\t\t\t\t\t\t.map(c => `'${c}'`)\n\t\t\t\t\t\t\t.join(' | ')\n\t\t\t\t\t: 'never'\n\n\t\t\treturn `\\texport type ${tag} = ${union}`\n\t\t})\n\t\t.join('\\n')\n}\n",
5
+ "const LEVELS = {\n\tdebug: 0,\n\tinfo: 1,\n\twarn: 2,\n\terror: 3,\n\tfatal: 4,\n} as const\n\nexport type LogLevel = keyof typeof LEVELS\n\nconst defaultLevel: LogLevel = process.env['NODE_ENV'] === 'production' ? 'error' : 'info'\n\ntype LogEntry = {\n\tts: number\n\tlevel: LogLevel\n\tmessage: string\n\terror?:\n\t\t| Error\n\t\t| {\n\t\t\t\tmessage: string\n\t\t\t\tstack?: string\n\t\t\t\tcause?: unknown\n\t\t }\n}\n\n/**\n * Log messages with different severity levels.\n */\nexport class Logger {\n\t#level: LogLevel = defaultLevel\n\n\tconstructor(public name?: string) {}\n\n\t/**\n\t * Convert a value to an Error instance.\n\t */\n\tstatic toError(err: unknown) {\n\t\treturn err instanceof Error ? err : new Error(String(err), { cause: err })\n\t}\n\n\t/**\n\t * Stringify the error for logging.\n\t */\n\tstatic print(err: unknown) {\n\t\tif (err instanceof Error) {\n\t\t\treturn err.message + (err.stack ? `\\n${err.stack}` : '')\n\t\t}\n\n\t\t// for plain objects, attempt to stringify with indentation\n\t\t// for readability\n\t\tif (typeof err === 'object' && err !== null) {\n\t\t\ttry {\n\t\t\t\treturn JSON.stringify(err, null, 2)\n\t\t\t} catch {\n\t\t\t\t// if stringify fails (e.g. circular reference), fall back\n\t\t\t\t// to basic string conversion\n\t\t\t\treturn String(err)\n\t\t\t}\n\t\t}\n\n\t\treturn String(err)\n\t}\n\n\tset level(level: LogLevel) {\n\t\tthis.#level = level\n\t}\n\n\tget level() {\n\t\treturn this.#level\n\t}\n\n\t/**\n\t * Log a message with a specific level.\n\t */\n\tlog(level: LogLevel, message: string, error?: Error) {\n\t\tif (LEVELS[level] < LEVELS[this.level]) return\n\n\t\tconst entry: LogEntry = {\n\t\t\tts: Date.now(),\n\t\t\tlevel,\n\t\t\tmessage,\n\t\t}\n\n\t\tif (level === 'error' || level === 'fatal') {\n\t\t\tentry.error = error ? Logger.toError(error) : new Error(message)\n\t\t}\n\n\t\tconst line = `${this.name ? `[${this.name}]` : ''} [${entry.ts}] [${level.toUpperCase()}] ${message}`\n\t\tconst extra = entry.error ? `\\n${Logger.print(entry.error)}` : ''\n\n\t\tif (level === 'warn') {\n\t\t\tconsole.warn(line, extra)\n\t\t\treturn\n\t\t}\n\n\t\tif (level === 'error' || level === 'fatal') {\n\t\t\tconsole.error(line, extra)\n\t\t\treturn\n\t\t}\n\n\t\tconsole.log(line, extra)\n\t}\n\n\t/**\n\t * Log a debug message.\n\t */\n\tdebug(...messages: string[]) {\n\t\tthis.log('debug', messages.join(' '))\n\t}\n\n\t/**\n\t * Log an info message.\n\t */\n\tinfo(...messages: string[]) {\n\t\tthis.log('info', messages.join(' '))\n\t}\n\n\t/**\n\t * Log a warning message.\n\t */\n\twarn(...messages: string[]) {\n\t\tthis.log('warn', messages.join(' '))\n\t}\n\n\t/**\n\t * Log an error message.\n\t */\n\terror(message: string, error?: unknown) {\n\t\tthis.log('error', message, error === undefined ? undefined : Logger.toError(error))\n\t}\n\n\t/**\n\t * Log a fatal error message.\n\t */\n\tfatal(message: string, error?: unknown) {\n\t\tthis.log('fatal', message, error === undefined ? undefined : Logger.toError(error))\n\t}\n}\n",
6
+ "import type { AsyncSubscription, Event } from '@parcel/watcher'\nimport type { NextConfig } from 'next'\n\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport type { PluginConfig } from '../types.js'\nimport { collect, refreshFile, seedTypes, writeTypesForFile } from '../build.js'\nimport { GENERATED_DIR } from '../config.js'\nimport { Logger } from '../logger.js'\n\nconst typeLogger = new Logger('cxx')\n\nconst nextDir = path.dirname(fileURLToPath(import.meta.url))\nconst loader = path.join(nextDir, 'cxx-loader.cjs')\n\n// keep the exact file inputs and their config so a single recursive watcher can filter events\nconst watchedFiles = new Map<string, { pluginConfig: PluginConfig; logger: Logger }>()\n\nlet subscription: AsyncSubscription | null = null\nlet subscriptionPromise: Promise<void> | null = null\nlet cleanupRegistered = false\nlet watcherLogger: Logger | null = null\n\n// a single recursive watch avoids overlapping per-directory watchers; ignore the parts of the\n// tree that never contain source we transform\nconst DEFAULT_IGNORE = [\n\t'**/node_modules/**',\n\t'**/.next/**',\n\t`**/${GENERATED_DIR}/**`,\n\t'**/.git/**',\n]\n\nasync function onEvent(event: Event['type'], filePath: string) {\n\tconst watched = watchedFiles.get(filePath)\n\tif (!watched) return\n\n\tconst { pluginConfig, logger } = watched\n\n\tif (event === 'delete') {\n\t\tawait writeTypesForFile(filePath, new Map())\n\t} else {\n\t\tawait refreshFile(filePath, pluginConfig)\n\t}\n\n\tlogger.info(`updated types from ${filePath}`)\n}\n\n/**\n * Start the watcher lazily, on the first file we actually process, so merely importing this module\n * has no side effects.\n */\nfunction ensureWatcher(pluginConfig: PluginConfig, logger: Logger) {\n\twatcherLogger = logger\n\n\tif (subscriptionPromise) return\n\n\tconst root = pluginConfig.watch?.root ?? process.cwd()\n\n\tsubscriptionPromise = (async () => {\n\t\t// lazily imported so the native module is only loaded when watching is needed\n\t\tconst { subscribe } = await import('@parcel/watcher')\n\n\t\tsubscription = await subscribe(\n\t\t\troot,\n\t\t\t(watchErr, events) => {\n\t\t\t\tif (watchErr) {\n\t\t\t\t\twatcherLogger?.error(`failed to watch ${root}`, watchErr)\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const event of events) {\n\t\t\t\t\tconst filePath = path.resolve(event.path)\n\t\t\t\t\tif (!watchedFiles.has(filePath)) continue\n\n\t\t\t\t\tvoid onEvent(event.type, filePath).catch(err => {\n\t\t\t\t\t\twatcherLogger?.error(`failed to update types from ${filePath}`, err)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ ignore: DEFAULT_IGNORE },\n\t\t)\n\n\t\tregisterCleanup()\n\t})().catch(err => {\n\t\twatcherLogger?.error('failed to start cxx watcher', err)\n\t\tsubscriptionPromise = null\n\t})\n}\n\n/**\n * Close all active Parcel subscriptions.\n */\nasync function cleanup() {\n\tconst active = subscription\n\n\tsubscription = null\n\tsubscriptionPromise = null\n\twatchedFiles.clear()\n\n\tif (active) await active.unsubscribe()\n}\n\n/**\n * Restore the host process's default signal behaviour instead of forcing an exit from a library.\n */\nasync function shutdown(signal: NodeJS.Signals) {\n\ttry {\n\t\tawait cleanup()\n\t} finally {\n\t\t// our `once` handlers have already been removed, so re-raising lets Node terminate as usual\n\t\tprocess.kill(process.pid, signal)\n\t}\n}\n\nfunction registerCleanup() {\n\tif (cleanupRegistered) return\n\n\tcleanupRegistered = true\n\tprocess.once('SIGINT', () => void shutdown('SIGINT'))\n\tprocess.once('SIGTERM', () => void shutdown('SIGTERM'))\n}\n\n/**\n * Transform one module and, in development, register it with the shared watcher state.\n */\nexport function processFile(\n\tsource: string,\n\tfilePath: string,\n\tpluginConfig: PluginConfig,\n\tlogger: Logger,\n) {\n\tconst resolvedFilePath = path.resolve(filePath)\n\n\t// skip files that cannot contain a template, including node_modules\n\tif (!source.includes('cxx') || /[\\\\/]node_modules[\\\\/]/.test(resolvedFilePath)) {\n\t\treturn { template: source, tags: new Map(), map: null }\n\t}\n\n\tif (process.env['NODE_ENV'] !== 'production') {\n\t\twatchedFiles.set(resolvedFilePath, { pluginConfig, logger })\n\t\tensureWatcher(pluginConfig, logger)\n\t}\n\n\tconst result = collect(source, resolvedFilePath, pluginConfig)\n\n\tvoid writeTypesForFile(resolvedFilePath, result.tags)\n\n\treturn result\n}\n\nconst TURBOPACK_GLOB = '*.{tsx,jsx,ts,js}'\n\nexport function withCxx(nextConfig: NextConfig = {}, pluginConfig: PluginConfig = {}) {\n\tconst watchRoot =\n\t\tpluginConfig.watch?.root ?? nextConfig.turbopack?.root ?? process.cwd()\n\n\t// Seed on dev startup only, matching Vite. A production build is covered by the loader, and\n\t// `next start` must not scan or write at runtime.\n\tif (process.env['NODE_ENV'] !== 'production') {\n\t\t// the app directory, not the whole Turbopack root, so sibling apps in a monorepo do not\n\t\t// leak into this app's types\n\t\tconst seedRoot = pluginConfig.watch?.root ?? process.cwd()\n\n\t\tvoid seedTypes(seedRoot, pluginConfig).catch(err =>\n\t\t\ttypeLogger.error('failed to seed cxx types', err),\n\t\t)\n\t}\n\n\tconst loaderItem = {\n\t\tloader,\n\t\toptions: {\n\t\t\tpluginConfig: {\n\t\t\t\t...pluginConfig,\n\t\t\t\twatch: { ...pluginConfig.watch, root: watchRoot },\n\t\t\t},\n\t\t},\n\t}\n\n\tconst currentRule = nextConfig.turbopack?.rules?.[TURBOPACK_GLOB]\n\tconst userWebpack = nextConfig.webpack\n\n\treturn {\n\t\t...nextConfig,\n\t\tturbopack: {\n\t\t\t...nextConfig.turbopack,\n\t\t\trules: {\n\t\t\t\t...nextConfig.turbopack?.rules,\n\t\t\t\t[TURBOPACK_GLOB]: Array.isArray(currentRule)\n\t\t\t\t\t? [...currentRule, loaderItem]\n\t\t\t\t\t: currentRule\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t...currentRule,\n\t\t\t\t\t\t\t\tloaders: [...(currentRule.loaders ?? []), loaderItem],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: { loaders: [loaderItem] },\n\t\t\t},\n\t\t},\n\t\t// webpack builds (Next without `--turbopack`) would otherwise silently skip the transform\n\t\twebpack(config: unknown, context: unknown) {\n\t\t\tconst next = (\n\t\t\t\tuserWebpack ? userWebpack(config as never, context as never) : config\n\t\t\t) as {\n\t\t\t\tmodule?: { rules?: unknown[] }\n\t\t\t}\n\n\t\t\tnext.module ??= {}\n\t\t\tnext.module.rules ??= []\n\t\t\tnext.module.rules.push({\n\t\t\t\ttest: /\\.[jt]sx?$/,\n\t\t\t\texclude: /node_modules/,\n\t\t\t\tenforce: 'pre',\n\t\t\t\tuse: [loaderItem],\n\t\t\t})\n\n\t\t\treturn next\n\t\t},\n\t}\n}\n",
7
+ "import type { Dirent } from 'node:fs'\n\nimport { createHash } from 'node:crypto'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { transform } from 'lightningcss'\nimport MagicString, { type SourceMap } from 'magic-string'\n\nimport type { PluginConfig, Tags } from './types.js'\nimport { AUTOGEN_MSG, GENERATED_DIR, NAME, PKG_NAME } from './config.js'\nimport { Logger } from './logger.js'\nimport { LruCache } from './lru.js'\nimport { pascalise } from './utils.js'\n\nconst logger = new Logger(NAME)\n\nconst decoder = new TextDecoder()\nconst encoder = new TextEncoder()\n\n/**\n * LRU cache of `collect` results by file id + last seen source + config so watcher and transform\n * can reuse the same parsed template/tags.\n */\nconst collectCache = new LruCache<{\n\tsource: string\n\tconfig: string\n\ttemplate: string\n\ttags: Tags\n\tmap: SourceMap | null\n}>()\n\n/**\n * Serialises type file writes inside a single process so overlapping writes can't interleave or\n * land out of order.\n */\nlet writeChain: Promise<void> = Promise.resolve()\n\n/**\n * Returns whether the error was caused by a missing file or directory.\n */\nexport function isENOENT(err: unknown) {\n\treturn err instanceof Error && 'code' in err && err.code === 'ENOENT'\n}\n\n/**\n * Write a file by writing to a unique temporary file and renaming it into place, so concurrent\n * writers never observe a partial file. The temp file is cleaned up if the rename fails.\n */\nasync function writeFileAtomic(filePath: string, content: string) {\n\tconst tmp = `${filePath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`\n\n\tawait fs.writeFile(tmp, content)\n\n\ttry {\n\t\tawait fs.rename(tmp, filePath)\n\t} catch (err) {\n\t\tawait fs.rm(tmp, { force: true })\n\t\tthrow err\n\t}\n}\n\n/**\n * Run a write task after all previously queued writes have settled. A rejection doesn't break the\n * chain for later tasks.\n */\nfunction enqueueWrite<T>(task: () => Promise<T>) {\n\t// wait for the previous write to finish, then run this one, even if the previous one failed\n\tconst run = writeChain.then(task, task)\n\n\t// move the queue on to this write, but turn either outcome into success so it never rejects\n\twriteChain = run.then(\n\t\t() => undefined,\n\t\t() => undefined,\n\t)\n\n\t// return the real promise, so the caller still sees this write's value or error\n\treturn run\n}\n\n/**\n * Write a file only if the content differs from what is already on disk, so watchers are not woken\n * by a needless mtime change.\n */\nexport async function maybeWrite(filePath: string, content: string) {\n\ttry {\n\t\tif ((await fs.readFile(filePath, 'utf-8')) === content) return false\n\t} catch (err) {\n\t\tif (!isENOENT(err)) throw err\n\t}\n\n\tawait writeFileAtomic(filePath, content)\n\n\treturn true\n}\n\n// matches `[css, classes, href] = cxx\\`...\\`` and `cxx.tag<T>('name')\\`...\\``\n// capture groups: 1 optional `export `, 2-4 assigned variable names, 5 plain\n// css body, 6 quote kind, 7 tag name, 8 tagged css body\nconst regex =\n\t/((?:export\\s+)?)(?:const|var|let)\\s*\\[(\\w*)\\s*,?\\s*(\\w*)\\s*,?\\s*(\\w*)\\s*\\]\\s*=\\s*cxx(?:\\s*`([\\s\\S]*?)`|\\s*\\.\\s*tag(?:\\s*<[^>]+>)?\\s*\\(\\s*(['\"])(.*?)\\6\\s*\\)\\s*`([\\s\\S]*?)`)/gm\n\nconst IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/\n\n/**\n * Hash transformed CSS into a stable href for style deduplication.\n */\nfunction hashCss(code: Uint8Array) {\n\treturn `cxx-${createHash('sha256').update(code).digest('base64url').slice(0, 12)}`\n}\n\nexport class DuplicateTagError extends Error {\n\tname = 'DuplicateTagError'\n\n\tconstructor(tag: string) {\n\t\tsuper(`Tag ${tag} has already been seen. Tags must be unique across your application`)\n\t}\n}\n\nexport class InvalidTagError extends Error {\n\tname = 'InvalidTagError'\n\n\tconstructor(tag: string) {\n\t\tsuper(\n\t\t\t`Tag \"${tag}\" does not map to a valid TypeScript identifier. ` +\n\t\t\t\t`Use letters, numbers, spaces, \"_\" or \"-\"`,\n\t\t)\n\t}\n}\n\n/**\n * Transform `cxx` templates in one source file and collect any exported tag types.\n */\nexport function collect(source: string, id: string, config: PluginConfig) {\n\tconst configKey = JSON.stringify(config)\n\n\t// reuse the last result when the source and config are unchanged\n\tconst cached = collectCache.get(id)\n\tif (cached?.source === source && cached.config === configKey) return cached\n\n\tconst tags: Tags = new Map()\n\tconst magic = new MagicString(source)\n\n\tlet matched = false\n\n\t// the regex is global, so reset its cursor before scanning\n\tregex.lastIndex = 0\n\n\tlet match: RegExpExecArray | null\n\n\t// walk every cxx template and replace it in place\n\twhile ((match = regex.exec(source))) {\n\t\tmatched = true\n\n\t\t// capture groups: export, three bindings, plain css, (quote), tag, tagged css\n\t\tconst [, exp, varOne, varTwo, varThree, plainCss, , tag, taggedCss] = match\n\t\tconst css = plainCss ?? taggedCss\n\t\tconst matchIndex = match.index\n\n\t\t// compile the CSS to minified CSS Modules, reporting the source line on failure\n\t\tconst { code, exports: classExports = {} } = (() => {\n\t\t\ttry {\n\t\t\t\treturn transform({\n\t\t\t\t\tminify: true,\n\t\t\t\t\tcssModules: true,\n\t\t\t\t\tfilename: id,\n\t\t\t\t\tcode: encoder.encode(css),\n\t\t\t\t})\n\t\t\t} catch (err) {\n\t\t\t\tconst line = source.slice(0, matchIndex).split('\\n').length\n\t\t\t\tthrow new Error(`Failed to compile cxx CSS at ${id}:${line}`, { cause: err })\n\t\t\t}\n\t\t})()\n\n\t\tconst href = hashCss(code)\n\t\t// map each class name to its generated (scoped) name\n\t\tconst styles = Object.fromEntries(\n\t\t\tObject.entries(classExports).map(([k, v]) => [k, v.name]),\n\t\t)\n\n\t\tif (tag) {\n\t\t\tconst suffix =\n\t\t\t\ttypeof config.typeSuffix === 'string'\n\t\t\t\t\t? config.typeSuffix\n\t\t\t\t\t: config.typeSuffix === false\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: 'Classes'\n\t\t\tconst tagWithSuffix = pascalise(`${tag}${suffix}`)\n\n\t\t\tif (!IDENTIFIER.test(tagWithSuffix)) throw new InvalidTagError(tag)\n\t\t\tif (tags.has(tagWithSuffix)) throw new DuplicateTagError(tagWithSuffix)\n\n\t\t\t// side effect but necessary\n\t\t\ttags.set(tagWithSuffix, Object.keys(styles))\n\t\t}\n\n\t\tconst statements: string[] = []\n\n\t\tif (varOne) {\n\t\t\tstatements.push(`${exp}const ${varOne} = ${JSON.stringify(decoder.decode(code))}`)\n\t\t}\n\n\t\tif (varTwo) {\n\t\t\tstatements.push(`${exp}const ${varTwo} = ${JSON.stringify(styles)}`)\n\t\t}\n\n\t\tif (varThree) {\n\t\t\tstatements.push(`${exp}const ${varThree} = ${JSON.stringify(href)}`)\n\t\t}\n\n\t\t// swap the template for the generated declarations, keeping the export keyword\n\t\tmagic.overwrite(matchIndex, matchIndex + match[0].length, statements.join('\\n'))\n\t}\n\n\tconst template = magic.toString()\n\t// only build a map when something was actually rewritten\n\tconst map = matched\n\t\t? magic.generateMap({ source: id, includeContent: true, hires: true })\n\t\t: null\n\tconst result = { source, config: configKey, template, tags, map }\n\n\tcollectCache.set(id, result)\n\n\treturn result\n}\n\n/**\n * Render the generated declaration file contents for a set of collected tags.\n */\nfunction renderTypes(tags: Tags) {\n\treturn [\n\t\tAUTOGEN_MSG,\n\t\t'',\n\t\t`import '${PKG_NAME}'`,\n\t\t'',\n\t\t`declare module '${PKG_NAME}' {`,\n\t\ttagsToType(tags),\n\t\t'}',\n\t\t'',\n\t].join('\\n')\n}\n\n/**\n * Write (or remove) the generated `index.d.ts` for a full tag surface.\n */\nasync function writeRenderedTypes(tags: Tags) {\n\tconst filePath = path.join(GENERATED_DIR, 'index.d.ts')\n\n\tif (!tags.size) {\n\t\tawait fs.rm(filePath, { force: true })\n\t\treturn\n\t}\n\n\tawait fs.mkdir(GENERATED_DIR, { recursive: true })\n\tawait maybeWrite(filePath, renderTypes(tags))\n}\n\nconst PARTIAL_DIR = path.join(GENERATED_DIR, 'tags')\n\n// wait this long after the last file before rebuilding, so a burst of files\n// only re-reads the partials once\nconst REBUILD_WAIT = 100\n\nlet rebuildTimer: ReturnType<typeof setTimeout> | null = null\n\n/**\n * Map a source file to its partial file, named by a hash of the absolute path so each file has\n * exactly one partial.\n */\nfunction partialPath(filePath: string) {\n\treturn path.join(\n\t\tPARTIAL_DIR,\n\t\t`${createHash('sha1').update(filePath).digest('hex')}.json`,\n\t)\n}\n\ntype DuplicateTag = {\n\ttag: string\n\tfiles: string[]\n}\n\n/**\n * Read every per-file partial and merge them into one tag map. Partials whose source file no\n * longer exists are pruned, and duplicate tag names are reported with the files that define them.\n */\nasync function readPartials(): Promise<{ tags: Tags; duplicates: DuplicateTag[] }> {\n\tlet entries: string[]\n\n\ttry {\n\t\tentries = await fs.readdir(PARTIAL_DIR)\n\t} catch (err) {\n\t\tif (isENOENT(err)) return { tags: new Map(), duplicates: [] }\n\t\tthrow err\n\t}\n\n\tconst tags: Tags = new Map()\n\tconst fileByTag = new Map<string, string>()\n\tconst duplicates: DuplicateTag[] = []\n\n\tfor (const entry of entries) {\n\t\tif (!entry.endsWith('.json')) continue\n\n\t\tconst partial = path.join(PARTIAL_DIR, entry)\n\t\tlet parsed: { file: string; tags: Record<string, string[]> }\n\n\t\ttry {\n\t\t\tparsed = JSON.parse(await fs.readFile(partial, 'utf-8'))\n\t\t} catch {\n\t\t\tcontinue\n\t\t}\n\n\t\tlet source: string\n\n\t\ttry {\n\t\t\tsource = await fs.readFile(parsed.file, 'utf-8')\n\t\t} catch {\n\t\t\tawait fs.rm(partial, { force: true })\n\t\t\tcontinue\n\t\t}\n\n\t\t// drop partials for files that no longer use cxx, so their tags do not linger\n\t\tif (!source.includes('cxx')) {\n\t\t\tawait fs.rm(partial, { force: true })\n\t\t\tcontinue\n\t\t}\n\n\t\tfor (const [name, classes] of Object.entries(parsed.tags)) {\n\t\t\tconst existing = fileByTag.get(name)\n\n\t\t\tif (existing) {\n\t\t\t\tduplicates.push({ tag: name, files: [existing, parsed.file] })\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfileByTag.set(name, parsed.file)\n\t\t\ttags.set(name, classes)\n\t\t}\n\t}\n\n\treturn { tags, duplicates }\n}\n\n/**\n * Persist one file's tags to its own partial, then rebuild the shared types soon. Rebuilding is\n * debounced and serialised, so a large build does not re-read every partial per file.\n */\nexport function writeTypesForFile(filePath: string, tags: Tags) {\n\treturn enqueueWrite(async () => {\n\t\tawait fs.mkdir(PARTIAL_DIR, { recursive: true })\n\n\t\tconst partial = partialPath(filePath)\n\n\t\tif (!tags.size) {\n\t\t\tawait fs.rm(partial, { force: true })\n\t\t} else {\n\t\t\tawait writeFileAtomic(\n\t\t\t\tpartial,\n\t\t\t\tJSON.stringify({ file: filePath, tags: Object.fromEntries(tags) }),\n\t\t\t)\n\t\t}\n\t})\n\t\t.then(() => scheduleRebuild())\n\t\t.catch(err => {\n\t\t\tlogger.error(`failed to write types for ${filePath}`, err)\n\t\t})\n}\n\n/**\n * Queue a rebuild of `index.d.ts` after a short delay, so a burst of writes only rebuilds once.\n */\nfunction scheduleRebuild() {\n\tif (rebuildTimer) clearTimeout(rebuildTimer)\n\n\trebuildTimer = setTimeout(() => {\n\t\trebuildTimer = null\n\t\tflushTypes().catch(err => {\n\t\t\tlogger.error('failed to generate types', err)\n\t\t})\n\t}, REBUILD_WAIT)\n}\n\n/**\n * Rebuild `index.d.ts` from every partial.\n */\nexport function flushTypes() {\n\tif (rebuildTimer) {\n\t\tclearTimeout(rebuildTimer)\n\t\trebuildTimer = null\n\t}\n\n\treturn enqueueWrite(async () => {\n\t\tconst { tags, duplicates } = await readPartials()\n\t\tawait writeRenderedTypes(tags)\n\n\t\tfor (const duplicate of duplicates) {\n\t\t\tlogger.error(\n\t\t\t\t`Tag \"${duplicate.tag}\" is defined in multiple files: ${duplicate.files.join(', ')}`,\n\t\t\t)\n\t\t}\n\t})\n}\n\nexport const SOURCE_EXTENSIONS = new Set(['.js', '.jsx', '.ts', '.tsx'])\n\n// directories that never contain source we transform\nconst SKIP_DIRS = new Set(['node_modules', 'dist', 'build', 'coverage', 'out'])\n\n/**\n * Run `fn` for every item, with at most `concurrency` calls in flight.\n */\nasync function runWithConcurrency<T>(\n\titems: T[],\n\tconcurrency: number,\n\tfn: (item: T) => Promise<void>,\n) {\n\tlet cursor = 0\n\n\tconst workers = Array.from(\n\t\t{ length: Math.min(concurrency, items.length) },\n\t\tasync () => {\n\t\t\twhile (cursor < items.length) {\n\t\t\t\tconst index = cursor++\n\t\t\t\tawait fn(items[index])\n\t\t\t}\n\t\t},\n\t)\n\n\tawait Promise.all(workers)\n}\n\n/**\n * Read one file, collect its tags, and persist them. A file with no `cxx` usage has its partial\n * removed, so stale tags drop out.\n */\nexport async function refreshFile(file: string, config: PluginConfig) {\n\tlet source: string\n\n\ttry {\n\t\tsource = await fs.readFile(file, 'utf-8')\n\t} catch (err) {\n\t\tif (!isENOENT(err)) throw err\n\t\tawait writeTypesForFile(file, new Map())\n\t\treturn\n\t}\n\n\tconst tags = source.includes('cxx') ? collect(source, file, config).tags : new Map()\n\tawait writeTypesForFile(file, tags)\n}\n\n/**\n * Walk every source file under `root` and seed the type surface, so a fresh checkout (and a build\n * with no edits) has types without waiting for a transform.\n */\nexport async function seedTypes(root: string, config: PluginConfig) {\n\tasync function scan(dir: string) {\n\t\tlet entries: Dirent[]\n\n\t\ttry {\n\t\t\tentries = await fs.readdir(dir, { withFileTypes: true })\n\t\t} catch {\n\t\t\treturn\n\t\t}\n\n\t\tawait runWithConcurrency(entries, 8, async entry => {\n\t\t\tif (entry.name.startsWith('.') || SKIP_DIRS.has(entry.name)) return\n\n\t\t\tconst full = path.join(dir, entry.name)\n\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tawait scan(full)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!SOURCE_EXTENSIONS.has(path.extname(entry.name))) return\n\n\t\t\tawait refreshFile(full, config)\n\t\t})\n\t}\n\n\tawait scan(root)\n\tawait flushTypes()\n}\n\n/**\n * Render collected tags as a module augmentation for the package entrypoint.\n */\nexport function tagsToType(tags: Tags) {\n\treturn [...tags]\n\t\t.toSorted(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n\t\t.map(([tag, classes]) => {\n\t\t\tconst union =\n\t\t\t\tclasses.length > 0\n\t\t\t\t\t? classes\n\t\t\t\t\t\t\t.toSorted((a, b) => a.length - b.length)\n\t\t\t\t\t\t\t.map(c => `'${c}'`)\n\t\t\t\t\t\t\t.join(' | ')\n\t\t\t\t\t: 'never'\n\n\t\t\treturn `\\texport type ${tag} = ${union}`\n\t\t})\n\t\t.join('\\n')\n}\n",
8
8
  "export const NAME = 'cxx'\nexport const PKG_NAME = `@jk2908/${NAME}`\nexport const GENERATED_DIR = `.${NAME}`\nexport const AUTOGEN_MSG = `// auto-generated by ${NAME}`\n",
9
9
  "export const CACHE_MAX_SIZE = 100\n\nexport class LruCache<T> {\n\t#cache: Map<string, T> = new Map()\n\t#maxSize: number\n\n\tconstructor(maxSize = CACHE_MAX_SIZE) {\n\t\tthis.#maxSize = maxSize\n\t}\n\n\tget size() {\n\t\treturn this.#cache.size\n\t}\n\n\t/**\n\t * Retrieve a cached value and promote it to most-recently-used so it won't\n\t * be evicted while still actively referenced.\n\t */\n\tget(key: string) {\n\t\tconst cached = this.#cache.get(key)\n\t\tif (this.#cache.has(key)) this.set(key, cached as T)\n\n\t\treturn cached\n\t}\n\n\t/**\n\t * Promote an existing cache entry to most-recently-used by deleting and\n\t * re-inserting it, which moves it to the end of the Map's iteration\n\t * order. If the cache is at capacity, evict the least recently used\n\t * entry (front) before inserting.\n\t */\n\tset(key: string, value: T) {\n\t\t// drop any existing entry\n\t\tthis.#cache.delete(key)\n\n\t\tif (this.#cache.size >= this.#maxSize) {\n\t\t\tconst lru = this.#cache.keys().next().value\n\t\t\tif (lru !== undefined) this.#cache.delete(lru)\n\t\t}\n\n\t\tthis.#cache.set(key, value)\n\t}\n\n\tdelete(key: string) {\n\t\treturn this.#cache.delete(key)\n\t}\n\n\tclear() {\n\t\treturn this.#cache.clear()\n\t}\n}\n",
10
- "export function capitalise(str: string) {\n\treturn str.charAt(0).toUpperCase() + str.slice(1)\n}\n\nexport function pascalise(str: string) {\n\treturn str\n\t\t.split(/[ _-]+/)\n\t\t.map(capitalise)\n\t\t.join('')\n}\n\nexport type Batcher<K, V> = {\n\t/**\n\t * Queue a value for a key. Queueing the same key again replaces the previous value.\n\t */\n\tadd: (key: K, value: V) => void\n\t/**\n\t * Run any waiting work now and resolve once it has finished.\n\t */\n\tflush: () => Promise<void>\n}\n\n/**\n * Group bursts of work and run them together. Every key queued within `wait` is\n * included once, and a key queued while a batch is running is handled in the next\n * batch instead of replacing the one in progress.\n */\nexport function createBatcher<K, V>(\n\twait: number,\n\tflush: (batch: Map<K, V>) => void | Promise<void>,\n): Batcher<K, V> {\n\t// work waiting to run, keyed so each key is only queued once\n\tconst pending = new Map<K, V>()\n\t// waits for a burst of changes to settle before running\n\tlet timer: ReturnType<typeof setTimeout> | null = null\n\t// the run in progress, so `flush` can wait for it and we never start a second\n\tlet current: Promise<void> | null = null\n\n\tfunction drain() {\n\t\t// a run is already going, so let it pick up the new work\n\t\tif (current) return current\n\n\t\tconst run = (async () => {\n\t\t\t// keep looping while there is work, including work added during a flush\n\t\t\twhile (pending.size > 0) {\n\t\t\t\t// snapshot the queued work\n\t\t\t\tconst batch = new Map(pending)\n\t\t\t\t// empty the queue right away, so anything added during flush waits for the next loop\n\t\t\t\tpending.clear()\n\n\t\t\t\tawait flush(batch)\n\t\t\t}\n\t\t})()\n\n\t\tcurrent = run\n\t\trun.then(\n\t\t\t() => {\n\t\t\t\tif (current === run) current = null\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (current === run) current = null\n\t\t\t},\n\t\t)\n\n\t\treturn run\n\t}\n\n\tfunction schedule() {\n\t\t// cancel the previous wait, so the timer restarts from now\n\t\tif (timer) clearTimeout(timer)\n\n\t\t// run once the calls stop coming for `wait` ms\n\t\ttimer = setTimeout(() => {\n\t\t\t// the timer has fired, so drop the stale handle\n\t\t\ttimer = null\n\t\t\t// the flush callback handles its own errors, so just start the run\n\t\t\tvoid drain().catch(() => {})\n\t\t}, wait)\n\t}\n\n\treturn {\n\t\tadd(key, value) {\n\t\t\t// the newest value for this key wins\n\t\t\tpending.set(key, value)\n\t\t\tschedule()\n\t\t},\n\t\tflush() {\n\t\t\t// run now instead of waiting out the timer\n\t\t\tif (timer) {\n\t\t\t\tclearTimeout(timer)\n\t\t\t\ttimer = null\n\t\t\t}\n\n\t\t\treturn drain()\n\t\t},\n\t}\n}\n",
10
+ "export function capitalise(str: string) {\n\treturn str.charAt(0).toUpperCase() + str.slice(1)\n}\n\nexport function pascalise(str: string) {\n\treturn str\n\t\t.split(/[ _-]+/)\n\t\t.map(capitalise)\n\t\t.join('')\n}\n",
11
11
  "import { Logger } from '../logger.js'\nimport { processFile } from './index.js'\n\nconst loader = function (source) {\n\tconst { pluginConfig } = this.getOptions()\n\tconst logger = new Logger()\n\n\tconst { template, map } = processFile(source, this.resourcePath, pluginConfig, logger)\n\n\t// hand the transform's source map back to webpack/turbopack when they support it\n\tif (map && typeof this.callback === 'function') {\n\t\tthis.callback(null, template, map)\n\n\t\treturn\n\t}\n\n\treturn template\n}\n\nexport default loader\n"
12
12
  ],
13
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,SAAS;AAAA,EACd,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AACR;AAIA,IAAM,eAAyB,QAAQ,IAAI,gBAAgB,eAAe,UAAU;AAAA;AAkB7E,MAAM,OAAO;AAAA,EAKX;AAAA,EAJR;AAAA,EAEA,WAAW,CACV,OACO,MACN;AAAA,IADM;AAAA,IAEP,KAAK,SAAS,SAAS;AAAA;AAAA,SAMjB,OAAO,CAAC,KAAc;AAAA,IAC5B,OAAO,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,GAAG,GAAG,EAAE,OAAO,IAAI,CAAC;AAAA;AAAA,SAMnE,KAAK,CAAC,KAAc;AAAA,IAC1B,IAAI,eAAe,OAAO;AAAA,MACzB,OAAO,IAAI,WAAW,IAAI,QAAQ;AAAA,EAAK,IAAI,UAAU;AAAA,IACtD;AAAA,IAIA,IAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM;AAAA,MAC5C,IAAI;AAAA,QACH,OAAO,KAAK,UAAU,KAAK,MAAM,CAAC;AAAA,QACjC,MAAM;AAAA,QAGP,OAAO,OAAO,GAAG;AAAA;AAAA,IAEnB;AAAA,IAEA,OAAO,OAAO,GAAG;AAAA;AAAA,MAGd,KAAK,CAAC,OAAiB;AAAA,IAC1B,KAAK,SAAS;AAAA;AAAA,MAGX,KAAK,GAAG;AAAA,IACX,OAAO,KAAK;AAAA;AAAA,EAMb,GAAG,CAAC,OAAiB,SAAiB,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-1,6 +1,6 @@
1
1
  import type { NextConfig } from 'next';
2
- import type { Logger } from '../logger.js';
3
2
  import type { PluginConfig } from '../types.js';
3
+ import { Logger } from '../logger.js';
4
4
  /**
5
5
  * Transform one module and, in development, register it with the shared watcher state.
6
6
  */
@@ -24,7 +24,6 @@ export declare function withCxx(nextConfig?: NextConfig, pluginConfig?: PluginCo
24
24
  pluginConfig: {
25
25
  watch: {
26
26
  root: string;
27
- ignore?: string[];
28
27
  };
29
28
  typeSuffix?: string | false;
30
29
  };
@@ -36,7 +35,6 @@ export declare function withCxx(nextConfig?: NextConfig, pluginConfig?: PluginCo
36
35
  pluginConfig: {
37
36
  watch: {
38
37
  root: string;
39
- ignore?: string[];
40
38
  };
41
39
  typeSuffix?: string | false;
42
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAMtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAuI/C;;GAEG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM;;;;;;;;;;EAuBd;AAID,wBAAgB,OAAO,CAAC,UAAU,GAAE,UAAe,EAAE,YAAY,GAAE,YAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsDw0D,CAAC;uBAAsC,CAAC;;;;oBApBl7D,OAAO,WAAW,OAAO;iBAI9B;YAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;SAAE;;;;;;;;;;;;;;;mBAgBs/4C,CAAC;kBAA+B,CAAC;gBAA6B,CAAC;;mBAAuD,CAAC;kBAA+B,CAAC;gBAA6B,CAAC;;;;;;;;;;;;eAA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