From 4b47a7c4533c320eec9dec31b16e65b47a27107a Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Mon, 4 Sep 2023 21:15:48 +0200 Subject: [PATCH] remove node: prefix from imports fixes #323 --- src/Explorer.ts | 4 ++-- src/ExplorerBase.ts | 2 +- src/ExplorerSync.ts | 4 ++-- src/index.ts | 2 +- src/loaders.ts | 8 ++++---- test/caches.test.ts | 4 ++-- test/failed-directories.test.ts | 4 ++-- test/index.test.ts | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Explorer.ts b/src/Explorer.ts index 7eadb4b..c2f931f 100644 --- a/src/Explorer.ts +++ b/src/Explorer.ts @@ -1,5 +1,5 @@ -import fs from 'node:fs/promises'; -import path from 'node:path'; +import fs from 'fs/promises'; +import path from 'path'; import { isDirectory } from 'path-type'; import { ExplorerBase, getExtensionDescription } from './ExplorerBase.js'; import { loadJson } from './loaders.js'; diff --git a/src/ExplorerBase.ts b/src/ExplorerBase.ts index e273ce7..1e6c378 100644 --- a/src/ExplorerBase.ts +++ b/src/ExplorerBase.ts @@ -1,4 +1,4 @@ -import path from 'node:path'; +import path from 'path'; import { AsyncCache, Cache, diff --git a/src/ExplorerSync.ts b/src/ExplorerSync.ts index b25978e..699e154 100644 --- a/src/ExplorerSync.ts +++ b/src/ExplorerSync.ts @@ -1,5 +1,5 @@ -import fs from 'node:fs'; -import path from 'node:path'; +import fs from 'fs'; +import path from 'path'; import { isDirectorySync } from 'path-type'; import { ExplorerBase, getExtensionDescription } from './ExplorerBase.js'; import { loadJson } from './loaders.js'; diff --git a/src/index.ts b/src/index.ts index 57c791b..889972f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ export * from './types.js'; -import os from 'node:os'; +import os from 'os'; import { Explorer } from './Explorer.js'; import { ExplorerSync } from './ExplorerSync.js'; import { diff --git a/src/loaders.ts b/src/loaders.ts index a0ea7fd..6f0b69d 100644 --- a/src/loaders.ts +++ b/src/loaders.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import { existsSync, rmSync, writeFileSync } from 'node:fs'; -import { rm, writeFile } from 'node:fs/promises'; -import path from 'node:path'; -import { pathToFileURL } from 'node:url'; +import { existsSync, rmSync, writeFileSync } from 'fs'; +import { rm, writeFile } from 'fs/promises'; +import path from 'path'; +import { pathToFileURL } from 'url'; import { Loader, LoaderSync } from './types.js'; let importFresh: typeof import('import-fresh'); diff --git a/test/caches.test.ts b/test/caches.test.ts index 97b31f4..da0afd2 100644 --- a/test/caches.test.ts +++ b/test/caches.test.ts @@ -7,8 +7,8 @@ import { test, vi, } from 'vitest'; -import fs from 'node:fs'; -import fsPromises from 'node:fs/promises'; +import fs from 'fs'; +import fsPromises from 'fs/promises'; import { cosmiconfig, cosmiconfigSync } from '../src'; import { isNotMjs, TempDir } from './util'; diff --git a/test/failed-directories.test.ts b/test/failed-directories.test.ts index 3956e83..3d5db1f 100644 --- a/test/failed-directories.test.ts +++ b/test/failed-directories.test.ts @@ -1,6 +1,6 @@ import { beforeEach, afterAll, describe, expect, test, vi } from 'vitest'; -import fs from 'node:fs'; -import fsPromises from 'node:fs/promises'; +import fs from 'fs'; +import fsPromises from 'fs/promises'; import { cosmiconfig, cosmiconfigSync, diff --git a/test/index.test.ts b/test/index.test.ts index 5d86fa1..54b04e7 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -16,7 +16,7 @@ import { ExplorerOptions, ExplorerOptionsSync, Loaders } from '../src/types'; import { TempDir } from './util'; import { ExplorerSync } from '../src/ExplorerSync'; import { Explorer } from '../src/Explorer'; -import path from 'node:path'; +import path from 'path'; vi.mock('../src/ExplorerSync', async () => { const { ExplorerSync } = await vi.importActual<