require the use of node prefix on native imports
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch
|
||||
'@backstage/plugin-search-backend-module-stack-overflow-collator': patch
|
||||
'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch
|
||||
'@backstage/plugin-auth-backend-module-azure-easyauth-provider': patch
|
||||
'@backstage/plugin-auth-backend-module-oauth2-proxy-provider': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-bitbucket-cloud': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch
|
||||
'@backstage/plugin-auth-backend-module-pinniped-provider': patch
|
||||
'@backstage/plugin-auth-backend-module-aws-alb-provider': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-bitbucket': patch
|
||||
'@backstage/plugin-search-backend-module-elasticsearch': patch
|
||||
'@backstage/plugin-auth-backend-module-oidc-provider': patch
|
||||
'@backstage/backend-dynamic-feature-service': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-gerrit': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-github': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-gitlab': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-sentry': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-yeoman': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-gitea': patch
|
||||
'@backstage/plugin-scaffolder-backend-module-rails': patch
|
||||
'@backstage/plugin-catalog-backend-module-openapi': patch
|
||||
'@backstage/plugin-search-backend-module-techdocs': patch
|
||||
'@backstage/plugin-catalog-backend-module-gerrit': patch
|
||||
'@backstage/plugin-catalog-backend-module-github': patch
|
||||
'@backstage/plugin-catalog-backend-module-gitlab': patch
|
||||
'@backstage/plugin-search-backend-module-catalog': patch
|
||||
'@backstage/plugin-search-backend-module-explore': patch
|
||||
'@backstage/plugin-catalog-backend-module-ldap': patch
|
||||
'@backstage/plugin-catalog-backend-module-aws': patch
|
||||
'@backstage/plugin-scaffolder-node-test-utils': patch
|
||||
'@backstage/plugin-techdocs-addons-test-utils': patch
|
||||
'@backstage/plugin-search-backend-module-pg': patch
|
||||
'@backstage/backend-openapi-utils': patch
|
||||
'@backstage/plugin-bitbucket-cloud-common': patch
|
||||
'@backstage/integration-aws-node': patch
|
||||
'@backstage/plugin-notifications-backend': patch
|
||||
'@backstage/backend-plugin-api': patch
|
||||
'@backstage/backend-test-utils': patch
|
||||
'@backstage/plugin-search-backend-node': patch
|
||||
'@backstage/backend-dev-utils': patch
|
||||
'@backstage/plugin-kubernetes-backend': patch
|
||||
'@backstage/plugin-permission-backend': patch
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
'@backstage/backend-defaults': patch
|
||||
'@backstage/core-components': patch
|
||||
'@backstage/plugin-devtools-backend': patch
|
||||
'@backstage/plugin-kubernetes-react': patch
|
||||
'@backstage/plugin-techdocs-backend': patch
|
||||
'@backstage/e2e-test-utils': patch
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
'@backstage/plugin-kubernetes-node': patch
|
||||
'@backstage/plugin-scaffolder-node': patch
|
||||
'@backstage/plugin-signals-backend': patch
|
||||
'@backstage/config-loader': patch
|
||||
'@backstage/eslint-plugin': patch
|
||||
'@backstage/plugin-events-backend': patch
|
||||
'@backstage/plugin-search-backend': patch
|
||||
'@techdocs/cli': patch
|
||||
'@backstage/plugin-proxy-backend': patch
|
||||
'@backstage/plugin-search-common': patch
|
||||
'@backstage/plugin-techdocs-node': patch
|
||||
'@backstage/integration': patch
|
||||
'@backstage/plugin-auth-backend': patch
|
||||
'@backstage/plugin-catalog-node': patch
|
||||
'@backstage/cli-common': patch
|
||||
'@backstage/create-app': patch
|
||||
'@backstage/repo-tools': patch
|
||||
'@backstage/plugin-app-backend': patch
|
||||
'@backstage/plugin-scaffolder': patch
|
||||
'@backstage/cli-node': patch
|
||||
'@backstage/codemods': patch
|
||||
'@backstage/plugin-auth-node': patch
|
||||
'@backstage/plugin-api-docs': patch
|
||||
'@backstage/plugin-app-node': patch
|
||||
'@backstage/cli': patch
|
||||
'@backstage/ui': patch
|
||||
---
|
||||
|
||||
Use node prefix on native imports
|
||||
+3
-2
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var path = require('path');
|
||||
var path = require('node:path');
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
plugins: ['@spotify', 'notice', 'react', 'testing-library', '@backstage'],
|
||||
plugins: ['@spotify', 'notice', 'react', 'testing-library', '@backstage', 'node-import'],
|
||||
rules: {
|
||||
'node-import/prefer-node-protocol': 1,
|
||||
'@backstage/no-mixed-plugin-imports': [
|
||||
'error',
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const prNumber = process.argv[2];
|
||||
const description = process.argv.slice(3).join(' ');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { bundle } = require('lightningcss');
|
||||
const chokidar = require('chokidar');
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs';
|
||||
const backstageTheme = themes.vsDark;
|
||||
backstageTheme.plain.backgroundColor = '#232323';
|
||||
|
||||
const useVersionedDocs = require('fs').existsSync('versions.json');
|
||||
const useVersionedDocs = require('node:fs').existsSync('versions.json');
|
||||
|
||||
// This patches the redirect plugin to ignore the error when it tries to override existing fields.
|
||||
// This lets us add redirects that only apply to the next docs, while the stable docs still contain the source path.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const docsDir = path.resolve(__dirname, '../docs');
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@
|
||||
"cross-env": "^10.0.0",
|
||||
"e2e-test": "workspace:*",
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-plugin-node-import": "^1.0.5",
|
||||
"eslint-plugin-notice": "^1.0.0",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-testing-library": "^7.0.0",
|
||||
|
||||
@@ -19,9 +19,9 @@ import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import axios from 'axios';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import http from 'http';
|
||||
import http from 'node:http';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import https from 'https';
|
||||
import https from 'node:https';
|
||||
|
||||
const errorMsg = 'Network requests are not allowed in tests';
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ import { ErrorRequestHandler } from 'express';
|
||||
import { Express as Express_2 } from 'express';
|
||||
import { Handler } from 'express';
|
||||
import { HelmetOptions } from 'helmet';
|
||||
import * as http from 'http';
|
||||
import * as http from 'node:http';
|
||||
import { LifecycleService } from '@backstage/backend-plugin-api';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { RequestHandler } from 'express';
|
||||
import { RequestListener } from 'http';
|
||||
import { RequestListener } from 'node:http';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
import { RootHealthService } from '@backstage/backend-plugin-api';
|
||||
import { RootHttpRouterService } from '@backstage/backend-plugin-api';
|
||||
|
||||
@@ -20,7 +20,7 @@ import { GithubIntegration } from '@backstage/integration';
|
||||
import { GitLabIntegration } from '@backstage/integration';
|
||||
import { HarnessIntegration } from '@backstage/integration';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
import { ServiceFactory } from '@backstage/backend-plugin-api';
|
||||
import { ServiceRef } from '@backstage/backend-plugin-api';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import { resolve as resolvePath, dirname } from 'path';
|
||||
import { resolve as resolvePath, dirname } from 'node:path';
|
||||
|
||||
import {
|
||||
BackendFeature,
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import {
|
||||
mockServices,
|
||||
registerMswTestHooks,
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { randomBytes } from 'crypto';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { SignJWT, exportJWK, generateKeyPair } from 'jose';
|
||||
import { DateTime } from 'luxon';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { randomBytes } from 'crypto';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { SignJWT, importJWK } from 'jose';
|
||||
import { DateTime } from 'luxon';
|
||||
import { legacyTokenHandler } from './legacy';
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
BackstageUserPrincipal,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { InternalBackstageCredentials } from './types';
|
||||
import { createHash } from 'crypto';
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
export function createCredentialsWithServicePrincipal(
|
||||
sub: string,
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
import { Config } from '@backstage/config';
|
||||
import { HumanDuration, durationToMilliseconds } from '@backstage/types';
|
||||
import { promises as fs } from 'fs';
|
||||
import { promises as fs } from 'node:fs';
|
||||
import { JWK, exportJWK, importPKCS8, importSPKI } from 'jose';
|
||||
import { KeyLike } from 'jose';
|
||||
import { KeyPayload } from './types';
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
CacheServiceSetOptions,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { createHash } from 'crypto';
|
||||
import { createHash } from 'node:crypto';
|
||||
import Keyv from 'keyv';
|
||||
import { ttlToMilliseconds } from './types';
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { InfinispanPutOptions } from '../../types';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import {
|
||||
buildSqliteDatabaseConfig,
|
||||
createSqliteDatabaseClient,
|
||||
|
||||
@@ -21,7 +21,7 @@ import { JsonObject } from '@backstage/types';
|
||||
import { ensureDirSync } from 'fs-extra';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { merge, omit } from 'lodash';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { Connector } from '../types';
|
||||
import { mergeDatabaseConfig } from './mergeDatabaseConfig';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { ForwardedError, InputError, NotFoundError } from '@backstage/errors';
|
||||
import { resolveSrv, SrvRecord } from 'dns';
|
||||
import { resolveSrv, SrvRecord } from 'node:dns';
|
||||
|
||||
const PROTOCOL_SUFFIX = '+srv:';
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { assertError } from '@backstage/errors';
|
||||
import { randomBytes } from 'crypto';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
|
||||
function handleBadError(error: Error, logger: LoggerService) {
|
||||
const logId = randomBytes(10).toString('hex');
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import { RequestListener } from 'http';
|
||||
import * as http from 'node:http';
|
||||
import * as https from 'node:https';
|
||||
import { RequestListener } from 'node:http';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { HttpServerOptions, ExtendedHttpServer } from './types';
|
||||
import { getGeneratedCertificate } from './getGeneratedCertificate';
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import { resolve as resolvePath, dirname } from 'path';
|
||||
import { resolve as resolvePath, dirname } from 'node:path';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import forge from 'node-forge';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as http from 'http';
|
||||
import * as http from 'node:http';
|
||||
|
||||
/**
|
||||
* An HTTP server extended with utility methods.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import { Knex } from 'knex';
|
||||
import { TestDatabases } from '@backstage/backend-test-utils';
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
import { migrationsDir } from './migrateBackendTasks';
|
||||
|
||||
const migrationsFiles = fs.readdirSync(migrationsDir).sort();
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ import { JsonObject } from '@backstage/types';
|
||||
import { DefaultReadTreeResponseFactory } from './tree';
|
||||
import { AwsCodeCommitUrlReader, parseUrl } from './AwsCodeCommitUrlReader';
|
||||
import { UrlReaderPredicateTuple } from './types';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { NotModifiedError } from '@backstage/errors';
|
||||
import { mockClient } from 'aws-sdk-client-mock';
|
||||
import {
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
GetFileCommand,
|
||||
GetFolderCommand,
|
||||
} from '@aws-sdk/client-codecommit';
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
import { DefaultAwsCredentialsManager } from '@backstage/integration-aws-node';
|
||||
import {
|
||||
AwsCodeCommitIntegration,
|
||||
|
||||
@@ -46,9 +46,9 @@ import {
|
||||
GetFolderCommand,
|
||||
} from '@aws-sdk/client-codecommit';
|
||||
import { AwsCredentialIdentityProvider } from '@aws-sdk/types';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
|
||||
import { relative } from 'path/posix';
|
||||
import { relative } from 'node:path/posix';
|
||||
import { AbortController } from '@aws-sdk/abort-controller';
|
||||
|
||||
export function parseUrl(
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
} from '@backstage/integration';
|
||||
import { DefaultAwsCredentialsManager } from '@backstage/integration-aws-node';
|
||||
import { UrlReaderPredicateTuple } from './types';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { NotModifiedError } from '@backstage/errors';
|
||||
import { mockClient } from 'aws-sdk-client-mock';
|
||||
import {
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
S3ServiceException,
|
||||
} from '@aws-sdk/client-s3';
|
||||
import { sdkStreamMixin } from '@aws-sdk/util-stream-node';
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
import { mockServices } from '@backstage/backend-test-utils';
|
||||
|
||||
const treeResponseFactory = DefaultReadTreeResponseFactory.create({
|
||||
|
||||
@@ -49,8 +49,8 @@ import {
|
||||
} from '@aws-sdk/client-s3';
|
||||
import { AbortController } from '@aws-sdk/abort-controller';
|
||||
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
|
||||
import { Readable } from 'stream';
|
||||
import { relative } from 'path/posix';
|
||||
import { Readable } from 'node:stream';
|
||||
import { relative } from 'node:path/posix';
|
||||
|
||||
export const DEFAULT_REGION = 'us-east-1';
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import {
|
||||
} from '@backstage/integration';
|
||||
import { UrlReaderPredicateTuple } from './types';
|
||||
import { mockServices } from '@backstage/backend-test-utils';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
// Mock Azure Blob Storage SDK
|
||||
const mockBlobDownload = jest.fn();
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ import {
|
||||
ForwardedError,
|
||||
NotModifiedError,
|
||||
} from '@backstage/errors';
|
||||
import { Readable } from 'stream';
|
||||
import { relative } from 'path/posix';
|
||||
import { Readable } from 'node:stream';
|
||||
import { relative } from 'node:path/posix';
|
||||
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
|
||||
import {
|
||||
AzureBlobStorageIntergation,
|
||||
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
import fs from 'fs-extra';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { NotModifiedError } from '@backstage/errors';
|
||||
import { AzureUrlReader } from './AzureUrlReader';
|
||||
import { DefaultReadTreeResponseFactory } from './tree';
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import {
|
||||
import fs from 'fs-extra';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { NotModifiedError } from '@backstage/errors';
|
||||
import { BitbucketCloudUrlReader } from './BitbucketCloudUrlReader';
|
||||
import { DefaultReadTreeResponseFactory } from './tree';
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import {
|
||||
import fs from 'fs-extra';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { NotModifiedError } from '@backstage/errors';
|
||||
import { BitbucketServerUrlReader } from './BitbucketServerUrlReader';
|
||||
import { DefaultReadTreeResponseFactory } from './tree';
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
import fs from 'fs-extra';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { NotModifiedError } from '@backstage/errors';
|
||||
import { BitbucketUrlReader } from './BitbucketUrlReader';
|
||||
import { DefaultReadTreeResponseFactory } from './tree';
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
NotModifiedError,
|
||||
} from '@backstage/errors';
|
||||
import { ReaderFactory } from './types';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
|
||||
import { Config } from '@backstage/config';
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import { JsonObject } from '@backstage/types';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { UrlReaderPredicateTuple } from './types';
|
||||
import { DefaultReadTreeResponseFactory } from './tree';
|
||||
import { GerritUrlReader } from './GerritUrlReader';
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { Base64Decode } from 'base64-stream';
|
||||
import fetch, { Response } from 'node-fetch';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import {
|
||||
GerritIntegration,
|
||||
ScmIntegrations,
|
||||
|
||||
@@ -29,7 +29,7 @@ import getRawBody from 'raw-body';
|
||||
import { GiteaUrlReader } from './GiteaUrlReader';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
|
||||
const treeResponseFactory = DefaultReadTreeResponseFactory.create({
|
||||
config: new ConfigReader({}),
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
NotFoundError,
|
||||
NotModifiedError,
|
||||
} from '@backstage/errors';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { parseLastModified } from './util';
|
||||
import parseGitUrl from 'git-url-parse';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
import fs from 'fs-extra';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
import {
|
||||
GhBlobResponse,
|
||||
|
||||
@@ -36,7 +36,7 @@ import { RestEndpointMethodTypes } from '@octokit/rest';
|
||||
import fetch, { RequestInit, Response } from 'node-fetch';
|
||||
import parseGitUrl from 'git-url-parse';
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import {
|
||||
assertError,
|
||||
NotFoundError,
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import fs from 'fs-extra';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { GitlabUrlReader } from './GitlabUrlReader';
|
||||
import { DefaultReadTreeResponseFactory } from './tree';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
|
||||
@@ -41,7 +41,7 @@ import {
|
||||
import parseGitUrl from 'git-url-parse';
|
||||
import { trimEnd, trimStart } from 'lodash';
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
|
||||
import { ReaderFactory, ReadTreeResponseFactory } from './types';
|
||||
import { parseLastModified } from './util';
|
||||
|
||||
@@ -23,7 +23,7 @@ import { UrlReaderPredicateTuple } from './types';
|
||||
import packageinfo from '../../../../package.json';
|
||||
import { mockServices } from '@backstage/backend-test-utils';
|
||||
import { UrlReaderServiceReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
const bucketGetFilesMock = jest.fn();
|
||||
class Bucket {
|
||||
|
||||
@@ -31,11 +31,11 @@ import {
|
||||
readGoogleGcsIntegrationConfig,
|
||||
} from '@backstage/integration';
|
||||
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
|
||||
import packageinfo from '../../../../package.json';
|
||||
import { assertError } from '@backstage/errors';
|
||||
import { relative } from 'path/posix';
|
||||
import { relative } from 'node:path/posix';
|
||||
|
||||
const GOOGLE_GCS_HOST = 'storage.cloud.google.com';
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import getRawBody from 'raw-body';
|
||||
import { HarnessUrlReader } from './HarnessUrlReader';
|
||||
import { NotFoundError, NotModifiedError } from '@backstage/errors';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
|
||||
const treeResponseFactory = DefaultReadTreeResponseFactory.create({
|
||||
config: new ConfigReader({}),
|
||||
|
||||
@@ -41,7 +41,7 @@ import {
|
||||
NotFoundError,
|
||||
NotModifiedError,
|
||||
} from '@backstage/errors';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
/**
|
||||
* Implements a {@link @backstage/backend-plugin-api#UrlReaderService} for the Harness code v1 api.
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
import { ConflictError } from '@backstage/errors';
|
||||
import getRawBody from 'raw-body';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { ReadUrlResponseFactory } from './ReadUrlResponseFactory';
|
||||
|
||||
describe('ReadUrlResponseFactory', () => {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { ConflictError } from '@backstage/errors';
|
||||
import { UrlReaderServiceReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import getRawBody from 'raw-body';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { ReadUrlResponseFactoryFromStreamOptions } from './types';
|
||||
import { parseLastModified, responseToReadable } from './util';
|
||||
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import os from 'os';
|
||||
import { Readable } from 'stream';
|
||||
import os from 'node:os';
|
||||
import { Readable } from 'node:stream';
|
||||
import { Config } from '@backstage/config';
|
||||
import {
|
||||
ReadTreeResponseFactoryOptions,
|
||||
|
||||
+2
-2
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { FromReadableArrayOptions } from '../types';
|
||||
import { ReadableArrayResponse } from './ReadableArrayResponse';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import { relative } from 'path/posix';
|
||||
import { relative } from 'node:path/posix';
|
||||
|
||||
const name1 = 'file1.yaml';
|
||||
const file1 = fs.readFileSync(
|
||||
|
||||
+3
-3
@@ -21,12 +21,12 @@ import {
|
||||
UrlReaderServiceReadTreeResponseFile,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import concatStream from 'concat-stream';
|
||||
import platformPath, { dirname } from 'path';
|
||||
import platformPath, { dirname } from 'node:path';
|
||||
import getRawBody from 'raw-body';
|
||||
import fs from 'fs-extra';
|
||||
import { promisify } from 'util';
|
||||
import { promisify } from 'node:util';
|
||||
import * as tar from 'tar';
|
||||
import { pipeline as pipelineCb, Readable } from 'stream';
|
||||
import { pipeline as pipelineCb, Readable } from 'node:stream';
|
||||
import { FromReadableArrayOptions } from '../types';
|
||||
|
||||
const pipeline = promisify(pipelineCb);
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import { resolve as resolvePath, join as joinPath } from 'path';
|
||||
import { resolve as resolvePath, join as joinPath } from 'node:path';
|
||||
import { TarArchiveResponse } from './TarArchiveResponse';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import * as tar from 'tar';
|
||||
|
||||
@@ -22,11 +22,11 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import concatStream from 'concat-stream';
|
||||
import fs from 'fs-extra';
|
||||
import platformPath from 'path';
|
||||
import { pipeline as pipelineCb, Readable } from 'stream';
|
||||
import platformPath from 'node:path';
|
||||
import { pipeline as pipelineCb, Readable } from 'node:stream';
|
||||
import * as tar from 'tar';
|
||||
import type { ReadEntry } from 'tar';
|
||||
import { promisify } from 'util';
|
||||
import { promisify } from 'node:util';
|
||||
import { stripFirstDirectoryFromPath } from './util';
|
||||
|
||||
const pipeline = promisify(pipelineCb);
|
||||
|
||||
+2
-2
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import { create as createArchive } from 'archiver';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { resolve as resolvePath } from 'node:path';
|
||||
import { ZipArchiveResponse } from './ZipArchiveResponse';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ import {
|
||||
import archiver from 'archiver';
|
||||
import yauzl, { Entry } from 'yauzl';
|
||||
import fs from 'fs-extra';
|
||||
import platformPath from 'path';
|
||||
import { Readable } from 'stream';
|
||||
import platformPath from 'node:path';
|
||||
import { Readable } from 'node:stream';
|
||||
import { streamToBuffer } from './util';
|
||||
import { resolveSafeChildPath } from '@backstage/backend-plugin-api';
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Readable, pipeline as pipelineCb } from 'stream';
|
||||
import { promisify } from 'util';
|
||||
import { Readable, pipeline as pipelineCb } from 'node:stream';
|
||||
import { promisify } from 'node:util';
|
||||
import concatStream from 'concat-stream';
|
||||
|
||||
const pipeline = promisify(pipelineCb);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import {
|
||||
UrlReaderService,
|
||||
UrlReaderServiceReadTreeResponse,
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PassThrough, Readable } from 'stream';
|
||||
import { ReadableStream as WebReadableStream } from 'stream/web';
|
||||
import { PassThrough, Readable } from 'node:stream';
|
||||
import { ReadableStream as WebReadableStream } from 'node:stream/web';
|
||||
|
||||
export function parseLastModified(
|
||||
value: string | null | undefined,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import { Knex } from 'knex';
|
||||
import { TestDatabases } from '@backstage/backend-test-utils';
|
||||
import fs from 'fs';
|
||||
import fs from 'node:fs';
|
||||
|
||||
const migrationsDir = `${__dirname}/../migrations/scheduler`;
|
||||
const migrationsFiles = fs.readdirSync(migrationsDir).sort();
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Serializable, spawn } from 'child_process';
|
||||
import { Serializable, spawn } from 'node:child_process';
|
||||
import { DevDataStore } from './DevDataStore';
|
||||
import { BackstageIpcClient } from './ipcClient';
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { dynamicPluginsFeatureLoader } from './features';
|
||||
import { DynamicPlugin, dynamicPluginsServiceRef } from '../manager';
|
||||
import path, { resolve as resolvePath } from 'path';
|
||||
import path, { resolve as resolvePath } from 'node:path';
|
||||
import {
|
||||
BackendFeature,
|
||||
createBackendPlugin,
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
CommonJSModuleLoaderOptions,
|
||||
} from '../loader/CommonJSModuleLoader';
|
||||
import * as winston from 'winston';
|
||||
import * as url from 'url';
|
||||
import * as url from 'node:url';
|
||||
import { MESSAGE } from 'triple-beam';
|
||||
import { overridePackagePathResolution } from '@backstage/backend-plugin-api/testUtils';
|
||||
import { ScannedPluginPackage } from '../scanner';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { ModuleLoader } from './types';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { ScannedPluginManifest } from '../scanner';
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,9 +23,9 @@ import {
|
||||
coreServices,
|
||||
createServiceFactory,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
import fs from 'fs';
|
||||
import * as path from 'node:path';
|
||||
import * as url from 'node:url';
|
||||
import fs from 'node:fs';
|
||||
import {
|
||||
BackendDynamicPlugin,
|
||||
BaseDynamicPlugin,
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
NewBackendPluginInstaller,
|
||||
} from './types';
|
||||
import { ScannedPluginManifest, ScannedPluginPackage } from '../scanner/types';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { createSpecializedBackend } from '@backstage/backend-app-api';
|
||||
import { ConfigSources } from '@backstage/config-loader';
|
||||
import { Logs, MockedLogger, LogContent } from '../__testUtils__/testUtils';
|
||||
|
||||
@@ -25,7 +25,7 @@ import { ScannedPluginPackage } from '../scanner';
|
||||
import { PluginScanner } from '../scanner/plugin-scanner';
|
||||
import { ModuleLoader } from '../loader';
|
||||
import { CommonJSModuleLoader } from '../loader/CommonJSModuleLoader';
|
||||
import * as url from 'url';
|
||||
import * as url from 'node:url';
|
||||
import {
|
||||
BackendFeature,
|
||||
LoggerService,
|
||||
@@ -36,7 +36,7 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { PackageRole, PackageRoles } from '@backstage/cli-node';
|
||||
import { findPaths } from '@backstage/cli-common';
|
||||
import * as fs from 'fs';
|
||||
import * as fs from 'node:fs';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
import { PluginScanner } from './plugin-scanner';
|
||||
import { LogContent, Logs, MockedLogger } from '../__testUtils__/testUtils';
|
||||
import { Config, ConfigReader } from '@backstage/config';
|
||||
import path, { join } from 'path';
|
||||
import path, { join } from 'node:path';
|
||||
import { ScannedPluginPackage } from './types';
|
||||
import { mkdtempSync, rmSync } from 'fs';
|
||||
import { mkdir, writeFile, rm } from 'fs/promises';
|
||||
import { tmpdir } from 'os';
|
||||
import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { mkdir, writeFile, rm } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import waitForExpect from 'wait-for-expect';
|
||||
|
||||
describe('plugin-scanner', () => {
|
||||
|
||||
@@ -18,8 +18,8 @@ import { PluginScanner } from './plugin-scanner';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { Logs, MockedLogger } from '../__testUtils__/testUtils';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import path from 'path';
|
||||
import * as url from 'url';
|
||||
import path from 'node:path';
|
||||
import * as url from 'node:url';
|
||||
import { ScannedPluginPackage } from './types';
|
||||
import {
|
||||
MockDirectoryContent,
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
import { Config } from '@backstage/config';
|
||||
import { ScannedPluginPackage, ScannedPluginManifest } from './types';
|
||||
import * as fs from 'fs/promises';
|
||||
import { Stats, lstatSync, existsSync } from 'fs';
|
||||
import * as fs from 'node:fs/promises';
|
||||
import { Stats, lstatSync, existsSync } from 'node:fs';
|
||||
import * as chokidar from 'chokidar';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
import * as path from 'node:path';
|
||||
import * as url from 'node:url';
|
||||
import debounce from 'lodash/debounce';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { ForwardedError } from '@backstage/errors';
|
||||
|
||||
@@ -23,8 +23,8 @@ import {
|
||||
import { findPaths } from '@backstage/cli-common';
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
import * as path from 'node:path';
|
||||
import * as url from 'node:url';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
|
||||
@@ -21,9 +21,9 @@ import {
|
||||
import express from 'express';
|
||||
import { createOpenApiRouter, spec } from '../schema/openapi/generated';
|
||||
import { DynamicPluginProvider } from '../manager/types';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import * as url from 'node:url';
|
||||
import { FrontendRemoteResolvers } from './frontendRemotesServer';
|
||||
import { Remote } from '../schema/openapi/generated/models';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
```ts
|
||||
import { Express as Express_2 } from 'express';
|
||||
import { Server } from 'http';
|
||||
import { Server } from 'node:http';
|
||||
|
||||
// @public
|
||||
export const wrapInOpenApiTestServer: (app: Express_2) => Server | Express_2;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import * as mockttp from 'mockttp';
|
||||
import { OpenApiProxyValidator } from '../schema/validation';
|
||||
import getPort from 'get-port';
|
||||
import { Server } from 'http';
|
||||
import { Server } from 'node:http';
|
||||
|
||||
export class Proxy {
|
||||
server: mockttp.Mockttp;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Express } from 'express';
|
||||
import { Server } from 'http';
|
||||
import { Server } from 'node:http';
|
||||
import { Proxy } from './proxy/setup';
|
||||
|
||||
const proxiesToCleanup: Proxy[] = [];
|
||||
|
||||
@@ -22,7 +22,7 @@ import { PermissionRule } from '@backstage/plugin-permission-node';
|
||||
import { PermissionRuleset } from '@backstage/plugin-permission-node';
|
||||
import { QueryPermissionRequest } from '@backstage/plugin-permission-common';
|
||||
import { QueryPermissionResponse } from '@backstage/plugin-permission-common';
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
import type { Request as Request_2 } from 'express';
|
||||
import type { Response as Response_2 } from 'express';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import { isChildPath } from '@backstage/cli-common';
|
||||
import { NotAllowedError } from '@backstage/errors';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { resolve as resolvePath } from 'node:path';
|
||||
|
||||
/** @internal */
|
||||
export const packagePathMocks = new Map<
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Readable } from 'stream';
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
/**
|
||||
* A generic interface for fetching plain data from URLs.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { packagePathMocks } from './paths';
|
||||
import { posix as posixPath, resolve as resolvePath } from 'path';
|
||||
import { posix as posixPath, resolve as resolvePath } from 'node:path';
|
||||
|
||||
/** @public */
|
||||
export interface PackagePathResolutionOverride {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { stringifyError } from '@backstage/errors';
|
||||
import { randomBytes } from 'crypto';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import yn from 'yn';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { stringifyError } from '@backstage/errors';
|
||||
import { randomBytes } from 'crypto';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { parse as parsePgConnectionString } from 'pg-connection-string';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import os from 'os';
|
||||
import { join as joinPath, relative as relativePath } from 'path';
|
||||
import os from 'node:os';
|
||||
import { join as joinPath, relative as relativePath } from 'node:path';
|
||||
import { createMockDirectory, MockDirectory } from './MockDirectory';
|
||||
|
||||
describe('createMockDirectory', () => {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import os from 'os';
|
||||
import os from 'node:os';
|
||||
import { isChildPath } from '@backstage/backend-plugin-api';
|
||||
import fs from 'fs-extra';
|
||||
import textextensions from 'text-extensions';
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
relative as relativePath,
|
||||
win32,
|
||||
posix,
|
||||
} from 'path';
|
||||
} from 'node:path';
|
||||
|
||||
const tmpdirMarker = Symbol('os-tmpdir-mock');
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
import { startTestBackend } from '../wiring';
|
||||
import { MockSchedulerService } from './MockSchedulerService';
|
||||
import { mockServices } from './mockServices';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
import { setTimeout } from 'node:timers/promises';
|
||||
|
||||
const baseOpts = {
|
||||
frequency: { seconds: 10 },
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { ChildProcess } from 'child_process';
|
||||
import { ChildProcess } from 'node:child_process';
|
||||
import { CustomErrorBase } from '@backstage/errors';
|
||||
import { SpawnOptions } from 'child_process';
|
||||
import { SpawnOptions } from 'node:child_process';
|
||||
|
||||
// @public
|
||||
export const BACKSTAGE_JSON = 'backstage.json';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { posix, win32 } from 'path';
|
||||
import { posix, win32 } from 'node:path';
|
||||
|
||||
describe('isChildPath', () => {
|
||||
it('should check child posix paths', () => {
|
||||
|
||||
@@ -20,8 +20,8 @@ import {
|
||||
resolve as resolvePath,
|
||||
dirname,
|
||||
basename,
|
||||
} from 'path';
|
||||
import { realpathSync, lstatSync, readlinkSync } from 'fs';
|
||||
} from 'node:path';
|
||||
import { realpathSync, lstatSync, readlinkSync } from 'node:fs';
|
||||
|
||||
// Resolves a path to its real location, following symlinks.
|
||||
// Handles cases where the final target doesn't exist by recursively
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { resolve as resolvePath } from 'node:path';
|
||||
import { findPaths, findRootPath, findOwnDir, findOwnRootDir } from './paths';
|
||||
|
||||
describe('paths', () => {
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import { dirname, resolve as resolvePath } from 'path';
|
||||
import fs from 'node:fs';
|
||||
import { dirname, resolve as resolvePath } from 'node:path';
|
||||
|
||||
/**
|
||||
* A function that takes a set of path fragments and resolves them into a
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ChildProcess, SpawnOptions } from 'child_process';
|
||||
import { ChildProcess, SpawnOptions } from 'node:child_process';
|
||||
import spawn from 'cross-spawn';
|
||||
import { ExitCodeError } from './errors';
|
||||
import { assertError } from '@backstage/errors';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { resolve as resolvePath } from 'node:path';
|
||||
import { getPackages } from '@manypkg/get-packages';
|
||||
import { PackageGraph } from './PackageGraph';
|
||||
import { Lockfile } from './Lockfile';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import { getPackages, Package } from '@manypkg/get-packages';
|
||||
import { paths } from '../paths';
|
||||
import { PackageRole } from '../roles';
|
||||
|
||||
@@ -15,11 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
// Figure out whether we're running inside the backstage repo or as an installed dependency
|
||||
/* eslint-disable-next-line no-restricted-syntax */
|
||||
const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src'));
|
||||
const isLocal = require('node:fs').existsSync(
|
||||
path.resolve(__dirname, '../src'),
|
||||
);
|
||||
|
||||
if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) {
|
||||
require('..');
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const { join: joinPath } = require('path');
|
||||
const { join: joinPath } = require('node:path');
|
||||
|
||||
/**
|
||||
* Creates a ESLint configuration that extends the base Backstage configuration.
|
||||
@@ -235,7 +235,7 @@ function createConfigForRole(dir, role, extraConfig = {}) {
|
||||
name: '@mui/material',
|
||||
message: "Please import '@mui/material/...' instead.",
|
||||
},
|
||||
...require('module').builtinModules,
|
||||
...require('node:module').builtinModules,
|
||||
...(extraConfig.restrictedImports ?? []),
|
||||
],
|
||||
// https://mui.com/material-ui/guides/minimizing-bundle-size/
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const crypto = require('crypto');
|
||||
const glob = require('util').promisify(require('glob'));
|
||||
const path = require('node:path');
|
||||
const crypto = require('node:crypto');
|
||||
const glob = require('node:util').promisify(require('glob'));
|
||||
const { version } = require('../package.json');
|
||||
const paths = require('@backstage/cli-common').findPaths(process.cwd());
|
||||
const {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
module.exports = {
|
||||
process(src, filename) {
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const http = require('http');
|
||||
const https = require('https');
|
||||
const http = require('node:http');
|
||||
const https = require('node:https');
|
||||
|
||||
const errorMessage = 'Network requests are not allowed in tests';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const { createHash } = require('crypto');
|
||||
const { createHash } = require('node:crypto');
|
||||
const { transform } = require('sucrase');
|
||||
const sucrasePkg = require('sucrase/package.json');
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
const yaml = require('yaml');
|
||||
const crypto = require('crypto');
|
||||
const crypto = require('node:crypto');
|
||||
|
||||
function createTransformer(config) {
|
||||
const process = source => {
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const { pathToFileURL } = require('url');
|
||||
const { pathToFileURL } = require('node:url');
|
||||
const { transformSync } = require('@swc/core');
|
||||
const { addHook } = require('pirates');
|
||||
const { Module } = require('module');
|
||||
const { Module } = require('node:module');
|
||||
|
||||
// This hooks into module resolution and overrides imports of packages that
|
||||
// exist in the linked workspace to instead be resolved from the linked workspace.
|
||||
if (process.env.BACKSTAGE_CLI_LINKED_WORKSPACE) {
|
||||
const { join: joinPath } = require('path');
|
||||
const { join: joinPath } = require('node:path');
|
||||
const { getPackagesSync } = require('@manypkg/get-packages');
|
||||
const { packages: linkedPackages, root: linkedRoot } = getPackagesSync(
|
||||
process.env.BACKSTAGE_CLI_LINKED_WORKSPACE,
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { dirname, extname, resolve as resolvePath } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, extname, resolve as resolvePath } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { transformFile } from '@swc/core';
|
||||
import { isBuiltin } from 'node:module';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { existsSync } from 'fs';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { existsSync } from 'node:fs';
|
||||
|
||||
// @ts-check
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user