Skip to content

Commit

Permalink
fix: export type information for node16 module resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed May 20, 2022
1 parent ada1a4f commit 39abeec
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 13 deletions.
2 changes: 2 additions & 0 deletions index.d.cts
@@ -0,0 +1,2 @@
import Ava from "./index.js";
export = Ava;
10 changes: 5 additions & 5 deletions index.d.ts
@@ -1,9 +1,9 @@
import type {TestFn} from './types/test-fn';
import type {TestFn} from './types/test-fn.js';

export * from './types/assertions';
export * from './types/try-fn';
export * from './types/test-fn';
export * from './types/subscribable';
export * from './types/assertions.js';
export * from './types/try-fn.js';
export * from './types/test-fn.js';
export * from './types/subscribable.js';

/** Call to declare a test, or chain to declare hooks or test modifiers */
declare const test: TestFn;
Expand Down
20 changes: 16 additions & 4 deletions package.json
Expand Up @@ -10,13 +10,25 @@
},
"exports": {
".": {
"import": "./entrypoints/main.mjs",
"require": "./entrypoints/main.cjs"
"import": {
"types": "./index.d.ts",
"default": "./entrypoints/main.mjs"
},
"require": {
"types": "./index.d.cts",
"default": "./entrypoints/main.cjs"
}
},
"./eslint-plugin-helper": "./entrypoints/eslint-plugin-helper.cjs",
"./plugin": {
"import": "./entrypoints/plugin.mjs",
"require": "./entrypoints/plugin.cjs"
"import": {
"types": "./plugin.d.ts",
"default": "./entrypoints/plugin.mjs"
},
"require": {
"types": "./plugin.d.cts",
"default": "./entrypoints/plugin.cjs"
}
}
},
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions plugin.d.cts
@@ -0,0 +1 @@
export * from "./plugin.js";
File renamed without changes.
6 changes: 3 additions & 3 deletions types/test-fn.d.ts
@@ -1,6 +1,6 @@
import type {Assertions} from './assertions';
import type {Subscribable} from './subscribable';
import type {TryFn} from './try-fn';
import type {Assertions} from './assertions.js';
import type {Subscribable} from './subscribable.js';
import type {TryFn} from './try-fn.js';

/** The `t` value passed to test & hook implementations. */
export interface ExecutionContext<Context = unknown> extends Assertions {
Expand Down
2 changes: 1 addition & 1 deletion types/try-fn.d.ts
@@ -1,4 +1,4 @@
import type {Implementation} from './test-fn';
import type {Implementation} from './test-fn.js';

export type CommitDiscardOptions = {
/**
Expand Down

0 comments on commit 39abeec

Please sign in to comment.