Skip to content

Commit 932c140

Browse files
wooormremcohaszing
andcommitted
Change to use exports
Closes GH-217. Co-authored-by: Remco Haszing <remcohaszing@gmail.com>
1 parent 620ccf9 commit 932c140

11 files changed

+20
-21
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
],
3939
"sideEffects": false,
4040
"type": "module",
41-
"main": "index.js",
42-
"types": "index.d.ts",
41+
"exports": "./index.js",
4342
"files": [
4443
"lib/",
4544
"index.d.ts",

test/async-function.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import assert from 'node:assert/strict'
66
import test from 'node:test'
77
import {VFile} from 'vfile'
8-
import {unified} from '../index.js'
8+
import {unified} from 'unified'
99

1010
test('async function transformer () {}', () => {
1111
const givenFile = new VFile('alpha')
@@ -16,7 +16,7 @@ test('async function transformer () {}', () => {
1616
.use(() => async function () {})
1717
.use(
1818
// Note: TS JS doesn’t understand the `Promise<undefined>` w/o explicit type.
19-
/** @type {import('../index.js').Plugin<[]>} */
19+
/** @type {import('unified').Plugin<[]>} */
2020
() =>
2121
async function () {
2222
return undefined

test/core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {unified} from '../index.js'
3+
import {unified} from 'unified'
44

55
test('unified()', () => {
66
/** @type {number} */

test/data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {unified} from '../index.js'
3+
import {unified} from 'unified'
44

55
test('data(key[, value])', () => {
66
const processor = unified()

test/freeze.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
2-
* @typedef {import('../index.js').Plugin} Plugin
2+
* @typedef {import('unified').Plugin} Plugin
33
*/
44

55
import assert from 'node:assert/strict'
66
import test from 'node:test'
7-
import {unified} from '../index.js'
7+
import {unified} from 'unified'
88
import {SimpleCompiler, SimpleParser} from './util/simple.js'
99

1010
test('freeze()', async (t) => {
@@ -78,7 +78,7 @@ test('freeze()', async (t) => {
7878
processor().freeze()
7979

8080
/**
81-
* @this {import('../index.js').Processor}
81+
* @this {import('unified').Processor}
8282
* @type {Plugin}
8383
*/
8484
function freezingPlugin() {

test/parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import assert from 'node:assert/strict'
77
import test from 'node:test'
8-
import {unified} from '../index.js'
8+
import {unified} from 'unified'
99

1010
test('parse(file)', () => {
1111
const processor = unified()

test/process.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* @typedef {import('unist').Literal} Literal
3-
* @typedef {import('../index.js').Parser} Parser
4-
* @typedef {import('../index.js').Compiler} Compiler
3+
* @typedef {import('unified').Parser} Parser
4+
* @typedef {import('unified').Compiler} Compiler
55
*/
66

77
import {Buffer} from 'node:buffer'
88
import assert from 'node:assert/strict'
99
import test from 'node:test'
1010
import {VFile} from 'vfile'
11-
import {unified} from '../index.js'
11+
import {unified} from 'unified'
1212
import {SimpleCompiler, SimpleParser} from './util/simple.js'
1313

1414
test('process(file, done)', () => {

test/run.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import process from 'node:process'
22
import assert from 'node:assert/strict'
33
import test from 'node:test'
44
import {VFile} from 'vfile'
5-
import {unified} from '../index.js'
5+
import {unified} from 'unified'
66

77
test('run(node[, file], done)', async () => {
88
const givenFile = new VFile('alpha')
@@ -144,7 +144,7 @@ test('run(node[, file], done)', async () => {
144144
unified()
145145
.use(
146146
// Note: TS JS doesn’t understand the promise w/o explicit type.
147-
/** @type {import('../index.js').Plugin<[]>} */
147+
/** @type {import('unified').Plugin<[]>} */
148148
() =>
149149
function () {
150150
return new Promise((resolve) => {
@@ -436,7 +436,7 @@ test('run(node[, file])', async () => {
436436
unified()
437437
.use(
438438
// Note: TS JS doesn’t understand the promise w/o explicit type.
439-
/** @type {import('../index.js').Plugin<[]>} */
439+
/** @type {import('unified').Plugin<[]>} */
440440
() =>
441441
function () {
442442
return new Promise((resolve) => {
@@ -661,7 +661,7 @@ test('runSync(node[, file])', async () => {
661661
unified()
662662
.use(
663663
// Note: TS JS doesn’t understand the promise w/o explicit type.
664-
/** @type {import('../index.js').Plugin<[]>} */
664+
/** @type {import('unified').Plugin<[]>} */
665665
() =>
666666
function () {
667667
return new Promise((resolve) => {

test/stringify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import assert from 'node:assert/strict'
66
import test from 'node:test'
77
import {VFile} from 'vfile'
8-
import {unified} from '../index.js'
8+
import {unified} from 'unified'
99

1010
test('stringify(node[, file])', () => {
1111
const processor = unified()

test/use.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {unified} from '../index.js'
3+
import {unified} from 'unified'
44

55
test('use(plugin[, options])', async (t) => {
66
await t.test('should ignore missing values', () => {

test/util/simple.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @typedef {import('unist').Literal} Literal
3-
* @typedef {import('../../index.js').Parser} Parser
4-
* @typedef {import('../../index.js').Compiler} Compiler
3+
* @typedef {import('unified').Parser} Parser
4+
* @typedef {import('unified').Compiler} Compiler
55
*/
66

77
/** @type {Parser} */

0 commit comments

Comments
 (0)