Prefix node protocol (#26391)

This commit is contained in:
Volnei Munhoz authored and GitHub committed 2026-01-02 12:47:00 +00:00
1 parent fed6899c36
commit a1e5384859
129 files changed
+182 -177

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
const http = require("http");
const http = require("node:http");
const connect = require("connect");
const { createProxyMiddleware } = require("http-proxy-middleware");
+1 -1
View File
@@ -1,4 +1,4 @@
const path = require("path");
const path = require("node:path");
const i18nConfig = require("@calcom/config/next-i18next.config");
/** @type {import("next-i18next").UserConfig} */
+1 -1
View File
@@ -1,6 +1,6 @@
// This is a workaround for https://github.com/jsdom/jsdom/issues/2524#issuecomment-902027138
// See https://github.com/microsoft/accessibility-insights-web/blob/40416a4ae6b91baf43102f58e069eff787de4de2/src/tests/unit/jest-setup.ts
const { TextEncoder, TextDecoder } = require("util");
const { TextEncoder, TextDecoder } = require("node:util");
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
+1 -1
View File
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const path = require("node:path");
const i18nConfig = require("@calcom/config/next-i18next.config");
/** @type {import("next-i18next").UserConfig} */
+1 -1
View File
@@ -1,4 +1,4 @@
import { execSync } from "child_process";
import { execSync } from "node:child_process";
function checkCommandExists(command: string): boolean {
try {
+1 -1
View File
@@ -1,4 +1,4 @@
import { createHash } from "crypto";
import { createHash } from "node:crypto";
export const sha256Hash = (token: string): string => createHash("sha256").update(token).digest("hex");
+1 -1
View File
@@ -1,4 +1,4 @@
import { IncomingHttpHeaders } from "http";
import { IncomingHttpHeaders } from "node:http";
export function filterReqHeaders(headers: IncomingHttpHeaders): Partial<IncomingHttpHeaders> {
return {
@@ -1,7 +1,7 @@
import { Injectable, Logger, OnModuleDestroy } from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import * as path from "path";
import { Worker } from "worker_threads";
import * as path from "node:path";
import { Worker } from "node:worker_threads";
// Import WorkerOptions type
import type { GetScheduleOptions } from "@calcom/trpc/server/routers/viewer/slots/types";
@@ -1,8 +1,8 @@
import { AvailableSlotsService } from "@/lib/services/available-slots.service";
import { Logger } from "@nestjs/common";
import { NestFactory } from "@nestjs/core";
import { IncomingMessage } from "http";
import { parentPort, isMainThread } from "worker_threads";
import { IncomingMessage } from "node:http";
import { parentPort, isMainThread } from "node:worker_threads";
import { SlotsWorkerModule } from "./slots.worker.module";
@@ -1,5 +1,5 @@
import * as fs from "fs-extra";
import * as path from "path";
import * as path from "node:path";
// First, copyNestSwagger is required to enable "@nestjs/swagger" in the "nest-cli.json",
// because nest-cli.json is resolving "@nestjs/swagger" plugin from
+2 -2
View File
@@ -8,8 +8,8 @@ import type {
OperationObject,
} from "@nestjs/swagger/dist/interfaces/open-api-spec.interface";
import "dotenv/config";
import * as fs from "fs";
import type { Server } from "http";
import * as fs from "node:fs";
import type { Server } from "node:http";
import { spawnSync } from "node:child_process";
import { createRequire } from "node:module";
@@ -1,7 +1,7 @@
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
import { TestingModule } from "@nestjs/testing";
import { randomBytes, createHash } from "crypto";
import { randomBytes, createHash } from "node:crypto";
export class ApiKeysRepositoryFixture {
private prismaReadClient: PrismaReadService["prisma"];
@@ -1,7 +1,7 @@
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
import { TestingModule } from "@nestjs/testing";
import * as crypto from "crypto";
import * as crypto from "node:crypto";
import { DateTime } from "luxon";
export class TokensRepositoryFixture {
@@ -1,6 +1,6 @@
import { defaultResponderForAppDir } from "app/api/defaultResponderForAppDir";
import { parseRequestData } from "app/api/parseRequestData";
import crypto from "crypto";
import crypto from "node:crypto";
import { cookies, headers } from "next/headers";
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
+1 -1
View File
@@ -1,4 +1,4 @@
import { randomBytes } from "crypto";
import { randomBytes } from "node:crypto";
import { NextResponse } from "next/server";
import { WEBAPP_URL } from "@calcom/lib/constants";
@@ -1,5 +1,5 @@
import { defaultResponderForAppDir } from "app/api/defaultResponderForAppDir";
import { createHmac } from "crypto";
import { createHmac } from "node:crypto";
import { headers } from "next/headers";
import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
+1 -1
View File
@@ -1,5 +1,5 @@
import { defaultResponderForAppDir } from "app/api/defaultResponderForAppDir";
import { createHmac } from "crypto";
import { createHmac } from "node:crypto";
import { headers } from "next/headers";
import { cookies } from "next/headers";
import type { NextRequest } from "next/server";
+1 -1
View File
@@ -15,7 +15,7 @@ import type { SSRConfig } from "next-i18next/dist/types/types";
import { ThemeProvider } from "next-themes";
import type { AppProps as NextAppProps, AppProps as NextJsAppProps } from "next/app";
import { NuqsAdapter } from "nuqs/adapters/next/pages";
import type { ParsedUrlQuery } from "querystring";
import type { ParsedUrlQuery } from "node:querystring";
import type { PropsWithChildren, ReactNode } from "react";
import { useEffect } from "react";
+2 -2
View File
@@ -1,6 +1,6 @@
import fs from "fs";
import fs from "node:fs"
import matter from "gray-matter";
import path from "path";
import path from "node:path"
import { z } from "zod";
import { getAppWithMetadata } from "@calcom/app-store/_appRegistry";
+1 -1
View File
@@ -1,5 +1,5 @@
import type { GetServerSidePropsContext } from "next";
import type { ParsedUrlQuery } from "querystring";
import type { ParsedUrlQuery } from "node:querystring";
import { vi, describe, it, expect, beforeEach, afterEach } from "vitest";
import * as constants from "@calcom/lib/constants";
+2 -2
View File
@@ -1,5 +1,5 @@
import type { ParsedUrlQuery } from "querystring";
import { stringify } from "querystring";
import type { ParsedUrlQuery } from "node:querystring";
import { stringify } from "node:querystring";
import { SINGLE_ORG_SLUG } from "@calcom/lib/constants";
import logger from "@calcom/lib/logger";
@@ -1,6 +1,6 @@
// page can be a server component
import type { GetServerSidePropsContext } from "next";
import { URLSearchParams } from "url";
import { URLSearchParams } from "node:url";
import { z } from "zod";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
+1 -1
View File
@@ -2,7 +2,7 @@
import { signOut, useSession } from "next-auth/react";
import { useRouter } from "next/navigation";
import type { ParsedUrlQuery } from "querystring";
import type { ParsedUrlQuery } from "node:querystring";
import { useEffect, useState } from "react";
import { WEBSITE_URL } from "@calcom/lib/constants";
+1 -1
View File
@@ -1,4 +1,4 @@
import path from "path";
import path from "node:path"
import i18nConfig from "@calcom/config/next-i18next.config";
+1 -1
View File
@@ -1,4 +1,4 @@
import type { IncomingMessage } from "http";
import type { IncomingMessage } from "node:http";
import type { NextPageContext } from "next";
import { SessionProvider } from "next-auth/react";
import React from "react";
+1 -1
View File
@@ -1,5 +1,5 @@
import { platform } from "@todesktop/client-core";
import type { IncomingMessage } from "http";
import type { IncomingMessage } from "node:http";
import { dir } from "i18next";
import type { DocumentContext, DocumentProps } from "next/document";
import Document, { Head, Html, Main, NextScript } from "next/document";
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Server } from "http";
import type { Server } from "node:http";
import { nextServer } from "../lib/next-server";
+2 -2
View File
@@ -1,5 +1,5 @@
import fs from "fs";
import path from "path";
import fs from "node:fs"
import path from "node:path"
/**
* Simple utility to load JSON files from the file system. Needed to avoid certain errors with:
+3 -3
View File
@@ -1,8 +1,8 @@
import detect from "detect-port";
import type { Server } from "http";
import { createServer } from "http";
import type { Server } from "node:http";
import { createServer } from "node:http";
import next from "next";
import { parse } from "url";
import { parse } from "node:url";
// eslint-disable-next-line @typescript-eslint/no-namespace
declare let process: {
+4 -4
View File
@@ -1,9 +1,9 @@
import type { Frame, Page, Request as PlaywrightRequest } from "@playwright/test";
import { expect } from "@playwright/test";
import { createHash } from "crypto";
import EventEmitter from "events";
import type { IncomingMessage, ServerResponse } from "http";
import { createServer } from "http";
import { createHash } from "node:crypto";
import EventEmitter from "node:events";
import type { IncomingMessage, ServerResponse } from "node:http";
import { createServer } from "node:http";
import type { Messages } from "mailhog";
import { totp } from "otplib";
import { v4 as uuid } from "uuid";
+1 -1
View File
@@ -1,5 +1,5 @@
import { expect } from "@playwright/test";
import { createHash, randomBytes } from "crypto";
import { createHash, randomBytes } from "node:crypto";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { prisma } from "@calcom/prisma";
@@ -1,5 +1,5 @@
import { expect } from "@playwright/test";
import path from "path";
import path from "node:path"
import { CAL_URL } from "@calcom/lib/constants";
import { prisma } from "@calcom/prisma";
+1 -1
View File
@@ -1,6 +1,6 @@
import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
import { randomBytes } from "crypto";
import { randomBytes } from "node:crypto";
import { APP_NAME, IS_PREMIUM_USERNAME_ENABLED, IS_MAILHOG_ENABLED } from "@calcom/lib/constants";
import prisma from "@calcom/prisma";
@@ -1,5 +1,5 @@
import { readFileSync, readdirSync, writeFileSync } from "fs";
import { join } from "path";
import { readFileSync, readdirSync, writeFileSync } from "node:fs";
import { join } from "node:path";
const TEMPLATE_LANGUAGE = "en";
const SPECIFIC_LOCALES = process.argv.slice(2) || [];
+3 -3
View File
@@ -1,7 +1,7 @@
const fs = require("fs");
const path = require("path");
const fs = require("node:fs");
const path = require("node:path");
const glob = require("glob");
const crypto = require("crypto");
const crypto = require("node:crypto");
const copyAppStoreStatic = () => {
// Get all static files from app-store packages
+1 -1
View File
@@ -1,4 +1,4 @@
const { execSync } = require("child_process");
const { execSync } = require("node:child_process");
const CLIENT_FILES_PATH = ".next/static/chunks";
+1 -1
View File
@@ -1,4 +1,4 @@
import { execSync } from "child_process";
import { execSync } from "node:child_process";
type Err = {
stdout: string;
@@ -1,6 +1,6 @@
import type { EmbedProps } from "app/WithEmbedSSR";
import type { GetServerSideProps } from "next";
import { encode } from "querystring";
import { encode } from "node:querystring";
import type { z } from "zod";
import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
+1 -1
View File
@@ -1,6 +1,6 @@
// This is a workaround for https://github.com/jsdom/jsdom/issues/2524#issuecomment-902027138
// See https://github.com/microsoft/accessibility-insights-web/blob/40416a4ae6b91baf43102f58e069eff787de4de2/src/tests/unit/jest-setup.ts
const { TextEncoder, TextDecoder } = require("util");
const { TextEncoder, TextDecoder } = require("node:util");
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
@@ -7,7 +7,7 @@ import {
type ScenarioData,
} from "../../utils/bookingScenario/bookingScenario";
import type { IncomingMessage } from "http";
import type { IncomingMessage } from "node:http";
import { describe, test, beforeEach, vi } from "vitest";
import type { z } from "zod";