Skip to content

Commit

Permalink
Update dependencies, etc
Browse files Browse the repository at this point in the history
Closes GH-#30.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
tusbar committed Oct 25, 2023
1 parent 8b90510 commit 6f1abc1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 30 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ jobs:
name: ${{matrix.node}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
strategy:
matrix:
node:
- lts/gallium
- lts/hydrogen
- node
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @typedef {import('mdast').Content} Content
* @typedef {import('mdast').RootContent} RootContent
* @typedef {import('mdast').Root} Root
* @typedef {Root|Content} Node
* @typedef {Root|RootContent} Node
* @typedef {Node['type']} Type
*
* @callback Handler
Expand Down
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,35 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"exports": "./index.js",
"types": "index.d.ts",
"files": [
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/mdast": "^3.0.0",
"@types/unist": "^2.0.6",
"unified": "^10.0.0"
"unified": "^11.0.0"
},
"devDependencies": {
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
"prettier": "^2.0.0",
"remark": "^14.0.0",
"remark-cli": "^10.0.0",
"remark-directive": "^2.0.0",
"remark-gfm": "^3.0.0",
"@types/mdast": "^4.0.0",
"@types/tape": "^5.0.0",
"@types/unist": "^3.0.0",
"c8": "^8.0.0",
"prettier": "^3.0.0",
"remark": "^15.0.0",
"remark-cli": "^12.0.0",
"remark-directive": "^3.0.0",
"remark-gfm": "^4.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"unist-builder": "^3.0.0",
"xo": "^0.45.0"
"typescript": "^5.0.0",
"unist-builder": "^4.0.0",
"xo": "^0.56.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" && tsc && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "prettier . -w --log-level warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ No change is needed: it works exactly the same now as it did before!
## Install

This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.
Node 16+ is needed to use it and it must be `import`ed instead of `require`d.

[npm][]:

Expand Down
8 changes: 5 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @typedef {import('unist').Node} Node
* @typedef {import('mdast').Content} Content
* @typedef {import('mdast').RootContent} RootContent
* @typedef {import('./index.js').Options} Options
*/

Expand Down Expand Up @@ -116,7 +116,7 @@ test('stripMarkdown()', (t) => {
)
t.equal(
proc('- **Hello**\n\n- World!', {keep: ['list', 'listItem']}),
'* Hello\n\n* World!',
'* Hello\n\n* World!',
'keep lists'
)
t.throws(
Expand All @@ -130,6 +130,7 @@ test('stripMarkdown()', (t) => {

// "remove" option
t.equal(
// @ts-expect-error: textDirective from mdast-util-directive.
proc('I read this :cite[smith04]!', {remove: ['textDirective']}),
'I read this !',
'remove directive'
Expand All @@ -139,10 +140,11 @@ test('stripMarkdown()', (t) => {
'A :i[lovely] language known as :abbr[HTML]{title="HyperText Markup Language"}.',
{
remove: [
// @ts-expect-error: textDirective from mdast-util-directive.
[
'textDirective',
(
/** @type {Node & {children: Content[], name: string, attributes: Record<string, string>}} */ node
/** @type {Node & {children: RootContent[], name: string, attributes: Record<string, string>}} */ node
) => {
if (node.name === 'abbr') {
return {type: 'text', value: node.attributes.title}
Expand Down
7 changes: 3 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"include": ["*.js"],
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020"],
"module": "ES2020",
"moduleResolution": "node",
"target": "es2022",
"lib": ["es2022"],
"module": "node16",
"allowJs": true,
"checkJs": true,
"declaration": true,
Expand Down

0 comments on commit 6f1abc1

Please sign in to comment.