Skip to content

Commit 5d04b1e

Browse files
committed
feat: drop support for Node 10 (#37)
BREAKING CHANGE: Requires Node@>=12 BREAKING CHANGE: Requires @remark-embedder/core@^2.0.0
1 parent d54ba5a commit 5d04b1e

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: ${{ !contains(github.head_ref, 'all-contributors') }}
1717
strategy:
1818
matrix:
19-
node: [10.13, 12, 14, 16]
19+
node: [12, 14, 16, 17]
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: 🛑 Cancel Previous Runs

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com)",
1717
"license": "MIT",
1818
"engines": {
19-
"node": ">=10",
19+
"node": ">=12",
2020
"npm": ">=6"
2121
},
2222
"repository": {
@@ -40,21 +40,21 @@
4040
"validate": "kcd-scripts validate"
4141
},
4242
"dependencies": {
43-
"@babel/runtime": "^7.14.8",
44-
"@types/make-fetch-happen": "^9.0.0",
45-
"make-fetch-happen": "^9.0.4"
43+
"@babel/runtime": "^7.16.0",
44+
"@types/make-fetch-happen": "^9.0.1",
45+
"make-fetch-happen": "^9.1.0"
4646
},
4747
"devDependencies": {
48-
"@remark-embedder/core": "^1.4.2",
49-
"@types/jest": "^27.0.0",
50-
"kcd-scripts": "^11.2.0",
48+
"@remark-embedder/core": "^2.0.0",
49+
"@types/jest": "^27.0.2",
50+
"kcd-scripts": "^11.2.2",
5151
"msw": "^0.35.0",
5252
"remark": "^13.0.0",
53-
"remark-html": "^13.0.1",
54-
"typescript": "^4.3.5"
53+
"remark-html": "^13.0.2",
54+
"typescript": "^4.4.4"
5555
},
5656
"peerDependencies": {
57-
"@remark-embedder/core": "^1.0.0"
57+
"@remark-embedder/core": "^2.0.0"
5858
},
5959
"eslintConfig": {
6060
"extends": "./node_modules/kcd-scripts/eslint.js",

src/__tests__/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {rest} from 'msw'
33
import type {RestRequest} from 'msw'
44
import {setupServer} from 'msw/node'
55
import remark from 'remark'
6-
import html from 'remark-html'
6+
import remarkHTML from 'remark-html'
77

88
import transformer from '../'
99
import type {Config} from '../'
@@ -52,8 +52,7 @@ const server = setupServer(
5252
rest.get('https://publish.twitter.com/oembed', (req, res, ctx) =>
5353
res(
5454
ctx.json({
55-
html:
56-
'<blockquote class="twitter-tweet" data-dnt="true" data-theme="dark"><p lang="en" dir="ltr">I spent a few minutes working on this, just for you all. I promise, it wont disappoint. Though it may surprise 🎉<br><br>🙏 <a href="https://t.co/wgTJYYHOzD">https://t.co/wgTJYYHOzD</a></p>— Kent C. Dodds (@kentcdodds) <a href="https://twitter.com/kentcdodds/status/783161196945944580?ref_src=twsrc%5Etfw">October 4, 2016</a></blockquote>',
55+
html: '<blockquote class="twitter-tweet" data-dnt="true" data-theme="dark"><p lang="en" dir="ltr">I spent a few minutes working on this, just for you all. I promise, it wont disappoint. Though it may surprise 🎉<br><br>🙏 <a href="https://t.co/wgTJYYHOzD">https://t.co/wgTJYYHOzD</a></p>— Kent C. Dodds (@kentcdodds) <a href="https://twitter.com/kentcdodds/status/783161196945944580?ref_src=twsrc%5Etfw">October 4, 2016</a></blockquote>',
5756
}),
5857
),
5958
),
@@ -75,7 +74,7 @@ test('smoke test', async () => {
7574
],
7675
],
7776
})
78-
.use(html)
77+
.use(remarkHTML, {sanitize: false})
7978
.process(
8079
`
8180
Here's a great tweet:
@@ -101,7 +100,7 @@ test('no config required', async () => {
101100
.use(remarkEmbedder, {
102101
transformers: [transformer],
103102
})
104-
.use(html)
103+
.use(remarkHTML, {sanitize: false})
105104
.process(`https://twitter.com/kentcdodds/status/783161196945944580`)
106105

107106
expect(result.toString()).toMatchInlineSnapshot(
@@ -117,7 +116,7 @@ test('config can be a function', async () => {
117116
.use(remarkEmbedder, {
118117
transformers: [[transformer, config]],
119118
})
120-
.use(html)
119+
.use(remarkHTML, {sanitize: false})
121120
.process(`https://twitter.com/kentcdodds/status/783161196945944580`)
122121

123122
expect(result.toString()).toMatchInlineSnapshot(
@@ -131,7 +130,7 @@ test('config function does not need to return anything', async () => {
131130
.use(remarkEmbedder, {
132131
transformers: [[transformer, config]],
133132
})
134-
.use(html)
133+
.use(remarkHTML, {sanitize: false})
135134
.process(`https://twitter.com/kentcdodds/status/783161196945944580`)
136135

137136
expect(result.toString()).toMatchInlineSnapshot(
@@ -162,7 +161,7 @@ test('sends the correct search params', async () => {
162161
],
163162
],
164163
})
165-
.use(html)
164+
.use(remarkHTML, {sanitize: false})
166165
.process(`https://twitter.com/kentcdodds/status/783161196945944580`)
167166

168167
// @ts-expect-error it doesn't think request will be assigned by now... But it will!

0 commit comments

Comments
 (0)