From ce5d28c97442d30b52e509b08e618ea7a2ba0992 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 22 Aug 2023 15:52:29 +0200 Subject: [PATCH] Change to use `exports` --- package.json | 3 +-- test.js | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3f416b9..354d083 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,7 @@ ], "sideEffects": false, "type": "module", - "main": "index.js", - "types": "index.d.ts", + "exports": "./index.js", "files": [ "lib/", "index.d.ts", diff --git a/test.js b/test.js index 378b004..c56fe3a 100644 --- a/test.js +++ b/test.js @@ -11,13 +11,15 @@ import assert from 'node:assert/strict' import nodeStream from 'node:stream' import test from 'node:test' import {unified} from 'unified' -import {stream} from './index.js' +import {stream} from 'unified-stream' const proc = unified().use(parse).use(stringify) test('unified-stream', async function (t) { await t.test('should expose the public api', async function () { - assert.deepEqual(Object.keys(await import('./index.js')).sort(), ['stream']) + assert.deepEqual(Object.keys(await import('unified-stream')).sort(), [ + 'stream' + ]) }) const tr = stream(proc)