@tapi-dev/sdk 0.1.8 → 0.1.9

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.
Files changed (3) hide show
  1. package/README.md +4 -2
  2. package/dist/cli.js +15 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -25,8 +25,10 @@ npx tapi studio
25
25
  `tapi studio` checks the required local `tapi-service`, installs it when needed,
26
26
  downloads the portable Studio server release when the channel manifest uses
27
27
  `installerKind: portable-server`, starts Studio locally, and opens the browser.
28
- Legacy NSIS desktop Studio manifests still work, but the normal developer path
29
- is the portable server launched by the CLI.
28
+ If the channel still publishes a legacy NSIS desktop Studio manifest and no
29
+ Studio executable is installed yet, `tapi studio` runs the installer first, then
30
+ opens Studio. The normal developer path is the portable server launched by the
31
+ CLI.
30
32
 
31
33
  Useful commands:
32
34
 
package/dist/cli.js CHANGED
@@ -1329,7 +1329,15 @@ async function openStudio(options) {
1329
1329
  return 0;
1330
1330
  }
1331
1331
  }
1332
- const exePath = options.exePath ?? getStudioExecutableCandidates().find((candidate) => existsSync(candidate));
1332
+ let exePath = findStudioExecutable(options);
1333
+ if (!exePath && !options.exePath) {
1334
+ console.log("Tapi Studio executable was not found. Installing Tapi Studio now...");
1335
+ const installCode = await installStudio(options);
1336
+ if (installCode !== 0) {
1337
+ return installCode;
1338
+ }
1339
+ exePath = findStudioExecutable(options);
1340
+ }
1333
1341
  if (!exePath || !existsSync(exePath)) {
1334
1342
  console.error("Tapi Studio executable was not found.");
1335
1343
  console.error("Run `npx tapi studio install --channel pilot`, or set TAPI_STUDIO_EXE to the installed executable path.");
@@ -1345,6 +1353,12 @@ async function openStudio(options) {
1345
1353
  console.log(`Opened Tapi Studio: ${exePath}`);
1346
1354
  return 0;
1347
1355
  }
1356
+ function findStudioExecutable(options) {
1357
+ if (options.exePath) {
1358
+ return existsSync(options.exePath) ? options.exePath : undefined;
1359
+ }
1360
+ return getStudioExecutableCandidates().find((candidate) => existsSync(candidate));
1361
+ }
1348
1362
  async function ensurePortableStudioServer(options) {
1349
1363
  const event = await createCliWideEvent("tapi_cli.studio_server_ensure", {
1350
1364
  sdk_version: sdkVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapi-dev/sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",