Conversation
`catalyst logs tail` and `catalyst logs query` now resolve credentials via `resolveCredentials`, falling back to `.bigcommerce/project.json` when `--store-hash` / `--access-token` flags or `CATALYST_STORE_HASH` / `CATALYST_ACCESS_TOKEN` env vars are not provided. This matches the behavior already used by `project`, `deploy`, and `build`, and removes the need to re-pass credentials after running `catalyst project link`. Also migrates the shared `--store-hash` / `--access-token` option helpers from the legacy `BIGCOMMERCE_*` env var names to `CATALYST_*` for consistency with the rest of the CLI. Fixes LTRAC-444 Co-Authored-By: Claude <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Size ReportComparing against baseline from No bundle size changes detected. |
| '--store-hash <hash>', | ||
| 'BigCommerce store hash. Can be found in the URL of your store Control Panel.', | ||
| ).env('BIGCOMMERCE_STORE_HASH'); | ||
| ).env('CATALYST_STORE_HASH'); |
There was a problem hiding this comment.
Should the other env vars in these options also be prefixed with CATALYST_?
There was a problem hiding this comment.
Included CATALYST_PROJECT_UUID
…ROJECT_UUID The shared `projectUuidOption()` helper was still using the legacy `BIGCOMMERCE_PROJECT_UUID` env var name. It was missed in the earlier `CATALYST_*` rename sweep because `logs` was the only consumer at the time. The inline declarations in `build.ts` and `deploy.ts` already use `CATALYST_PROJECT_UUID`, so this aligns the helper with the rest of the CLI and the alpha.2 patch notes. Refs LTRAC-444 Co-Authored-By: Claude <noreply@anthropic.com>
Jira: LTRAC-444
What/Why?
catalyst logs tailandcatalyst logs querypreviously required--store-hashand--access-tokenon every invocation (via.makeOptionMandatory()). After runningcatalyst project link/project create, those credentials are already persisted to.bigcommerce/project.json, butlogswasn't reading them.This switches both subcommands to
resolveCredentials(options, getProjectConfig())— the same helper used byproject,deploy, andbuild— so flags >CATALYST_*env vars >project.json.While here, also migrates the shared
--store-hash/--access-token/--project-uuidoption helpers inlib/shared-options.tsfromBIGCOMMERCE_*toCATALYST_*env var names. This was the env-var fallback the rest of the CLI moved to in the recentfix-env-var-nameschangeset;logswas the last command still on the legacy names.Note the legacy
BIGCOMMERCE_STORE_HASH/BIGCOMMERCE_ACCESS_TOKEN/BIGCOMMERCE_PROJECT_UUIDenv vars are no longer read bylogs tail/logs query.Fixes LTRAC-444
Testing
Unit tests added:
falls back to project.json for storeHash and accessToken— writes credentials to a tmpproject.jsonand runslogs tailwith no flags.exits with error when no credentials are provided— assertsMissing credentials.andprocess.exit(1)for bothtailandquery.Manual verification in a Catalyst project that's already run
catalyst project link:catalyst logs tail(no flags, no env vars) — connects and tails usingproject.jsoncredentials.catalyst logs tail --store-hash X --access-token Y— flag values overrideproject.json.CATALYST_STORE_HASH=X CATALYST_ACCESS_TOKEN=Y catalyst logs tail— env values used.project.jsonand no flags/env — fails with the standardMissing credentials.message pointing atcatalyst auth login.pnpm --filter @bigcommerce/catalyst test,typecheck, andlintall clean.Migration
The legacy
BIGCOMMERCE_STORE_HASH/BIGCOMMERCE_ACCESS_TOKEN/BIGCOMMERCE_PROJECT_UUIDenv vars are no longer read bylogs tail/logs query. Anyone relying on them needs to switch toCATALYST_STORE_HASH/CATALYST_ACCESS_TOKEN/CATALYST_PROJECT_UUID(or usecatalyst project linkto persist credentials). All other CLI commands already require theCATALYST_*names.🤖 Generated with Claude Code