Skip to content

Commit

Permalink
node: qualifiers on node imports
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Mar 28, 2024
1 parent 91b40c6 commit 2d906ab
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions generator/client/msw-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))}`);
Expand Down
4 changes: 2 additions & 2 deletions generator/client/type-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions generator/client/zodValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion generator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion generator/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright Oxide Computer Company
*/

import { Writable } from "stream";
import { Writable } from "node:stream";

export interface IO {
w: (str: string) => void;
Expand Down

0 comments on commit 2d906ab

Please sign in to comment.