@multiplatform.one/config 7.34.3 → 7.35.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/src/storybook.ts CHANGED
@@ -318,7 +318,9 @@ function mergePackageResolveAliases(
318
318
  }
319
319
  }
320
320
  } else {
321
- const resolved = resolveSubpathSource(pkgDir, subpath);
321
+ const resolved =
322
+ resolveSubpathSource(pkgDir, subpath) ??
323
+ exportSourceTarget(pkgDir, pkgJson.exports[exportKey]);
322
324
  if (resolved) {
323
325
  aliases[`${pkgName}/${subpath}`] = resolved;
324
326
  }
@@ -327,6 +329,14 @@ function mergePackageResolveAliases(
327
329
  }
328
330
  }
329
331
 
332
+ /** An export entry's `source` file, for subpaths whose name is not their path under src/. */
333
+ function exportSourceTarget(pkgDir: string, entry: unknown): string | undefined {
334
+ const source = (entry as { source?: unknown } | null)?.source;
335
+ if (typeof source !== "string") return undefined;
336
+ const file = path.join(pkgDir, source);
337
+ return fs.existsSync(file) && fs.statSync(file).isFile() ? file : undefined;
338
+ }
339
+
330
340
  function resolveSubpathSource(pkgDir: string, subpath: string): string | undefined {
331
341
  const candidates = [
332
342
  path.join(pkgDir, "src", `${subpath}.storybook.ts`),
@@ -1 +1 @@
1
- {"version":3,"file":"phosphorTokenColor.d.ts","sourceRoot":"","sources":["../src/phosphorTokenColor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAiFnC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAgBjD;AAkDD;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAkBnD"}
1
+ {"version":3,"file":"phosphorTokenColor.d.ts","sourceRoot":"","sources":["../src/phosphorTokenColor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAkFnC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAgBjD;AAkDD;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAkBnD"}