Skip to content

Commit

Permalink
feat: ui.markdown component (deephaven#903)
Browse files Browse the repository at this point in the history
- Adds deephaven#890 
- Update Jest transform (similar to
deephaven/web-client-ui#1734 (comment))

---------

Co-authored-by: margaretkennedy <[email protected]>
  • Loading branch information
wusteven815 and margaretkennedy authored Oct 22, 2024
1 parent 3b25024 commit 0d1eea8
Show file tree
Hide file tree
Showing 13 changed files with 1,421 additions and 136 deletions.
39 changes: 38 additions & 1 deletion jest.config.base.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
const path = require('path');

// List of node_modules that need to be transformed from ESM to CJS for jest to work
const nodeModulesToTransform = [
'@deephaven',
'nanoid',
// monaco
'monaco-editor',
// plotly.js dependencies
'd3-interpolate',
'd3-color',
// react-markdown and its dependencies
'react-markdown',
'vfile',
'vfile-message',
'unist-util.*',
'unified',
'bail',
'is-plain-obj',
'trough',
'remark.*',
'mdast-util.*',
'micromark.*',
'decode-named-character-reference',
'trim-lines',
'property-information',
'hast-util.*',
'.*separated-tokens',
'ccount',
'devlop',
'escape-string-regexp',
'markdown-table',
'zwitch',
'longest-streak',
'rehype.*',
'web-namespaces',
'hastscript',
];

module.exports = {
transform: {
'^.+\\.(ts|tsx|js|jsx)$': ['babel-jest', { rootMode: 'upward' }],
},
transformIgnorePatterns: [
'/node_modules/(?!(@deephaven|monaco-editor|d3-interpolate|d3-color|nanoid)/)',
`node_modules/(?!(${nodeModulesToTransform.join('|')})/)`,
],
moduleNameMapper: {
'theme-([^/]+?)\\.css(\\?(?:inline|raw))?$': path.join(
Expand Down
Loading

0 comments on commit 0d1eea8

Please sign in to comment.