Skip to content

Commit

Permalink
feat: enable packages option
Browse files Browse the repository at this point in the history
  • Loading branch information
gpuente committed Jan 23, 2025
1 parent 3bd8d33 commit 4c32ac1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion studio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type ConnectStudioOptions = {
localEditors?: string;
localDocuments?: string;
open?: boolean;
packages?: { packageName: string }[];
};

export function generateImportSctipt(outputPath: string, projects: Project[]) {
Expand Down Expand Up @@ -89,7 +90,7 @@ export function generateImportSctipt(outputPath: string, projects: Project[]) {
}

export function startConnectStudio(options: ConnectStudioOptions) {
let serverOptions: StartServerOptions = {};
const serverOptions: StartServerOptions = {};

if (options.port) {
process.env.PORT = options.port;
Expand Down Expand Up @@ -154,6 +155,18 @@ export function startConnectStudio(options: ConnectStudioOptions) {
serverOptions.enableExternalProjects = false;
}

if (options.packages && options.packages.length > 0) {
const packages = mapProjects(options.packages);
generateImportSctipt(projectRoot, packages);
process.env.LOAD_EXTERNAL_PROJECTS = 'true';

serverOptions.enableExternalProjects = true;
serverOptions.projectsImportPath = resolve(
projectRoot,
IMPORT_SCRIPT_FILE,
);
}

if (options.localEditors) {
process.env.LOCAL_DOCUMENT_EDITORS = options.localEditors;
}
Expand Down

0 comments on commit 4c32ac1

Please sign in to comment.