From 954ce44c1d0ec4cb9d91a0476403c60da17a1db2 Mon Sep 17 00:00:00 2001 From: Scott Doxey Date: Sat, 13 Apr 2024 15:11:14 -0400 Subject: [PATCH 1/2] Added node namespace to node packages. --- bin/version.js | 4 ++-- packages/doxdox-cli/src/index.test.ts | 6 +++--- packages/doxdox-cli/src/index.ts | 10 +++++----- packages/doxdox-core/src/loader.ts | 4 ++-- packages/doxdox-core/src/utils.test.ts | 4 ++-- packages/doxdox-core/src/utils.ts | 6 +++--- packages/doxdox-parser-custom/src/index.ts | 4 ++-- packages/doxdox-parser-dox/src/index.ts | 2 +- packages/doxdox-parser-jsdoc/src/index.ts | 8 ++++---- packages/doxdox-parser-template/src/index.ts | 4 ++-- packages/doxdox-renderer-dash/src/index.ts | 2 +- packages/doxdox-renderer-github-wiki/src/index.ts | 2 +- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/bin/version.js b/bin/version.js index 1d729929..0f83250d 100755 --- a/bin/version.js +++ b/bin/version.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -import { join } from 'path'; +import { join } from 'node:path'; -import { readFile, writeFile } from 'fs/promises'; +import { readFile, writeFile } from 'node:fs/promises'; import semver from 'semver'; diff --git a/packages/doxdox-cli/src/index.test.ts b/packages/doxdox-cli/src/index.test.ts index b7da2ff3..a4125901 100644 --- a/packages/doxdox-cli/src/index.test.ts +++ b/packages/doxdox-cli/src/index.test.ts @@ -1,8 +1,8 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; -import { promisify } from 'util'; +import { promisify } from 'node:util'; -import { exec } from 'child_process'; +import { exec } from 'node:child_process'; const execAsync = promisify(exec); diff --git a/packages/doxdox-cli/src/index.ts b/packages/doxdox-cli/src/index.ts index 7414536b..a943af74 100644 --- a/packages/doxdox-cli/src/index.ts +++ b/packages/doxdox-cli/src/index.ts @@ -1,14 +1,14 @@ #!/usr/bin/env node -import { EOL, homedir } from 'os'; +import { EOL, homedir } from 'node:os'; -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; -import { dirname, join, resolve } from 'path'; +import { dirname, join, resolve } from 'node:path'; -import { execSync } from 'child_process'; +import { execSync } from 'node:child_process'; -import { fileURLToPath } from 'url'; +import { fileURLToPath } from 'node:url'; import { globby } from 'globby'; diff --git a/packages/doxdox-core/src/loader.ts b/packages/doxdox-core/src/loader.ts index 516c6b9a..686246f5 100644 --- a/packages/doxdox-core/src/loader.ts +++ b/packages/doxdox-core/src/loader.ts @@ -1,6 +1,6 @@ -import { join, resolve } from 'path'; +import { join, resolve } from 'node:path'; -import { pathToFileURL } from 'url'; +import { pathToFileURL } from 'node:url'; import { getProjectPackage, isDirectory, isFile } from './utils.js'; diff --git a/packages/doxdox-core/src/utils.test.ts b/packages/doxdox-core/src/utils.test.ts index 9239ae2b..0774df68 100644 --- a/packages/doxdox-core/src/utils.test.ts +++ b/packages/doxdox-core/src/utils.test.ts @@ -1,6 +1,6 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; -import { join } from 'path'; +import { join } from 'node:path'; import { findFileInPath, diff --git a/packages/doxdox-core/src/utils.ts b/packages/doxdox-core/src/utils.ts index 3f4e1dbc..13e125bc 100644 --- a/packages/doxdox-core/src/utils.ts +++ b/packages/doxdox-core/src/utils.ts @@ -1,8 +1,8 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; -import { resolve, dirname } from 'path'; +import { resolve, dirname } from 'node:path'; -import { fileURLToPath } from 'url'; +import { fileURLToPath } from 'node:url'; import normalizeData from 'normalize-package-data'; diff --git a/packages/doxdox-parser-custom/src/index.ts b/packages/doxdox-parser-custom/src/index.ts index 449978a4..0e19bb87 100644 --- a/packages/doxdox-parser-custom/src/index.ts +++ b/packages/doxdox-parser-custom/src/index.ts @@ -1,6 +1,6 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; -import { join } from 'path'; +import { join } from 'node:path'; import { File, Method, multiLinePatternMatch, slugify } from 'doxdox-core'; diff --git a/packages/doxdox-parser-dox/src/index.ts b/packages/doxdox-parser-dox/src/index.ts index dd38bb1e..5dd12c43 100644 --- a/packages/doxdox-parser-dox/src/index.ts +++ b/packages/doxdox-parser-dox/src/index.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; import { slugify } from 'doxdox-core'; diff --git a/packages/doxdox-parser-jsdoc/src/index.ts b/packages/doxdox-parser-jsdoc/src/index.ts index 3601b6fd..e3d54420 100644 --- a/packages/doxdox-parser-jsdoc/src/index.ts +++ b/packages/doxdox-parser-jsdoc/src/index.ts @@ -1,10 +1,10 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; -import { fileURLToPath } from 'url'; +import { fileURLToPath } from 'node:url'; -import { platform } from 'os'; +import { platform } from 'node:os'; -import { dirname, join } from 'path'; +import { dirname, join } from 'node:path'; import spawn from 'spawn-please'; diff --git a/packages/doxdox-parser-template/src/index.ts b/packages/doxdox-parser-template/src/index.ts index 0408fed2..942ba9c4 100644 --- a/packages/doxdox-parser-template/src/index.ts +++ b/packages/doxdox-parser-template/src/index.ts @@ -1,6 +1,6 @@ -import { promises as fs } from 'fs'; +import { promises as fs } from 'node:fs'; -import { join } from 'path'; +import { join } from 'node:path'; import { File } from 'doxdox-core'; diff --git a/packages/doxdox-renderer-dash/src/index.ts b/packages/doxdox-renderer-dash/src/index.ts index 3e4f9454..77d44be3 100644 --- a/packages/doxdox-renderer-dash/src/index.ts +++ b/packages/doxdox-renderer-dash/src/index.ts @@ -1,4 +1,4 @@ -import { join } from 'path'; +import { join } from 'node:path'; import admzip from 'adm-zip'; diff --git a/packages/doxdox-renderer-github-wiki/src/index.ts b/packages/doxdox-renderer-github-wiki/src/index.ts index 297007d2..5bf0c26b 100644 --- a/packages/doxdox-renderer-github-wiki/src/index.ts +++ b/packages/doxdox-renderer-github-wiki/src/index.ts @@ -1,4 +1,4 @@ -import { join } from 'path'; +import { join } from 'node:path'; import admzip from 'adm-zip'; From f102f07c6f56da29d0b3ad6f8db99ce70504778a Mon Sep 17 00:00:00 2001 From: Scott Doxey Date: Sat, 13 Apr 2024 15:18:52 -0400 Subject: [PATCH 2/2] Changed fs import. --- packages/doxdox-cli/src/index.test.ts | 2 +- packages/doxdox-cli/src/index.ts | 2 +- packages/doxdox-core/src/utils.test.ts | 2 +- packages/doxdox-core/src/utils.ts | 2 +- packages/doxdox-parser-custom/src/index.ts | 2 +- packages/doxdox-parser-dox/src/index.ts | 2 +- packages/doxdox-parser-jsdoc/src/index.ts | 2 +- packages/doxdox-parser-template/src/index.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/doxdox-cli/src/index.test.ts b/packages/doxdox-cli/src/index.test.ts index a4125901..9d059e3a 100644 --- a/packages/doxdox-cli/src/index.test.ts +++ b/packages/doxdox-cli/src/index.test.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { promisify } from 'node:util'; diff --git a/packages/doxdox-cli/src/index.ts b/packages/doxdox-cli/src/index.ts index a943af74..9fc33d03 100644 --- a/packages/doxdox-cli/src/index.ts +++ b/packages/doxdox-cli/src/index.ts @@ -2,7 +2,7 @@ import { EOL, homedir } from 'node:os'; -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { dirname, join, resolve } from 'node:path'; diff --git a/packages/doxdox-core/src/utils.test.ts b/packages/doxdox-core/src/utils.test.ts index 0774df68..a193a3c5 100644 --- a/packages/doxdox-core/src/utils.test.ts +++ b/packages/doxdox-core/src/utils.test.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { join } from 'node:path'; diff --git a/packages/doxdox-core/src/utils.ts b/packages/doxdox-core/src/utils.ts index 13e125bc..978469a1 100644 --- a/packages/doxdox-core/src/utils.ts +++ b/packages/doxdox-core/src/utils.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { resolve, dirname } from 'node:path'; diff --git a/packages/doxdox-parser-custom/src/index.ts b/packages/doxdox-parser-custom/src/index.ts index 0e19bb87..6d4f411c 100644 --- a/packages/doxdox-parser-custom/src/index.ts +++ b/packages/doxdox-parser-custom/src/index.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { join } from 'node:path'; diff --git a/packages/doxdox-parser-dox/src/index.ts b/packages/doxdox-parser-dox/src/index.ts index 5dd12c43..62a8f8d5 100644 --- a/packages/doxdox-parser-dox/src/index.ts +++ b/packages/doxdox-parser-dox/src/index.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { slugify } from 'doxdox-core'; diff --git a/packages/doxdox-parser-jsdoc/src/index.ts b/packages/doxdox-parser-jsdoc/src/index.ts index e3d54420..06627687 100644 --- a/packages/doxdox-parser-jsdoc/src/index.ts +++ b/packages/doxdox-parser-jsdoc/src/index.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; diff --git a/packages/doxdox-parser-template/src/index.ts b/packages/doxdox-parser-template/src/index.ts index 942ba9c4..987e7f30 100644 --- a/packages/doxdox-parser-template/src/index.ts +++ b/packages/doxdox-parser-template/src/index.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs'; +import fs from 'node:fs/promises'; import { join } from 'node:path';