require the use of node prefix on native imports

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-01-25 13:47:32 +01:00
parent 4ad63b8d9f
commit 7455dae884
444 changed files with 749 additions and 634 deletions
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { LoggerService } from '@backstage/backend-plugin-api';
import { spawn } from 'child_process';
import { PassThrough, Writable } from 'stream';
import { spawn } from 'node:child_process';
import { PassThrough, Writable } from 'node:stream';
import { executeShellCommand } from './executeShellCommand';
jest.mock('child_process', () => ({
@@ -15,8 +15,8 @@
*/
import { LoggerService } from '@backstage/backend-plugin-api';
import { spawn, SpawnOptionsWithoutStdio } from 'child_process';
import { PassThrough, Writable } from 'stream';
import { spawn, SpawnOptionsWithoutStdio } from 'node:child_process';
import { PassThrough, Writable } from 'node:stream';
/**
* Options for {@link executeShellCommand}.
@@ -17,12 +17,12 @@
jest.mock('fs-extra');
import fs from 'fs-extra';
import { resolve as resolvePath } from 'path';
import { resolve as resolvePath } from 'node:path';
import { UrlReaderService } from '@backstage/backend-plugin-api';
import { ConfigReader } from '@backstage/config';
import { ScmIntegrations } from '@backstage/integration';
import { fetchContents, fetchFile } from './fetch';
import os from 'os';
import os from 'node:os';
describe('fetchContents helper', () => {
beforeEach(() => {
+1 -1
View File
@@ -22,7 +22,7 @@ import {
import { InputError } from '@backstage/errors';
import { ScmIntegrations } from '@backstage/integration';
import fs from 'fs-extra';
import path from 'path';
import path from 'node:path';
/**
* A helper function that reads the contents of a directory from the given URL.
+1 -1
View File
@@ -16,7 +16,7 @@
import { InputError } from '@backstage/errors';
import { isChildPath } from '@backstage/backend-plugin-api';
import { join as joinPath, normalize as normalizePath } from 'path';
import { join as joinPath, normalize as normalizePath } from 'node:path';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { TemplateActionOptions } from './createTemplateAction';
import zodToJsonSchema from 'zod-to-json-schema';
@@ -15,7 +15,7 @@
*/
import fs from 'fs-extra';
import { dirname } from 'path';
import { dirname } from 'node:path';
import { resolveSafeChildPath } from '@backstage/backend-plugin-api';
import { SerializedFile } from './types';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { promises as fs } from 'fs';
import { promises as fs } from 'node:fs';
import globby from 'globby';
import limiterFactory from 'p-limit';
import { resolveSafeChildPath } from '@backstage/backend-plugin-api';
@@ -16,8 +16,8 @@
import * as tar from 'tar';
import concatStream from 'concat-stream';
import { promisify } from 'util';
import { pipeline as pipelineCb, Readable } from 'stream';
import { promisify } from 'node:util';
import { pipeline as pipelineCb, Readable } from 'node:stream';
const pipeline = promisify(pipelineCb);
/**