0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

nit: use node: prefix everywhere (#7692)

* nit: use `node:` prefix everywhere

* nit: fs/promises too

* test: workaround issue in node builtin detection
This commit is contained in:
Erika 2023-07-18 02:17:59 +02:00 committed by GitHub
parent a5faaa4c42
commit 1320600592
8 changed files with 14 additions and 14 deletions

View file

@ -108,7 +108,7 @@ Or, with Fastify (>4):
import Fastify from 'fastify';
import fastifyMiddie from '@fastify/middie';
import fastifyStatic from '@fastify/static';
import { fileURLToPath } from 'url';
import { fileURLToPath } from 'node:url';
import { handler as ssrHandler } from './dist/server/entry.mjs';
const app = Fastify({ logger: true });

View file

@ -1,4 +1,4 @@
import type { OutgoingHttpHeaders } from 'http';
import type { OutgoingHttpHeaders } from 'node:http';
/**
* Takes in a nullable WebAPI Headers object and produces a NodeJS OutgoingHttpHeaders object suitable for usage

View file

@ -1,9 +1,9 @@
import fs from 'fs';
import http from 'http';
import https from 'https';
import fs from 'node:fs';
import http from 'node:http';
import { fileURLToPath } from 'node:url';
import send from 'send';
import enableDestroy from 'server-destroy';
import { fileURLToPath } from 'url';
interface CreateServerOptions {
client: URL;

View file

@ -1,5 +1,5 @@
import type { NodeApp } from 'astro/app/node';
import type { IncomingMessage, ServerResponse } from 'http';
import type { IncomingMessage, ServerResponse } from 'node:http';
import type { Readable } from 'stream';
import { createOutgoingHttpHeaders } from './createOutgoingHttpHeaders';
import { responseIterator } from './response-iterator';

View file

@ -1,6 +1,6 @@
import type { CreatePreviewServer } from 'astro';
import type http from 'http';
import { fileURLToPath } from 'url';
import type http from 'node:http';
import { fileURLToPath } from 'node:url';
import { createServer } from './http-server.js';
import type { createExports } from './server';

View file

@ -1,7 +1,7 @@
import type { NodeApp } from 'astro/app/node';
import https from 'https';
import path from 'path';
import { fileURLToPath } from 'url';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { createServer } from './http-server.js';
import middleware from './nodeMiddleware.js';
import type { Options } from './types';

View file

@ -1,5 +1,5 @@
import { EventEmitter } from 'events';
import httpMocks from 'node-mocks-http';
import { EventEmitter } from 'node:events';
import { loadFixture as baseLoadFixture } from '../../../astro/test/test-utils.js';
/**

View file

@ -1,7 +1,7 @@
import { TLSSocket } from 'tls';
import nodejs from '../dist/index.js';
import { loadFixture, createRequestAndResponse } from './test-utils.js';
import { expect } from 'chai';
import { TLSSocket } from 'node:tls';
import nodejs from '../dist/index.js';
import { createRequestAndResponse, loadFixture } from './test-utils.js';
describe('URL protocol', () => {
/** @type {import('./test-utils').Fixture} */