Skip to content

Commit

Permalink
Remove remove the types entries when generating tarballs, they are ne…
Browse files Browse the repository at this point in the history
…eded
  • Loading branch information
NullVoxPopuli committed Jan 9, 2025
1 parent adc7336 commit 87c58bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions release/core/publish/steps/generate-tarballs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,6 @@ function scrubTypesFromExports(pkg: Package) {
delete pkg.pkgData.exports;
return;
}

// scrub the package.json of any types fields in exports
if (pkg.pkgData.exports) {
// level 1
for (const [key, value] of Object.entries(pkg.pkgData.exports)) {
if (key === 'types') {
delete pkg.pkgData.exports[key];
} else if (typeof value === 'object') {
// level 2
delete value.types;

for (const [k, v] of Object.entries(value)) {
if (typeof v === 'object') {
// level 3
delete v.types;
}
}
}
}
}
}

async function makeTypesPrivate(pkg: Package) {
Expand Down
7 changes: 7 additions & 0 deletions tests/vite-basic-compat/app/type-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expectTypeOf } from 'expect-type';

import Debug from '@ember-data/debug';
import Store from '@ember-data/store';

expectTypeOf<typeof Debug>().not.toBeAny();
expectTypeOf<typeof Store>().not.toBeAny();
1 change: 1 addition & 0 deletions tests/vite-basic-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"eslint-plugin-n": "^17.13.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-qunit": "^8.1.2",
"expect-type": "^0.20.0",
"globals": "^15.12.0",
"loader.js": "^4.7.0",
"pnpm-sync-dependencies-meta-injected": "0.0.14",
Expand Down

0 comments on commit 87c58bd

Please sign in to comment.