From 6fa63d411f9485a5f38be3be5a2c053b77d9c0cf Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 22 Feb 2026 14:15:27 +0100 Subject: [PATCH] Fix prettier formatting Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/cache/SuccessCache.ts | 1 - packages/cli/src/lib/typeDistProject.ts | 1 - packages/cli/src/lib/yarnPlugin.ts | 1 - .../build/commands/package/start/command.ts | 1 - .../src/modules/build/commands/repo/start.test.ts | 1 - .../build/lib/bundler/hasReactDomClient.ts | 1 - .../modules/build/lib/bundler/linkWorkspaces.ts | 1 - .../modules/build/lib/bundler/packageDetection.ts | 1 - .../cli/src/modules/build/lib/bundler/paths.ts | 4 +++- .../build/lib/packager/createDistWorkspace.ts | 4 +++- .../modules/maintenance/commands/package/clean.ts | 1 - .../modules/maintenance/commands/repo/clean.ts | 1 - .../commands/repo/list-deprecations.ts | 1 - .../src/modules/migrate/commands/packageRole.ts | 1 - .../src/modules/migrate/commands/versions/bump.ts | 7 +++++-- .../src/modules/new/lib/codeowners/codeowners.ts | 1 - .../lib/execution/writeTemplateContents.test.ts | 1 - .../new/lib/execution/writeTemplateContents.ts | 2 -- .../api-reports/api-reports/runApiExtraction.ts | 15 +++------------ .../src/commands/api-reports/buildApiReports.ts | 4 +--- .../commands/api-reports/categorizePackageDirs.ts | 4 +--- .../src/commands/package-docs/command.ts | 10 ++-------- .../repo-tools/src/commands/package-docs/utils.ts | 5 ++++- packages/repo-tools/src/lib/paths.ts | 4 +++- 24 files changed, 25 insertions(+), 48 deletions(-) diff --git a/packages/cli/src/lib/cache/SuccessCache.ts b/packages/cli/src/lib/cache/SuccessCache.ts index 2dc01593b4..8131a469a4 100644 --- a/packages/cli/src/lib/cache/SuccessCache.ts +++ b/packages/cli/src/lib/cache/SuccessCache.ts @@ -18,7 +18,6 @@ import fs from 'fs-extra'; import { resolve as resolvePath } from 'node:path'; import { targetPaths } from '@backstage/cli-common'; - const DEFAULT_CACHE_BASE_PATH = 'node_modules/.cache/backstage-cli'; const CACHE_MAX_AGE_MS = 7 * 24 * 3600_000; diff --git a/packages/cli/src/lib/typeDistProject.ts b/packages/cli/src/lib/typeDistProject.ts index 11a0019490..e9cc96d988 100644 --- a/packages/cli/src/lib/typeDistProject.ts +++ b/packages/cli/src/lib/typeDistProject.ts @@ -22,7 +22,6 @@ import { resolve as resolvePath } from 'node:path'; import { Project, SourceFile, SyntaxKind, ts, Type } from 'ts-morph'; import { targetPaths } from '@backstage/cli-common'; - export const createTypeDistProject = async () => { return new Project({ tsConfigFilePath: targetPaths.resolveRoot('tsconfig.json'), diff --git a/packages/cli/src/lib/yarnPlugin.ts b/packages/cli/src/lib/yarnPlugin.ts index fdef27e07f..0390345651 100644 --- a/packages/cli/src/lib/yarnPlugin.ts +++ b/packages/cli/src/lib/yarnPlugin.ts @@ -19,7 +19,6 @@ import yaml from 'yaml'; import z from 'zod'; import { targetPaths } from '@backstage/cli-common'; - const yarnRcSchema = z.object({ plugins: z .array( diff --git a/packages/cli/src/modules/build/commands/package/start/command.ts b/packages/cli/src/modules/build/commands/package/start/command.ts index c1abd7ed14..18f06ab0d2 100644 --- a/packages/cli/src/modules/build/commands/package/start/command.ts +++ b/packages/cli/src/modules/build/commands/package/start/command.ts @@ -20,7 +20,6 @@ import { resolveLinkedWorkspace } from './resolveLinkedWorkspace'; import { findRoleFromCommand } from '../../../lib/role'; import { targetPaths } from '@backstage/cli-common'; - export async function command(opts: OptionValues): Promise { await startPackage({ role: await findRoleFromCommand(opts), diff --git a/packages/cli/src/modules/build/commands/repo/start.test.ts b/packages/cli/src/modules/build/commands/repo/start.test.ts index 4cb3449e12..54414b7e90 100644 --- a/packages/cli/src/modules/build/commands/repo/start.test.ts +++ b/packages/cli/src/modules/build/commands/repo/start.test.ts @@ -19,7 +19,6 @@ import { findTargetPackages } from './start'; import { posix } from 'node:path'; import { targetPaths } from '@backstage/cli-common'; - const mocks = { app: { packageJson: { diff --git a/packages/cli/src/modules/build/lib/bundler/hasReactDomClient.ts b/packages/cli/src/modules/build/lib/bundler/hasReactDomClient.ts index 0a60840047..9dfc3fef5f 100644 --- a/packages/cli/src/modules/build/lib/bundler/hasReactDomClient.ts +++ b/packages/cli/src/modules/build/lib/bundler/hasReactDomClient.ts @@ -16,7 +16,6 @@ import { targetPaths } from '@backstage/cli-common'; - export function hasReactDomClient() { try { require.resolve('react-dom/client', { diff --git a/packages/cli/src/modules/build/lib/bundler/linkWorkspaces.ts b/packages/cli/src/modules/build/lib/bundler/linkWorkspaces.ts index 10a2e7d209..f724e444b4 100644 --- a/packages/cli/src/modules/build/lib/bundler/linkWorkspaces.ts +++ b/packages/cli/src/modules/build/lib/bundler/linkWorkspaces.ts @@ -19,7 +19,6 @@ import { getPackages } from '@manypkg/get-packages'; import { rspack } from '@rspack/core'; import { targetPaths } from '@backstage/cli-common'; - /** * This returns of collection of plugins that links a separate workspace into * the target one. Any packages that are present in the linked workspaces will diff --git a/packages/cli/src/modules/build/lib/bundler/packageDetection.ts b/packages/cli/src/modules/build/lib/bundler/packageDetection.ts index cb2c3f588f..5b4837a133 100644 --- a/packages/cli/src/modules/build/lib/bundler/packageDetection.ts +++ b/packages/cli/src/modules/build/lib/bundler/packageDetection.ts @@ -22,7 +22,6 @@ import PQueue from 'p-queue'; import { dirname, join as joinPath, resolve as resolvePath } from 'node:path'; import { targetPaths } from '@backstage/cli-common'; - const DETECTED_MODULES_MODULE_NAME = '__backstage-autodetected-plugins__'; interface PackageDetectionConfig { diff --git a/packages/cli/src/modules/build/lib/bundler/paths.ts b/packages/cli/src/modules/build/lib/bundler/paths.ts index 4e79f77884..2b65052550 100644 --- a/packages/cli/src/modules/build/lib/bundler/paths.ts +++ b/packages/cli/src/modules/build/lib/bundler/paths.ts @@ -49,7 +49,9 @@ export function resolveBundlingPaths(options: BundlingPathsOptions) { } else { targetHtml = resolvePath(targetDir, `${entry}.html`); if (!fs.pathExistsSync(targetHtml)) { - targetHtml = findOwnPaths(__dirname).resolve('templates/serve_index.html'); + targetHtml = findOwnPaths(__dirname).resolve( + 'templates/serve_index.html', + ); } } diff --git a/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts b/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts index e1adcd6c20..50fb0f4e31 100644 --- a/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts +++ b/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts @@ -211,7 +211,9 @@ export async function createDistWorkspace( targetDir: pkg.dir, packageJson: pkg.packageJson, outputs: outputs, - logPrefix: `${chalk.cyan(relativePath(targetPaths.rootDir, pkg.dir))}: `, + logPrefix: `${chalk.cyan( + relativePath(targetPaths.rootDir, pkg.dir), + )}: `, minify: options.minify, workspacePackages: packages, }); diff --git a/packages/cli/src/modules/maintenance/commands/package/clean.ts b/packages/cli/src/modules/maintenance/commands/package/clean.ts index 74c6761a50..70d7ea3771 100644 --- a/packages/cli/src/modules/maintenance/commands/package/clean.ts +++ b/packages/cli/src/modules/maintenance/commands/package/clean.ts @@ -17,7 +17,6 @@ import fs from 'fs-extra'; import { targetPaths } from '@backstage/cli-common'; - export default async function clean() { await fs.remove(targetPaths.resolve('dist')); await fs.remove(targetPaths.resolve('dist-types')); diff --git a/packages/cli/src/modules/maintenance/commands/repo/clean.ts b/packages/cli/src/modules/maintenance/commands/repo/clean.ts index 00f45ad967..28b123fa9e 100644 --- a/packages/cli/src/modules/maintenance/commands/repo/clean.ts +++ b/packages/cli/src/modules/maintenance/commands/repo/clean.ts @@ -20,7 +20,6 @@ import { PackageGraph } from '@backstage/cli-node'; import { run, targetPaths } from '@backstage/cli-common'; - export async function command(): Promise { const packages = await PackageGraph.listTargetPackages(); diff --git a/packages/cli/src/modules/maintenance/commands/repo/list-deprecations.ts b/packages/cli/src/modules/maintenance/commands/repo/list-deprecations.ts index f473e55ce6..f4114838a1 100644 --- a/packages/cli/src/modules/maintenance/commands/repo/list-deprecations.ts +++ b/packages/cli/src/modules/maintenance/commands/repo/list-deprecations.ts @@ -21,7 +21,6 @@ import { relative as relativePath } from 'node:path'; import { PackageGraph } from '@backstage/cli-node'; import { targetPaths } from '@backstage/cli-common'; - export async function command(opts: OptionValues) { const packages = await PackageGraph.listTargetPackages(); diff --git a/packages/cli/src/modules/migrate/commands/packageRole.ts b/packages/cli/src/modules/migrate/commands/packageRole.ts index 32e20f10eb..6b422c375e 100644 --- a/packages/cli/src/modules/migrate/commands/packageRole.ts +++ b/packages/cli/src/modules/migrate/commands/packageRole.ts @@ -20,7 +20,6 @@ import { getPackages } from '@manypkg/get-packages'; import { PackageRoles } from '@backstage/cli-node'; import { targetPaths } from '@backstage/cli-common'; - export default async () => { const { packages } = await getPackages(targetPaths.dir); diff --git a/packages/cli/src/modules/migrate/commands/versions/bump.ts b/packages/cli/src/modules/migrate/commands/versions/bump.ts index ff8852de71..4283028216 100644 --- a/packages/cli/src/modules/migrate/commands/versions/bump.ts +++ b/packages/cli/src/modules/migrate/commands/versions/bump.ts @@ -13,8 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { BACKSTAGE_JSON, bootstrapEnvProxyAgents, targetPaths } from '@backstage/cli-common'; - +import { + BACKSTAGE_JSON, + bootstrapEnvProxyAgents, + targetPaths, +} from '@backstage/cli-common'; bootstrapEnvProxyAgents(); diff --git a/packages/cli/src/modules/new/lib/codeowners/codeowners.ts b/packages/cli/src/modules/new/lib/codeowners/codeowners.ts index d8e3d0c02f..c0cddba126 100644 --- a/packages/cli/src/modules/new/lib/codeowners/codeowners.ts +++ b/packages/cli/src/modules/new/lib/codeowners/codeowners.ts @@ -18,7 +18,6 @@ import fs from 'fs-extra'; import path from 'node:path'; import { targetPaths } from '@backstage/cli-common'; - const TEAM_ID_RE = /^@[-\w]+\/[-\w]+$/; const USER_ID_RE = /^@[-\w]+$/; const EMAIL_RE = /^[^@]+@[-.\w]+\.[-\w]+$/i; diff --git a/packages/cli/src/modules/new/lib/execution/writeTemplateContents.test.ts b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.test.ts index e991d45b51..768f46e20e 100644 --- a/packages/cli/src/modules/new/lib/execution/writeTemplateContents.test.ts +++ b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.test.ts @@ -19,7 +19,6 @@ import { writeTemplateContents } from './writeTemplateContents'; import { createMockDirectory } from '@backstage/backend-test-utils'; import { targetPaths } from '@backstage/cli-common'; - const baseConfig = { version: '0.1.0', license: 'Apache-2.0', diff --git a/packages/cli/src/modules/new/lib/execution/writeTemplateContents.ts b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.ts index 40bbec1ed4..619a6fc3f2 100644 --- a/packages/cli/src/modules/new/lib/execution/writeTemplateContents.ts +++ b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.ts @@ -17,14 +17,12 @@ import fs from 'fs-extra'; import { dirname, resolve as resolvePath } from 'node:path'; - import { PortableTemplate, PortableTemplateInput } from '../types'; import { ForwardedError, InputError } from '@backstage/errors'; import { isMonoRepo as getIsMonoRepo } from '@backstage/cli-node'; import { PortableTemplater } from './PortableTemplater'; import { isChildPath, targetPaths } from '@backstage/cli-common'; - export async function writeTemplateContents( template: PortableTemplate, input: PortableTemplateInput, diff --git a/packages/repo-tools/src/commands/api-reports/api-reports/runApiExtraction.ts b/packages/repo-tools/src/commands/api-reports/api-reports/runApiExtraction.ts index 89b87b9a0b..787a2cb3f4 100644 --- a/packages/repo-tools/src/commands/api-reports/api-reports/runApiExtraction.ts +++ b/packages/repo-tools/src/commands/api-reports/api-reports/runApiExtraction.ts @@ -35,9 +35,7 @@ import { targetPaths } from '@backstage/cli-common'; import { logApiReportInstructions } from '../common'; import { patchApiReportGeneration } from './patchApiReportGeneration'; -const tmpDir = targetPaths.resolveRoot( - './node_modules/.cache/api-extractor', -); +const tmpDir = targetPaths.resolveRoot('./node_modules/.cache/api-extractor'); export async function countApiReportWarnings(reportPath: string) { try { @@ -143,11 +141,7 @@ export async function runApiExtraction({ // inspected. const allDistTypesEntryPointPaths = allEntryPoints.map( ({ packageDir, distTypesPath }) => { - return targetPaths.resolveRoot( - './dist-types', - packageDir, - distTypesPath, - ); + return targetPaths.resolveRoot('./dist-types', packageDir, distTypesPath); }, ); @@ -173,10 +167,7 @@ export async function runApiExtraction({ : allowWarnings; const projectFolder = targetPaths.resolveRoot(packageDir); - const packageFolder = targetPaths.resolveRoot( - './dist-types', - packageDir, - ); + const packageFolder = targetPaths.resolveRoot('./dist-types', packageDir); const remainingReportFiles = new Set( fs.readdirSync(projectFolder).filter( diff --git a/packages/repo-tools/src/commands/api-reports/buildApiReports.ts b/packages/repo-tools/src/commands/api-reports/buildApiReports.ts index 87b3f62a6c..41c6aa8a57 100644 --- a/packages/repo-tools/src/commands/api-reports/buildApiReports.ts +++ b/packages/repo-tools/src/commands/api-reports/buildApiReports.ts @@ -38,9 +38,7 @@ type Options = { } & OptionValues; export async function buildApiReports(paths: string[] = [], opts: Options) { - const tmpDir = targetPaths.resolveRoot( - './node_modules/.cache/api-extractor', - ); + const tmpDir = targetPaths.resolveRoot('./node_modules/.cache/api-extractor'); const isCiBuild = opts.ci; const isDocsBuild = opts.docs; diff --git a/packages/repo-tools/src/commands/api-reports/categorizePackageDirs.ts b/packages/repo-tools/src/commands/api-reports/categorizePackageDirs.ts index 7dfaa64524..973c7b8acb 100644 --- a/packages/repo-tools/src/commands/api-reports/categorizePackageDirs.ts +++ b/packages/repo-tools/src/commands/api-reports/categorizePackageDirs.ts @@ -45,9 +45,7 @@ export async function categorizePackageDirs(packageDirs: string[]) { if (!role) { return; // Ignore packages without roles } - if ( - await fs.pathExists(targetPaths.resolveRoot(dir, 'migrations')) - ) { + if (await fs.pathExists(targetPaths.resolveRoot(dir, 'migrations'))) { sqlPackageDirs.push(dir); } // TODO(Rugvip): Inlined packages are ignored because we can't handle @internal exports diff --git a/packages/repo-tools/src/commands/package-docs/command.ts b/packages/repo-tools/src/commands/package-docs/command.ts index 13a0603e41..3e635b34f4 100644 --- a/packages/repo-tools/src/commands/package-docs/command.ts +++ b/packages/repo-tools/src/commands/package-docs/command.ts @@ -150,10 +150,7 @@ export default async function packageDocs(paths: string[] = [], opts: any) { selectedPackageDirs.map(pkg => limit(async () => { const pkgJson = JSON.parse( - await readFile( - targetPaths.resolveRoot(pkg, 'package.json'), - 'utf-8', - ), + await readFile(targetPaths.resolveRoot(pkg, 'package.json'), 'utf-8'), ); if (EXCLUDE.includes(pkg) || pkgJson.name.startsWith('@internal/')) { return; @@ -172,10 +169,7 @@ export default async function packageDocs(paths: string[] = [], opts: any) { console.log(`### Processing ${pkg}`); const success = await generateDocJson(pkg); if (success) { - await cache.write( - pkg, - targetPaths.resolveRoot(`dist-types`, pkg), - ); + await cache.write(pkg, targetPaths.resolveRoot(`dist-types`, pkg)); } } catch (e) { console.error('Failed to generate docs for', pkg); diff --git a/packages/repo-tools/src/commands/package-docs/utils.ts b/packages/repo-tools/src/commands/package-docs/utils.ts index 41720f8055..97a98a28d0 100644 --- a/packages/repo-tools/src/commands/package-docs/utils.ts +++ b/packages/repo-tools/src/commands/package-docs/utils.ts @@ -18,7 +18,10 @@ import { findOwnPaths } from '@backstage/cli-common'; import fs from 'fs-extra'; export async function createTemporaryTsConfig(dir: string) { - const path = findOwnPaths(__dirname).resolveRoot(dir, 'tsconfig.typedoc.tmp.json'); + const path = findOwnPaths(__dirname).resolveRoot( + dir, + 'tsconfig.typedoc.tmp.json', + ); process.once('exit', () => { fs.removeSync(path); diff --git a/packages/repo-tools/src/lib/paths.ts b/packages/repo-tools/src/lib/paths.ts index 3f1c5ce3f4..fea456ea3e 100644 --- a/packages/repo-tools/src/lib/paths.ts +++ b/packages/repo-tools/src/lib/paths.ts @@ -63,7 +63,9 @@ export async function resolvePackagePaths( if (include) { packages = packages.filter(pkg => include.some(pattern => - new Minimatch(pattern).match(relativePath(targetPaths.rootDir, pkg.dir)), + new Minimatch(pattern).match( + relativePath(targetPaths.rootDir, pkg.dir), + ), ), ); }