Skip to content

Commit

Permalink
Change to use exports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 18, 2023
1 parent 6561ed3 commit 796d7b9
Show file tree
Hide file tree
Showing 29 changed files with 34 additions and 35 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion test/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down
4 changes: 2 additions & 2 deletions test/completers.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @typedef {import('../index.js').FileSet} FileSet
* @typedef {import('unified-engine').FileSet} FileSet
*/

import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import {sep} from 'node:path'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
2 changes: 1 addition & 1 deletion test/configuration-default.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
2 changes: 1 addition & 1 deletion test/configuration-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
import {sep} from 'node:path'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down
2 changes: 1 addition & 1 deletion test/configuration-presets.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down
6 changes: 3 additions & 3 deletions test/configuration-transform.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @typedef {import('../index.js').Preset['plugins']} Plugins
* @typedef {import('../index.js').Preset['settings']} Settings
* @typedef {import('unified-engine').Preset['plugins']} Plugins
* @typedef {import('unified-engine').Preset['settings']} Settings
* @typedef {import('../lib/configuration.js').Configuration} Configuration
*/

Expand All @@ -15,7 +15,7 @@

import assert from 'node:assert/strict'
import test from 'node:test'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
2 changes: 1 addition & 1 deletion test/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
import {sep} from 'node:path'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down
4 changes: 2 additions & 2 deletions test/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import assert from 'node:assert/strict'
import test from 'node:test'
import {promisify} from 'node:util'
import {unified} from 'unified'
import {engine} from '../index.js'
import {engine} from 'unified-engine'

const run = promisify(engine)

test('engine', 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('unified-engine')).sort(), [
'Configuration',
'engine'
])
Expand Down
2 changes: 1 addition & 1 deletion test/file-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {sep} from 'node:path'
import {PassThrough} from 'node:stream'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {plugins: [['./plugin.js', {one: true, two: true}]]}

export default config
2 changes: 1 addition & 1 deletion test/fixtures/config-plugins-reconfigure-off/preset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {
plugins: {
'./plugin.js': null
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/config-plugins-reconfigure/preset/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {
plugins: [
['./array-to-object.js', ['charlie']],
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/config-preset-plugins-reconfigure/.foorc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import preset from './preset/index.js'
import plugin from './preset/plugin.js'

/** @type {import('../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {
plugins: [preset, [plugin, {three: true, two: false}]]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import plugin from './plugin.js'

/** @type {import('../../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {plugins: [[plugin, {one: true, two: true}]]}

export default config
2 changes: 1 addition & 1 deletion test/fixtures/config-presets-local/preset/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {
plugins: {
'./plugin.js': {one: true, two: true}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {plugins: {'./plugin.js': null}}

export default config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {settings: {alpha: false}}

export default config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {settings: {alpha: false}}

export default config
2 changes: 1 addition & 1 deletion test/fixtures/rc-module-mjs/.foorc.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {
settings: {
foo: 'bar'
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/rc-script/.foorc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('../../../index.js').Preset} */
/** @type {import('unified-engine').Preset} */
const config = {settings: {}}

export default config
2 changes: 1 addition & 1 deletion test/ignore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {fileURLToPath} from 'node:url'
import {join, relative, sep} from 'node:path'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down
2 changes: 1 addition & 1 deletion test/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import test from 'node:test'
import {promisify} from 'node:util'
import {unified} from 'unified'
import {VFile} from 'vfile'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down
2 changes: 1 addition & 1 deletion test/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'node:fs/promises'
import {PassThrough} from 'node:stream'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
2 changes: 1 addition & 1 deletion test/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import fs from 'node:fs/promises'
import {sep} from 'node:path'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from 'unified-engine'
import {VFile} from 'vfile'
import {engine} from '../index.js'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down
4 changes: 2 additions & 2 deletions test/reporting.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @typedef {import('unist').Literal} Literal
* @typedef {import('../index.js').VFileReporter} VFileReporter
* @typedef {import('unified-engine').VFileReporter} VFileReporter
*/

import {fileURLToPath} from 'node:url'
Expand All @@ -10,7 +10,7 @@ import test from 'node:test'
import {promisify} from 'node:util'
import stripAnsi from 'strip-ansi'
import vfileReporterPretty from 'vfile-reporter-pretty'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
2 changes: 1 addition & 1 deletion test/settings-and-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
2 changes: 1 addition & 1 deletion test/stdin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'node:fs/promises'
import {PassThrough} from 'node:stream'
import test from 'node:test'
import {promisify} from 'node:util'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'

Expand Down
2 changes: 1 addition & 1 deletion test/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {PassThrough} from 'node:stream'
import test from 'node:test'
import {promisify} from 'node:util'
import {VFile} from 'vfile'
import {engine} from '../index.js'
import {engine} from 'unified-engine'
import {cleanError} from './util/clean-error.js'
import {noop} from './util/noop-processor.js'
import {spy} from './util/spy.js'
Expand Down

0 comments on commit 796d7b9

Please sign in to comment.