Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 9, 2023
1 parent 8a56312 commit 07e2b36
Show file tree
Hide file tree
Showing 22 changed files with 5,088 additions and 4,263 deletions.
6 changes: 4 additions & 2 deletions docs/_asset/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,8 @@ button.success {
margin-block: calc(2 * (1em + 1ex));
overflow: hidden;
/* yellow */
background-image: radial-gradient(
background-image:
radial-gradient(
ellipse at 0% 0%,
rgb(252 180 45 / 5%) 20%,
rgb(252 180 45 / 0%) 80%
Expand Down Expand Up @@ -1056,7 +1057,8 @@ button.success {

.card {
/* yellow */
background-image: radial-gradient(
background-image:
radial-gradient(
ellipse at 0% 0%,
rgb(252 180 45 / 10%) 20%,
rgb(252 180 45 / 0%) 80%
Expand Down
9,066 changes: 4,912 additions & 4,154 deletions package-lock.json

Large diffs are not rendered by default.

58 changes: 12 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@
"chrome-aws-lambda": "^10.1.0",
"codemirror": "^6.0.0",
"cross-env": "^7.0.0",
"cssnano": "^5.0.0",
"cssnano": "^6.0.0",
"dlv": "^1.0.0",
"esbuild": "^0.17.0",
"esbuild": "^0.19.0",
"eslint-config-xo-react": "^0.27.0",
"eslint-plugin-es": "^4.0.0",
"eslint-plugin-react": "^7.0.0",
"eslint-plugin-react-hooks": "^4.0.0",
"eslint-plugin-security": "^1.0.0",
"estree-util-value-to-estree": "^2.0.0",
"estree-util-visit": "^1.0.0",
"globby": "^13.0.0",
Expand All @@ -57,15 +56,15 @@
"hastscript": "^7.0.0",
"highlight.js": "^11.0.0",
"husky": "^8.0.0",
"lint-staged": "^13.0.0",
"lint-staged": "^14.0.0",
"lowlight": "^2.0.0",
"p-all": "^4.0.0",
"patch-package": "^6.0.0",
"patch-package": "^8.0.0",
"periscopic": "^3.0.0",
"postcss": "^8.0.0",
"postcss-cli": "^10.0.0",
"prettier": "^2.0.0",
"puppeteer-core": "^19.0.0",
"prettier": "^3.0.0",
"puppeteer-core": "^21.0.0",
"react": "0.0.0-experimental-1159ff619-20220324",
"react-dom": "0.0.0-experimental-1159ff619-20220324",
"react-error-boundary": "^3.0.0",
Expand Down Expand Up @@ -115,7 +114,7 @@
"xast-util-feed": "^1.0.0",
"xast-util-sitemap": "^1.0.0",
"xast-util-to-xml": "^3.0.0",
"xo": "^0.54.0"
"xo": "^0.56.0"
},
"scripts": {
"postinstall": "patch-package",
Expand All @@ -130,8 +129,8 @@
"docs-prod": "npm run docs-prep && npm run docs-bundle-prod && npm run docs-generate && npm run docs-prerender && npm run docs-post",
"docs": "npm run docs-prod",
"docs-deploy": "vercel && vercel alias $(pbpaste) mdxjs.com && vercel alias $(pbpaste) www.mdxjs.com",
"format": "remark . -qfo && remark . -e mdx -u mdx -qfo && prettier . -w --loglevel warn && xo --fix",
"lint": "remark . -qf && remark . -e mdx -u mdx -qf && prettier . -c --loglevel warn && xo",
"format": "remark . -qfo && remark . -e mdx -u mdx -qfo && prettier . -w --log-level warn && xo --fix",
"lint": "remark . -qf && remark . -e mdx -u mdx -qf && prettier . -c --log-level warn && xo",
"build": "npm run build --workspaces --if-present",
"test-api": "npm run test-api --workspaces --if-present",
"test-coverage": "npm run test-coverage --workspaces --if-present",
Expand Down Expand Up @@ -165,23 +164,16 @@
"envs": [
"shared-node-browser"
],
"extensions": [
"jsx",
"cjs"
],
"prettier": true,
"rules": {
"import/extensions": "off",
"n/file-extension-in-import": "off",
"react/prop-types": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-code-point": "off",
"unicorn/prefer-at": "off",
"unicorn/prefer-logical-operator-over-ternary": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-top-level-await": "off",
"capitalized-comments": "off",
"complexity": "off",
"max-depth": "off"
"complexity": "off"
},
"overrides": [
{
Expand All @@ -194,35 +186,9 @@
},
{
"files": [
"docs/**/*.js",
"packages/{mdx,react,preact}/test/**/*.{js,jsx}",
"website/**/*.js"
"docs/**/*.js"
],
"extends": "xo-react"
},
{
"files": [
"packages/*/lib/**/*.js",
"packages/remark-mdx/index.js"
],
"extends": [
"plugin:es/restrict-to-es2019",
"plugin:security/recommended"
],
"rules": {
"security/detect-object-injection": "off"
}
},
{
"files": [
"**/*.d.ts"
],
"rules": {
"@typescript-eslint/consistent-indexed-object-style": [
"error",
"index-signature"
]
}
}
]
},
Expand Down
4 changes: 1 addition & 3 deletions packages/esbuild/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function esbuild(options) {
*/
function setup(build) {
const filter = extnamesToRegex(extnames)
/* eslint-disable-next-line security/detect-non-literal-regexp */
const filterHttp = new RegExp('^https?:\\/{2}.+' + filter.source)
const http = /^https?:\/{2}/
const filterHttpOrRelative = /^(https?:\/{2}|.{1,2}\/).*/
Expand Down Expand Up @@ -133,8 +132,7 @@ export function esbuild(options) {
data.pluginData.contents !== null &&
data.pluginData.contents !== undefined
? data.pluginData.contents
: /* eslint-disable-next-line security/detect-non-literal-fs-filename */
await fs.readFile(data.path)
: await fs.readFile(data.path)
)

let file = new VFile({value: doc, path: data.path})
Expand Down
12 changes: 10 additions & 2 deletions packages/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/unist": "^2.0.0",
"esbuild": "^0.17.0",
"esbuild": "^0.19.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"vfile-message": "^3.0.0"
Expand All @@ -61,7 +61,15 @@
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run test-coverage"
},
"xo": false,
"xo": {
"prettier": true,
"rules": {
"complexity": "off",
"n/file-extension-in-import": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-node-protocol": "off"
}
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
Expand Down
22 changes: 17 additions & 5 deletions packages/loader/index.d.cts
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
// Some TS versions use this file, some `index.d.ts`.
type LoaderContext = import('webpack').LoaderContext<unknown>
// Some TS versions use this file, some `index.d.cts`.
import type {ProcessorOptions} from '@mdx-js/mdx/lib/core.js'
import type {LoaderContext} from 'webpack'

declare function mdxLoader(this: LoaderContext, code: string): void
export = mdxLoader
/**
* A Webpack loader to compile MDX to JavaScript.
*
* [Reference for Loader API](https://webpack.js.org/api/loaders/)
*
* @this {LoaderContext<unknown>}
* @param {string} value
* The original module source code.
* @returns {void}
*/
declare function mdxLoader(this: LoaderContext<unknown>, value: string): void

export type Options = import('@mdx-js/mdx/lib/core.js').ProcessorOptions
export default mdxLoader

export type Options = ProcessorOptions
19 changes: 0 additions & 19 deletions packages/loader/index.d.ts

This file was deleted.

11 changes: 9 additions & 2 deletions packages/loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@vue/server-renderer": "^3.0.0",
"babel-loader": "^9.0.0",
"preact": "^10.0.0",
"preact-render-to-string": "^5.0.0",
"preact-render-to-string": "^6.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"vue": "^3.0.0",
Expand All @@ -71,7 +71,14 @@
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run test-coverage"
},
"xo": false,
"xo": {
"prettier": true,
"rules": {
"n/file-extension-in-import": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-string-replace-all": "off"
}
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
Expand Down
1 change: 1 addition & 0 deletions packages/loader/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ webpack.mdx:1:22: Unexpected end of file in expression, expected a corresponding
)

assert.equal(
// @ts-expect-error: preact + react conflict.
render(h(modPreact.default.default, {})),
'<h1>Hello, World!</h1>',
'should compile (preact)'
Expand Down
1 change: 0 additions & 1 deletion packages/mdx/lib/util/extnames-to-regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* Regex matching them.
*/
export function extnamesToRegex(extnames) {
// eslint-disable-next-line security/detect-non-literal-regexp
return new RegExp(
'\\.(' + extnames.map((d) => d.slice(1)).join('|') + ')([?#]|$)'
)
Expand Down
15 changes: 13 additions & 2 deletions packages/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@mdx-js/react": "^2.0.0",
"nanoid": "^4.0.0",
"preact": "^10.0.0",
"preact-render-to-string": "^5.0.0",
"preact-render-to-string": "^6.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"rehype-katex": "^6.0.0",
Expand All @@ -90,7 +90,18 @@
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run test-coverage"
},
"xo": false,
"xo": {
"prettier": true,
"rules": {
"complexity": "off",
"max-depth": "off",
"n/file-extension-in-import": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-at": "off",
"unicorn/prefer-code-point": "off",
"unicorn/prefer-node-protocol": "off"
}
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
Expand Down
33 changes: 20 additions & 13 deletions packages/mdx/test/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ test('compile', async (t) => {
await t.test(
'should support an import source (`@jsxImportSource`)',
async () => {
const node = await run(
compileSync('?', {jsxImportSource: 'preact/compat'})
)
assert.equal(
render(
h(await run(compileSync('?', {jsxImportSource: 'preact/compat'})), {})
// @ts-expect-error: this fails because react/preact types conflict.
h(node, {})
),
'<p>?</p>'
)
Expand All @@ -200,19 +204,19 @@ test('compile', async (t) => {
'should support `pragma`, `pragmaFrag` for `preact/compat`',

async () => {
const node = await run(
compileSync('<>%</>', {
jsxRuntime: 'classic',
pragma: 'preact.createElement',
pragmaFrag: 'preact.Fragment',
pragmaImportSource: 'preact/compat'
})
)

assert.equal(
render(
h(
await run(
compileSync('<>%</>', {
jsxRuntime: 'classic',
pragma: 'preact.createElement',
pragmaFrag: 'preact.Fragment',
pragmaImportSource: 'preact/compat'
})
),
{}
)
// @ts-expect-error: this fails because react/preact types conflict.
h(node, {})
),
'%'
)
Expand All @@ -223,9 +227,12 @@ test('compile', async (t) => {
'should support `jsxImportSource` for `preact`',

async () => {
const node = await run(compileSync('<>1</>', {jsxImportSource: 'preact'}))

assert.equal(
render(
h(await run(compileSync('<>1</>', {jsxImportSource: 'preact'})), {})
// @ts-expect-error: this fails because react/preact types conflict.
h(node, {})
),
'1'
)
Expand Down
1 change: 0 additions & 1 deletion packages/node-loader/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function createLoader(options) {
return defaultLoad(url, context, defaultLoad)
}

/* eslint-disable-next-line security/detect-non-literal-fs-filename */
const value = await fs.readFile(fileURLToPath(new URL(url)))
const file = await process(new VFile({value, path: new URL(url)}))
let source = String(file)
Expand Down
9 changes: 8 additions & 1 deletion packages/node-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run test-coverage"
},
"xo": false,
"xo": {
"prettier": true,
"rules": {
"n/file-extension-in-import": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-node-protocol": "off"
}
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
Expand Down

0 comments on commit 07e2b36

Please sign in to comment.