Remove dead parallelism options and narrow public API
The parallelism fields on bundler types (BundlingOptions, BuildOptions, BackendBundlingOptions) and createDistWorkspace Options were defined but never read — fully dead code. Likewise the parallelismSetting option on ParallelWorkerOptions was never passed by any caller. Also narrows the cli-node public API to only export the three runner functions and their option types, keeping getEnvironmentParallelism and parseParallelismOption as internal utilities. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@ import { resolve as resolvePath } from 'node:path';
|
||||
import * as tar from 'tar';
|
||||
import { createDistWorkspace } from './packager';
|
||||
import { buildPackage, Output } from './builder';
|
||||
import { PackageGraph, getEnvironmentParallelism } from '@backstage/cli-node';
|
||||
import { PackageGraph } from '@backstage/cli-node';
|
||||
|
||||
const BUNDLE_FILE = 'bundle.tar.gz';
|
||||
const SKELETON_FILE = 'skeleton.tar.gz';
|
||||
@@ -52,7 +52,6 @@ export async function buildBackend(options: BuildBackendOptions) {
|
||||
configPaths,
|
||||
buildDependencies: !skipBuildDependencies,
|
||||
buildExcludes: [pkg.name],
|
||||
parallelism: getEnvironmentParallelism(),
|
||||
skeleton: SKELETON_FILE,
|
||||
minify,
|
||||
});
|
||||
|
||||
@@ -17,10 +17,7 @@
|
||||
import fs from 'fs-extra';
|
||||
import { resolve as resolvePath } from 'node:path';
|
||||
import { buildBundle, getModuleFederationRemoteOptions } from './bundler';
|
||||
import {
|
||||
BackstagePackageJson,
|
||||
getEnvironmentParallelism,
|
||||
} from '@backstage/cli-node';
|
||||
import { BackstagePackageJson } from '@backstage/cli-node';
|
||||
import { loadCliConfig } from '../../config/lib/config';
|
||||
|
||||
interface BuildAppOptions {
|
||||
@@ -39,7 +36,6 @@ export async function buildFrontend(options: BuildAppOptions) {
|
||||
await buildBundle({
|
||||
targetDir,
|
||||
entry: 'src/index',
|
||||
parallelism: getEnvironmentParallelism(),
|
||||
statsJsonEnabled: writeStats,
|
||||
moduleFederationRemote: options.isModuleFederationRemote
|
||||
? await getModuleFederationRemoteOptions(
|
||||
|
||||
@@ -36,7 +36,6 @@ export type BundlingOptions = {
|
||||
isDev: boolean;
|
||||
frontendConfig: Config;
|
||||
getFrontendAppConfigs(): AppConfig[];
|
||||
parallelism?: number;
|
||||
additionalEntryPoints?: string[];
|
||||
// Path to append to the detected public path, e.g. '/public'
|
||||
publicSubPath?: string;
|
||||
@@ -63,7 +62,6 @@ export type BuildOptions = BundlingPathsOptions & {
|
||||
// Target directory, defaulting to paths.targetDir
|
||||
targetDir?: string;
|
||||
statsJsonEnabled: boolean;
|
||||
parallelism?: number;
|
||||
schema?: ConfigSchema;
|
||||
frontendConfig: Config;
|
||||
frontendAppConfigs: AppConfig[];
|
||||
@@ -75,7 +73,6 @@ export type BuildOptions = BundlingPathsOptions & {
|
||||
export type BackendBundlingOptions = {
|
||||
checksEnabled: boolean;
|
||||
isDev: boolean;
|
||||
parallelism?: number;
|
||||
inspectEnabled: boolean;
|
||||
inspectBrkEnabled: boolean;
|
||||
require?: string;
|
||||
|
||||
@@ -86,11 +86,6 @@ type Options = {
|
||||
*/
|
||||
buildExcludes?: string[];
|
||||
|
||||
/**
|
||||
* Controls amount of parallelism in some build steps.
|
||||
*/
|
||||
parallelism?: number;
|
||||
|
||||
/**
|
||||
* If set, creates a skeleton tarball that contains all package.json files
|
||||
* with the same structure as the workspace dir.
|
||||
|
||||
Reference in New Issue
Block a user