Skip to content

Commit

Permalink
feat!: bump with mdast-util-from-markdown with synckit
Browse files Browse the repository at this point in the history
close #218, drop node 12
  • Loading branch information
JounQin committed Dec 1, 2023
1 parent 4d9f36f commit 3d372c5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install Packages
Expand All @@ -30,7 +30,7 @@ jobs:
matrix:
os: [ubuntu-latest]
eslint: [6, 7, 8]
node: [12.22.0, 14, 16, 17, 18, 19, 20, 21]
node: [14, 16, 17, 18, 19, 20, 21]
include:
- os: windows-latest
eslint: 7
Expand All @@ -41,9 +41,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Expand Up @@ -29,9 +29,9 @@ jobs:
{ "type": "refactor", "section": "Chores", "hidden": false },
{ "type": "test", "section": "Chores", "hidden": false }
]
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
Expand Down
4 changes: 3 additions & 1 deletion lib/processor.js
Expand Up @@ -28,7 +28,9 @@

"use strict";

const parse = require("mdast-util-from-markdown");
const { createSyncFn } = require("synckit");

const parse = createSyncFn(require.resolve("./worker.mjs"));

const UNSATISFIABLE_RULES = [
"eol-last", // The Markdown parser strips trailing newlines in code fences
Expand Down
9 changes: 9 additions & 0 deletions lib/worker.mjs
@@ -0,0 +1,9 @@
import { fromMarkdown } from "mdast-util-from-markdown";
import { runAsWorker } from "synckit";

runAsWorker(
/**
* @param {string} text
*/
(text) => fromMarkdown(text)
);
8 changes: 5 additions & 3 deletions package.json
Expand Up @@ -33,7 +33,8 @@
"files": [
"index.js",
"lib/index.js",
"lib/processor.js"
"lib/processor.js",
"lib/worker.mjs"
],
"devDependencies": {
"chai": "^4.2.0",
Expand All @@ -46,12 +47,13 @@
"nyc": "^14.1.1"
},
"dependencies": {
"mdast-util-from-markdown": "^0.8.5"
"mdast-util-from-markdown": "^2.0.0",
"synckit": "^0.8.5"
},
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
"node": "^14.18.0 || >=16.0.0"
}
}

0 comments on commit 3d372c5

Please sign in to comment.