diff --git a/.changeset/rare-peas-dream.md b/.changeset/rare-peas-dream.md new file mode 100644 index 0000000000..443f8c566d --- /dev/null +++ b/.changeset/rare-peas-dream.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Repack the package to fix issues with typescript with named exports diff --git a/.changeset/silent-experts-move.md b/.changeset/silent-experts-move.md new file mode 100644 index 0000000000..06441a62c6 --- /dev/null +++ b/.changeset/silent-experts-move.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Subpath export `package.json` should be of a unique name to avoid typescript resolution issues diff --git a/packages/cli/src/lib/packager/productionPack.ts b/packages/cli/src/lib/packager/productionPack.ts index 6a59924a30..3c2b5aa89e 100644 --- a/packages/cli/src/lib/packager/productionPack.ts +++ b/packages/cli/src/lib/packager/productionPack.ts @@ -180,7 +180,9 @@ async function prepareExportsEntryPoints( await fs.writeJson( resolvePath(entryPointDir, PKG_PATH), { - name: pkg.name, + // Need a temporary name, as sharing the same name causes some typescript issues with caching of packages names + // And their defined `types` field. + name: `${pkg.name}__${entryPoint.name.toLocaleLowerCase('en-US')}`, version: pkg.version, ...(exp.default ? { main: posixPath.join('..', exp.default) } : {}), ...(exp.import ? { module: posixPath.join('..', exp.import) } : {}),