Skip to content

Commit

Permalink
more node: prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
keegancsmith committed Jun 27, 2024
1 parent 22c386e commit a47118a
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 38 deletions.
6 changes: 3 additions & 3 deletions bin/cli.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S node --experimental-modules --experimental-network-imports --no-warnings
import { readFileSync } from 'fs'
import path from 'path'
import { pathToFileURL } from 'url'
import { readFileSync } from 'node:fs'
import path from 'node:path'
import { pathToFileURL } from 'node:url'
import {
type Client,
type ClientConfiguration,
Expand Down
2 changes: 1 addition & 1 deletion client/vscode-lib/src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'
import type { ClientConfiguration } from '@openctx/client'
import * as vscode from 'vscode'

Expand Down
6 changes: 3 additions & 3 deletions client/vscode/dev/release.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execFileSync } from 'child_process'
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import semver from 'semver'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
Expand Down
6 changes: 3 additions & 3 deletions client/vscode/test/integration/api.test.cts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as assert from 'assert'
import path from 'path'
import * as assert from 'node:assert'
import { copyFile } from 'node:fs/promises'
import path from 'node:path'
import type { ClientConfiguration } from '@openctx/client'
import type { ExtensionApiForTesting } from '@openctx/vscode-lib'
import { copyFile } from 'node:fs/promises'
import { before } from 'mocha'
import * as vscode from 'vscode'

Expand Down
2 changes: 1 addition & 1 deletion client/vscode/test/integration/index.cts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from 'path'
import * as path from 'node:path'
import { globSync } from 'glob'
import Mocha from 'mocha'

Expand Down
6 changes: 3 additions & 3 deletions client/vscode/test/integration/main.cts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { tmpdir } from 'os'
import * as path from 'path'
import { runTests } from '@vscode/test-electron'
import { mkdir, mkdtemp, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import * as path from 'node:path'
import { runTests } from '@vscode/test-electron'

async function main(): Promise<void> {
// When run, this script's filename is `client/vscode/dist/tsc/test/integration/main.js`, so
Expand Down
2 changes: 1 addition & 1 deletion client/web-playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from 'path'
import { resolve } from 'node:path'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'

Expand Down
4 changes: 2 additions & 2 deletions lib/schema/dev/generateJsonSchemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Generates TypeScript types for a JSON Schema.
*/

import path from 'path'
import { pathToFileURL } from 'url'
import { readFile } from 'node:fs/promises'
import path from 'node:path'
import { pathToFileURL } from 'node:url'
import { compile as compileJSONSchema } from 'json-schema-to-typescript'

async function generateSchema(schemaPath: string, preamble?: string): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion provider/devdocs/devdocs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import url from 'url'
import fs from 'node:fs/promises'
import url from 'node:url'

/** Format of the file found at a location like https://devdocs.io/docs/go/index.json */
interface Index {
Expand Down
4 changes: 2 additions & 2 deletions provider/devdocs/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path'
import url from 'url'
import path from 'node:path'
import url from 'node:url'
import type { Item, Mention, MentionsParams } from '@openctx/provider'
import { describe, expect, test } from 'vitest'
import devdocs, { type Settings } from './index.js'
Expand Down
4 changes: 2 additions & 2 deletions provider/devdocs/update-fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'
import url from 'url'
import fs from 'node:fs/promises'
import path from 'node:path'
import url from 'node:url'
import { fetchDoc, fetchIndex } from './devdocs.js'

/**
Expand Down
4 changes: 2 additions & 2 deletions provider/google-docs/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from 'fs'
import http from 'http'
import type { AddressInfo } from 'net'
import url from 'url'
import { readFileSync } from 'node:fs'
import url from 'node:url'
import dedent from 'dedent'
import { OAuth2Client } from 'google-auth-library'
import open from 'open'
Expand Down
8 changes: 4 additions & 4 deletions provider/linear-docs/auth.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import http from 'http'
// Identical to provider/linear-issues/auth.ts.
// Keep the duplicate for now to keep things simple.
import { readFileSync, writeFileSync } from 'fs'
import http from 'http'
import path from 'path'
import url, { fileURLToPath } from 'url'
import { readFileSync, writeFileSync } from 'node:fs'
import path from 'node:path'
import url, { fileURLToPath } from 'node:url'
import open from 'open'
import destroyer from 'server-destroy'

Expand Down
2 changes: 1 addition & 1 deletion provider/linear-docs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readFileSync } from 'fs'
import { readFileSync } from 'node:fs'
import type {
ItemsParams,
ItemsResult,
Expand Down
8 changes: 4 additions & 4 deletions provider/linear-issues/auth.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import http from 'http'
// Identical to provider/linear-docs/auth.ts.
// Keep the duplicate for now to keep things simple.
import { readFileSync, writeFileSync } from 'fs'
import http from 'http'
import path from 'path'
import url, { fileURLToPath } from 'url'
import { readFileSync, writeFileSync } from 'node:fs'
import path from 'node:path'
import url, { fileURLToPath } from 'node:url'
import open from 'open'
import destroyer from 'server-destroy'

Expand Down
2 changes: 1 addition & 1 deletion provider/linear-issues/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { readFile } from 'node:fs/promises'
import type {
ItemsParams,
ItemsResult,
Expand All @@ -8,7 +9,6 @@ import type {
} from '@openctx/provider'
import dedent from 'dedent'
import { XMLBuilder } from 'fast-xml-parser'
import { readFile } from 'node:fs/promises'

import type { UserCredentials } from './auth.js'

Expand Down
4 changes: 2 additions & 2 deletions vitest.workspace.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFileSync } from 'fs'
import path from 'path'
import { readFileSync } from 'node:fs'
import path from 'node:path'
import { load } from 'js-yaml'

interface PnpmWorkspaceFile {
Expand Down
4 changes: 2 additions & 2 deletions web/src/server/root.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-when-using-the-experimental-modules-flag/50052194#50052194

import { dirname } from 'path'
import { fileURLToPath } from 'url'
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'

export { root }

Expand Down

0 comments on commit a47118a

Please sign in to comment.