add node: prefixes

This commit is contained in:
Norbert de Langen 2024-08-14 17:48:31 +02:00
parent f55504560f
commit 49036cb89a
10 changed files with 16 additions and 12 deletions

View File

@ -1,7 +1,8 @@
import { platform } from 'node:os';
import { expect, it } from 'vitest';
import type { OutputFile } from 'esbuild';
import { platform } from 'os';
import { sanitizePath } from './files';

View File

@ -1,11 +1,11 @@
import { existsSync, readFileSync } from 'node:fs';
import { platform } from 'node:os';
import { join } from 'node:path';
import { logger } from '@storybook/core/node-logger';
import { FindPackageVersionsError } from '@storybook/core/server-errors';
import { findUp } from 'find-up';
import { platform } from 'os';
import sort from 'semver/functions/sort.js';
import dedent from 'ts-dedent';

View File

@ -1,10 +1,10 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import os, { type NetworkInterfaceInfoIPv4 } from 'node:os';
import os, { type NetworkInterfaceInfoIPv4 } from 'os';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { getServerAddresses } from '../server-address';
vi.mock('os');
vi.mock('node:os');
const mockedOs = vi.mocked(os);
describe('getServerAddresses', () => {

View File

@ -4,7 +4,7 @@ import detectPort from 'detect-port';
import { getServerAddresses, getServerChannelUrl, getServerPort } from './server-address';
vi.mock('os', () => ({
vi.mock('node:os', () => ({
default: { release: () => '' },
}));
vi.mock('detect-port');

View File

@ -1,7 +1,8 @@
import os from 'node:os';
import { logger } from '@storybook/core/node-logger';
import detectFreePort from 'detect-port';
import os from 'os';
export function getServerAddresses(
port: number,

View File

@ -1,7 +1,8 @@
/// <reference types="node" />
import * as os from 'node:os';
import retry from 'fetch-retry';
import { nanoid } from 'nanoid';
import * as os from 'os';
import { getAnonymousProjectId } from './anonymous-id';
import { set as saveToCache } from './event-cache';

View File

@ -1,9 +1,10 @@
import { cpus } from 'node:os';
import { NextJsSharpError } from 'storybook/internal/preview-errors';
import imageSizeOf from 'image-size';
import { interpolateName } from 'loader-utils';
import type { NextConfig } from 'next';
import { cpus } from 'os';
import type { RawLoaderDefinition } from 'webpack';
interface LoaderOptions {

View File

@ -1,4 +1,4 @@
import { EOL } from 'os';
import { EOL } from 'node:os';
// copied from https://github.com/chalk/ansi-regex
// the package is ESM only so not compatible with jest

View File

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
/**
* The maximum number of concurrent tasks we want to have on some CLI and CI tasks.

View File

@ -1,4 +1,4 @@
import { cpus } from 'os';
import { cpus } from 'node:os';
/**
* The maximum number of concurrent tasks we want to have on some CLI and CI tasks.