diff --git a/src/declare.ts b/src/declare.ts new file mode 100644 index 0000000..8c4fb93 --- /dev/null +++ b/src/declare.ts @@ -0,0 +1,12 @@ +export { bigInteger } from "./declaration/big-integer.js"; +export { binary } from "./declaration/binary.js"; +export { boolean } from "./declaration/boolean.js"; +export { duration } from "./declaration/duration.js"; +export { enumeration } from "./declaration/enumeration.js"; +export { integer } from "./declaration/integer.js"; +export { kubernetesAddress } from "./declaration/kubernetes-address.js"; +export type { KubernetesAddress } from "./declaration/kubernetes-address.js"; +export { networkPortNumber } from "./declaration/network-port-number.js"; +export { number } from "./declaration/number.js"; +export { string } from "./declaration/string.js"; +export { url } from "./declaration/url.js"; diff --git a/src/index.ts b/src/index.ts index 741aed5..ab83812 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,2 @@ -export { bigInteger } from "./declaration/big-integer.js"; -export { binary } from "./declaration/binary.js"; -export { boolean } from "./declaration/boolean.js"; -export { duration } from "./declaration/duration.js"; -export { enumeration } from "./declaration/enumeration.js"; -export { integer } from "./declaration/integer.js"; -export { kubernetesAddress } from "./declaration/kubernetes-address.js"; -export type { KubernetesAddress } from "./declaration/kubernetes-address.js"; -export { networkPortNumber } from "./declaration/network-port-number.js"; -export { number } from "./declaration/number.js"; -export { string } from "./declaration/string.js"; -export { url } from "./declaration/url.js"; export { initialize } from "./environment.js"; export type { OnInvalid } from "./environment.js"; diff --git a/test/fixture/example/env.ts b/test/fixture/example/env.ts index 6f75358..759511b 100644 --- a/test/fixture/example/env.ts +++ b/test/fixture/example/env.ts @@ -11,7 +11,7 @@ import { number, string, url, -} from "../../../src/index.js"; +} from "../../../src/declare.js"; export const cdnUrl = url("CDN_URL", "CDN to use when serving static assets", { protocols: ["http:", "https:"], diff --git a/test/suite/constraint/length.spec.ts b/test/suite/constraint/length.spec.ts index b557392..2a9b524 100644 --- a/test/suite/constraint/length.spec.ts +++ b/test/suite/constraint/length.spec.ts @@ -1,11 +1,12 @@ import { beforeEach, describe, expect, it } from "vitest"; import type { LengthConstraintSpec } from "../../../src/constraint/length.js"; import type { Declaration, Options } from "../../../src/declaration.js"; +import { binary, string } from "../../../src/declare.js"; import type { DeclarationExampleOptions, Example, } from "../../../src/example.js"; -import { binary, initialize, string } from "../../../src/index.js"; +import { initialize } from "../../../src/index.js"; import { toString } from "../../../src/schema.js"; import { noop } from "../../helpers.js"; diff --git a/test/suite/constraint/range.spec.ts b/test/suite/constraint/range.spec.ts index 0fbe2dd..d97f28c 100644 --- a/test/suite/constraint/range.spec.ts +++ b/test/suite/constraint/range.spec.ts @@ -5,18 +5,18 @@ import { type RangeConstraintSpec, } from "../../../src/constraint/range.js"; import { Declaration, type Options } from "../../../src/declaration.js"; -import type { - DeclarationExampleOptions, - Example, -} from "../../../src/example.js"; import { bigInteger, duration, - initialize, integer, networkPortNumber, number, -} from "../../../src/index.js"; +} from "../../../src/declare.js"; +import type { + DeclarationExampleOptions, + Example, +} from "../../../src/example.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const { Duration } = Temporal; diff --git a/test/suite/declaration/big-integer.spec-d.ts b/test/suite/declaration/big-integer.spec-d.ts index 150f6f5..ea6e005 100644 --- a/test/suite/declaration/big-integer.spec-d.ts +++ b/test/suite/declaration/big-integer.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { bigInteger, initialize } from "../../../src/index.js"; +import { bigInteger } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Big integer declarations", () => { diff --git a/test/suite/declaration/big-integer.spec.ts b/test/suite/declaration/big-integer.spec.ts index e3b6cd6..2814b83 100644 --- a/test/suite/declaration/big-integer.spec.ts +++ b/test/suite/declaration/big-integer.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/big-integer.js"; -import { bigInteger, initialize } from "../../../src/index.js"; +import { bigInteger } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const validValueTable = [ diff --git a/test/suite/declaration/binary.spec-d.ts b/test/suite/declaration/binary.spec-d.ts index b0727a1..e80a196 100644 --- a/test/suite/declaration/binary.spec-d.ts +++ b/test/suite/declaration/binary.spec-d.ts @@ -1,6 +1,7 @@ import { Buffer } from "buffer"; import { describe, expectTypeOf, it } from "vitest"; -import { binary, initialize } from "../../../src/index.js"; +import { binary } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Binary declarations", () => { diff --git a/test/suite/declaration/binary.spec.ts b/test/suite/declaration/binary.spec.ts index c4007d8..c849698 100644 --- a/test/suite/declaration/binary.spec.ts +++ b/test/suite/declaration/binary.spec.ts @@ -2,7 +2,8 @@ import { Buffer } from "buffer"; import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/binary.js"; -import { binary, initialize } from "../../../src/index.js"; +import { binary } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const validValueTable = [ diff --git a/test/suite/declaration/boolean.spec-d.ts b/test/suite/declaration/boolean.spec-d.ts index 88434cb..1aceca5 100644 --- a/test/suite/declaration/boolean.spec-d.ts +++ b/test/suite/declaration/boolean.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { boolean, initialize } from "../../../src/index.js"; +import { boolean } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Boolean declarations", () => { diff --git a/test/suite/declaration/boolean.spec.ts b/test/suite/declaration/boolean.spec.ts index 6008159..32c27db 100644 --- a/test/suite/declaration/boolean.spec.ts +++ b/test/suite/declaration/boolean.spec.ts @@ -1,7 +1,8 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/boolean.js"; -import { boolean, initialize } from "../../../src/index.js"; +import { boolean } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Boolean declarations", () => { diff --git a/test/suite/declaration/duration.spec-d.ts b/test/suite/declaration/duration.spec-d.ts index cc12bd8..e89c1f1 100644 --- a/test/suite/declaration/duration.spec-d.ts +++ b/test/suite/declaration/duration.spec-d.ts @@ -1,6 +1,7 @@ import { Temporal } from "@js-temporal/polyfill"; import { describe, expectTypeOf, it } from "vitest"; -import { duration, initialize } from "../../../src/index.js"; +import { duration } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const { Duration } = Temporal; diff --git a/test/suite/declaration/duration.spec.ts b/test/suite/declaration/duration.spec.ts index 3c5304e..5a3c78f 100644 --- a/test/suite/declaration/duration.spec.ts +++ b/test/suite/declaration/duration.spec.ts @@ -2,7 +2,8 @@ import { Temporal } from "@js-temporal/polyfill"; import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/duration.js"; -import { duration, initialize } from "../../../src/index.js"; +import { duration } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const { Duration } = Temporal; diff --git a/test/suite/declaration/enumeration.spec-d.ts b/test/suite/declaration/enumeration.spec-d.ts index 93986ee..c7835f4 100644 --- a/test/suite/declaration/enumeration.spec-d.ts +++ b/test/suite/declaration/enumeration.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { enumeration, initialize } from "../../../src/index.js"; +import { enumeration } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Enumeration declarations", () => { diff --git a/test/suite/declaration/enumeration.spec.ts b/test/suite/declaration/enumeration.spec.ts index 80b4153..c750d76 100644 --- a/test/suite/declaration/enumeration.spec.ts +++ b/test/suite/declaration/enumeration.spec.ts @@ -1,7 +1,8 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/enumeration.js"; -import { enumeration, initialize } from "../../../src/index.js"; +import { enumeration } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Enumeration declarations", () => { diff --git a/test/suite/declaration/integer.spec-d.ts b/test/suite/declaration/integer.spec-d.ts index e5863b7..bffa49f 100644 --- a/test/suite/declaration/integer.spec-d.ts +++ b/test/suite/declaration/integer.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { initialize, integer } from "../../../src/index.js"; +import { integer } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Integer declarations", () => { diff --git a/test/suite/declaration/integer.spec.ts b/test/suite/declaration/integer.spec.ts index 3be275f..ba725ac 100644 --- a/test/suite/declaration/integer.spec.ts +++ b/test/suite/declaration/integer.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/integer.js"; -import { initialize, integer } from "../../../src/index.js"; +import { integer } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const validValueTable = [ diff --git a/test/suite/declaration/kubernetes-address.spec-d.ts b/test/suite/declaration/kubernetes-address.spec-d.ts index bb997dc..1bcc94f 100644 --- a/test/suite/declaration/kubernetes-address.spec-d.ts +++ b/test/suite/declaration/kubernetes-address.spec-d.ts @@ -1,9 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { - KubernetesAddress, - initialize, - kubernetesAddress, -} from "../../../src/index.js"; +import { KubernetesAddress, kubernetesAddress } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Kubernetes address declarations", () => { diff --git a/test/suite/declaration/kubernetes-address.spec.ts b/test/suite/declaration/kubernetes-address.spec.ts index da8035d..ceb3a73 100644 --- a/test/suite/declaration/kubernetes-address.spec.ts +++ b/test/suite/declaration/kubernetes-address.spec.ts @@ -1,11 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/kubernetes-address.js"; -import { - KubernetesAddress, - initialize, - kubernetesAddress, -} from "../../../src/index.js"; +import { KubernetesAddress, kubernetesAddress } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { quote } from "../../../src/shell.js"; import { noop } from "../../helpers.js"; diff --git a/test/suite/declaration/network-port-number.spec-d.ts b/test/suite/declaration/network-port-number.spec-d.ts index ab7c7a0..d69acd6 100644 --- a/test/suite/declaration/network-port-number.spec-d.ts +++ b/test/suite/declaration/network-port-number.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { initialize, networkPortNumber } from "../../../src/index.js"; +import { networkPortNumber } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Network port number declarations", () => { diff --git a/test/suite/declaration/network-port-number.spec.ts b/test/suite/declaration/network-port-number.spec.ts index f6bc882..7a9e19f 100644 --- a/test/suite/declaration/network-port-number.spec.ts +++ b/test/suite/declaration/network-port-number.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/network-port-number.js"; -import { initialize, networkPortNumber } from "../../../src/index.js"; +import { networkPortNumber } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const validValueTable = [ diff --git a/test/suite/declaration/number.spec-d.ts b/test/suite/declaration/number.spec-d.ts index 20860c6..2ab7cbb 100644 --- a/test/suite/declaration/number.spec-d.ts +++ b/test/suite/declaration/number.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { initialize, number } from "../../../src/index.js"; +import { number } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("Number declarations", () => { diff --git a/test/suite/declaration/number.spec.ts b/test/suite/declaration/number.spec.ts index d338d31..e961e39 100644 --- a/test/suite/declaration/number.spec.ts +++ b/test/suite/declaration/number.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/number.js"; -import { initialize, number } from "../../../src/index.js"; +import { number } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const validValueTable = [ diff --git a/test/suite/declaration/string.spec-d.ts b/test/suite/declaration/string.spec-d.ts index 4b1f51e..0694f81 100644 --- a/test/suite/declaration/string.spec-d.ts +++ b/test/suite/declaration/string.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { initialize, string } from "../../../src/index.js"; +import { string } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("String declarations", () => { diff --git a/test/suite/declaration/string.spec.ts b/test/suite/declaration/string.spec.ts index 40ad0f8..8132b1b 100644 --- a/test/suite/declaration/string.spec.ts +++ b/test/suite/declaration/string.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/string.js"; -import { initialize, string } from "../../../src/index.js"; +import { string } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("String declarations", () => { diff --git a/test/suite/declaration/url.spec-d.ts b/test/suite/declaration/url.spec-d.ts index 8a001ff..e3e73ef 100644 --- a/test/suite/declaration/url.spec-d.ts +++ b/test/suite/declaration/url.spec-d.ts @@ -1,5 +1,6 @@ import { describe, expectTypeOf, it } from "vitest"; -import { initialize, url } from "../../../src/index.js"; +import { url } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; describe("URL declarations", () => { diff --git a/test/suite/declaration/url.spec.ts b/test/suite/declaration/url.spec.ts index 0d90e23..6abd5ae 100644 --- a/test/suite/declaration/url.spec.ts +++ b/test/suite/declaration/url.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../../src/declaration.js"; import { Options } from "../../../src/declaration/url.js"; -import { initialize, url } from "../../../src/index.js"; +import { url } from "../../../src/declare.js"; +import { initialize } from "../../../src/index.js"; import { noop } from "../../helpers.js"; const validValueTable = [ diff --git a/test/suite/examples.spec.ts b/test/suite/examples.spec.ts index 6ef7007..224386e 100644 --- a/test/suite/examples.spec.ts +++ b/test/suite/examples.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { integer } from "../../src/index.js"; +import { integer } from "../../src/declare.js"; describe("Examples", () => { describe("when a declaration example violates an intrinsic constraint", () => { diff --git a/test/suite/initialize.spec.ts b/test/suite/initialize.spec.ts index 48483db..ae91a28 100644 --- a/test/suite/initialize.spec.ts +++ b/test/suite/initialize.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it, vi, type Mock } from "vitest"; import { Declaration, Options } from "../../src/declaration.js"; +import { boolean, string } from "../../src/declare.js"; import { NotSetError } from "../../src/error.js"; -import { OnInvalid, boolean, initialize, string } from "../../src/index.js"; +import { OnInvalid, initialize } from "../../src/index.js"; import { Results } from "../../src/validation.js"; import { MockConsole, createMockConsole } from "../helpers.js"; diff --git a/test/suite/sensitive.spec.ts b/test/suite/sensitive.spec.ts index d3ead4c..7414975 100644 --- a/test/suite/sensitive.spec.ts +++ b/test/suite/sensitive.spec.ts @@ -1,7 +1,8 @@ import { beforeEach, describe, expect, it } from "vitest"; import { Declaration } from "../../src/declaration.js"; import { Options } from "../../src/declaration/binary.js"; -import { binary, initialize } from "../../src/index.js"; +import { binary } from "../../src/declare.js"; +import { initialize } from "../../src/index.js"; import { noop } from "../helpers.js"; describe("Sensitive declarations", () => { diff --git a/test/suite/specification-prettier.spec.ts b/test/suite/specification-prettier.spec.ts index 39bd571..d982100 100644 --- a/test/suite/specification-prettier.spec.ts +++ b/test/suite/specification-prettier.spec.ts @@ -9,7 +9,8 @@ import { it, vi, } from "vitest"; -import { initialize, url } from "../../src/index.js"; +import { url } from "../../src/declare.js"; +import { initialize } from "../../src/index.js"; import { MockConsole, createMockConsole } from "../helpers.js"; const fixturesPath = fileURLToPath( diff --git a/test/suite/specification.spec.ts b/test/suite/specification.spec.ts index d9fb150..1237765 100644 --- a/test/suite/specification.spec.ts +++ b/test/suite/specification.spec.ts @@ -8,14 +8,14 @@ import { boolean, duration, enumeration, - initialize, integer, kubernetesAddress, networkPortNumber, number, string, url, -} from "../../src/index.js"; +} from "../../src/declare.js"; +import { initialize } from "../../src/index.js"; import { MockConsole, createMockConsole } from "../helpers.js"; const fixturesPath = fileURLToPath( diff --git a/test/suite/summary.spec.ts b/test/suite/summary.spec.ts index 70a912c..8a45621 100644 --- a/test/suite/summary.spec.ts +++ b/test/suite/summary.spec.ts @@ -8,14 +8,14 @@ import { boolean, duration, enumeration, - initialize, integer, kubernetesAddress, networkPortNumber, number, string, url, -} from "../../src/index.js"; +} from "../../src/declare.js"; +import { initialize } from "../../src/index.js"; import { MockConsole, createMockConsole } from "../helpers.js"; const fixturesPath = fileURLToPath(