Skip to content

Commit

Permalink
Fix ESM output for native Node.js usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Oct 29, 2022
1 parent bdc3a78 commit 22f098a
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 21 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export NODE_OPTIONS := --experimental-vm-modules --redirect-warnings=artifacts/node-warnings

JS_SIZE_LIMIT_REQ += artifacts/dist

################################################################################
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
"size-limit-clean": "rm -rf artifacts/dist"
},
"dependencies": {
"@snout/regexp": "^0.3.0"
"@snout/regexp": "^0.3.2"
},
"devDependencies": {
"@size-limit/preset-small-lib": "^8.0.0",
"@snout/eslint-config": "^3.2.2",
"@snout/jest-config": "^2.1.0",
"@snout/tsconfig": "^2.0.0",
"@snout/jest-config": "^3.0.0",
"@snout/tsconfig": "^3.0.0",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^3.0.0",
"size-limit": "^8.0.0",
"typescript": "^4.2.3"
"typescript": "^4.8.4"
}
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export {
ParamOrString,
path,
PathPattern,
} from "./main";
} from "./main.js";
4 changes: 2 additions & 2 deletions test/unit/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as index from "../../src/index";
import { normalizeParam, path } from "../../src/main";
import * as index from "../../src/index.js";
import { normalizeParam, path } from "../../src/main.js";

describe("module index", () => {
it("should provide access to normalizeParam()", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/normalize-param.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { normalizeParam, Param } from "../../src/main";
import { normalizeParam, Param } from "../../src/main.js";

describe("normalizeParam()", () => {
it("should return Param objects unmodified", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/path.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Param, path } from "../../src/main";
import { Param, path } from "../../src/main.js";

describe("path()", () => {
describe("path.match()", () => {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/type/any-param.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AnyParam, Param } from "../../../src/main";
import { hasType } from "../../helpers";
import { AnyParam, Param } from "../../../src/main.js";
import { hasType } from "../../helpers.js";

describe("AnyParam", () => {
const a: Param<"a"> = {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/type/normalize-param.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NormalizeParam, Param } from "../../../src/main";
import { hasType } from "../../helpers";
import { NormalizeParam, Param } from "../../../src/main.js";
import { hasType } from "../../helpers.js";

describe("NormalizeParam", () => {
it("should convert string types to Param types", () => {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/type/param-arg.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Param, ParamArg } from "../../../src/main";
import { hasType } from "../../helpers";
import { Param, ParamArg } from "../../../src/main.js";
import { hasType } from "../../helpers.js";

describe("ParamArg", () => {
const a: Param<"a"> = {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/type/param-name.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Param, ParamName } from "../../../src/main";
import { hasType } from "../../helpers";
import { Param, ParamName } from "../../../src/main.js";
import { hasType } from "../../helpers.js";

describe("ParamName", () => {
const a: Param<"a"> = {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/type/param-or-string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Param, ParamOrString } from "../../../src/main";
import { hasType } from "../../helpers";
import { Param, ParamOrString } from "../../../src/main.js";
import { hasType } from "../../helpers.js";

describe("ParamOrString", () => {
const a: Param<"a"> = {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/type/param.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Param } from "../../../src/main";
import { Param } from "../../../src/main.js";

describe("Param", () => {
it("should not allow any properties to be modified", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/type/path-pattern.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { path } from "../../../src/main";
import { path } from "../../../src/main.js";

describe("PathPattern", () => {
it("should not allow any properties to be modified", () => {
Expand Down

0 comments on commit 22f098a

Please sign in to comment.