From 336f8c75f5f1027867acefcd6a49f01eb8367507 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:14:31 -0500 Subject: [PATCH] Don't remove remove the types entries when generating tarballs, they are needed --- pnpm-lock.yaml | 3 +++ .../core/publish/steps/generate-tarballs.ts | 20 ------------------- tests/vite-basic-compat/app/type-tests.ts | 7 +++++++ tests/vite-basic-compat/package.json | 1 + 4 files changed, 11 insertions(+), 20 deletions(-) create mode 100644 tests/vite-basic-compat/app/type-tests.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 34a9ceaf682..4fb100774b6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4294,6 +4294,9 @@ importers: eslint-plugin-qunit: specifier: ^8.1.2 version: 8.1.2(eslint@9.14.0) + expect-type: + specifier: ^0.20.0 + version: 0.20.0 globals: specifier: ^15.12.0 version: 15.12.0 diff --git a/release/core/publish/steps/generate-tarballs.ts b/release/core/publish/steps/generate-tarballs.ts index 529d4535a09..2894dbaf931 100644 --- a/release/core/publish/steps/generate-tarballs.ts +++ b/release/core/publish/steps/generate-tarballs.ts @@ -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) { diff --git a/tests/vite-basic-compat/app/type-tests.ts b/tests/vite-basic-compat/app/type-tests.ts new file mode 100644 index 00000000000..55a96dbd328 --- /dev/null +++ b/tests/vite-basic-compat/app/type-tests.ts @@ -0,0 +1,7 @@ +import { expectTypeOf } from 'expect-type'; + +import Debug from '@ember-data/debug'; +import Store from '@ember-data/store'; + +expectTypeOf().not.toBeAny(); +expectTypeOf().not.toBeAny(); diff --git a/tests/vite-basic-compat/package.json b/tests/vite-basic-compat/package.json index 147578bae34..ae873acfbf4 100644 --- a/tests/vite-basic-compat/package.json +++ b/tests/vite-basic-compat/package.json @@ -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",