Skip to content

Commit

Permalink
feat: upgrade all dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This will require the latest of all unified related
deps. Additionally, it appears remark-mdx-frontmatter no longer parses
dates (part of me thinks it never did actually). That's why you'll
notice the tests got changed. As I said I don't think this ever actually
did parse dates so we're probably fine there.
  • Loading branch information
kentcdodds committed Nov 14, 2023
1 parent f1f4828 commit da24af7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 29 deletions.
51 changes: 29 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,49 @@
"validate": "kcd-scripts validate"
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@esbuild-plugins/node-resolve": "^0.1.4",
"@babel/runtime": "^7.23.2",
"@esbuild-plugins/node-resolve": "^0.2.2",
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
"@mdx-js/esbuild": "^2.0.0",
"@mdx-js/esbuild": "^3.0.0",
"gray-matter": "^4.0.3",
"remark-frontmatter": "^4.0.1",
"remark-mdx-frontmatter": "^1.1.1",
"uuid": "^8.3.2",
"vfile": "^5.3.2"
"remark-frontmatter": "^5.0.0",
"remark-mdx-frontmatter": "^4.0.0",
"uuid": "^9.0.1",
"vfile": "^6.0.1"
},
"peerDependencies": {
"esbuild": "0.*"
},
"devDependencies": {
"@testing-library/react": "^13.0.0",
"@types/jsdom": "^16.2.14",
"@types/mdx": "^2.0.1",
"@types/react": "^17.0.34",
"@types/react-dom": "^17.0.11",
"@types/uuid": "^8.3.4",
"@testing-library/react": "^14.1.0",
"@types/jsdom": "^21.1.5",
"@types/mdx": "^2.0.10",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/uuid": "^9.0.7",
"babel-eslint": "^10.1.0",
"c8": "^7.10.0",
"c8": "^8.0.1",
"cross-env": "^7.0.3",
"esbuild": "^0.14.29",
"jsdom": "^19.0.0",
"kcd-scripts": "^11.2.2",
"esbuild": "^0.19.5",
"jsdom": "^22.1.0",
"kcd-scripts": "^14.0.1",
"left-pad": "^1.3.0",
"mdx-test-data": "^1.0.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"remark-mdx-images": "^1.0.3",
"typescript": "^4.4.3",
"uvu": "^0.5.2"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remark-mdx-images": "^2.0.0",
"typescript": "^5.2.2",
"uvu": "^0.5.6"
},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js",
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"modules": true
},
"ecmaVersion": 2022
},
"rules": {
"import/extensions": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as assert from 'uvu/assert'
import React from 'react'
import rtl from '@testing-library/react'
import leftPad from 'left-pad'
import {remarkMdxImages} from 'remark-mdx-images'
import remarkMdxImages from 'remark-mdx-images'
import {VFile} from 'vfile'
import {bundleMDX} from '../index.js'
import {getMDXComponent, getMDXExport} from '../client.js'
Expand Down Expand Up @@ -417,7 +417,7 @@ test('should output assets', async () => {
)
})

test('should support importing named exports', async () => {
test.only('should support importing named exports', async () => {
const mdxSource = `
---
title: Example Post
Expand All @@ -432,13 +432,13 @@ export const uncle = 'Bob'

const result = await bundleMDX({source: mdxSource})

/** @type {import('../types').MDXExport<{uncle: string}, {title: string, published: Date, description: string}>} */
/** @type {import('../types').MDXExport<{uncle: string}, {title: string, published: string, description: string}>} */
const mdxExport = getMDXExport(result.code)

// remark-mdx-frontmatter exports frontmatter
assert.equal(mdxExport.frontmatter, {
title: 'Example Post',
published: new Date('2021-02-13'),
published: '2021-02-13',
description: 'This is some meta-data',
})

Expand Down Expand Up @@ -506,7 +506,7 @@ test('should provide VFile path to plugins', async () => {
/** @type {import('unified').Plugin} */
function plugin() {
return function transformer(tree, file) {
assert.is(file.path, '/data/mdx/my-post.mdx' )
assert.is(file.path, '/data/mdx/my-post.mdx')
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs'
import path from 'path'
import {StringDecoder} from 'string_decoder'
import {remarkMdxFrontmatter} from 'remark-mdx-frontmatter'
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
import grayMatter from 'gray-matter'
import * as esbuild from 'esbuild'
import {NodeResolvePlugin} from '@esbuild-plugins/node-resolve'
Expand Down Expand Up @@ -194,7 +194,7 @@ async function bundleMDX({
type: 'cjs',
},
}),
// eslint-disable-next-line @babel/new-cap
// eslint-disable-next-line new-cap
NodeResolvePlugin({
extensions: ['.js', '.ts', '.jsx', '.tsx'],
resolveOptions: {basedir: cwd},
Expand Down

0 comments on commit da24af7

Please sign in to comment.