Skip to content

fix(type-compiler): correct plugin export paths#702

Open
mojobeeping wants to merge 1 commit into
marcj:masterfrom
mojobeeping:mojobeep/fix-type-compiler-plugin-export
Open

fix(type-compiler): correct plugin export paths#702
mojobeeping wants to merge 1 commit into
marcj:masterfrom
mojobeeping:mojobeep/fix-type-compiler-plugin-export

Conversation

@mojobeeping

Copy link
Copy Markdown

Summary

The published @deepkit/type-compiler@1.0.19 package exposes ./plugin, but the export map points at files that are not present in the tarball:

"./plugin": {
  "types": "./dist/cjs/plugin.d.ts",
  "require": "./dist/cjs/plugin.js",
  "default": "./dist/esm/plugin.js"
}

The published package contains the plugin files under dist/*/src/ instead:

dist/cjs/src/plugin.js
dist/cjs/src/plugin.d.ts
dist/esm/src/plugin.js
dist/esm/src/plugin.d.ts

This PR updates only the ./plugin export paths to match the files that are actually emitted.

Reproduction

rm -rf /tmp/mojobeep-deepkit-type-repro
mkdir -p /tmp/mojobeep-deepkit-type-repro
cd /tmp/mojobeep-deepkit-type-repro
npm init -y >/dev/null
npm install @deepkit/type-compiler@1.0.19 >/dev/null
node --input-type=module -e "import('@deepkit/type-compiler/plugin').catch(error => { console.log(error.code, error.message); process.exit(1) })"

Observed output:

ERR_MODULE_NOT_FOUND Cannot find module .../node_modules/@deepkit/type-compiler/dist/esm/plugin.js

Validation

I validated the corrected export paths against a clean install of the published package by patching only the local package metadata:

PATCHED_DEEPKIT_ESM_OK [ 'deepkitType' ] function
PATCHED_DEEPKIT_CJS_OK [ 'deepkitType' ] function
PATCHED_DEEPKIT_TYPES_OK

I also verified this repository change with:

node -e "const p=require('./packages/type-compiler/package.json'); console.log(JSON.stringify(p.exports['./plugin'], null, 2))"
git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant