|
|
|
|
/**
|
|
|
|
|
* Script para eliminar todos los campos privados con # de los componentes Terra
|
|
|
|
|
* Motivo: Los campos marcados con # se exponen vía data-* attrs, creando ambigüedad
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { readFileSync, writeFileSync, existsSync, readdirSync } from 'node:fs';
|
|
|
|
|
import { resolve, dirname } from 'node:path';
|
|
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
|
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
|
|
|
const __dirname = dirname(__filename);
|
|
|
|
|
|
|
|
|
|
const terraDir = resolve(__dirname, '../src/uix/terra');
|
|
|
|
|
|
|
|
|
|
// Obtener todos los archivos .svelte.ts y .ts recursivamente
|
|
|
|
|
function getAllTsFiles(dir: string, baseDir = dir): string[] {
|
|
|
|
|
const files: string[] = [];
|
|
|
|
|
const entries = readdirSync(dir, { withFileTypes: true });
|
|
|
|
|
|
|
|
|
|
for (const entry of entries) {
|
|
|
|
|
const fullPath = resolve(dir, entry.name);
|
|
|
|
|
if (entry.isDirectory()) {
|
|
|
|
|
// Skip node_modules and similar
|
|
|
|
|
if (!entry.name.startsWith('.') && entry.name !== 'node_modules') {
|
|
|
|
|
files.push(...getAllTsFiles(fullPath, baseDir));
|
|
|
|
|
}
|
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar.
Codex audit fixes (2026-04-17):
- Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar
- Toast Root → Item refactor (data-toast-item, resolves part collision)
- TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry
- Combobox label registry, Pagination count=0, Splitter feasible-range clamp
- TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter
- Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/
Switch/Toolbar; Slider thumbLabels per-index
- NumberField startValue saneado, Table getIsSomeSelected filtra visibles
- Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination
First/Last snippet
Supporting changes:
- App layer + ling/logr/glob/util consolidation, tests updates
- Terra/scripts mechanical reformat (quotes, imports)
- Test pages updated to match new APIs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
} else if (
|
|
|
|
|
entry.isFile() &&
|
|
|
|
|
(entry.name.endsWith('.svelte.ts') || entry.name.endsWith('.ts'))
|
|
|
|
|
) {
|
|
|
|
|
files.push(fullPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return files;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let modified = 0;
|
|
|
|
|
let skipped = 0;
|
|
|
|
|
let errors = 0;
|
|
|
|
|
|
|
|
|
|
const files = getAllTsFiles(terraDir);
|
|
|
|
|
|
|
|
|
|
for (const file of files) {
|
|
|
|
|
try {
|
|
|
|
|
let content = readFileSync(file, 'utf-8');
|
|
|
|
|
const original = content;
|
|
|
|
|
|
|
|
|
|
// Skip NAMING_CONVENTIONS.md and other non-code files
|
|
|
|
|
if (file.includes('NAMING_CONVENTIONS.md') || file.includes('README.md')) {
|
|
|
|
|
skipped++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 1. Reemplazar declaraciones de campos privados con readonly
|
|
|
|
|
// readonly #foo => readonly foo
|
|
|
|
|
content = content.replace(/readonly\s+#(\w+)/g, 'readonly $1');
|
|
|
|
|
|
|
|
|
|
// 2. Reemplazar declaraciones de campos privados sin readonly
|
|
|
|
|
// #foo = $state(...) => foo = $state(...)
|
|
|
|
|
content = content.replace(/^(\s*)#(\w+)\s*=/gm, '$1$2 =');
|
|
|
|
|
|
|
|
|
|
// 3. Reemplazar uso de campos privados
|
|
|
|
|
// this.#foo => this.foo
|
|
|
|
|
content = content.replace(/this\.#(\w+)/g, 'this.$1');
|
|
|
|
|
|
|
|
|
|
// 4. Reemplazar métodos privados (opcional - convertir a públicos)
|
|
|
|
|
// #methodName() => methodName()
|
|
|
|
|
// Solo si no es seguido por "private" keyword (que no usamos)
|
|
|
|
|
content = content.replace(/(\s+)#/g, '$1');
|
|
|
|
|
|
|
|
|
|
if (content !== original) {
|
|
|
|
|
writeFileSync(file, content, 'utf-8');
|
|
|
|
|
modified++;
|
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar.
Codex audit fixes (2026-04-17):
- Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar
- Toast Root → Item refactor (data-toast-item, resolves part collision)
- TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry
- Combobox label registry, Pagination count=0, Splitter feasible-range clamp
- TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter
- Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/
Switch/Toolbar; Slider thumbLabels per-index
- NumberField startValue saneado, Table getIsSomeSelected filtra visibles
- Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination
First/Last snippet
Supporting changes:
- App layer + ling/logr/glob/util consolidation, tests updates
- Terra/scripts mechanical reformat (quotes, imports)
- Test pages updated to match new APIs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
const relativePath = file
|
|
|
|
|
.replace(/.*src\\uix\\terra\\/, '')
|
|
|
|
|
.replace(/\.svelte\.ts$/, '')
|
|
|
|
|
.replace(/\.ts$/, '');
|
|
|
|
|
console.log(`✅ ${relativePath}`);
|
|
|
|
|
} else {
|
|
|
|
|
skipped++;
|
|
|
|
|
}
|
|
|
|
|
} catch (e: any) {
|
|
|
|
|
errors++;
|
|
|
|
|
console.log(`❌ Error procesando ${file}:`, e.message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(`\n📊 Resumen:`);
|
|
|
|
|
console.log(` Modificados: ${modified}`);
|
|
|
|
|
console.log(` Skippeados (sin cambios): ${skipped}`);
|
|
|
|
|
console.log(` Errores: ${errors}`);
|
|
|
|
|
console.log(` Total procesados: ${modified + skipped + errors}`);
|