Skip to content
EspañolEnglish

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

  1. Upgrade the dependency to 0.17.1: npm install @amset/ui@latest.
  2. npx amset-ui doctor says what is still wrong in the project, with the file.
  3. npx amset-ui migrate --dry-run reports the changes without writing; npx amset-ui migrate makes them.
  4. Whatever it cannot decide on its own it leaves as a warning with file and line: a ...props, a .sentido read in a handler, an export { Viejo } from. Those are done by hand.
  5. Put npx amset-ui migrate --check in CI: it exits with 1 if someone writes a removed name again.
npx amset-ui migrate app --check
  app/pedidos.tsx  6 cambio(s) Cambiaria: 6 cambio(s) en 1 fichero(s).
Exit code 1 A dashboard coming from 0.14: something is left to migrate.
app/pedidos.tsx
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 }} />    </>  )}
Before.
app/pedidos.tsx
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 }} />    </>  )}
After npx amset-ui migrate.

What is done by hand

  • data-tema and data-densidad in your HTML become data-theme and data-density. migrate does not touch them because they may belong to your own application.
  • The linea1 and linea2 keys of an address become line1 and line2; the compiler already suggests the new name.
  • A stylesheet imported from CSS (@import '@amset/ui/estilos.css' or estilos/<hoja>.css) becomes styles.css or styles/<sheet>.css. Those imported from JavaScript are changed by migrate.
  • The root classes renamed in 0.17: .amset-code (the one-time code field) is .amset-code-field, .amset-heading is .amset-page-header and .amset-list is .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:

BeforeNow
@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/*.jsondocs.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.cssnpx amset-ui theme, npx amset-ui knobs, npx amset-ui migrate, amset-theme.css; add writes styles/ and styles.css
data-tema, data-densidaddata-theme, data-density
data-cargando, data-seleccionada, data-deshabilitada (Card) and the rest of the data-* in Spanishdata-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__hitoamset-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, valorDeCeldatableToCsv, downloadCsv, defaultSeparator, filterRows, sortRows, paginateRows, columnOptions, cellValue
calcularFactura, errorDeImportecalculateInvoice, amountError; and rejectionReason / FileLimits from FileUpload, which the README presented as exported and were not
Tooltip para, AddressField linea1 / linea2, parseHotkey(...).teclaTooltip trigger, line1 / line2, .key
PasswordField nuevanewPassword
Avatar state="inline" (it was "en línea" mistranslated)state="online"
TaxZone: peninsula, baleares, canariasmainland, 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.