@roblexperu/style 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -15,12 +15,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
15
15
  - `npm run lint:js` — ESLint over `**/*.js` (only `scripts/version-update.js` and `fonts-icons.js` are JS in this repo; runs automatically on staged JS files via husky pre-commit + lint-staged)
16
16
  - `npm run build:icon` — regenerates the icon font from `./svg/*.svg` using `fontello-offline-cli`, then runs `fonts-icons.js` to copy the generated font/CSS into `fonts/`, `public/fonts/RoblexIcons`, and `src/icons/_roblex-icons-codes.scss`. Run this after adding/removing/editing an SVG icon in `./svg/`.
17
17
  - `npm run update-version` / `npm run push` — interactive version bump (patch/minor/major/preupdate) via `scripts/version-update.js`, which also commits and tags; `push` then runs `npm publish`. This mutates git history and publishes — don't run without the user asking.
18
-
19
- There is no test suite in this repo.
18
+ - `npm test` — Jest: unit tests for the JS scripts (`test/js/`) and Sass mixin tests via `sass-true` (`test/sass/`).
19
+ - Node: `package.json` `engines` requires `^22.22.3 || ^24.15.0 || >=26.0.0` and there is no `.nvmrc`. With an older default Node (e.g. 16) the husky pre-commit hook crashes inside lint-staged (`util.styleText is not a function`) and the commit is refused — switch first (`nvm use 24`).
20
+ - Release state (2026-12-05): npm has **1.2.1** (Bootstrap 4.6). `master` already carries the Bootstrap 5 migration (`feat!`, b67249e) and must be published as **2.0.0**, not as a patch/minor; no consuming app has migrated to it yet, so they stay pinned to 1.2.x until each one goes through `docs/MIGRACION-BOOTSTRAP-5.md`.
21
+ - `scripts/version-update.js` loads `chalk` (v6, ESM-only) lazily inside `run()` via `require(esm)` (Node >= 22.12). Keep it out of module scope: the Jest tests import the pure functions, and Jest only supports `require(esm)` on Node >= 24.9.
20
22
 
21
23
  ## Architecture
22
24
 
23
- Everything is assembled from `src/main.scss`, which imports (in order): Bootstrap 4, then design layers under `src/`, each with its own `_index.scss` partial acting as a barrel file:
25
+ Everything is assembled from `src/main.scss`, which imports (in order): Bootstrap 5 (the full precompiled `bootstrap/dist/css/bootstrap.css`; was Bootstrap 4.6 up to 1.2.x, see `docs/MIGRACION-BOOTSTRAP-5.md` for the breaking changes that drove 2.0.0), then design layers under `src/`, each with its own `_index.scss` partial acting as a barrel file:
24
26
 
25
27
  1. `vars/` — Sass variables and maps: colors (`_colors.scss`, incl. the `$colors-roblex` map), breakpoints, base vars (CDN/font path), flexbox vars. No selectors, just tokens.
26
28
  2. `mixins/` — reusable mixins: flexbox helpers, media-query breakpoints, `@font-face`/font-size helpers.
@@ -0,0 +1,47 @@
1
+ # Migración a Bootstrap 5 (`@roblexperu/style` 2.0.0)
2
+
3
+ `@roblexperu/style` incrusta el CSS completo de Bootstrap (`src/main.scss` → `@use '../node_modules/bootstrap/dist/css/bootstrap'`).
4
+ Desde el 2026-12-01, `master` compila con **Bootstrap 5.3.9** en vez de 4.6.2. Es un cambio que rompe compatibilidad:
5
+ **se publica como 2.0.0** (opción *Major* de `npm run push`). Las apps fijadas en `^1.2.x` no se ven afectadas hasta que suban.
6
+
7
+ El SCSS propio de Roblex no depende de ninguna clase exclusiva de Bootstrap 4, porque la grilla es propia (`utility/_flex-grid.scss`).
8
+ Lo que rompe está en el **HTML de las apps** y en los **estilos base (reboot)** de Bootstrap.
9
+
10
+ ## 1. Cambios globales (afectan sin tocar HTML)
11
+
12
+ Hay que revisarlos visualmente en cada app al adoptar la 2.0.0:
13
+
14
+ | Elemento | Bootstrap 4 | Bootstrap 5 |
15
+ |---|---|---|
16
+ | `a` | sin subrayado, subrayado en hover, `#007bff` | **subrayado siempre**, color `--bs-link-color` |
17
+ | `label` | `margin-bottom: .5rem` | sin margen |
18
+ | `h1`–`h4` | tamaño fijo (`2.5rem`, `2rem`, …) | tamaño fluido `calc(… + …vw)` |
19
+ | `.row > *` | sin estilo | **`width: 100%`**, `flex-shrink: 0`, padding de gutter: afecta a cualquier hijo de `.row` que no sea `col-*` |
20
+ | `.row` / `.container` | gutter fijo de 15px | gutter con variables (`--bs-gutter-x` = 1.5rem, o sea 12px por lado) |
21
+ | `.form-control` | `height: calc(1.5em + .75rem + 2px)` | sin altura fija, `appearance: none` |
22
+ | `.btn`, `.card`, `.badge`, `.table`, `hr` | valores fijos | valores vía variables CSS `--bs-*` |
23
+
24
+ ## 2. Clases eliminadas que se usan hoy
25
+
26
+ Medido el 2026-12-01: de 451 clases que existían en el CSS 1.x y faltan en el 2.0.0, estas 21 aparecen en plantillas.
27
+
28
+ | BS4 | BS5 | Usos |
29
+ |---|---|---|
30
+ | `mr-N` / `ml-N` | `me-N` / `ms-N` | mr-2 ×21, ml-1 ×17 (back-office), mr-3 ×11, ml-2 ×8, mr-1 ×4, ml-3 ×2, ml-5, ml-0, mr-0, mr-4 |
31
+ | `pr-N` / `pl-N` | `pe-N` / `ps-N` | pr-2 ×12 (6 en **commons**), pl-2 ×5, pl-3 ×2, pl-4 ×2, pr-1, pl-1 |
32
+ | `text-left` / `text-right` | `text-start` / `text-end` | text-left ×3 (changes), text-right ×1 (back-office) |
33
+ | `close` | `btn-close` (trae su propio ícono X por `background-image`) | back-office ×1, **commons** `alert-message` ×1 |
34
+ | `form-group` | eliminada (usar `mb-3`) | web ×2 |
35
+ | `navbar-light` | eliminada en 5.3 (la navbar es clara por defecto, o `data-bs-theme`) | web ×1, **commons** `header` ×1 |
36
+
37
+ Por repo: back-office 26, web 13, microfront-accounts 14, microfront-cards 10, microfront-profile 15, microfront-changes 8, microfront-operations 3, roblex-app 2, **roblex-common-frontend 8**.
38
+
39
+ **Commons** usa `pr-2` (footer, header-collapsed-sidepanel), `ml-2` (header), `close` (alert-message) y `navbar-light` (header).
40
+ Para no romper a quien siga en style 1.x, migrarlo agregando la clase de BS5 *junto* a la de BS4 (por ejemplo `pr-2 pe-2`) y quitar la vieja cuando todas las apps estén en 2.x.
41
+
42
+ ## 3. Cómo volver a medir
43
+
44
+ ```bash
45
+ grep -rhoE '\b(m[lr]|p[lr])-(sm-|md-|lg-|xl-)?[0-5]\b|\b(float|text)-(sm-|md-|lg-)?(left|right)\b|\bform-group\b|\bcustom-(control|select|checkbox|switch|file)\b|\bno-gutters\b|\bbadge-(primary|secondary|success|danger|warning|info|light|dark)\b|\bsr-only\b|\bclose\b|\bnavbar-light\b' \
46
+ --include='*.html' --exclude-dir=node_modules --exclude-dir=dist <repo>/ | sort | uniq -c | sort -rn
47
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roblexperu/style",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "description": "package for styles",
5
5
  "scripts": {
6
6
  "build": "sass src/main.scss public/css/roblex-style.css && node scripts/normalize-css.js",
@@ -19,21 +19,20 @@
19
19
  "engines": {
20
20
  "node": "^22.22.3 || ^24.15.0 || >=26.0.0"
21
21
  },
22
- "dependencies": {},
23
22
  "devDependencies": {
24
23
  "@eslint/js": "^10.0.1",
25
- "bootstrap": "^4.6.2",
26
- "chalk": "^4.1.0",
27
- "eslint": "^10.8.0",
24
+ "bootstrap": "^5.3.9",
25
+ "chalk": "^6.0.1",
26
+ "eslint": "^10.16.0",
28
27
  "fontello-offline-cli": "^7.0.0",
29
- "fs-extra": "^11.4.0",
30
- "globals": "^17.9.0",
28
+ "fs-extra": "^11.4.1",
29
+ "globals": "^17.15.0",
31
30
  "husky": "^9.1.7",
32
- "jest": "^30.4.2",
33
- "lint-staged": "^17.3.0",
31
+ "jest": "^30.5.2",
32
+ "lint-staged": "^17.6.3",
34
33
  "live-server": "^1.2.2",
35
34
  "prompts": "^2.4.0",
36
- "sass": "^1.102.0",
35
+ "sass": "^1.108.2",
37
36
  "sass-true": "^10.1.0"
38
37
  }
39
38
  }