-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(@deephaven/icons): Properly package icons and remove unnecessary files in dist #1437
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1437 +/- ##
==========================================
- Coverage 45.71% 45.71% -0.01%
==========================================
Files 511 511
Lines 35070 35073 +3
Branches 8769 8772 +3
==========================================
+ Hits 16033 16034 +1
- Misses 18986 18988 +2
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Publish an alpha and make sure Enterprise still works with the published alpha?
jest.config.base.cjs
Outdated
'./packages/icons/dist/index.js' | ||
), | ||
'^@deephaven/(.*)$': path.join(__dirname, './packages/$1/src'), | ||
// All pacakges except icons use src code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// All pacakges except icons use src code | |
// All packages except icons use src code |
Tested with an alpha and enterprise builds/tests/looks correct. I put this as a breaking change mostly as a message to update the DHE community packages paths in Vite and Jest (for using the |
While updating packages consumed in the docs, I noticed our icons
package.json
was off. It specified it was a module type (ESM), but exported CJS as.js
. This is incorrect as those will be interpreted as ESM by Node. Instead we should be exporting a.cjs
file and a.js
or.mjs
as the main file.Added an exports section to the
package.json
to indicate which file is for ESM and which is for CJS. We still need to distribute CJS for Jest tests.Removed unnecessary files from the distribution. We don't use imports like
import vsTrash from '@deephaven/icons/vsTrash';
and the ESM tree shakes, so I removed the individual files exported. They also would have been imported from/icons/dist
which is bad practice. Removed the SVG files from the files for the published package as well since they aren't used by anything in production.BREAKING CHANGE: Any imports/aliasing to
@deephaven/icons/dist
should be removed and just read the package contents normally (e.g. DHE jest and vite configs for using community packages locally). See the changes to vite and jest configs in this change for how to update