cli: use namespaced env var to communicate linked workspace
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user