Conversation
@contentstack/cli and @contentstack/cli-utilities compile with importHelpers: true, so their emitted output requires tslib at runtime. tslib was listed under devDependencies (cli) or not at all (cli-utilities), so consumers never receive it and a global install fails with "Cannot find module 'tslib'". Verified against the published v1-x tarballs: @contentstack/cli 1.68.0 has 3 files requiring tslib, @contentstack/cli-utilities 1.19.2 has 26, neither declaring it. cli-auth, cli-command and cli-config emit zero tslib requires and are deliberately left unchanged. Mirrors PR #2722, which fixed the same defect on the v2 line. Also switches the .talismanrc pnpm-lock.yaml entry from a checksum pin to ignore_detectors, so lockfile regeneration no longer invalidates it. Refs: #2629 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Upgrades @contentstack/cli-utilities dependencies and the workspace-level pnpm overrides. packages/contentstack-utilities: @contentstack/management ~1.30.1 -> ~1.31.1 @contentstack/marketplace-sdk ^1.5.1 -> ^1.5.4 axios ^1.19.0 -> ^1.20.0 js-yaml ^4.3.1 -> ^4.3.2 picomatch (@oclif/core override) ^4.0.4 -> ^4.0.7 pnpm-workspace.yaml overrides: uuid 14.0.1 -> 14.0.2 brace-expansion 5.0.9 -> 5.0.12 js-yaml 5.2.3 -> 5.4.2 fast-uri 4.1.2 -> 4.2.1 snyk test --all-projects --fail-on=all reports 6 projects with no vulnerable paths. pnpm install --frozen-lockfile and pnpm build both pass, and the tslib runtime dependency added in the preceding commit is unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The 401 branch recursed with the same stale error object and an unincremented counter, so a token refresh that succeeded without clearing the 401 looped forever, issuing a real refresh-endpoint call each pass. The maxRetryCount cap existed only on the 429/408 branch. Apply the same guard: attempt one refresh, then print a clear error and exit if the 401 persists. The cap is 2 rather than the 429/408 branch's 3 because a single refresh is enough to establish that the token is dead. This brings v1-legacy in line with the v2 fix, which was never backported. The resulting file is byte-identical to the one on main. Reachability note: the callers in @contentstack/cli-variants pass an HttpResponse, whose `response` field is TypeScript-private but a real property at runtime, so `error.response.status` resolves and the branch is genuinely reachable. Adds test/unit/authentication-handler.test.ts, the first coverage for this file in either branch. Eight cases across the 401 and 429/408 paths, including a regression guard that hangs indefinitely without this fix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix(auth): cap 401 retry count in refreshAccessToken
fix(deps): declare tslib as a runtime dependency
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixes
@contentstack/cliand@contentstack/cli-utilitiesnow declaretslibas a runtime dependency. Installs that don't hoist dependencies, such aspnpm add -g @contentstack/cli, no longer fail with "Cannot find module 'tslib'".Security
@contentstack/cli-utilitiesdependencies:@contentstack/management~1.31.1,@contentstack/marketplace-sdk^1.5.4,axios^1.20.0,js-yaml^4.3.2 andpicomatch^4.0.7.uuid14.0.2,brace-expansion5.0.12,js-yaml5.4.2 andfast-uri4.2.1. Snyk reports no vulnerable paths after the upgrade.