Fix missing dist directory in published npm package #1161
Merged
+7
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Versions after 10.0.238 of
@eth-optimism/tokenlist
do not include adist
directory, resulting in the following error when attempting to import the package:Root Cause
The CircleCI publish workflow was missing a critical build step. While the workflow correctly:
pnpm generate:ci
)pnpm publish
)It was not building the
dist
directory that contains the compiled JavaScript and TypeScript declaration files that consumers need to import the package.The
package.json
correctly specifies:"main": "dist/index.js"
"module": "dist/index.mjs"
"types": "dist/index.d.ts"
"files": ["dist"]
But without the build step, the
dist
directory didn't exist in the published package.Solution
Added a build step in the CircleCI workflow before publishing:
This ensures the
dist
directory is created with all necessary compiled files before the package is published to npm.Verification
npm pack --dry-run
to confirm thedist
directory and all its files are included in the packageindex.js
,index.mjs
(compiled JavaScript)index.d.ts
,optimism.tokenlist.d.ts
(TypeScript declarations)Impact
@eth-optimism/tokenlist
packagedist
directoryrelease
script pattern