remarkjs / remark

markdown processor powered by plugins part of the @unifiedjs collective
https://remark.js.org
MIT License
7.65k stars 358 forks source link

New release with updated dependencies #1231

Closed tobiasdiez closed 1 year ago

tobiasdiez commented 1 year ago

Initial checklist

Problem

Using this package via nuxt/content results in some issues since the last released version depends on older version of dependencies, see https://github.com/nuxt/content/issues/1562.

Solution

Should be resolved by https://github.com/remarkjs/remark/commit/943f6ac94bfb29e101a1dceee9ca5b3191420261, so only thing needed is a new release 😄

Alternatives

Couldn't find a workaround.

wooorm commented 1 year ago

Hey! Working on it, as you saw. Working on 100s of repos. I’ll close this for now, it’s not beneficial to have separate issues in some repos open.

I don’t understand why Nuxt results in an error. With semver, you shouldn’t get a newer micromark that doesn’t work with current remark.

github-actions[bot] commented 1 year ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

tobiasdiez commented 1 year ago

I thought a new release might be easy to do - so sorry for the added noise.

The problem in the context of nuxt/content is that some other packages depend on micromark 4 while this package here still uses v3, and nuxt has some troubles with these double versions.

wooorm commented 1 year ago

no problem about the issue/“noise”, it’s just easier for me to not try and track a couple issues scattered across different projects!

The release is ready, it’s just that I also want to release a couple remark plugins that deeply integrate with this at the same time. And that I don’t have much time this weekend. Should be monday.

and nuxt has some troubles with these double versions.

Ah. Hmm. Weird!

lucgagan commented 1 year ago

@wooorm Is this related to the issue I am getting here?

src/routines/formatMarkdown.ts:10:10 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(preset?: Preset | null | undefined): Processor<Root, undefined, undefined, Root, string>', gave the following error.
    Argument of type 'import("/Developer/rayrun/blog/node_modules/.pnpm/unified@10.1.2/node_modules/unified/index").Preset' is not assignable to parameter of type 'import("/Developer/rayrun/blog/node_modules/.pnpm/unified@11.0.3/node_modules/unified/lib/index").Preset'.
  Overload 2 of 3, '(list: PluggableList): Processor<Root, undefined, undefined, Root, string>', gave the following error.
    Argument of type 'Preset' is not assignable to parameter of type 'PluggableList'.
  Overload 3 of 3, '(plugin: Plugin<[], undefined, undefined>, ...parameters: [] | [boolean]): Processor<Root, undefined, undefined, Root, string>', gave the following error.
    Argument of type 'Preset' is not assignable to parameter of type 'Plugin<[], undefined, undefined>'.

10     .use(remarkPresetLintMarkdownStyleGuide)
import { remark } from 'remark';
import remarkLintListItemBulletIndent from 'remark-lint-list-item-bullet-indent';
import remarkLintListItemIndent from 'remark-lint-list-item-indent';
import remarkPresetLintMarkdownStyleGuide from 'remark-preset-lint-markdown-style-guide';
import remarkPresetLintRecommended from 'remark-preset-lint-recommended';

export const formatMarkdown = async (markdown: string): Promise<string> => {
  const file = await remark()
    .use(remarkPresetLintRecommended)
    .use(remarkPresetLintMarkdownStyleGuide)
    .use(remarkLintListItemIndent, 'space')
    .use(remarkLintListItemBulletIndent, 'space')
    .process(markdown);

  return file.value.toString();
};
lucgagan commented 1 year ago

I am getting it for seemingly every plugin.

lucgagan commented 1 year ago
at 09:54:27 ❯ cat package.json | grep remark
    "remark": "^15.0.1",
    "remark-gfm": "^4.0.0",
    "remark-html": "^15.0.2",
    "remark-lint-list-item-bullet-indent": "^4.1.2",
    "remark-lint-list-item-indent": "^3.1.2",
    "remark-parse": "^11.0.0",
    "remark-preset-lint-markdown-style-guide": "^5.1.3",
    "remark-preset-lint-recommended": "^6.1.3",
    "remark-toc": "^9.0.0",
wooorm commented 1 year ago

Yes, it is related. Wait a bit for me to update everything. Should be done in 2 weeks.