cli: use namespaced env var to communicate linked workspace

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-10-22 13:27:47 +02:00
parent d2e166cbb2
commit 659d28e411
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -20,11 +20,11 @@ const { Module } = require('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.LINKED_WORKSPACE) {
if (process.env.BACKSTAGE_CLI_LINKED_WORKSPACE) {
const { join: joinPath } = require('path');
const { getPackagesSync } = require('@manypkg/get-packages');
const { packages: linkedPackages, root: linkedRoot } = getPackagesSync(
process.env.LINKED_WORKSPACE,
process.env.BACKSTAGE_CLI_LINKED_WORKSPACE,
);
// Matches all packages in the linked workspaces, as well as sub-path exports from them
+1 -1
View File
@@ -121,7 +121,7 @@ export async function runBackend(options: RunBackendOptions) {
stdio: ['ignore', 'inherit', 'inherit', 'ipc'],
env: {
...process.env,
LINKED_WORKSPACE: options.linkedWorkspace,
BACKSTAGE_CLI_LINKED_WORKSPACE: options.linkedWorkspace,
BACKSTAGE_CLI_CHANNEL: '1',
ESBK_TSCONFIG_PATH: paths.resolveTargetRoot('tsconfig.json'),
},