From 49808faa2059d2c476242d19534a7ec0ee6974b7 Mon Sep 17 00:00:00 2001 From: Erin Millard Date: Tue, 5 Nov 2024 14:21:36 +1000 Subject: [PATCH] Split exports for wider runtime support --- .attw.json | 3 + package.json | 14 +++++ src/environment.ts | 60 +------------------ src/index.ts | 2 - src/initialize.ts | 57 ++++++++++++++++++ src/node.ts | 2 + test/fixture/example/run.ts | 2 +- test/suite/constraint/length.spec.ts | 3 +- test/suite/constraint/range.spec.ts | 2 +- test/suite/declaration/big-integer.spec-d.ts | 3 +- test/suite/declaration/big-integer.spec.ts | 3 +- test/suite/declaration/binary.spec-d.ts | 3 +- test/suite/declaration/binary.spec.ts | 3 +- test/suite/declaration/boolean.spec-d.ts | 3 +- test/suite/declaration/boolean.spec.ts | 3 +- test/suite/declaration/duration.spec-d.ts | 3 +- test/suite/declaration/duration.spec.ts | 3 +- test/suite/declaration/enumeration.spec-d.ts | 3 +- test/suite/declaration/enumeration.spec.ts | 3 +- test/suite/declaration/integer.spec-d.ts | 3 +- test/suite/declaration/integer.spec.ts | 3 +- .../declaration/kubernetes-address.spec-d.ts | 7 +-- .../declaration/kubernetes-address.spec.ts | 7 +-- .../declaration/network-port-number.spec-d.ts | 3 +- .../declaration/network-port-number.spec.ts | 3 +- test/suite/declaration/number.spec-d.ts | 3 +- test/suite/declaration/number.spec.ts | 3 +- test/suite/declaration/string.spec-d.ts | 3 +- test/suite/declaration/string.spec.ts | 3 +- test/suite/declaration/url.spec-d.ts | 3 +- test/suite/declaration/url.spec.ts | 3 +- test/suite/initialize.spec.ts | 3 +- test/suite/sensitive.spec.ts | 3 +- test/suite/specification-prettier.spec.ts | 3 +- test/suite/specification.spec.ts | 2 +- test/suite/summary.spec.ts | 2 +- 36 files changed, 134 insertions(+), 98 deletions(-) create mode 100644 .attw.json create mode 100644 src/initialize.ts create mode 100644 src/node.ts diff --git a/.attw.json b/.attw.json new file mode 100644 index 0000000..de5330c --- /dev/null +++ b/.attw.json @@ -0,0 +1,3 @@ +{ + "ignoreRules": ["no-resolution"] +} diff --git a/package.json b/package.json index 49f48cc..4089300 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,20 @@ "types": "./artifacts/dist/esm/index.d.ts", "default": "./artifacts/dist/esm/index.js" } + }, + "./node": { + "import": { + "types": "./artifacts/dist/esm/node.d.ts", + "default": "./artifacts/dist/esm/node.js" + }, + "require": { + "types": "./artifacts/dist/cjs/node.d.ts", + "default": "./artifacts/dist/cjs/node.js" + }, + "default": { + "types": "./artifacts/dist/esm/node.d.ts", + "default": "./artifacts/dist/esm/node.js" + } } }, "sideEffects": false, diff --git a/src/environment.ts b/src/environment.ts index 60c49be..f55bd67 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -1,10 +1,3 @@ -import { EOL } from "os"; -import { - render as renderSpecification, - type MarkdownPrettyPrintType, -} from "./specification.js"; -import { render as renderSummary } from "./summary.js"; -import { Results, validate } from "./validation.js"; import { createVariableComposite, type VariableComposite, @@ -12,38 +5,7 @@ import { } from "./variable-composite.js"; import { Variable, VariableSpec, createVariable } from "./variable.js"; -let state: State = createInitialState(); - -export type InitializeOptions = { - readonly onInvalid?: OnInvalid; - readonly markdownPrettyPrint?: MarkdownPrettyPrintType; -}; - -export async function initialize( - options: InitializeOptions = {}, -): Promise { - if (process.env.AUSTENITE_SPEC === "true") { - const { markdownPrettyPrint = "prettier" } = options; - console.log( - await renderSpecification(markdownPrettyPrint, variablesByName()), - ); - - // eslint-disable-next-line n/no-process-exit - process.exit(0); - } else { - const { onInvalid = defaultOnInvalid } = options; - const [isValid, results] = validate(variablesByName(), state.composites); - - if (!isValid) { - onInvalid({ - results, - defaultHandler() { - defaultOnInvalid({ results }); - }, - }); - } - } -} +export let state: State = createInitialState(); export function registerVariable(spec: VariableSpec): Variable { const variable = createVariable(spec); @@ -88,28 +50,10 @@ function createInitialState(): State { }; } -function defaultOnInvalid({ results }: { results: Results }): never { - console.error( - ["Environment Variables:", "", renderSummary(results)].join(EOL), - ); - - // eslint-disable-next-line n/no-process-exit - process.exit(1); - - return undefined as never; -} - -function variablesByName(): Variable[] { +export function variablesByName(): Variable[] { return Object.values(state.variables).sort(compareVariableNames); } function compareVariableNames(a: Variable, b: Variable) { return a.spec.name.localeCompare(b.spec.name); } - -export type OnInvalid = (args: OnInvalidArgs) => void; - -type OnInvalidArgs = { - readonly results: Results; - readonly defaultHandler: () => never; -}; diff --git a/src/index.ts b/src/index.ts index 741aed5..8c4fb93 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,5 +10,3 @@ 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/src/initialize.ts b/src/initialize.ts new file mode 100644 index 0000000..203f8c0 --- /dev/null +++ b/src/initialize.ts @@ -0,0 +1,57 @@ +import { EOL } from "os"; +import { state, variablesByName } from "./environment.js"; +import { + render as renderSpecification, + type MarkdownPrettyPrintType, +} from "./specification.js"; +import { render as renderSummary } from "./summary.js"; +import { validate, type Results } from "./validation.js"; + +export async function initialize( + options: InitializeOptions = {}, +): Promise { + if (process.env.AUSTENITE_SPEC === "true") { + const { markdownPrettyPrint = "prettier" } = options; + console.log( + await renderSpecification(markdownPrettyPrint, variablesByName()), + ); + + // eslint-disable-next-line n/no-process-exit + process.exit(0); + } else { + const { onInvalid = defaultOnInvalid } = options; + const [isValid, results] = validate(variablesByName(), state.composites); + + if (!isValid) { + onInvalid({ + results, + defaultHandler() { + defaultOnInvalid({ results }); + }, + }); + } + } +} + +export function defaultOnInvalid({ results }: { results: Results }): never { + console.error( + ["Environment Variables:", "", renderSummary(results)].join(EOL), + ); + + // eslint-disable-next-line n/no-process-exit + process.exit(1); + + return undefined as never; +} + +export type InitializeOptions = { + readonly onInvalid?: OnInvalid; + readonly markdownPrettyPrint?: MarkdownPrettyPrintType; +}; + +export type OnInvalid = (args: OnInvalidArgs) => void; + +type OnInvalidArgs = { + readonly results: Results; + readonly defaultHandler: () => never; +}; diff --git a/src/node.ts b/src/node.ts new file mode 100644 index 0000000..c6c19b1 --- /dev/null +++ b/src/node.ts @@ -0,0 +1,2 @@ +export { initialize } from "./initialize.js"; +export type { OnInvalid } from "./initialize.js"; diff --git a/test/fixture/example/run.ts b/test/fixture/example/run.ts index d9be2c4..6a1375e 100644 --- a/test/fixture/example/run.ts +++ b/test/fixture/example/run.ts @@ -1,4 +1,4 @@ -import { initialize } from "../../../src/index.js"; +import { initialize } from "../../../src/node.js"; import { cdnUrl, earthAtomCount, diff --git a/test/suite/constraint/length.spec.ts b/test/suite/constraint/length.spec.ts index b557392..f11f65a 100644 --- a/test/suite/constraint/length.spec.ts +++ b/test/suite/constraint/length.spec.ts @@ -5,7 +5,8 @@ import type { DeclarationExampleOptions, Example, } from "../../../src/example.js"; -import { binary, initialize, string } from "../../../src/index.js"; +import { binary, string } from "../../../src/index.js"; +import { initialize } from "../../../src/node.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..c2844a7 100644 --- a/test/suite/constraint/range.spec.ts +++ b/test/suite/constraint/range.spec.ts @@ -12,11 +12,11 @@ import type { import { bigInteger, duration, - initialize, integer, networkPortNumber, number, } from "../../../src/index.js"; +import { initialize } from "../../../src/node.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..3860625 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/index.js"; +import { initialize } from "../../../src/node.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..7a4d7f2 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/index.js"; +import { initialize } from "../../../src/node.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..215b368 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/index.js"; +import { initialize } from "../../../src/node.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..9e3ed08 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/index.js"; +import { initialize } from "../../../src/node.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..c320bc5 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/index.js"; +import { initialize } from "../../../src/node.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..8d60c23 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/index.js"; +import { initialize } from "../../../src/node.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..208287e 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/index.js"; +import { initialize } from "../../../src/node.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..cc09e1d 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/index.js"; +import { initialize } from "../../../src/node.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..5aeb99e 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/index.js"; +import { initialize } from "../../../src/node.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..1a4c8f0 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/index.js"; +import { initialize } from "../../../src/node.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..f3ed035 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/index.js"; +import { initialize } from "../../../src/node.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..2b317d5 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/index.js"; +import { initialize } from "../../../src/node.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..316230a 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/index.js"; +import { initialize } from "../../../src/node.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..48aa09b 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/index.js"; +import { initialize } from "../../../src/node.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..67f6e85 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/index.js"; +import { initialize } from "../../../src/node.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..2272653 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/index.js"; +import { initialize } from "../../../src/node.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..c932d67 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/index.js"; +import { initialize } from "../../../src/node.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..32613b0 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/index.js"; +import { initialize } from "../../../src/node.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..ba7ceb9 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/index.js"; +import { initialize } from "../../../src/node.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..100d995 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/index.js"; +import { initialize } from "../../../src/node.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..1cd9130 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/index.js"; +import { initialize } from "../../../src/node.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..52b5a6e 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/index.js"; +import { initialize } from "../../../src/node.js"; import { noop } from "../../helpers.js"; const validValueTable = [ diff --git a/test/suite/initialize.spec.ts b/test/suite/initialize.spec.ts index 48483db..9db493e 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 { NotSetError } from "../../src/error.js"; -import { OnInvalid, boolean, initialize, string } from "../../src/index.js"; +import { boolean, string } from "../../src/index.js"; +import { OnInvalid, initialize } from "../../src/node.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..3ea1342 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/index.js"; +import { initialize } from "../../src/node.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..746253b 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/index.js"; +import { initialize } from "../../src/node.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..165a6dd 100644 --- a/test/suite/specification.spec.ts +++ b/test/suite/specification.spec.ts @@ -8,7 +8,6 @@ import { boolean, duration, enumeration, - initialize, integer, kubernetesAddress, networkPortNumber, @@ -16,6 +15,7 @@ import { string, url, } from "../../src/index.js"; +import { initialize } from "../../src/node.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..90c728b 100644 --- a/test/suite/summary.spec.ts +++ b/test/suite/summary.spec.ts @@ -8,7 +8,6 @@ import { boolean, duration, enumeration, - initialize, integer, kubernetesAddress, networkPortNumber, @@ -16,6 +15,7 @@ import { string, url, } from "../../src/index.js"; +import { initialize } from "../../src/node.js"; import { MockConsole, createMockConsole } from "../helpers.js"; const fixturesPath = fileURLToPath(