@jk2908/cxx 0.2.6 → 0.3.1
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/README.md +18 -2
- package/dist/build.d.ts +13 -4
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +180 -54
- package/dist/build.js.map +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +3 -3
- package/dist/logger.d.ts +0 -2
- package/dist/logger.d.ts.map +1 -1
- package/dist/next/cxx-loader.cjs +214 -132
- package/dist/next/cxx-loader.cjs.map +7 -7
- package/dist/next/index.d.ts +32 -11
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/index.js +272 -123
- package/dist/next/index.js.map +5 -5
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +16 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/vite/index.d.ts +11 -3
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +273 -115
- package/dist/vite/index.js.map +6 -6
- package/package.json +83 -79
- package/src/build.ts +258 -93
- package/src/index.ts +26 -9
- package/src/logger.ts +5 -13
- package/src/next/cxx-loader.js +1 -5
- package/src/next/index.ts +143 -100
- package/src/types.ts +5 -4
- package/src/utils.ts +72 -7
- package/src/vite/index.ts +109 -78
package/dist/next/cxx-loader.cjs
CHANGED
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -75,20 +77,14 @@ var LEVELS = {
|
|
|
75
77
|
error: 3,
|
|
76
78
|
fatal: 4
|
|
77
79
|
};
|
|
80
|
+
var defaultLevel = process.env["NODE_ENV"] === "production" ? "error" : "info";
|
|
78
81
|
|
|
79
82
|
class Logger {
|
|
80
83
|
name;
|
|
81
|
-
static #defaultLevel = "info";
|
|
82
84
|
#level;
|
|
83
85
|
constructor(level, name) {
|
|
84
86
|
this.name = name;
|
|
85
|
-
this.#level = level;
|
|
86
|
-
}
|
|
87
|
-
static set defaultLevel(level) {
|
|
88
|
-
Logger.#defaultLevel = level;
|
|
89
|
-
}
|
|
90
|
-
static get defaultLevel() {
|
|
91
|
-
return Logger.#defaultLevel;
|
|
87
|
+
this.#level = level ?? defaultLevel;
|
|
92
88
|
}
|
|
93
89
|
static toError(err) {
|
|
94
90
|
return err instanceof Error ? err : new Error(String(err), { cause: err });
|
|
@@ -111,7 +107,7 @@ ${err.stack}` : "");
|
|
|
111
107
|
this.#level = level;
|
|
112
108
|
}
|
|
113
109
|
get level() {
|
|
114
|
-
return this.#level
|
|
110
|
+
return this.#level;
|
|
115
111
|
}
|
|
116
112
|
log(level, message, error) {
|
|
117
113
|
if (LEVELS[level] < LEVELS[this.level])
|
|
@@ -158,13 +154,13 @@ ${Logger.print(entry.error)}` : "";
|
|
|
158
154
|
var import_promises2 = __toESM(require("node:fs/promises"));
|
|
159
155
|
var import_node_path2 = __toESM(require("node:path"));
|
|
160
156
|
var import_node_url = require("node:url");
|
|
161
|
-
var import_watcher = __toESM(require("@parcel/watcher"));
|
|
162
157
|
|
|
163
158
|
// src/build.ts
|
|
164
159
|
var import_node_crypto = require("node:crypto");
|
|
165
160
|
var import_promises = __toESM(require("node:fs/promises"));
|
|
166
161
|
var import_node_path = __toESM(require("node:path"));
|
|
167
162
|
var import_lightningcss = require("lightningcss");
|
|
163
|
+
var import_magic_string = __toESM(require("magic-string"));
|
|
168
164
|
|
|
169
165
|
// src/config.ts
|
|
170
166
|
var NAME = "cxx";
|
|
@@ -216,18 +212,31 @@ function pascalise(str) {
|
|
|
216
212
|
}
|
|
217
213
|
|
|
218
214
|
// src/build.ts
|
|
215
|
+
var decoder = new TextDecoder;
|
|
219
216
|
var collectCache = new LruCache;
|
|
220
217
|
var fileCache = new LruCache;
|
|
218
|
+
var writeChain = Promise.resolve();
|
|
221
219
|
function isENOENT(err) {
|
|
222
220
|
return err instanceof Error && "code" in err && err.code === "ENOENT";
|
|
223
221
|
}
|
|
222
|
+
async function writeFileAtomic(filePath, content) {
|
|
223
|
+
const tmp = `${filePath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
224
|
+
await import_promises.default.writeFile(tmp, content);
|
|
225
|
+
await import_promises.default.rename(tmp, filePath);
|
|
226
|
+
}
|
|
227
|
+
function enqueueWrite(task) {
|
|
228
|
+
const run = writeChain.then(task, task);
|
|
229
|
+
writeChain = run.then(() => {
|
|
230
|
+
return;
|
|
231
|
+
}, () => {
|
|
232
|
+
return;
|
|
233
|
+
});
|
|
234
|
+
return run;
|
|
235
|
+
}
|
|
224
236
|
async function maybeWrite(filePath, content) {
|
|
225
237
|
const cached = fileCache.get(filePath);
|
|
226
|
-
if (cached
|
|
227
|
-
|
|
228
|
-
fileCache.set(filePath, content);
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
238
|
+
if (cached === content)
|
|
239
|
+
return false;
|
|
231
240
|
try {
|
|
232
241
|
if (await import_promises.default.readFile(filePath, "utf-8") === content) {
|
|
233
242
|
fileCache.set(filePath, content);
|
|
@@ -237,11 +246,12 @@ async function maybeWrite(filePath, content) {
|
|
|
237
246
|
if (!isENOENT(err))
|
|
238
247
|
throw err;
|
|
239
248
|
}
|
|
240
|
-
await
|
|
249
|
+
await writeFileAtomic(filePath, content);
|
|
241
250
|
fileCache.set(filePath, content);
|
|
242
251
|
return true;
|
|
243
252
|
}
|
|
244
|
-
var regex = /(?:const|var|let)\s*\[(\w
|
|
253
|
+
var regex = /((?: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;
|
|
254
|
+
var IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
245
255
|
function hashCss(code) {
|
|
246
256
|
return `cxx-${import_node_crypto.createHash("sha256").update(code).digest("base64url").slice(0, 12)}`;
|
|
247
257
|
}
|
|
@@ -252,12 +262,26 @@ class DuplicateTagError extends Error {
|
|
|
252
262
|
super(`Tag ${tag} has already been seen. Tags must be unique across your application`);
|
|
253
263
|
}
|
|
254
264
|
}
|
|
265
|
+
|
|
266
|
+
class InvalidTagError extends Error {
|
|
267
|
+
name = "InvalidTagError";
|
|
268
|
+
constructor(tag) {
|
|
269
|
+
super(`Tag "${tag}" does not map to a valid TypeScript identifier. ` + `Use letters, numbers, spaces, "_" or "-"`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
255
272
|
function collect(source, id, config) {
|
|
256
|
-
const
|
|
273
|
+
const configKey = JSON.stringify(config);
|
|
257
274
|
const cached = collectCache.get(id);
|
|
258
|
-
if (cached?.source === source)
|
|
275
|
+
if (cached?.source === source && cached.config === configKey)
|
|
259
276
|
return cached;
|
|
260
|
-
const
|
|
277
|
+
const tags = new Map;
|
|
278
|
+
const magic = new import_magic_string.default(source);
|
|
279
|
+
let matched = false;
|
|
280
|
+
regex.lastIndex = 0;
|
|
281
|
+
let match;
|
|
282
|
+
while (match = regex.exec(source)) {
|
|
283
|
+
matched = true;
|
|
284
|
+
const [, exp, varOne, varTwo, varThree, plainCss, , tag, taggedCss] = match;
|
|
261
285
|
const css = plainCss ?? taggedCss;
|
|
262
286
|
const { code, exports: exports2 = {} } = import_lightningcss.transform({
|
|
263
287
|
minify: true,
|
|
@@ -270,55 +294,85 @@ function collect(source, id, config) {
|
|
|
270
294
|
if (tag) {
|
|
271
295
|
const suffix = typeof config.typeSuffix === "string" ? config.typeSuffix : config.typeSuffix === false ? "" : "Classes";
|
|
272
296
|
const tagWithSuffix = pascalise(`${tag}${suffix}`);
|
|
297
|
+
if (!IDENTIFIER.test(tagWithSuffix))
|
|
298
|
+
throw new InvalidTagError(tag);
|
|
273
299
|
if (tags.has(tagWithSuffix))
|
|
274
300
|
throw new DuplicateTagError(tagWithSuffix);
|
|
275
301
|
tags.set(tagWithSuffix, Object.keys(styles));
|
|
276
302
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
303
|
+
const statements = [];
|
|
304
|
+
if (varOne) {
|
|
305
|
+
statements.push(`${exp}const ${varOne} = ${JSON.stringify(decoder.decode(code))}`);
|
|
306
|
+
}
|
|
307
|
+
if (varTwo) {
|
|
308
|
+
statements.push(`${exp}const ${varTwo} = ${JSON.stringify(styles)}`);
|
|
309
|
+
}
|
|
310
|
+
if (varThree) {
|
|
311
|
+
statements.push(`${exp}const ${varThree} = ${JSON.stringify(href)}`);
|
|
312
|
+
}
|
|
313
|
+
magic.overwrite(match.index, match.index + match[0].length, statements.join(`
|
|
314
|
+
`));
|
|
315
|
+
}
|
|
316
|
+
const template = magic.toString();
|
|
317
|
+
const map = matched ? magic.generateMap({ source: id, includeContent: true, hires: true }) : null;
|
|
318
|
+
const result = { source, config: configKey, template, tags, map };
|
|
319
|
+
collectCache.set(id, result);
|
|
320
|
+
return result;
|
|
321
|
+
}
|
|
322
|
+
function renderTypes(tags) {
|
|
323
|
+
return [
|
|
324
|
+
AUTOGEN_MSG,
|
|
325
|
+
"",
|
|
326
|
+
`import '${PKG_NAME}'`,
|
|
327
|
+
"",
|
|
328
|
+
`declare module '${PKG_NAME}' {`,
|
|
329
|
+
tagsToType(tags),
|
|
330
|
+
"}",
|
|
331
|
+
""
|
|
332
|
+
].join(`
|
|
282
333
|
`);
|
|
283
|
-
});
|
|
284
|
-
collectCache.set(id, { source, template, tags });
|
|
285
|
-
return {
|
|
286
|
-
template,
|
|
287
|
-
tags
|
|
288
|
-
};
|
|
289
334
|
}
|
|
290
|
-
async function
|
|
335
|
+
async function writeRenderedTypes(tags) {
|
|
291
336
|
const filePath = import_node_path.default.join(GENERATED_DIR, "index.d.ts");
|
|
292
337
|
if (!tags.size) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
fileCache.delete(filePath);
|
|
296
|
-
} catch (err) {
|
|
297
|
-
if (!isENOENT(err))
|
|
298
|
-
throw err;
|
|
299
|
-
}
|
|
338
|
+
await import_promises.default.rm(filePath, { force: true });
|
|
339
|
+
fileCache.delete(filePath);
|
|
300
340
|
return;
|
|
301
341
|
}
|
|
302
342
|
await import_promises.default.mkdir(GENERATED_DIR, { recursive: true });
|
|
303
|
-
await maybeWrite(filePath,
|
|
304
|
-
|
|
305
|
-
import '${PKG_NAME}'
|
|
306
|
-
|
|
307
|
-
declare module '${PKG_NAME}' {
|
|
308
|
-
${tagsToType(tags)}
|
|
309
|
-
}
|
|
310
|
-
`);
|
|
343
|
+
await maybeWrite(filePath, renderTypes(tags));
|
|
311
344
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
`).join(`
|
|
316
|
-
`);
|
|
345
|
+
var PARTIAL_DIR = import_node_path.default.join(GENERATED_DIR, "tags");
|
|
346
|
+
function partialPath(filePath) {
|
|
347
|
+
return import_node_path.default.join(PARTIAL_DIR, `${import_node_crypto.createHash("sha1").update(filePath).digest("hex")}.json`);
|
|
317
348
|
}
|
|
318
|
-
function
|
|
349
|
+
async function readPartials() {
|
|
350
|
+
let entries;
|
|
351
|
+
try {
|
|
352
|
+
entries = await import_promises.default.readdir(PARTIAL_DIR);
|
|
353
|
+
} catch (err) {
|
|
354
|
+
if (isENOENT(err))
|
|
355
|
+
return new Map;
|
|
356
|
+
throw err;
|
|
357
|
+
}
|
|
319
358
|
const tags = new Map;
|
|
320
|
-
for (const
|
|
321
|
-
|
|
359
|
+
for (const entry of entries) {
|
|
360
|
+
if (!entry.endsWith(".json"))
|
|
361
|
+
continue;
|
|
362
|
+
const partial = import_node_path.default.join(PARTIAL_DIR, entry);
|
|
363
|
+
let parsed;
|
|
364
|
+
try {
|
|
365
|
+
parsed = JSON.parse(await import_promises.default.readFile(partial, "utf-8"));
|
|
366
|
+
} catch {
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
try {
|
|
370
|
+
await import_promises.default.access(parsed.file);
|
|
371
|
+
} catch {
|
|
372
|
+
await import_promises.default.rm(partial, { force: true });
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
for (const [name, classes] of Object.entries(parsed.tags)) {
|
|
322
376
|
if (tags.has(name))
|
|
323
377
|
throw new DuplicateTagError(name);
|
|
324
378
|
tags.set(name, classes);
|
|
@@ -326,106 +380,134 @@ function flattenTags(tagsByFile) {
|
|
|
326
380
|
}
|
|
327
381
|
return tags;
|
|
328
382
|
}
|
|
383
|
+
function writeTypesForFile(filePath, tags) {
|
|
384
|
+
return enqueueWrite(async () => {
|
|
385
|
+
await import_promises.default.mkdir(PARTIAL_DIR, { recursive: true });
|
|
386
|
+
const partial = partialPath(filePath);
|
|
387
|
+
if (!tags.size) {
|
|
388
|
+
await import_promises.default.rm(partial, { force: true });
|
|
389
|
+
} else {
|
|
390
|
+
await writeFileAtomic(partial, JSON.stringify({ file: filePath, tags: Object.fromEntries(tags) }));
|
|
391
|
+
}
|
|
392
|
+
await writeRenderedTypes(await readPartials());
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function tagsToType(tags) {
|
|
396
|
+
return [...tags].map(([tag, classes]) => {
|
|
397
|
+
const union = classes.length > 0 ? classes.toSorted((a, b) => a.length - b.length).map((c) => `'${c}'`).join(" | ") : "never";
|
|
398
|
+
return ` export type ${tag} = ${union}`;
|
|
399
|
+
}).join(`
|
|
400
|
+
`);
|
|
401
|
+
}
|
|
329
402
|
|
|
330
403
|
// src/next/index.ts
|
|
331
404
|
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"));
|
|
332
405
|
var loader = import_node_path2.default.join(nextDir, "cxx-loader.cjs");
|
|
333
|
-
var tagsByFile = new Map;
|
|
334
406
|
var watchedFiles = new Map;
|
|
335
|
-
var
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
407
|
+
var subscription = null;
|
|
408
|
+
var subscriptionPromise = null;
|
|
409
|
+
var cleanupRegistered = false;
|
|
410
|
+
var watcherLogger = null;
|
|
411
|
+
var DEFAULT_IGNORE = [
|
|
412
|
+
"**/node_modules/**",
|
|
413
|
+
"**/.next/**",
|
|
414
|
+
`**/${GENERATED_DIR}/**`,
|
|
415
|
+
"**/.git/**"
|
|
416
|
+
];
|
|
417
|
+
async function onEvent(event, filePath) {
|
|
418
|
+
const watched = watchedFiles.get(filePath);
|
|
419
|
+
if (!watched)
|
|
339
420
|
return;
|
|
340
|
-
const { pluginConfig, logger } =
|
|
341
|
-
const hadTags = tagsByFile.has(filePath);
|
|
421
|
+
const { pluginConfig, logger } = watched;
|
|
342
422
|
if (event === "delete") {
|
|
343
|
-
|
|
344
|
-
if (!hadTags)
|
|
345
|
-
return;
|
|
346
|
-
await writeTypes(flattenTags(tagsByFile));
|
|
423
|
+
await writeTypesForFile(filePath, new Map);
|
|
347
424
|
logger.info(`updated types from ${filePath}`);
|
|
348
425
|
return;
|
|
349
426
|
}
|
|
427
|
+
let source;
|
|
350
428
|
try {
|
|
351
|
-
|
|
352
|
-
const { tags } = collect(source, filePath, pluginConfig);
|
|
353
|
-
const hasTags = tags.size > 0;
|
|
354
|
-
if (hasTags) {
|
|
355
|
-
tagsByFile.set(filePath, tags);
|
|
356
|
-
} else {
|
|
357
|
-
tagsByFile.delete(filePath);
|
|
358
|
-
}
|
|
359
|
-
if (!hadTags && !hasTags)
|
|
360
|
-
return;
|
|
361
|
-
await writeTypes(flattenTags(tagsByFile));
|
|
362
|
-
logger.info(`updated types from ${filePath}`);
|
|
429
|
+
source = await import_promises2.default.readFile(filePath, "utf-8");
|
|
363
430
|
} catch (err) {
|
|
364
431
|
if (!isENOENT(err))
|
|
365
432
|
throw err;
|
|
366
|
-
|
|
367
|
-
return;
|
|
368
|
-
tagsByFile.delete(filePath);
|
|
369
|
-
await writeTypes(flattenTags(tagsByFile));
|
|
433
|
+
await writeTypesForFile(filePath, new Map);
|
|
370
434
|
logger.info(`updated types from ${filePath}`);
|
|
435
|
+
return;
|
|
371
436
|
}
|
|
437
|
+
const { tags } = collect(source, filePath, pluginConfig);
|
|
438
|
+
await writeTypesForFile(filePath, tags);
|
|
439
|
+
logger.info(`updated types from ${filePath}`);
|
|
440
|
+
}
|
|
441
|
+
function ensureWatcher(pluginConfig, logger) {
|
|
442
|
+
watcherLogger = logger;
|
|
443
|
+
if (subscriptionPromise)
|
|
444
|
+
return;
|
|
445
|
+
const root = pluginConfig.watch?.root ?? process.cwd();
|
|
446
|
+
const ignore = [...DEFAULT_IGNORE, ...pluginConfig.watch?.ignore ?? []];
|
|
447
|
+
subscriptionPromise = (async () => {
|
|
448
|
+
const { subscribe } = await import("@parcel/watcher");
|
|
449
|
+
subscription = await subscribe(root, (watchErr, events) => {
|
|
450
|
+
if (watchErr) {
|
|
451
|
+
watcherLogger?.error(`failed to watch ${root}`, watchErr);
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
for (const event of events) {
|
|
455
|
+
const filePath = import_node_path2.default.resolve(event.path);
|
|
456
|
+
if (!watchedFiles.has(filePath))
|
|
457
|
+
continue;
|
|
458
|
+
onEvent(event.type, filePath).catch((err) => {
|
|
459
|
+
watcherLogger?.error(`failed to update types from ${filePath}`, err);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
}, { ignore });
|
|
463
|
+
registerCleanup();
|
|
464
|
+
})().catch((err) => {
|
|
465
|
+
watcherLogger?.error("failed to start cxx watcher", err);
|
|
466
|
+
subscriptionPromise = null;
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
async function cleanup() {
|
|
470
|
+
const active = subscription;
|
|
471
|
+
subscription = null;
|
|
472
|
+
subscriptionPromise = null;
|
|
473
|
+
watchedFiles.clear();
|
|
474
|
+
if (active)
|
|
475
|
+
await active.unsubscribe();
|
|
476
|
+
}
|
|
477
|
+
async function shutdown(signal) {
|
|
478
|
+
try {
|
|
479
|
+
await cleanup();
|
|
480
|
+
} finally {
|
|
481
|
+
process.kill(process.pid, signal);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function registerCleanup() {
|
|
485
|
+
if (cleanupRegistered)
|
|
486
|
+
return;
|
|
487
|
+
cleanupRegistered = true;
|
|
488
|
+
process.once("SIGINT", () => void shutdown("SIGINT"));
|
|
489
|
+
process.once("SIGTERM", () => void shutdown("SIGTERM"));
|
|
372
490
|
}
|
|
373
491
|
function processFile(source, filePath, pluginConfig, logger) {
|
|
374
492
|
const resolvedFilePath = import_node_path2.default.resolve(filePath);
|
|
375
|
-
|
|
376
|
-
let subscription = subscriptionsByDir.get(directoryPath);
|
|
377
|
-
if (true) {
|
|
493
|
+
if (process.env["NODE_ENV"] !== "production") {
|
|
378
494
|
watchedFiles.set(resolvedFilePath, { pluginConfig, logger });
|
|
379
|
-
|
|
380
|
-
subscription = import_watcher.default.subscribe(directoryPath, async (err, events) => {
|
|
381
|
-
if (err) {
|
|
382
|
-
logger.error(`failed to update types from ${directoryPath}`, err);
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
for (const event of events) {
|
|
386
|
-
const eventFilePath = import_node_path2.default.resolve(event.path);
|
|
387
|
-
if (!watchedFiles.has(eventFilePath))
|
|
388
|
-
continue;
|
|
389
|
-
try {
|
|
390
|
-
await rebuildFile(eventFilePath, event.type);
|
|
391
|
-
} catch (watchErr) {
|
|
392
|
-
logger.error(`failed to update types from ${eventFilePath}`, watchErr);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
subscriptionsByDir.set(directoryPath, subscription);
|
|
397
|
-
}
|
|
495
|
+
ensureWatcher(pluginConfig, logger);
|
|
398
496
|
}
|
|
399
|
-
const result = collect(source,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
tagsByFile.delete(filePath);
|
|
404
|
-
}
|
|
405
|
-
writeTypes(flattenTags(tagsByFile));
|
|
497
|
+
const result = collect(source, resolvedFilePath, pluginConfig);
|
|
498
|
+
writeTypesForFile(resolvedFilePath, result.tags).catch((err) => {
|
|
499
|
+
logger.error(`failed to write types for ${resolvedFilePath}`, err);
|
|
500
|
+
});
|
|
406
501
|
return result;
|
|
407
502
|
}
|
|
408
|
-
async function cleanup() {
|
|
409
|
-
await Promise.all([...subscriptionsByDir].map(async ([directoryPath, subPromise]) => {
|
|
410
|
-
subscriptionsByDir.delete(directoryPath);
|
|
411
|
-
await (await subPromise).unsubscribe();
|
|
412
|
-
}));
|
|
413
|
-
subscriptionsByDir.clear();
|
|
414
|
-
}
|
|
415
|
-
process.once("SIGINT", () => {
|
|
416
|
-
cleanup().finally(() => process.exit(130));
|
|
417
|
-
});
|
|
418
|
-
process.once("SIGTERM", () => {
|
|
419
|
-
cleanup().finally(() => process.exit(143));
|
|
420
|
-
});
|
|
421
503
|
|
|
422
504
|
// src/next/cxx-loader.js
|
|
423
505
|
var loader2 = function(source) {
|
|
424
506
|
const { pluginConfig } = this.getOptions();
|
|
425
|
-
const logger = new Logger
|
|
507
|
+
const logger = new Logger;
|
|
426
508
|
const { template } = processFile(source, this.resourcePath, pluginConfig, logger);
|
|
427
509
|
return template;
|
|
428
510
|
};
|
|
429
511
|
var cxx_loader_default = loader2;
|
|
430
512
|
|
|
431
|
-
//# debugId=
|
|
513
|
+
//# debugId=9743BC642BE06F6664756E2164756E21
|
|
@@ -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\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\
|
|
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
|
|
7
|
-
"import { createHash } from 'node:crypto'\nimport fs from 'node:fs/promises'\nimport path from 'node:path'\n\nimport { transform } from 'lightningcss'\n\nimport type { BuildContext, 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/**\n * LRU cache of `collect` results by file id and last seen source so watcher and transform can\n * reuse the same parsed template/tags.\n */\nconst collectCache = new LruCache<{ source: string; template: string; tags: Tags }>()\n\n/**\n * LRU cache for file content. Stores the last written content per file path so `maybeWrite`\n * can skip disk i/o when nothing has changed.\n */\nconst fileCache = new LruCache<string>()\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 only if the content has changed since the last build.\n */\nexport async function maybeWrite(filePath: string, content: string) {\n\tconst cached = fileCache.get(filePath)\n\n\tif (cached !== content) {\n\t\t// cache says content changed, write without reading\n\t\tawait fs.writeFile(filePath, content)\n\t\tfileCache.set(filePath, content)\n\n\t\treturn true\n\t}\n\n\t// cache miss or cache hit with same content — verify on disk\n\ttry {\n\t\tif ((await fs.readFile(filePath, 'utf-8')) === content) {\n\t\t\tfileCache.set(filePath, content)\n\t\t\treturn false\n\t\t}\n\t} catch (err) {\n\t\tif (!isENOENT(err)) throw err\n\t}\n\n\tawait fs.writeFile(filePath, content)\n\tfileCache.set(filePath, content)\n\n\treturn true\n}\n\n// matches `[css, classes, href] = cxx\\`...\\`` and `cxx.tag<T>('name')\\`...\\``\n// capture groups: 1-3 assigned variable names, 4 plain css body, 5 quote\n// kind, 6 tag name, 7 tagged css body\nconst regex =\n\t/(?:const|var|let)\\s*\\[(\\w+|)\\s*,?\\s*(\\w+|)\\s*,?\\s*(\\w+|)\\s*\\]\\s*=\\s*cxx(?:\\s*`([\\s\\S]*?)`|\\s*\\.\\s*tag(?:\\s*<[^>]+>)?\\s*\\(\\s*(['\"])(.*?)\\5\\s*\\)\\s*`([\\s\\S]*?)`)/gm\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\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 tags: Tags = new Map()\n\n\tconst cached = collectCache.get(id)\n\tif (cached?.source === source) return cached\n\n\tconst template = source.replace(\n\t\tregex,\n\t\t(_match, varOne, varTwo, varThree, plainCss, _quote, tag, taggedCss) => {\n\t\t\tconst css = plainCss ?? taggedCss\n\n\t\t\tconst { code, exports = {} } = transform({\n\t\t\t\tminify: true,\n\t\t\t\tcssModules: true,\n\t\t\t\tfilename: id,\n\t\t\t\tcode: new TextEncoder().encode(css),\n\t\t\t})\n\n\t\t\tconst href = hashCss(code)\n\t\t\tconst styles = Object.fromEntries(\n\t\t\t\tObject.entries(exports).map(([k, v]) => [k, v.name]),\n\t\t\t)\n\n\t\t\tif (tag) {\n\t\t\t\tconst suffix =\n\t\t\t\t\ttypeof config.typeSuffix === 'string'\n\t\t\t\t\t\t? config.typeSuffix\n\t\t\t\t\t\t: config.typeSuffix === false\n\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t: 'Classes'\n\t\t\t\tconst tagWithSuffix = pascalise(`${tag}${suffix}`)\n\n\t\t\t\tif (tags.has(tagWithSuffix)) throw new DuplicateTagError(tagWithSuffix)\n\n\t\t\t\t// side effect but neccessary\n\t\t\t\ttags.set(tagWithSuffix, Object.keys(styles))\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\tvarOne && `const ${varOne} = \\`${code}\\``,\n\t\t\t\tvarTwo && `const ${varTwo} = ${JSON.stringify(styles)}`,\n\t\t\t\tvarThree && `const ${varThree} = \\`${href}\\``,\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join('\\n')\n\t\t},\n\t)\n\n\t// cache\n\tcollectCache.set(id, { source, template, tags })\n\n\treturn {\n\t\ttemplate,\n\t\ttags,\n\t}\n}\n\n/**\n * Write the generated declaration file for the current set of collected tags.\n */\nexport async function writeTypes(tags: Tags) {\n\tconst filePath = path.join(GENERATED_DIR, 'index.d.ts')\n\n\tif (!tags.size) {\n\t\ttry {\n\t\t\tawait fs.rm(filePath, { force: true })\n\t\t\tfileCache.delete(filePath)\n\t\t} catch (err) {\n\t\t\tif (!isENOENT(err)) throw err\n\t\t}\n\n\t\treturn\n\t}\n\n\tawait fs.mkdir(GENERATED_DIR, { recursive: true })\n\n\tawait maybeWrite(\n\t\tfilePath,\n\t\t`${AUTOGEN_MSG}\n\n\t\t\timport '${PKG_NAME}'\n\n\t\t\tdeclare module '${PKG_NAME}' {\n\t\t\t\t${tagsToType(tags)}\n\t\t\t}\n\t\t`,\n\t)\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.map(\n\t\t\t([tag, classes]) => `\n\t\texport type ${tag} = ${\n\t\t\tclasses.length > 0\n\t\t\t\t? classes\n\t\t\t\t\t\t.toSorted((a, b) => a.length - b.length)\n\t\t\t\t\t\t.map(c => `'${c}'`)\n\t\t\t\t\t\t.join(' | ')\n\t\t\t\t: 'never'\n\t\t}\n\t`,\n\t\t)\n\t\t.join('\\n')\n}\n\n/**\n * Merge per-file tag maps into one application-wide tag map.\n */\nexport function flattenTags(tagsByFile: BuildContext['tagsByFile']) {\n\tconst tags = new Map<string, string[]>()\n\n\tfor (const fileTags of tagsByFile.values()) {\n\t\tfor (const [name, classes] of fileTags) {\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",
|
|
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, 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 } = collect(source, filePath, pluginConfig)\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\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).catch(err => {\n\t\tlogger.error(`failed to write types for ${resolvedFilePath}`, err)\n\t})\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 { BuildContext, 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()\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 * LRU cache for file content. Stores the last written content per file path so `maybeWrite`\n * can skip disk i/o when nothing has changed.\n */\nconst fileCache = new LruCache<string>()\n\n/**\n * Serialises type file writes inside a single process so overlapping `writeTypes` calls can't\n * interleave or 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 first writing to a unique temporary file and then renaming it into place, so\n * concurrent writers (e.g. Turbopack loader workers) never observe a partial file.\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\tawait fs.rename(tmp, filePath)\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 actually differs from what is already on disk.\n */\nexport async function maybeWrite(filePath: string, content: string) {\n\tconst cached = fileCache.get(filePath)\n\t// fast path: already wrote this exact content in this process\n\tif (cached === content) return false\n\n\t// verify against disk on a cold start (or when the cache is stale) so we\n\t// don't needlessly bump the mtime and invalidate downstream watchers\n\ttry {\n\t\tif ((await fs.readFile(filePath, 'utf-8')) === content) {\n\t\t\tfileCache.set(filePath, content)\n\t\t\treturn false\n\t\t}\n\t} catch (err) {\n\t\tif (!isENOENT(err)) throw err\n\t}\n\n\tawait writeFileAtomic(filePath, content)\n\tfileCache.set(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\n\t\t// compile the CSS to minified CSS Modules\n\t\tconst { code, exports = {} } = transform({\n\t\t\tminify: true,\n\t\t\tcssModules: true,\n\t\t\tfilename: id,\n\t\t\tcode: new TextEncoder().encode(css),\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(exports).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(match.index, match.index + 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\t// `force` makes this a no-op when the file is already absent\n\t\tawait fs.rm(filePath, { force: true })\n\t\tfileCache.delete(filePath)\n\n\t\treturn\n\t}\n\n\tawait fs.mkdir(GENERATED_DIR, { recursive: true })\n\tawait maybeWrite(filePath, renderTypes(tags))\n}\n\n/**\n * Write the generated declaration file for the current set of collected tags.\n */\nexport function writeTypes(tags: Tags) {\n\treturn enqueueWrite(() => writeRenderedTypes(tags))\n}\n\nconst PARTIAL_DIR = path.join(GENERATED_DIR, 'tags')\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 * Read every per-file partial written by the Next loader workers and merge them into one tag map.\n * Partials whose source file no 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 * Next-specific write path. Turbopack spreads loaders across worker processes, so each worker\n * persists its own per-file partial and rebuilds the shared declaration file from all of them.\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\n\t\tawait writeRenderedTypes(await readPartials())\n\t})\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.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\n/**\n * Merge per-file tag maps into one application-wide tag map.\n */\nexport function flattenTags(tagsByFile: BuildContext['tagsByFile']) {\n\tconst tags = new Map<string, string[]>()\n\n\tfor (const fileTags of tagsByFile.values()) {\n\t\tfor (const [name, classes] of fileTags) {\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",
|
|
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
|
|
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(
|
|
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// true while a batch is running, so we never start a second one\n\tlet running = false\n\n\tasync function drain() {\n\t\t// a run is already going, so let it pick up the new work\n\t\tif (running) return\n\t\trunning = true\n\n\t\ttry {\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} finally {\n\t\t\t// always allow the next run, even if flush threw\n\t\t\trunning = false\n\t\t}\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// start the run without waiting for it (this is a timer callback)\n\t\t\tvoid drain()\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",
|
|
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 } = processFile(source, this.resourcePath, pluginConfig, logger)\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;AAAA;AAoBO,MAAM,OAAO;AAAA,EAOX;AAAA,SAND,gBAA0B;AAAA,EAEjC;AAAA,EAEA,WAAW,CACV,OACO,MACN;AAAA,IADM;AAAA,IAEP,KAAK,SAAS;AAAA;AAAA,aAGJ,YAAY,CAAC,OAAiB;AAAA,IACxC,OAAO,gBAAgB;AAAA;AAAA,aAGb,YAAY,GAAG;AAAA,IACzB,OAAO,OAAO;AAAA;AAAA,SAMR,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,MAG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