Skip to content

Commit

Permalink
Rename remark related imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydenseric committed Aug 7, 2021
1 parent 42b62f1 commit b899acd
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Patch

- Updated dependencies.
- Renamed remark related imports.

## 11.0.1

Expand Down
6 changes: 3 additions & 3 deletions private/jsdocDataMdToMdAst.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gfm from 'remark-gfm';
import parse from 'remark-parse';
import remarkGfm from 'remark-gfm';
import remarkParse from 'remark-parse';
import { unified } from 'unified';
import { removePosition } from 'unist-util-remove-position';
import CodeLocation from './CodeLocation.mjs';
Expand Down Expand Up @@ -129,7 +129,7 @@ export default function jsdocDataMdToMdAst(jsdocData, members, codeFiles) {
// technically more efficient and harmless to the public API, it bloats
// private test snapshots.
return removePosition(
unified().use(parse).use(gfm).parse(unescapeJsdoc(replacedMd)),
unified().use(remarkParse).use(remarkGfm).parse(unescapeJsdoc(replacedMd)),

// Delete the `position` properties from nodes instead of only replacing
// their values with `undefined`.
Expand Down
8 changes: 4 additions & 4 deletions private/membersToMdAst.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import remarkBehead from 'remark-behead';
import gfm from 'remark-gfm';
import toc from 'remark-toc';
import remarkGfm from 'remark-gfm';
import remarkToc from 'remark-toc';
import { unified } from 'unified';
import InvalidJsdocError from './InvalidJsdocError.mjs';
import deconstructJsdocNamepath from './deconstructJsdocNamepath.mjs';
Expand Down Expand Up @@ -479,8 +479,8 @@ export default function membersToMdAst(members, codeFiles, topDepth = 1) {
});

const mdAstWithToC = unified()
.use(gfm)
.use(toc, {
.use(remarkGfm)
.use(remarkToc, {
// Prettier formatting.
tight: true,
skip: 'Fires|See|Examples',
Expand Down
12 changes: 6 additions & 6 deletions private/replaceMdSection.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gfm from 'remark-gfm';
import parse from 'remark-parse';
import stringify from 'remark-stringify';
import remarkGfm from 'remark-gfm';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import { unified } from 'unified';
import REMARK_STRINGIFY_OPTIONS from './REMARK_STRINGIFY_OPTIONS.mjs';
import remarkPluginReplaceSection from './remarkPluginReplaceSection.mjs';
Expand Down Expand Up @@ -38,9 +38,9 @@ export default function replaceMdSection(
throw new TypeError('Argument 3 `replacementMdAst` must be an object.');

return unified()
.use(parse)
.use(gfm)
.use(stringify, REMARK_STRINGIFY_OPTIONS)
.use(remarkParse)
.use(remarkGfm)
.use(remarkStringify, REMARK_STRINGIFY_OPTIONS)
.use(remarkPluginReplaceSection, {
targetHeading,
replacementAst: replacementMdAst,
Expand Down
8 changes: 4 additions & 4 deletions test/membersToMdAstSnapshot.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gfm from 'remark-gfm';
import stringify from 'remark-stringify';
import remarkGfm from 'remark-gfm';
import remarkStringify from 'remark-stringify';
import snapshot from 'snapshot-assertion';
import { unified } from 'unified';
import REMARK_STRINGIFY_OPTIONS from '../private/REMARK_STRINGIFY_OPTIONS.mjs';
Expand Down Expand Up @@ -55,8 +55,8 @@ export default async function membersToMdAstSnapshot(
);

const md = unified()
.use(gfm)
.use(stringify, REMARK_STRINGIFY_OPTIONS)
.use(remarkGfm)
.use(remarkStringify, REMARK_STRINGIFY_OPTIONS)
.stringify(mdAst);

await snapshot(
Expand Down
8 changes: 4 additions & 4 deletions test/private/remarkPluginReplaceSection.test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { deepStrictEqual, throws } from 'assert';
import gfm from 'remark-gfm';
import remarkGfm from 'remark-gfm';
import { unified } from 'unified';
import remarkPluginReplaceSection from '../../private/remarkPluginReplaceSection.mjs';

Expand All @@ -25,7 +25,7 @@ export default (tests) => {
tests.add('`remarkPluginReplaceSection` with defaults.', () => {
deepStrictEqual(
unified()
.use(gfm)
.use(remarkGfm)
.use(remarkPluginReplaceSection)
.runSync({
type: 'root',
Expand Down Expand Up @@ -72,7 +72,7 @@ export default (tests) => {
tests.add('`remarkPluginReplaceSection` with options.', () => {
deepStrictEqual(
unified()
.use(gfm)
.use(remarkGfm)
.use(remarkPluginReplaceSection, {
targetHeading: 'A',
replacementAst: {
Expand Down Expand Up @@ -163,7 +163,7 @@ export default (tests) => {

tests.add('`remarkPluginReplaceSection` with a missing heading.', () => {
throws(() => {
unified().use(gfm).use(remarkPluginReplaceSection).runSync({
unified().use(remarkGfm).use(remarkPluginReplaceSection).runSync({
type: 'root',
children: [],
});
Expand Down
8 changes: 4 additions & 4 deletions test/private/typeAstToMdAst.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { throws } from 'assert';
import gfm from 'remark-gfm';
import stringify from 'remark-stringify';
import remarkGfm from 'remark-gfm';
import remarkStringify from 'remark-stringify';
import snapshot from 'snapshot-assertion';
import { unified } from 'unified';
import REMARK_STRINGIFY_OPTIONS from '../../private/REMARK_STRINGIFY_OPTIONS.mjs';
Expand Down Expand Up @@ -97,8 +97,8 @@ export default (tests) => {

await snapshot(
unified()
.use(gfm)
.use(stringify, REMARK_STRINGIFY_OPTIONS)
.use(remarkGfm)
.use(remarkStringify, REMARK_STRINGIFY_OPTIONS)
.stringify({
type: 'root',
children: [
Expand Down

0 comments on commit b899acd

Please sign in to comment.