@tapi-dev/sdk 0.1.39 → 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.d.ts CHANGED
@@ -148,10 +148,12 @@ export declare function validateStudioManifest(input: unknown): StudioReleaseMan
148
148
  export declare function validateServiceReleaseManifest(input: unknown): ServiceReleaseManifest;
149
149
  export declare function compareVersions(left: string, right: string): number;
150
150
  export declare function memoizeStudioInstallToken(options: StudioCliOptions, installToken?: string, source?: StudioCliOptions["installTokenSource"]): string;
151
+ export declare function resolveStudioTappSelection(options: StudioCliOptions): Promise<StudioCliOptions>;
151
152
  export declare function closeExistingPortableStudioServersForFreshLaunch(stopProcesses?: () => Promise<number>): Promise<{
152
153
  stopped: number;
153
154
  recordsRemoved: number;
154
155
  }>;
156
+ export declare function studioServerLaunchArgs(): string[];
155
157
  export declare function findPortablePlaywrightBrowsersDir(exePath: string): string | undefined;
156
158
  export declare function waitForHttpOk(url: string, timeoutMs?: number, intervalMs?: number, fetchImpl?: FetchLike): Promise<void>;
157
159
  export declare function chooseStudioPort(preferred?: number, options?: {
package/dist/cli.js CHANGED
@@ -3026,7 +3026,7 @@ async function openStudio(options) {
3026
3026
  console.log(`Opened Tapi Studio: ${exePath}`);
3027
3027
  return 0;
3028
3028
  }
3029
- async function resolveStudioTappSelection(options) {
3029
+ export async function resolveStudioTappSelection(options) {
3030
3030
  if (options.tappSelectionMode === "none") {
3031
3031
  return options.projectId ? await rememberSelectedStudioTapp(options, options.projectId) : options;
3032
3032
  }
@@ -3040,22 +3040,9 @@ async function resolveStudioTappSelection(options) {
3040
3040
  }
3041
3041
  return await rememberSelectedStudioTapp(options, lastSelection.lastTappId);
3042
3042
  }
3043
- let tapps = [];
3044
- try {
3045
- const authenticated = await withSdkAuth({ authToken: undefined });
3046
- tapps = await fetchAvailableTappsForStudio(options, authenticated.authToken);
3047
- }
3048
- catch (error) {
3049
- if (options.projectId) {
3050
- console.warn(`Could not load Tapp list (${formatError(error)}). Opening Studio with ${options.projectId}.`);
3051
- return await rememberSelectedStudioTapp(options, options.projectId);
3052
- }
3053
- throw error;
3054
- }
3043
+ const authenticated = await withSdkAuth({ authToken: undefined });
3044
+ const tapps = await fetchAvailableTappsForStudio(options, authenticated.authToken);
3055
3045
  if (!tapps.length) {
3056
- if (options.projectId) {
3057
- return await rememberSelectedStudioTapp(options, options.projectId);
3058
- }
3059
3046
  throw new Error("No Tapps found for this account. Create one with `tapi tapp create <name>`, then run `tapi studio`.");
3060
3047
  }
3061
3048
  const preferred = preferredStudioTappId(options, lastSelection, tapps);
@@ -3311,7 +3298,7 @@ async function launchPortableStudioServer(exePath, options, manifest) {
3311
3298
  const launchUrl = studioLaunchUrl(url, options);
3312
3299
  let childPid = 0;
3313
3300
  await withCliSpinner("Starting Tapi Studio", async () => {
3314
- const child = spawn(exePath, [], {
3301
+ const child = spawn(exePath, studioServerLaunchArgs(), {
3315
3302
  detached: true,
3316
3303
  env,
3317
3304
  stdio: "ignore",
@@ -3338,6 +3325,9 @@ async function launchPortableStudioServer(exePath, options, manifest) {
3338
3325
  openBrowser(launchUrl);
3339
3326
  console.log(`Opened Tapi Studio ${manifest.version}: ${launchUrl}`);
3340
3327
  }
3328
+ export function studioServerLaunchArgs() {
3329
+ return ["--no-open-browser"];
3330
+ }
3341
3331
  function studioLaunchUrl(baseUrl, options) {
3342
3332
  const normalizedBaseUrl = baseUrl.replace(/\/+$/, "");
3343
3333
  const launchQuery = options.launchUrlQuery ? options.launchUrlQuery.replace(/^\?+/, "") : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapi-dev/sdk",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",