Skip to content

Commit

Permalink
fix: replace main with exports in package.json (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous authored Aug 15, 2021
1 parent 9ad515f commit 4290ff8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"tool"
],
"type": "module",
"main": "lib/index.js",
"bin": "lib/cli.js",
"types": "types/ybiq.d.ts",
"exports": "./lib/index.js",
"bin": "./lib/cli.js",
"types": "./types/ybiq.d.ts",
"files": [
"lib",
"types",
Expand Down Expand Up @@ -162,6 +162,7 @@
]
},
"rules": {
"import/no-internal-modules": "off",
"node/no-unsupported-features/es-syntax": "off"
}
},
Expand Down
12 changes: 6 additions & 6 deletions test/__snapshots__/help.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Options:
`;
exports[`with arguments [] 1`] = `
"Command failed: lib/cli.js
"Command failed: ./lib/cli.js
cli.js <command>
Commands:
Expand All @@ -40,7 +40,7 @@ Not enough non-option arguments: got 0, need at least 1
`;
exports[`with arguments []: stderr 1`] = `
[Error: Command failed: lib/cli.js
[Error: Command failed: ./lib/cli.js
cli.js <command>
Commands:
Expand All @@ -55,7 +55,7 @@ Not enough non-option arguments: got 0, need at least 1
`;
exports[`with arguments [unknown, xyz] 1`] = `
"Command failed: lib/cli.js unknown xyz
"Command failed: ./lib/cli.js unknown xyz
cli.js <command>
Commands:
Expand All @@ -70,7 +70,7 @@ Unknown arguments: unknown, xyz
`;
exports[`with arguments [unknown, xyz]: stderr 1`] = `
[Error: Command failed: lib/cli.js unknown xyz
[Error: Command failed: ./lib/cli.js unknown xyz
cli.js <command>
Commands:
Expand All @@ -85,7 +85,7 @@ Unknown arguments: unknown, xyz
`;
exports[`with arguments [unknown] 1`] = `
"Command failed: lib/cli.js unknown
"Command failed: ./lib/cli.js unknown
cli.js <command>
Commands:
Expand All @@ -100,7 +100,7 @@ Unknown argument: unknown
`;
exports[`with arguments [unknown]: stderr 1`] = `
[Error: Command failed: lib/cli.js unknown
[Error: Command failed: ./lib/cli.js unknown
cli.js <command>
Commands:
Expand Down
2 changes: 1 addition & 1 deletion test/main.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { init } from "..";
import { init } from "../lib/index.js";

test("init", () => {
expect(typeof init).toEqual("function");
Expand Down
1 change: 1 addition & 0 deletions test/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-unresolved, node/no-missing-import -- Prevent error: TS7016: Could not find a declaration file for module '../lib/index.js'
import * as ybiq from "..";

const noop = (arg?: unknown): void => {
Expand Down

0 comments on commit 4290ff8

Please sign in to comment.