From 2d906ab86756704ec203ac1eee2fe4edf1cf0bfa Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 28 Mar 2024 11:59:32 -0500 Subject: [PATCH] node: qualifiers on node imports --- generator/client/msw-handlers.ts | 4 ++-- generator/client/type-tests.ts | 4 ++-- generator/client/zodValidators.ts | 4 ++-- generator/index.ts | 2 +- generator/io.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generator/client/msw-handlers.ts b/generator/client/msw-handlers.ts index 6ea8182..32dabbf 100644 --- a/generator/client/msw-handlers.ts +++ b/generator/client/msw-handlers.ts @@ -11,8 +11,8 @@ import { initIO } from "../io"; import { refToSchemaName } from "../schema/base"; import { snakeToCamel, snakeToPascal } from "../util"; import { contentRef, iterPathConfig } from "./base"; -import path from "path"; -import fs from "fs"; +import path from "node:path"; +import fs from "node:fs"; const formatPath = (path: string) => path.replace(/{(\w+)}/g, (n) => `:${snakeToCamel(n.slice(1, -1))}`); diff --git a/generator/client/type-tests.ts b/generator/client/type-tests.ts index 2509435..d483838 100644 --- a/generator/client/type-tests.ts +++ b/generator/client/type-tests.ts @@ -9,8 +9,8 @@ import type { OpenAPIV3 } from "openapi-types"; import { initIO } from "../io"; import { getSortedSchemas } from "./base"; -import fs from "fs"; -import path from "path"; +import fs from "node:fs"; +import path from "node:path"; export function generateTypeTests(spec: OpenAPIV3.Document, destDir: string) { if (!spec.components) return; diff --git a/generator/client/zodValidators.ts b/generator/client/zodValidators.ts index 8fb1657..51ba3f8 100644 --- a/generator/client/zodValidators.ts +++ b/generator/client/zodValidators.ts @@ -11,8 +11,8 @@ import { initIO } from "../io"; import { schemaToZod } from "../schema/zod"; import { extractDoc, processParamName, snakeToPascal } from "../util"; import { docComment, getSortedSchemas } from "./base"; -import path from "path"; -import fs from "fs"; +import path from "node:path"; +import fs from "node:fs"; const HttpMethods = OpenAPIV3.HttpMethods; diff --git a/generator/index.ts b/generator/index.ts index 8c1782b..de8c99e 100644 --- a/generator/index.ts +++ b/generator/index.ts @@ -13,7 +13,7 @@ import { copyStaticFiles, generateApi } from "./client/api"; import { generateMSWHandlers } from "./client/msw-handlers"; import { generateTypeTests } from "./client/type-tests"; import { generateZodValidators } from "./client/zodValidators"; -import { resolve } from "path"; +import { resolve } from "node:path"; async function generate(specFile: string, destDir: string) { // destination directory is resolved relative to CWD diff --git a/generator/io.ts b/generator/io.ts index 13175bf..8537f5e 100644 --- a/generator/io.ts +++ b/generator/io.ts @@ -6,7 +6,7 @@ * Copyright Oxide Computer Company */ -import { Writable } from "stream"; +import { Writable } from "node:stream"; export interface IO { w: (str: string) => void;