Release @pi/ui 0.0.4: import lodash functions with their extension
lodash declares no exports, so `lodash/isEqual` resolves in a bundler but not in Node's ESM loader: in 0.0.3 apps could not load @pi/ui in tests or when rendering on the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -195,9 +195,12 @@ Detalles a tener en cuenta:
|
||||
ignorando su valor. Se descubrió al dividir los componentes; `pi-bar-chart`
|
||||
es la primera versión que realmente renderiza barras.
|
||||
|
||||
**`lodash` se importa por función** (`lodash/isEqual`, `lodash/some`,
|
||||
`lodash/capitalize`), nunca `import _ from 'lodash'`: lodash es CommonJS y el
|
||||
import completo mete la librería entera en el bundle de quien use un select.
|
||||
**`lodash` se importa por función y con extensión** (`lodash/isEqual.js`,
|
||||
`lodash/some.js`, `lodash/capitalize.js`), nunca `import _ from 'lodash'`:
|
||||
lodash es CommonJS y el import completo mete la librería entera en el bundle de
|
||||
quien use un select. La extensión hace falta porque lodash no declara
|
||||
`exports`: un empaquetador resuelve `lodash/isEqual`, pero Node en ESM (Vitest,
|
||||
SSR) no, y la app falla al cargar `@pi/ui`.
|
||||
|
||||
**El loader de servidor de traducciones ya no está en el barrel.**
|
||||
`util/translate/loaders/translate-server.loader` usa `fs`, `path` y `process`;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pi/ui",
|
||||
"version": "0.0.3",
|
||||
"version": "0.0.4",
|
||||
"description": "Librería de componentes Angular standalone (botones, campos con Signal Forms, cards, charts, drawer/hub/modal, theming vía tokens CSS...).",
|
||||
"license": "MIT",
|
||||
"generators": "./generators.json",
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ComponentFamilyClass, theming } from '../../../styles';
|
||||
import { Date } from '../../../util/models';
|
||||
import { PiBaseChipComponent } from '../base-chip.component';
|
||||
import { DateTime } from 'luxon';
|
||||
import capitalize from 'lodash/capitalize';
|
||||
import capitalize from 'lodash/capitalize.js';
|
||||
|
||||
@Component({
|
||||
selector: 'pi-chip-date',
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
inject,
|
||||
} from '@angular/core';
|
||||
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isEqual from 'lodash/isEqual.js';
|
||||
import { PiBaseSelectComponent } from '../base-select.component';
|
||||
import { PiSelectOptionComponent } from '../select-option/select-option.component';
|
||||
import { Device } from '../../../util/device-configs';
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
|
||||
import { PiBaseSelectComponent } from '../base-select.component';
|
||||
import { PiSelectOptionComponent } from '../select-option/select-option.component';
|
||||
import some from 'lodash/some';
|
||||
import some from 'lodash/some.js';
|
||||
import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox';
|
||||
import { NgTemplateOutlet } from '@angular/common';
|
||||
import { PiIconComponent } from '../../icon/icon/icon.component';
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
|
||||
import { PiBaseSelectComponent } from '../base-select.component';
|
||||
import { PiSelectOptionComponent } from '../select-option/select-option.component';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isEqual from 'lodash/isEqual.js';
|
||||
import { NgTemplateOutlet } from '@angular/common';
|
||||
import { PiIconComponent } from '../../icon/icon/icon.component';
|
||||
import { PiDisabledDirective } from '../../../util/status/directives/status.directive';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
|
||||
import { PiBaseSelectComponent } from '../base-select.component';
|
||||
import { PiSelectOptionComponent } from '../select-option/select-option.component';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isEqual from 'lodash/isEqual.js';
|
||||
import { NgTemplateOutlet } from '@angular/common';
|
||||
import { PiIconComponent } from '../../icon/icon/icon.component';
|
||||
import { PiDisabledDirective } from '../../../util/status/directives/status.directive';
|
||||
|
||||
Reference in New Issue
Block a user