Skip to content

Commit

Permalink
Adding react-dom as a peer dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
cohitre committed Apr 19, 2024
1 parent 7d9bb07 commit 6537a87
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
4 changes: 4 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
transformIgnorePatterns: ['/node_modules/(?!(@usewaypoint)/)'],
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs)$': 'ts-jest',
},
};

export default config;
23 changes: 23 additions & 0 deletions packages/email-builder/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions packages/email-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
"name": "@usewaypoint/email-builder",
"version": "0.0.3",
"description": "React component to render email messages",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"target": "ES2022",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
],
Expand All @@ -15,6 +22,7 @@
"license": "MIT",
"peerDependencies": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18",
"zod": "^1 || ^2 || ^3"
},
"dependencies": {
Expand Down
24 changes: 24 additions & 0 deletions packages/email-builder/src/renderers/renderToStaticMarkup.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @jest-environment node
*/

import renderToStaticMarkup from './renderToStaticMarkup';

describe('renderToStaticMarkup', () => {
it.only('renders into a string', () => {
const result = renderToStaticMarkup(
{
root: {
type: 'Container',
data: {
props: {
childrenIds: [],
},
},
},
},
{ rootBlockId: 'root' }
);
expect(result).toEqual('<!DOCTYPE html><html><body><div></div></body></html>');
});
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"jsx": "react",
"strict": true,
"sourceMap": true,
"allowJs": true,
"esModuleInterop": true,

"skipLibCheck": true,
Expand Down

0 comments on commit 6537a87

Please sign in to comment.