@mdx-js/esbuild
Advanced tools
Comparing version 2.0.0-rc.2 to 2.0.0
@@ -16,5 +16,7 @@ /** | ||
import {promises as fs} from 'fs' | ||
import process from 'process' | ||
import {URL} from 'url' | ||
import assert from 'node:assert' | ||
import {promises as fs} from 'node:fs' | ||
import path from 'node:path' | ||
import process from 'node:process' | ||
import got from 'got' | ||
@@ -53,2 +55,3 @@ import {VFile} from 'vfile' | ||
const filterHttp = new RegExp('^https?:\\/{2}.+' + filter.source) | ||
const http = /^https?:\/{2}/ | ||
const filterHttpOrRelative = /^(https?:\/{2}|.{1,2}\/).*/ | ||
@@ -104,2 +107,3 @@ | ||
? onload({ | ||
suffix: '', | ||
// Clean search and hash from URL. | ||
@@ -116,3 +120,3 @@ path: Object.assign(new URL(href), {search: '', hash: ''}).href, | ||
/** | ||
* @param {Omit<OnLoadArgs, 'pluginData'> & {pluginData?: {contents?: string|Uint8Array}}} data | ||
* @param {Omit<OnLoadArgs, 'pluginData'> & {pluginData?: {contents?: string|Buffer}}} data | ||
* @returns {Promise<OnLoadResult>} | ||
@@ -212,7 +216,17 @@ */ | ||
// Safety check: the file has a path, so there has to be a `dirname`. | ||
assert(file.dirname, 'expected `dirname` to be defined') | ||
// V8 on Erbium. | ||
/* c8 ignore next 2 */ | ||
return {contents: value, errors, warnings, resolveDir: p.cwd()} | ||
/* c8 ignore next 9 */ | ||
return { | ||
contents: value, | ||
errors, | ||
warnings, | ||
resolveDir: http.test(file.path) | ||
? p.cwd() | ||
: path.resolve(file.cwd, file.dirname) | ||
} | ||
} | ||
} | ||
} |
{ | ||
"name": "@mdx-js/esbuild", | ||
"version": "2.0.0-rc.2", | ||
"version": "2.0.0", | ||
"description": "esbuild plugin for MDX", | ||
@@ -41,3 +41,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@mdx-js/mdx": "^2.0.0-rc.2", | ||
"@mdx-js/mdx": "^2.0.0", | ||
"got": "^11.0.0", | ||
@@ -53,5 +53,5 @@ "vfile": "^5.0.0" | ||
"@types/unist": "^2.0.0", | ||
"esbuild": "^0.13.0", | ||
"react": "^18.0.0-alpha-327d5c484-20211106", | ||
"react-dom": "^18.0.0-alpha-327d5c484-20211106", | ||
"esbuild": "^0.14.0", | ||
"react": "^18.0.0-beta-24dd07bd2-20211208", | ||
"react-dom": "^18.0.0-beta-24dd07bd2-20211208", | ||
"vfile-message": "^3.0.0" | ||
@@ -63,3 +63,3 @@ }, | ||
"test-api": "uvu test \"\\.js$\"", | ||
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api", | ||
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api", | ||
"test": "npm run build && npm run test-coverage" | ||
@@ -66,0 +66,0 @@ }, |
@@ -50,3 +50,3 @@ # `@mdx-js/esbuild` | ||
```sh | ||
npm install @mdx-js/esbuild@next | ||
npm install @mdx-js/esbuild | ||
``` | ||
@@ -57,3 +57,3 @@ | ||
```sh | ||
yarn add @mdx-js/esbuild@next | ||
yarn add @mdx-js/esbuild | ||
``` | ||
@@ -201,3 +201,3 @@ | ||
[coc]: https://github.com/mdx-js/.github/blob/HEAD/code-of-conduct.md | ||
[coc]: https://github.com/mdx-js/.github/blob/main/code-of-conduct.md | ||
@@ -204,0 +204,0 @@ [mit]: https://github.com/mdx-js/mdx/blob/main/packages/esbuild/license |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
16236
228
0
0
Updated@mdx-js/mdx@^2.0.0