Skip to content

Commit

Permalink
chore: when types are private, remove exports entirely for v1 addons
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Mar 1, 2024
1 parent 2a1e3d3 commit 79b175a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion release/core/publish/steps/generate-tarballs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ function scrubTypesFromExports(pkg: Package) {

async function makeTypesPrivate(pkg: Package) {
// scrub the package.json of any types fields in exports
scrubTypesFromExports(pkg);
// when the types are private, we completely remove the exports field
// to avoid issues with embroider, auto-import and v1 addons
if (pkg.pkgData['ember-addon']?.version === 1) {
delete pkg.pkgData.exports;
} else {
scrubTypesFromExports(pkg);
}

// remove @warp-drive/core-types from dependencies and peerDependencies
delete pkg.pkgData.dependencies?.['@warp-drive/core-types'];
Expand Down
5 changes: 5 additions & 0 deletions release/utils/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ export type PACKAGEJSON = {
scripts?: Record<string, string>;
files?: string[];
exports?: ExportConfig;
'ember-addon'?: {
main?: 'addon-main.js';
type?: 'addon';
version?: 1 | 2;
};
};

export type APPLIED_STRATEGY = {
Expand Down

0 comments on commit 79b175a

Please sign in to comment.