Upgrading
Before 1.0 a minor version can break things: the changelog says so in every entry marked Breaking. So that you do not have to read it all, the CLI rewrites what can be rewritten and warns about what cannot.
Step by step
- Upgrade the dependency to 0.17.1:
npm install @amset/ui@latest. npx amset-ui doctorsays what is still wrong in the project, with the file.npx amset-ui migrate --dry-runreports the changes without writing;npx amset-ui migratemakes them.- Whatever it cannot decide on its own it leaves as a warning with file and line: a
...props, a.sentidoread in a handler, anexport { Viejo } from. Those are done by hand. - Put
npx amset-ui migrate --checkin CI: it exits with 1 if someone writes a removed name again.
app/pedidos.tsx 6 cambio(s) Cambiaria: 6 cambio(s) en 1 fichero(s).import { Button, Table, Tooltip } from '@amset/ui'import '@amset/ui/estilos/boton.css' const columnas = [ { key: 'cliente', title: 'Cliente', ordenable: true }, { key: 'total', title: 'Total', numerica: true },] export function Pedidos({ filas }: { readonly filas: readonly { id: string; cliente: string; total: number }[] }) { return ( <> <Tooltip content="Exportar" para={<Button>Exportar</Button>} /> <Table aria-label="Pedidos" columns={columnas} rows={filas} enServidor paginacion={{ pageSize: 20 }} /> </> )}import { Button, Table, Tooltip } from '@amset/ui'import '@amset/ui/styles/button.css' const columnas = [ { key: 'cliente', title: 'Cliente', sortable: true }, { key: 'total', title: 'Total', numeric: true },] export function Pedidos({ filas }: { readonly filas: readonly { id: string; cliente: string; total: number }[] }) { return ( <> <Tooltip content="Exportar" trigger={<Button>Exportar</Button>} /> <Table aria-label="Pedidos" columns={columnas} rows={filas} serverSide pagination={{ pageSize: 20 }} /> </> )}npx amset-ui migrate.What is done by hand
data-temaanddata-densidadin your HTML becomedata-themeanddata-density.migratedoes not touch them because they may belong to your own application.- The
linea1andlinea2keys of an address becomeline1andline2; the compiler already suggests the new name. - A stylesheet imported from CSS (
@import '@amset/ui/estilos.css'orestilos/<hoja>.css) becomesstyles.cssorstyles/<sheet>.css. Those imported from JavaScript are changed bymigrate. - The root classes renamed in 0.17:
.amset-code(the one-time code field) is.amset-code-field,.amset-headingis.amset-page-headerand.amset-listis.amset-listbox. It only affects those who styled them from outside.
What changed when the API moved to English
Since 0.17 (the first release published after 0.14) everything that is touched from outside is in English: subpaths, stylesheets, files, data-* attributes, classes and the CLI itself. This is the table from the changelog:
| Before | Now |
|---|---|
@amset/ui/estilos.css, @amset/ui/estilos/<hoja>.css | @amset/ui/styles.css, @amset/ui/styles/<sheet>.css (the sheets, also in English: boton.css → button.css) |
@amset/ui/formulario, @amset/ui/esquemas | @amset/ui/form, @amset/ui/schemas |
fichas.json, mandos.json, ejemplos.json, idiomas/*.json | docs.json, knobs.json, examples.json, locales/*.json (and their keys: component, module, title, family, description, stories, name, knobs, story, code) |
npx amset-ui tema, npx amset-ui mandos, npx amset-ui migrar, amset-tema.css | npx amset-ui theme, npx amset-ui knobs, npx amset-ui migrate, amset-theme.css; add writes styles/ and styles.css |
data-tema, data-densidad | data-theme, data-density |
data-cargando, data-seleccionada, data-deshabilitada (Card) and the rest of the data-* in Spanish | data-loading, data-selected, data-disabled… (data-actual → data-current, data-sin-leer → data-unread, data-nivel → data-level…) |
@layer amset-ui.componentes | @layer amset-ui.components |
Classes amset-no-imprimir, amset-only-impresion, amset-for-imprimir, amset-card-pago*, amset-motion-esencial, amset-order-state__hito | amset-print-hidden, amset-print-only, amset-printable, amset-payment-card*, amset-motion-essential, amset-order-state__milestone (y --amset-order-state-milestone-gap) |
Animations amset-*-entra, -entrar, -salir, -aparece, amset-progress-va-y-viene, amset-rating-marcar | -enter, -exit, -appear, amset-progress-back-and-forth, amset-rating-mark |
csvDeTabla, descargarCsv, separadorPorDefecto, filtrarFilas, ordenarFilas, paginarFilas, opcionesDeColumna, valorDeCelda | tableToCsv, downloadCsv, defaultSeparator, filterRows, sortRows, paginateRows, columnOptions, cellValue |
calcularFactura, errorDeImporte | calculateInvoice, amountError; and rejectionReason / FileLimits from FileUpload, which the README presented as exported and were not |
Tooltip para, AddressField linea1 / linea2, parseHotkey(...).tecla | Tooltip trigger, line1 / line2, .key |
PasswordField nueva | newPassword |
Avatar state="inline" (it was "en línea" mistranslated) | state="online" |
TaxZone: peninsula, baleares, canarias | mainland, balearic-islands, canary-islands (ceuta and melilla stay) |
TransferList moveText(..., 'elegidos' | 'disponibles'), ROOT_FIELD = 'raiz' | 'chosen' | 'available', 'root' |
Text keys CabeceraDeAgenda.*, FilaDeFranja.*, TablaDeDias.*, NumerosDePagina.*, TiraDeDias.*, HorasDelDia.* | AgendaHeader.*, SlotRow.*, DayTable.*, PageNumbers.*, DayStrip.*, DayHours.* |
Storybook ids componente-boton--jugar, componentes-*, sistema-*, fundamentos-* | component-button--playground, review-*, system-*, foundations-*; the story exports also in English (Cargando → Loading) and the visible name in Spanish |
What was removed in 0.14
0.14 removed the aliases with the old names. It is the first thing migrate rewrites:
Breaking: the old names that remained as aliases are gone (AMS-1761). A deprecated alias is dead code: out go those of Table (enServidor, seleccionadas, alSeleccionar, paginacion, columnasConfigurables, alCambiarColumnas, redimensionables, alPulsarFila, barraSuperior; in the column numerica, ordenable, filtrable, ocultaPorDefecto, pegada, cabeceraDeFila; and sentido in the sort, with its type TableSortInput), the Spanish names of the form (Formulario, CampoTextoForm, CampoAreaForm, SelectorForm, SelectorFechaForm, CasillaForm, InterruptorForm, GrupoRadioForm, BuscadorForm, BotonEnviar, resolverDeEsquema, PropsForm, EsquemaEstandar, IncidenciaEstandar, ShippingAnswer), PropsCalendarRange, ariaGranularity and ERROR_NETWORK_COUPON. The table of equivalents is in the README. amset-ui-web and amset-assistant move to this version at the same time.Everything else
The full changelog, version by version.
Its options and its real output.
