Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: missing xhr-sync-worker.js in jsdom #121

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ten-carpets-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcms/html-to-slate-ast': patch
---

Fix jsdom being bundled with the package
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ jobs:

- name: Test
run: yarn test --ci --coverage --maxWorkers=2

- name: Run Node.js Environment Test for @graphcms/html-to-slate-ast
run: yarn test:node
working-directory: ./packages/html-to-slate-ast
2 changes: 2 additions & 0 deletions packages/html-to-slate-ast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ HTML to Slate AST converter for the Hygraph's RichTextAST format.

## ⚡ Usage

> Note: If you're using this package with Node.js, you'll need to use version 18 or higher.

### 1. Install

This package needs to have the packages `slate` and `slate-hyperscript` installed, and `jsdom` as well if you need to run the converter in Node.js.
Expand Down
5 changes: 4 additions & 1 deletion packages/html-to-slate-ast/examples/node-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ async function main() {

main()
.then(() => process.exit(0))
.catch(e => console.error(e));
.catch(e => {
console.error(e);
process.exit(1);
});
9 changes: 5 additions & 4 deletions packages/html-to-slate-ast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
"test": "tsdx test --passWithNoTests",
"test:watch": "tsdx test --watch --passWithNoTests",
"lint": "tsdx lint",
"prepublish": "npm run build"
"prepublish": "npm run build",
"test:node": "node examples/node-script.js"
},
"peerDependencies": {
"slate": "^0.66.1",
"slate-hyperscript": "^0.67.0"
},
"devDependencies": {
"@types/jsdom": "^21.1.5",
"jsdom": "^22.1.0",
"@types/jsdom": "^21.1.6",
"jsdom": "^24.0.0",
jpedroschmitz marked this conversation as resolved.
Show resolved Hide resolved
"slate": "^0.66.1",
"slate-hyperscript": "^0.67.0",
"tsup": "^8.0.1"
Expand Down Expand Up @@ -45,7 +46,7 @@
],
"jest": {},
"dependencies": {
"@braintree/sanitize-url": "^6.0.4",
"@braintree/sanitize-url": "^7.0.0",
"@graphcms/rich-text-types": "^0.5.0"
}
}
1 change: 1 addition & 0 deletions packages/html-to-slate-ast/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export default defineConfig(options => ({
treeshake: true,
clean: true,
format: ['esm', 'cjs'],
skipNodeModulesBundle: true,
}));
Loading
Loading