diff --git a/examples/end-to-end/custom-backend-task.ts b/examples/end-to-end/custom-backend-task.ts index 86e805de..dd89bca6 100644 --- a/examples/end-to-end/custom-backend-task.ts +++ b/examples/end-to-end/custom-backend-task.ts @@ -1,6 +1,6 @@ import kleur from "kleur"; -import fs from "fs"; -import path from "path"; +import fs from "node:fs"; +import path from "node:path"; kleur.enabled = true; diff --git a/generator/src/cli.js b/generator/src/cli.js index e9b15dd8..291473f2 100755 --- a/generator/src/cli.js +++ b/generator/src/cli.js @@ -5,8 +5,8 @@ import * as build from "./build.js"; import * as dev from "./dev-server.js"; import * as init from "./init.js"; import * as codegen from "./codegen.js"; -import * as fs from "fs"; -import * as path from "path"; +import * as fs from "node:fs"; +import * as path from "node:path"; import { restoreColorSafe } from "./error-formatter.js"; import * as renderer from "./render.js"; import { globbySync } from "globby"; diff --git a/generator/src/codegen.js b/generator/src/codegen.js index ed86bcc4..48112e3a 100644 --- a/generator/src/codegen.js +++ b/generator/src/codegen.js @@ -1,4 +1,4 @@ -import * as fs from "fs"; +import * as fs from "node:fs"; import * as fsExtra from "fs-extra/esm"; import { rewriteElmJson } from "./rewrite-elm-json.js"; import { rewriteClientElmJson } from "./rewrite-client-elm-json.js"; diff --git a/generator/src/copy-dir.js b/generator/src/copy-dir.js index ca6c5a61..cc82186b 100644 --- a/generator/src/copy-dir.js +++ b/generator/src/copy-dir.js @@ -1,5 +1,5 @@ -const util = require("util"); -const fsSync = require("fs"); +const util = require("node:util"); +const fsSync = require("node:fs"); const fs = { writeFile: util.promisify(fsSync.writeFile), mkdir: util.promisify(fsSync.mkdir), diff --git a/generator/src/dir-helpers.js b/generator/src/dir-helpers.js index cf2d3f1a..839a20f0 100644 --- a/generator/src/dir-helpers.js +++ b/generator/src/dir-helpers.js @@ -1,6 +1,6 @@ -import * as util from "util"; -import * as fsSync from "fs"; -import * as path from "path"; +import * as util from "node:util"; +import * as fsSync from "node:fs"; +import * as path from "node:path"; const fs = { writeFile: util.promisify(fsSync.writeFile), @@ -75,4 +75,3 @@ export async function copyDirNested(src, dest) { fs.copyFile(src, dest); } } - diff --git a/generator/src/file-helpers.js b/generator/src/file-helpers.js index eb293d3e..9bde5c2f 100644 --- a/generator/src/file-helpers.js +++ b/generator/src/file-helpers.js @@ -1,4 +1,4 @@ -import * as fs from "fs"; +import * as fs from "node:fs"; export function ensureDirSync(dirpath) { try { diff --git a/generator/src/render-worker.js b/generator/src/render-worker.js index ddf59e0f..96aa0848 100644 --- a/generator/src/render-worker.js +++ b/generator/src/render-worker.js @@ -1,9 +1,9 @@ import * as renderer from "../../generator/src/render.js"; -import * as path from "path"; +import * as path from "node:path"; import * as fs from "./dir-helpers.js"; -import { readFileSync, writeFileSync } from "fs"; +import { readFileSync, writeFileSync } from "node:fs"; import { stat } from "fs/promises"; -import { parentPort, threadId, workerData } from "worker_threads"; +import { parentPort, threadId, workerData } from "node:worker_threads"; import * as url from "url"; async function run({ mode, pathname, serverRequest, portsFilePath }) { diff --git a/generator/src/render.js b/generator/src/render.js index 5c494dd9..f3a250fd 100755 --- a/generator/src/render.js +++ b/generator/src/render.js @@ -1,16 +1,16 @@ // @ts-check -import * as path from "path"; +import * as path from "node:path"; import { default as mm } from "micromatch"; import { default as matter } from "gray-matter"; -import * as fsPromises from "fs/promises"; import * as globby from "globby"; +import * as fsPromises from "node:fs/promises"; import * as preRenderHtml from "./pre-render-html.js"; import { lookupOrPerform } from "./request-cache.js"; import * as kleur from "kleur/colors"; import * as cookie from "cookie-signature"; import { compatibilityKey } from "./compatibility-key.js"; -import * as fs from "fs"; +import * as fs from "node:fs"; import * as crypto from "node:crypto"; process.on("unhandledRejection", (error) => { diff --git a/generator/src/rewrite-client-elm-json.js b/generator/src/rewrite-client-elm-json.js index 9e658075..24d8baab 100644 --- a/generator/src/rewrite-client-elm-json.js +++ b/generator/src/rewrite-client-elm-json.js @@ -1,4 +1,4 @@ -import * as fs from "fs"; +import * as fs from "node:fs"; export async function rewriteClientElmJson() { var elmJson = JSON.parse( diff --git a/generator/src/rewrite-elm-json.js b/generator/src/rewrite-elm-json.js index d9bf5e04..1ce1abf8 100644 --- a/generator/src/rewrite-elm-json.js +++ b/generator/src/rewrite-elm-json.js @@ -1,4 +1,4 @@ -import * as fs from "fs"; +import * as fs from "node:fs"; export async function rewriteElmJson(sourceElmJsonPath, targetElmJsonPath) { var elmJson = JSON.parse(