From a1d7342484fd373c1e261724335fac3d010100ea Mon Sep 17 00:00:00 2001 From: Hunar Roop Kahlon Date: Sat, 3 Aug 2024 13:32:51 -0700 Subject: [PATCH] refactor(imports): use `node:` protocol for builtins Signed-off-by: Hunar Roop Kahlon --- app/entry.server.tsx | 2 +- app/utils/cache.server.ts | 2 +- index.js | 2 +- remix.init/index.mjs | 8 ++++---- server/index.ts | 2 +- tests/e2e/note-images.test.ts | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/entry.server.tsx b/app/entry.server.tsx index 9f17da84..92cb0422 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -1,4 +1,4 @@ -import { PassThrough } from 'stream' +import { PassThrough } from 'node:stream' import { createReadableStreamFromReadable, type LoaderFunctionArgs, diff --git a/app/utils/cache.server.ts b/app/utils/cache.server.ts index 19be1ea6..618f5a04 100644 --- a/app/utils/cache.server.ts +++ b/app/utils/cache.server.ts @@ -1,4 +1,4 @@ -import fs from 'fs' +import fs from 'node:fs' import { cachified as baseCachified, verboseReporter, diff --git a/index.js b/index.js index ef699b60..bc7c79f5 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ import 'dotenv/config' -import * as fs from 'fs' +import * as fs from 'node:fs' import chalk from 'chalk' import closeWithGrace from 'close-with-grace' import sourceMapSupport from 'source-map-support' diff --git a/remix.init/index.mjs b/remix.init/index.mjs index 2815a7e0..ecb03f96 100644 --- a/remix.init/index.mjs +++ b/remix.init/index.mjs @@ -1,7 +1,7 @@ -import { execSync } from 'child_process' -import crypto from 'crypto' -import fs from 'fs/promises' -import path from 'path' +import { execSync } from 'node:child_process' +import crypto from 'node:crypto' +import fs from 'node:fs/promises' +import path from 'node:path' import toml from '@iarna/toml' import { $ } from 'execa' import inquirer from 'inquirer' diff --git a/server/index.ts b/server/index.ts index 39a4582d..33284ec8 100644 --- a/server/index.ts +++ b/server/index.ts @@ -1,4 +1,4 @@ -import crypto from 'crypto' +import crypto from 'node:crypto' import { createRequestHandler } from '@remix-run/express' import { type ServerBuild } from '@remix-run/node' import { ip as ipAddress } from 'address' diff --git a/tests/e2e/note-images.test.ts b/tests/e2e/note-images.test.ts index 44ba5a96..5b1addcb 100644 --- a/tests/e2e/note-images.test.ts +++ b/tests/e2e/note-images.test.ts @@ -1,4 +1,4 @@ -import fs from 'fs' +import fs from 'node:fs' import { faker } from '@faker-js/faker' import { type NoteImage, type Note } from '@prisma/client' import { prisma } from '#app/utils/db.server.ts'