Cleye outputs ANSI bold escape sequences around section headers
(e.g. Usage:, Flags:) unconditionally, which prevented the help
page parser from recognizing them. Strip ANSI SGR sequences from
captured output and set NO_COLOR=1 in the child environment.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Remove fragile process.stdout._handle.setBlocking calls from CLI test
commands. Revert the preload workaround in repo-tools since the root
cause is removed.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Add a --require preload that stubs process.stdout._handle when stdout is
a SyncWriteStream (file-backed). Some CLI code accesses _handle.setBlocking
directly and would crash without the stub.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Use a temp file instead of a pipe for child process stdout in
createBinRunner. Node.js uses a SyncWriteStream for regular files, so
all writes complete synchronously before process.exit() can discard them.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Use spawnSync instead of spawn for child processes in createBinRunner.
This avoids stdout data loss when child processes call process.exit()
before Node.js flushes its internal stream buffer to the pipe.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Add cleye-based --help handling to all commands using the loader pattern.
Update the CLI report parser to support cleye's USAGE: and FLAGS: sections.
Revert accidental backstage.role addition to eslint-plugin.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Extend `BackstageCommand.execute` to accept either a direct function or a
`{ loader }` object for lazy loading command implementations. Convert
several build and migrate commands to use the new pattern. Switch from
`program.parse` to `program.parseAsync` to properly await async actions.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Split version.ts into two locations:
- Template version provider moved to modules/new/lib/version.ts
- CLI version info moved to wiring/version.ts
Remove publishPreflightCheck from repo fix command (still runs during
package prepack). Fix build module self-references to use shorter
within-module paths.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
The paths-ignore for microsite/** was also skipping CI for changes to
microsite/data/plugins/, which is where the plugin directory YAML files
live. This meant the verify plugin directory step never ran for the
files it was supposed to validate.
Switch from paths-ignore to paths with negation so that microsite/data/
changes still trigger CI while other microsite changes remain excluded.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
The shared dependency key `@mui/material/styles/` (with trailing slash) caused
module resolution failures because MUI's package.json exports map only defines
`./styles`, not `./styles/`. This resulted in errors like:
Package subpath './styles/' is not defined by "exports" in
@mui/material/package.json
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Move `getHasYarnPlugin` and `SuccessCache` from `@backstage/cli` internal
modules to `@backstage/cli-node` as public exports, making them available
for reuse by other CLI tooling.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>