Skip to content

Commit

Permalink
feat: use NodeNext module(resolution)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamiteru committed May 6, 2024
1 parent 55de328 commit e27e8bc
Show file tree
Hide file tree
Showing 76 changed files with 160 additions and 160 deletions.
2 changes: 1 addition & 1 deletion scripts/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { write } from "bun";
let content = "";
for (const file of list) {
if (file.isDirectory()) {
content += `export * from "./${file.name}";\n`;
content += `export * from "./${file.name}/index.js";\n`;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/assertions/and/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { maxValue } from "@assertions/maxValue";
import { minValue } from "@assertions/minValue";
import { number } from "@assertions/number";
import { and } from "@assertions/and/index.js";
import { maxValue } from "@assertions/maxValue/index.js";
import { minValue } from "@assertions/minValue/index.js";
import { number } from "@assertions/number/index.js";
import { fc, test } from "@fast-check/vitest";
import { assert } from "@utils/assert";
import { assert } from "@utils/assert/index.js";
import { expect } from "vitest";
import { and } from "./index";

const assertion = and([number, minValue(0), maxValue(2)]);

Expand Down
6 changes: 3 additions & 3 deletions src/assertions/and2/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { maxValue } from "@assertions/maxValue";
import { number } from "@assertions/number";
import { and2 } from "@assertions/and2/index.js";
import { maxValue } from "@assertions/maxValue/index.js";
import { number } from "@assertions/number/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";
import { and2 } from "./index";

const assertion = and2(number, maxValue(2));

Expand Down
8 changes: 4 additions & 4 deletions src/assertions/and3/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { maxValue } from "@assertions/maxValue";
import { minValue } from "@assertions/minValue";
import { number } from "@assertions/number";
import { and3 } from "@assertions/and3/index.js";
import { maxValue } from "@assertions/maxValue/index.js";
import { minValue } from "@assertions/minValue/index.js";
import { number } from "@assertions/number/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";
import { and3 } from "./index";

const assertion = and3(number, minValue(0), maxValue(2));

Expand Down
4 changes: 2 additions & 2 deletions src/assertions/array/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { number } from "@assertions/number";
import { array } from "@assertions/array/index.js";
import { number } from "@assertions/number/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";
import { array } from "./index";

const assertion = array(number);

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/array/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isArray } from "@assertions/isArray";
import { isArray } from "@assertions/isArray/index.js";
import type { Assertion } from "@the-minimal/types";

/**
Expand Down
4 changes: 2 additions & 2 deletions src/assertions/boolean/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { boolean } from "@assertions/boolean";
import { boolean } from "@assertions/boolean/index.js";
import { fc, test } from "@fast-check/vitest";
import { assert } from "@utils/assert";
import { assert } from "@utils/assert/index.js";
import { expect } from "vitest";

test.prop([fc.boolean()])(
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/boolean/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type } from "@assertions/type";
import { type } from "@assertions/type/index.js";

/**
* Checks that the value is a boolean.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/email/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { email } from "@assertions/email";
import { email } from "@assertions/email/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/email/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { regex } from "@assertions/regex";
import { regex } from "@assertions/regex/index.js";

/**
* Checks if value matches email RegExp.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/endsWith/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { endsWith } from "@assertions/endsWith";
import { endsWith } from "@assertions/endsWith/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/endsWith/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if value ends with `searchString`.
Expand Down
4 changes: 2 additions & 2 deletions src/assertions/expect/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { string } from "@assertions/string";
import { expect as _expect } from "@assertions/expect/index.js";
import { string } from "@assertions/string/index.js";
import { fc, test } from "@fast-check/vitest";
import type { Assertion } from "@the-minimal/types";
import { expect } from "vitest";
import { expect as _expect } from "./index";

const assertion: Assertion<string> = _expect(
string,
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/expect/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UnknownAssertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Wraps assertion and throws an error with message if assertion fails.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/includes/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { includes } from "@assertions/includes";
import { includes } from "@assertions/includes/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/includes/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if value includes with another value.
Expand Down
76 changes: 38 additions & 38 deletions src/assertions/index.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
export * from "./and";
export * from "./and2";
export * from "./and3";
export * from "./array";
export * from "./boolean";
export * from "./email";
export * from "./endsWith";
export * from "./expect";
export * from "./includes";
export * from "./integer";
export * from "./isArray";
export * from "./isObject";
export * from "./lazy";
export * from "./length";
export * from "./maxLength";
export * from "./maxValue";
export * from "./minLength";
export * from "./minValue";
export * from "./modulo";
export * from "./notLength";
export * from "./notValue";
export * from "./nullable";
export * from "./nullish";
export * from "./number";
export * from "./object";
export * from "./optional";
export * from "./or";
export * from "./or2";
export * from "./or3";
export * from "./rangeLength";
export * from "./rangeValue";
export * from "./regex";
export * from "./startsWith";
export * from "./string";
export * from "./tuple";
export * from "./type";
export * from "./union";
export * from "./value";
export * from "./and/index.js";
export * from "./and2/index.js";
export * from "./and3/index.js";
export * from "./array/index.js";
export * from "./boolean/index.js";
export * from "./email/index.js";
export * from "./endsWith/index.js";
export * from "./expect/index.js";
export * from "./includes/index.js";
export * from "./integer/index.js";
export * from "./isArray/index.js";
export * from "./isObject/index.js";
export * from "./lazy/index.js";
export * from "./length/index.js";
export * from "./maxLength/index.js";
export * from "./maxValue/index.js";
export * from "./minLength/index.js";
export * from "./minValue/index.js";
export * from "./modulo/index.js";
export * from "./notLength/index.js";
export * from "./notValue/index.js";
export * from "./nullable/index.js";
export * from "./nullish/index.js";
export * from "./number/index.js";
export * from "./object/index.js";
export * from "./optional/index.js";
export * from "./or/index.js";
export * from "./or2/index.js";
export * from "./or3/index.js";
export * from "./rangeLength/index.js";
export * from "./rangeValue/index.js";
export * from "./regex/index.js";
export * from "./startsWith/index.js";
export * from "./string/index.js";
export * from "./tuple/index.js";
export * from "./type/index.js";
export * from "./union/index.js";
export * from "./value/index.js";
2 changes: 1 addition & 1 deletion src/assertions/integer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { integer } from "@assertions/integer";
import { integer } from "@assertions/integer/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/integer/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if value is integer.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/isArray/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isArray } from "@assertions/isArray";
import { isArray } from "@assertions/isArray/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/isArray/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks that the value is an array.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/isObject/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isObject } from "@assertions/isObject";
import { isObject } from "@assertions/isObject/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/isObject/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks that the value is of type object and is not null.
Expand Down
8 changes: 4 additions & 4 deletions src/assertions/lazy/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { lazy } from "@assertions/lazy";
import { object } from "@assertions/object";
import { optional } from "@assertions/optional";
import { string } from "@assertions/string";
import { lazy } from "@assertions/lazy/index.js";
import { object } from "@assertions/object/index.js";
import { optional } from "@assertions/optional/index.js";
import { string } from "@assertions/string/index.js";
import { fc, test } from "@fast-check/vitest";
import type { Assertion } from "@the-minimal/types";
import { expect } from "vitest";
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/length/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { length } from "@assertions/length";
import { length } from "@assertions/length/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/length/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if length of value is equal to the provided length.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/maxLength/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { maxLength } from "@assertions/maxLength";
import { maxLength } from "@assertions/maxLength/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/maxLength/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if length of value is less than or equal to the provided length.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/maxValue/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { maxValue } from "@assertions/maxValue";
import { maxValue } from "@assertions/maxValue/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/maxValue/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if value is less than or equal to the provided length.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/minLength/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { minLength } from "@assertions/minLength";
import { minLength } from "@assertions/minLength/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/minLength/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if length of value is greater than or equal to the provided length.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/minValue/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { minValue } from "@assertions/minValue";
import { minValue } from "@assertions/minValue/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/minValue/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if value is greater than or equal to the provided length.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/modulo/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { modulo } from "@assertions/modulo/index";
import { modulo } from "@assertions/modulo/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/modulo/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if the remainer is equal to the specified value when the input is divided by the divider.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/notLength/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { notLength } from "@assertions/notLength";
import { notLength } from "@assertions/notLength/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/notLength/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if length of value is not equal to the provided length.
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/notValue/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { notValue } from "@assertions/notValue";
import { notValue } from "@assertions/notValue/index.js";
import { fc, test } from "@fast-check/vitest";
import { expect } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/assertions/notValue/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Assertion } from "@the-minimal/types";
import { ValidationError } from "@utils/error";
import { ValidationError } from "@utils/error/index.js";

/**
* Checks if value is not equal to the provided value.
Expand Down
6 changes: 3 additions & 3 deletions src/assertions/nullable/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { string } from "@assertions/string";
import { nullable } from "@assertions/nullable/index.js";
import { string } from "@assertions/string/index.js";
import { fc, test } from "@fast-check/vitest";
import { assert } from "@utils/assert";
import { assert } from "@utils/assert/index.js";
import { expect } from "vitest";
import { nullable } from "./index";

const assertion = nullable(string);

Expand Down
6 changes: 3 additions & 3 deletions src/assertions/nullish/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { string } from "@assertions/string";
import { nullish } from "@assertions/nullish/index.js";
import { string } from "@assertions/string/index.js";
import { fc, test } from "@fast-check/vitest";
import { assert } from "@utils/assert";
import { assert } from "@utils/assert/index.js";
import { expect } from "vitest";
import { nullish } from "./index";

const assertion = nullish(string);

Expand Down
Loading

0 comments on commit e27e8bc

Please sign in to comment.