Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 20, 2021
1 parent d2cd488 commit e1f3de0
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 51 deletions.
53 changes: 28 additions & 25 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ import fs from 'fs'
import notifier from 'update-notifier'
import supportsColor from 'supports-color'
import meow from 'meow'
import engine from 'unified-engine'
import unified from 'unified'
import markdown from 'remark-parse'
import html from 'rehype-parse'
import frontmatter from 'remark-frontmatter'
import mdx from 'remark-mdx'
import english from 'retext-english'
import remark2retext from 'remark-retext'
import rehype2retext from 'rehype-retext'
import defaultReporter from 'vfile-reporter'
import equality from 'retext-equality'
import profanities from 'retext-profanities'
import diff from 'unified-diff'
import {engine} from 'unified-engine'
import {unified} from 'unified'
import rehypeParse from 'rehype-parse'
import remarkParse from 'remark-parse'
import remarkFrontmatter from 'remark-frontmatter'
import remarkGfm from 'remark-gfm'
import remarkMdx from 'remark-mdx'
import retextEnglish from 'retext-english'
import remarkRetext from 'remark-retext'
import rehypeRetext from 'rehype-retext'
import vfileReporter from 'vfile-reporter'
import retextEquality from 'retext-equality'
import retextProfanities from 'retext-profanities'
import unifiedDiff from 'unified-diff'
import {filter} from './filter.js'

const pack = JSON.parse(
Expand Down Expand Up @@ -63,6 +64,7 @@ var cli = meow(
' $ alex'
].join('\n'),
{
importMeta: import.meta,
flags: {
version: {type: 'boolean', alias: 'v'},
help: {type: 'boolean', alias: 'h'},
Expand Down Expand Up @@ -110,7 +112,7 @@ engine(
rcName: '.alexrc',
packageField: 'alex',
color: supportsColor.stderr,
reporter: cli.flags.reporter || defaultReporter,
reporter: cli.flags.reporter || vfileReporter,
reporterOptions: {
verbose: cli.flags.why
},
Expand All @@ -129,24 +131,25 @@ engine(
function transform(options) {
var settings = options || {}
var plugins = [
english,
[profanities, {sureness: settings.profanitySureness}],
[equality, {noBinary: settings.noBinary}]
retextEnglish,
[retextProfanities, {sureness: settings.profanitySureness}],
[retextEquality, {noBinary: settings.noBinary}]
]

if (cli.flags.html) {
plugins = [html, [rehype2retext, unified().use({plugins: plugins})]]
plugins = [rehypeParse, [rehypeRetext, unified().use({plugins: plugins})]]
} else if (cli.flags.mdx) {
plugins = [
markdown,
mdx,
[remark2retext, unified().use({plugins: plugins})]
remarkParse,
remarkMdx,
[remarkRetext, unified().use({plugins: plugins})]
]
} else if (!cli.flags.text) {
plugins = [
markdown,
[frontmatter, ['yaml', 'toml']],
[remark2retext, unified().use({plugins: plugins})]
remarkParse,
remarkGfm,
[remarkFrontmatter, ['yaml', 'toml']],
[remarkRetext, unified().use({plugins: plugins})]
]
}

Expand All @@ -155,7 +158,7 @@ function transform(options) {
// Hard to check.
/* c8 ignore next 3 */
if (cli.flags.diff) {
plugins.push(diff)
plugins.push(unifiedDiff)
}

return {plugins: plugins}
Expand Down
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import VFile from 'vfile'
import unified from 'unified'
import {VFile} from 'vfile'
import {unified} from 'unified'
import remarkParse from 'remark-parse'
import remarkGfm from 'remark-gfm'
import remarkFrontmatter from 'remark-frontmatter'
import remarkMdx from 'remark-mdx'
import rehypeParse from 'rehype-parse'
Expand All @@ -9,7 +10,7 @@ import retextEquality from 'retext-equality'
import retextProfanities from 'retext-profanities'
import remarkRetext from 'remark-retext'
import rehypeRetext from 'rehype-retext'
import sort from 'vfile-sort'
import {sort} from 'vfile-sort'
import {filter} from './filter.js'

function makeText(config) {
Expand Down Expand Up @@ -54,6 +55,7 @@ export function markdown(value, config) {
config,
unified()
.use(remarkParse)
.use(remarkGfm)
.use(remarkFrontmatter, ['yaml', 'toml'])
.use(remarkRetext, makeText(config))
)
Expand Down
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,25 @@
"cli.js"
],
"dependencies": {
"meow": "^7.0.0",
"rehype-parse": "^7.0.0",
"rehype-retext": "^2.0.1",
"remark-frontmatter": "^2.0.0",
"remark-mdx": "2.0.0-next.7",
"remark-message-control": "^6.0.0",
"remark-parse": "^8.0.0",
"remark-retext": "^4.0.0",
"retext-english": "^3.0.0",
"retext-equality": "~5.5.0",
"retext-profanities": "~6.1.0",
"unified": "^9.0.0",
"unified-diff": "^3.0.0",
"unified-engine": "^8.0.0",
"update-notifier": "^4.0.0",
"vfile": "^4.0.0",
"vfile-reporter": "^6.0.0",
"vfile-sort": "^2.0.0"
"meow": "^10.0.0",
"rehype-parse": "^8.0.0",
"rehype-retext": "^3.0.0",
"remark-frontmatter": "^4.0.0",
"remark-gfm": "^3.0.0",
"remark-mdx": "2.0.0-rc.1",
"remark-message-control": "^7.0.0",
"remark-parse": "^10.0.0",
"remark-retext": "^5.0.0",
"retext-english": "^4.0.0",
"retext-equality": "~6.3.0",
"retext-profanities": "~7.1.0",
"unified": "^10.0.0",
"unified-diff": "^4.0.0",
"unified-engine": "^9.0.0",
"update-notifier": "^5.0.0",
"vfile": "^5.0.0",
"vfile-reporter": "^7.0.0",
"vfile-sort": "^3.0.0"
},
"devDependencies": {
"c8": "^7.10.0",
Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ We use [`cuss`][cuss], which has a dictionary of words that have a rating
between 0 and 2 of how likely it is that a word or phrase is a profanity (not
how “bad” it is):

| Rating | Use as a profanity | Use in clean text | Example |
| ------ | ------------------ | ----------------- | ------- |
| 2 | likely | unlikely | asshat |
| 1 | maybe | maybe | addict |
| 0 | unlikely | likely | beaver |
| Rating | Use as a profanity | Use in clean text | Example |
| ------ | ------------------ | ----------------- | -------- |
| 2 | likely | unlikely | `asshat` |
| 1 | maybe | maybe | `addict` |
| 0 | unlikely | likely | `beaver` |

The `profanitySureness` field is the minimum rating (including) that you want to
check for.
Expand Down

0 comments on commit e1f3de0

Please sign in to comment.