a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lex-cli): only generate files with contents

Mary 6f5906f2 5d004a8c

+34 -19
+5
.changeset/lucky-tools-start.md
··· 1 + --- 2 + '@atcute/lex-cli': patch 3 + --- 4 + 5 + only generate files with contents
+29 -19
packages/lexicons/lex-cli/src/codegen.ts
··· 106 106 107 107 const map: DocumentMap = new Map(documents.map((doc) => [doc.id, doc])); 108 108 const files: SourceFile[] = []; 109 + const generatedIds = new Set<string>(); 109 110 110 111 for (const doc of documents) { 111 112 const filename = `types/${doc.id.replaceAll('.', '/')}.ts`; ··· 353 354 } 354 355 } 355 356 356 - files.push({ 357 - filename: filename, 358 - code: 359 - file.imports + 360 - `\n\n` + 361 - file.rawschemas + 362 - `\n\n` + 363 - file.schemadefs + 364 - `\n\n` + 365 - file.schemas + 366 - `\n\n` + 367 - file.exports + 368 - `\n\n` + 369 - file.interfaces + 370 - `\n\n` + 371 - file.sinterfaces + 372 - `\n\n` + 373 - file.ambients, 374 - }); 357 + // skip files that only have imports and no actual content 358 + if (file.exports) { 359 + generatedIds.add(doc.id); 360 + 361 + files.push({ 362 + filename: filename, 363 + code: 364 + file.imports + 365 + `\n\n` + 366 + file.rawschemas + 367 + `\n\n` + 368 + file.schemadefs + 369 + `\n\n` + 370 + file.schemas + 371 + `\n\n` + 372 + file.exports + 373 + `\n\n` + 374 + file.interfaces + 375 + `\n\n` + 376 + file.sinterfaces + 377 + `\n\n` + 378 + file.ambients, 379 + }); 380 + } 375 381 } 376 382 377 383 { 378 384 let code = ``; 379 385 380 386 for (const doc of map.values()) { 387 + if (!generatedIds.has(doc.id)) { 388 + continue; 389 + } 390 + 381 391 code += `export * as ${toTitleCase(doc.id)} from ${lit(`./types/${doc.id.replaceAll('.', '/')}${importExt}`)};\n`; 382 392 } 383 393