replace --alwaysYarnPack with --alwaysPack
Signed-off-by: Tyler Davis <tylerd@canva.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
add --alwaysPack as a replacement for the now-hidden --alwaysYarnPack
|
||||
@@ -34,7 +34,7 @@ Commands:
|
||||
Usage: backstage-cli build-workspace [options] <workspace-dir> [packages...]
|
||||
|
||||
Options:
|
||||
--alwaysYarnPack
|
||||
--alwaysPack
|
||||
-h, --help
|
||||
```
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import fs from 'fs-extra';
|
||||
import { createDistWorkspace } from '../lib/packager';
|
||||
|
||||
type Options = {
|
||||
alwaysYarnPack?: boolean;
|
||||
alwaysPack?: boolean;
|
||||
};
|
||||
|
||||
export default async (dir: string, packages: string[], options: Options) => {
|
||||
@@ -28,7 +28,7 @@ export default async (dir: string, packages: string[], options: Options) => {
|
||||
|
||||
await createDistWorkspace(packages, {
|
||||
targetDir: dir,
|
||||
alwaysYarnPack: options.alwaysYarnPack,
|
||||
alwaysPack: options.alwaysPack,
|
||||
enableFeatureDetection: true,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Command } from 'commander';
|
||||
import { Command, Option } from 'commander';
|
||||
import { assertError } from '@backstage/errors';
|
||||
import { exitWithError } from '../lib/errors';
|
||||
|
||||
@@ -375,8 +375,16 @@ export function registerCommands(program: Command) {
|
||||
|
||||
program
|
||||
.command('build-workspace <workspace-dir> [packages...]')
|
||||
.addOption(
|
||||
new Option(
|
||||
'--alwaysYarnPack',
|
||||
'Alias for --alwaysPack for backwards compatibility.',
|
||||
)
|
||||
.implies({ alwaysPack: true })
|
||||
.hideHelp(true),
|
||||
)
|
||||
.option(
|
||||
'--alwaysYarnPack',
|
||||
'--alwaysPack',
|
||||
'Force workspace output to be a result of running `yarn pack` on each package (warning: very slow)',
|
||||
)
|
||||
.description('Builds a temporary dist workspace from the provided packages')
|
||||
|
||||
@@ -103,7 +103,7 @@ type Options = {
|
||||
* workspace. This ensures correct workspace output at significant cost to
|
||||
* command performance.
|
||||
*/
|
||||
alwaysYarnPack?: boolean;
|
||||
alwaysPack?: boolean;
|
||||
|
||||
/**
|
||||
* If set to true, the TypeScript feature detection will be enabled, which
|
||||
@@ -242,7 +242,7 @@ export async function createDistWorkspace(
|
||||
await moveToDistWorkspace(
|
||||
targetDir,
|
||||
targets,
|
||||
Boolean(options.alwaysYarnPack),
|
||||
Boolean(options.alwaysPack),
|
||||
Boolean(options.enableFeatureDetection),
|
||||
);
|
||||
|
||||
@@ -286,13 +286,13 @@ const FAST_PACK_SCRIPTS = [
|
||||
async function moveToDistWorkspace(
|
||||
workspaceDir: string,
|
||||
localPackages: PackageGraphNode[],
|
||||
alwaysYarnPack: boolean,
|
||||
alwaysPack: boolean,
|
||||
enableFeatureDetection: boolean,
|
||||
): Promise<void> {
|
||||
const [fastPackPackages, slowPackPackages] = partition(
|
||||
localPackages,
|
||||
pkg =>
|
||||
!alwaysYarnPack &&
|
||||
!alwaysPack &&
|
||||
FAST_PACK_SCRIPTS.includes(pkg.packageJson.scripts?.prepack),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user