From 813df9f964c825a7efacdc1bf5b2a4588154f96e Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 18 Sep 2023 13:12:05 +0200 Subject: [PATCH] Change to use `exports` --- package.json | 3 +-- test/index.js | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 965e09d..82c66bd 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,7 @@ ], "sideEffects": false, "type": "module", - "main": "index.js", - "types": "index.d.ts", + "exports": "./index.js", "files": [ "lib/", "index.d.ts", diff --git a/test/index.js b/test/index.js index 0c2f482..4f763ad 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,6 @@ /** * @typedef {import('mdast').Root} Root - * @typedef {import('../index.js').Options} Options + * @typedef {import('remark-frontmatter').Options} Options */ import assert from 'node:assert/strict' @@ -9,11 +9,11 @@ import process from 'node:process' import test from 'node:test' import {isHidden} from 'is-hidden' import {remark} from 'remark' -import remarkFrontmatter from '../index.js' +import remarkFrontmatter from 'remark-frontmatter' test('remarkFrontmatter', async function (t) { await t.test('should expose the public api', async function () { - assert.deepEqual(Object.keys(await import('../index.js')).sort(), [ + assert.deepEqual(Object.keys(await import('remark-frontmatter')).sort(), [ 'default' ]) })