Skip to content

Commit 7ec5060

Browse files
feat: ui.markdown component (#987)
- Closes #890 - Update Jest transform (similar to deephaven/web-client-ui#1734 (comment)) - Duplicate of #903 because that got reverted --------- Co-authored-by: margaretkennedy <[email protected]>
1 parent 55e8ce2 commit 7ec5060

File tree

13 files changed

+1421
-137
lines changed

13 files changed

+1421
-137
lines changed

jest.config.base.cjs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
11
const path = require('path');
22

3+
// List of node_modules that need to be transformed from ESM to CJS for jest to work
4+
const nodeModulesToTransform = [
5+
'@deephaven',
6+
'nanoid',
7+
// monaco
8+
'monaco-editor',
9+
// plotly.js dependencies
10+
'd3-interpolate',
11+
'd3-color',
12+
// react-markdown and its dependencies
13+
'react-markdown',
14+
'vfile',
15+
'vfile-message',
16+
'unist-util.*',
17+
'unified',
18+
'bail',
19+
'is-plain-obj',
20+
'trough',
21+
'remark.*',
22+
'mdast-util.*',
23+
'micromark.*',
24+
'decode-named-character-reference',
25+
'trim-lines',
26+
'property-information',
27+
'hast-util.*',
28+
'.*separated-tokens',
29+
'ccount',
30+
'devlop',
31+
'escape-string-regexp',
32+
'markdown-table',
33+
'zwitch',
34+
'longest-streak',
35+
'rehype.*',
36+
'web-namespaces',
37+
'hastscript',
38+
];
39+
340
module.exports = {
441
transform: {
542
'^.+\\.(ts|tsx|js|jsx)$': ['babel-jest', { rootMode: 'upward' }],
643
},
744
transformIgnorePatterns: [
8-
'/node_modules/(?!(@deephaven|monaco-editor|d3-interpolate|d3-color|nanoid)/)',
45+
`node_modules/(?!(${nodeModulesToTransform.join('|')})/)`,
946
],
1047
moduleNameMapper: {
1148
'theme-([^/]+?)\\.css(\\?(?:inline|raw))?$': path.join(

0 commit comments

Comments
 (0)