chore(messages): update IDE labels to "Prompt Builder" across multiple languages
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const examplesDir = path.join(process.cwd(), 'src/components/ide/examples');
|
||||
const outputFile = path.join(examplesDir, 'generated.ts');
|
||||
|
||||
const examples = [
|
||||
{ file: 'video.ts', export: 'EXAMPLE_VIDEO' },
|
||||
{ file: 'audio.ts', export: 'EXAMPLE_AUDIO' },
|
||||
{ file: 'image.ts', export: 'EXAMPLE_IMAGE' },
|
||||
{ file: 'chat.ts', export: 'EXAMPLE_CHAT' },
|
||||
{ file: 'default.ts', export: 'DEFAULT_CODE' },
|
||||
];
|
||||
|
||||
const lines: string[] = [
|
||||
'// Auto-generated from example .ts files - DO NOT EDIT MANUALLY',
|
||||
'// Run: npm run generate:examples to regenerate',
|
||||
'',
|
||||
];
|
||||
|
||||
for (const { file, export: exportName } of examples) {
|
||||
const content = fs.readFileSync(path.join(examplesDir, file), 'utf-8');
|
||||
// Escape backticks and ${} in the content
|
||||
const escaped = content
|
||||
.replace(/\\/g, '\\\\')
|
||||
.replace(/`/g, '\\`')
|
||||
.replace(/\$\{/g, '\\${');
|
||||
|
||||
lines.push(`export const ${exportName} = \`${escaped}\`;`);
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
fs.writeFileSync(outputFile, lines.join('\n'));
|
||||
console.log(`✅ Generated examples: ${outputFile}`);
|
||||
Reference in New Issue
Block a user