@dropi/ui 0.1.34 → 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 +24 -3
package/package.json
CHANGED
package/scripts/setup.js
CHANGED
|
@@ -365,12 +365,33 @@ dropi-icon:not(.hydrated) {
|
|
|
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 Yarn Berry
|
|
368
|
+
// Resolver ruta real de @dropi/ui (compatible con npm, Yarn Berry, monorepos)
|
|
369
369
|
let dropiUiRoot;
|
|
370
370
|
try {
|
|
371
|
+
// Intento 1: require.resolve desde projectRoot
|
|
371
372
|
dropiUiRoot = path.dirname(require.resolve('@dropi/ui/package.json', { paths: [projectRoot] }));
|
|
372
|
-
} catch (
|
|
373
|
-
|
|
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
|
+
}
|
|
374
395
|
}
|
|
375
396
|
|
|
376
397
|
const setupAsset = (srcRelativePath, destRelativePath) => {
|