@dropi/ui 0.1.33 → 0.1.35
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/package.json +1 -1
- package/scripts/setup.js +31 -2
package/package.json
CHANGED
package/scripts/setup.js
CHANGED
|
@@ -364,9 +364,38 @@ dropi-icon:not(.hydrated) {
|
|
|
364
364
|
|
|
365
365
|
// 5. Iconos y Lottie (Symlink/Copia de assets)
|
|
366
366
|
const publicDir = isAngular ? 'src/assets' : 'public';
|
|
367
|
-
|
|
367
|
+
|
|
368
|
+
// Resolver ruta real de @dropi/ui (compatible con npm, Yarn Berry, monorepos)
|
|
369
|
+
let dropiUiRoot;
|
|
370
|
+
try {
|
|
371
|
+
// Intento 1: require.resolve desde projectRoot
|
|
372
|
+
dropiUiRoot = path.dirname(require.resolve('@dropi/ui/package.json', { paths: [projectRoot] }));
|
|
373
|
+
} catch (e1) {
|
|
374
|
+
try {
|
|
375
|
+
// Intento 2: ejecutar node en contexto del proyecto (útil en Yarn Berry PnP)
|
|
376
|
+
const resolved = execSync(
|
|
377
|
+
`node -e "console.log(require.resolve('@dropi/ui/package.json'))"`,
|
|
378
|
+
{ cwd: projectRoot, encoding: 'utf8' }
|
|
379
|
+
).trim();
|
|
380
|
+
dropiUiRoot = path.dirname(resolved);
|
|
381
|
+
} catch (e2) {
|
|
382
|
+
// Intento 3: buscar en árbol de directorios (monorepos con hoisting)
|
|
383
|
+
let dir = projectRoot;
|
|
384
|
+
while (dir !== path.dirname(dir)) {
|
|
385
|
+
const candidate = path.join(dir, 'node_modules', '@dropi', 'ui');
|
|
386
|
+
if (fs.existsSync(path.join(candidate, 'package.json'))) {
|
|
387
|
+
dropiUiRoot = candidate;
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
dir = path.dirname(dir);
|
|
391
|
+
}
|
|
392
|
+
// Fallback convencional
|
|
393
|
+
if (!dropiUiRoot) dropiUiRoot = path.join(projectRoot, 'node_modules', '@dropi', 'ui');
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
368
397
|
const setupAsset = (srcRelativePath, destRelativePath) => {
|
|
369
|
-
const src = path.join(
|
|
398
|
+
const src = path.join(dropiUiRoot, srcRelativePath);
|
|
370
399
|
const dest = path.join(projectRoot, publicDir, destRelativePath);
|
|
371
400
|
const destDir = path.dirname(dest);
|
|
372
401
|
|