Repository navigation
fix(deps): declare tslib as a runtime dependency - #287
Conversation
The next commit changes both files, and lint-staged runs eslint --fix on every staged file, so their existing errors would block it. eslint --fix: indentation, quote style, let to const, Array<T> to T[]. By hand: drop an unused catch parameter, wrap two JSDoc lines, and add eslint-disable-next-line for long user-facing strings, one URL and the require() of the user's config file, so none of that text or behaviour changes. No functional change. .talismanrc gets a checksum entry for base-class.ts: Talisman flags the moved "key" type annotations (parseEnvVariablesString, envKeys) as potential secrets; they are not. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…indings
open@8.4.2 (SNYK-JS-OPEN-22112123, High) is fixed only in open 11, which
is ESM-only. The CLI compiles to CommonJS, where TypeScript turns import()
into require(), so the three browser-open call sites now go through
util/open-url.ts, which loads open with a native dynamic import. The
GitHub-connect step and launch:open await it, so the process cannot exit
before the browser starts; the delayed deployment-URL open keeps its
fire-and-forget timer. Opening the browser stays best effort: open 11
rejects when the launcher fails, and every caller prints the URL first,
so openUrl swallows that instead of failing the command (or crashing
with an unhandled rejection after a successful deploy).
@oclif/core moves from 4.11.14 to 4.14.0 within the existing ^4.2.7 range
(lockfile only). 4.14 uses ejs 6, which drops the ejs > jake > filelist >
minimatch@5.1.9 path behind SNYK-JS-MINIMATCH-22111072. An override pins
@oclif/core's own minimatch to ^11.0.1, as on v2-dev.
Two findings remain reported, not ignored. Neither has an upgrade, so
neither fails --fail-on=all: adm-zip@0.6.1 (SNYK-JS-ADMZIP-21707815), and
open@8.4.2 pulled in by @contentstack/cli-utilities, whose latest release
(2.0.2) still depends on open ^8.4.2.
Integration tests now mock util/open-url instead of open, and stub
@oclif/core's getPlatform, which 4.14 implements with a native
import('wsl-utils') that Jest's VM cannot run.
.talismanrc: base-class.ts checksum refreshed for its new content.
#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
…un from a hook Git exports GIT_DIR and the other repo-local variables to hooks, and the pre-push hook runs npm test. With them set, the harness's git init, config, commit and remote add in its temp projects acted on this repository: a push from a worktree left "initial commit" commits on the branch and set user.name, user.email, commit.gpgsign and core.bare in the shared .git/config. jest.global-setup.ts now clears the variables `git rev-parse --local-env-vars` lists. It runs in Jest's parent process, so the child processes the harness and the CLI spawn inherit the clean environment (setupFiles only change the sandbox's copy of process.env). #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
tsconfig sets importHelpers, so the compiled commands require tslib at runtime, but it was declared only as a devDependency. When csdx installs @contentstack/cli-launch as a plugin it skips devDependencies, so a strict install (pnpm) fails every launch command with "Cannot find module 'tslib'" (#194). Default npm installs only survived because tslib was hoisted from another package. Also drop @oclif/plugin-plugins from oclif.plugins. Its dependency was removed in February, so oclif already skipped the entry; help output and the generated manifest are unchanged without it. Add the dependency guard test from v2-dev (dc69e11). It compiles every runtime source with the project's compiler options and fails on any required package, or oclif.plugins entry, that is not a production dependency. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ 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
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Reviewed the whole PR (6bd5f3f); this branch carries #286's three commits, so the findings below are posted on #286 and are still open here too:
- Low
src/util/open-url.ts:5:new Functionruns at module load outside thetry;--disallow-code-generation-from-stringscrashes every deploy command. - Low
src/util/open-url.ts:3: new code comments againstAGENTS.md. - Low
src/util/open-url.test.ts:6:openUrl's success path is untested. - Low
test/integration/jest.setup.ts:1:AGENTS.md's harness section is now wrong. - Low
package-lock.json:3449: npm 10 regeneration dropped thelibcfields 6fc6af1 restored. - Low
package.json:26:@oclif/corerange not raised to^4.14.0.
Stack: #287's base is development, not #286's branch, so merge #286 first (or retarget this PR) to keep its diff to its own commit.
Not approved: 7 low findings open (more than 3).
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
- open-url.ts: create the dynamic importer lazily inside openUrl's try. Built at module load, new Function threw EvalError under --disallow-code-generation-from-strings, so every command importing the helper crashed instead of just not opening a browser. - openUrl takes an optional loader, and the tests inject a fake open to cover the success path (called with the URL) plus both failure paths, instead of relying on Jest's VM rejecting the native import. - Drop the code comments added in this PR (AGENTS.md: no code comments); the rationale lives in the commit messages and the PR description. - AGENTS.md: the integration harness now replaces src/util/open-url and @oclif/core's getPlatform rather than the open package, and jest.global-setup.ts clears git's repo-local env vars. - @oclif/core range raised to ^4.14.0 so installs cannot keep a 4.11.x that still carries the flagged minimatch path. - package-lock.json: restore the 23 "libc" fields npm 10 dropped, copied from development for the same package versions. npm 11 (release CI) re-resolves the file without changes. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…guard
The guard only matched double-quoted require("x"). TypeScript emits a
dynamic import('x') as require('x') with single quotes, and the open
helper builds import("open") inside a string passed to new Function, so
an undeclared package pulled in either way passed the guard and then
failed at runtime. It now matches require(...) and import(...) with
either quote style, and asserts that open is detected.
#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
|
/ship 2b summary (re: @dhruv-parekh-cs's review of
Left for human: none. Checks: Next: needs re-approval. Still stacked on #286, so merge #286 first. |
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Re-review since 6bd5f3f (081d551 from #286, the merge, and c5ec03c).
The dependency guard fix in c5ec03c addresses the earlier finding. The earlier findings carried from #286 are fixed here too.
This branch carries #286's new commit, so these 2 lows posted inline on #286 are also open here:
- Low
AGENTS.md:24: the "... all run for real" sentence got joined onto the git-env bullet. - Low
src/util/open-url.test.ts:25: the failure-path tests skip the happy path's assertions (AGENTS.mdtesting rule).
Stack: #287's base is still development, so merge #286 first (or retarget this PR).
Approved: no high or medium finding is open, and 2 lows are open (the limit is 3).
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
- AGENTS.md: the "all run for real" sentence had been joined onto the new git-env bullet; it closes the "Only these are replaced" bullet again, so the harness contract reads as before. - open-url.test.ts: the failure-path tests now keep the happy path's assertions (AGENTS.md: do not skip assertions in edge-case tests). The load-failure test checks the loader was called; the open-failure test checks open was called with the URL. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@dhruv-parekh-cs re: your review of |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
|
#286 is merged ( |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Re-review since c5ec03c (merges of #286 and development; the new content is ccdb47a).
The 2 lows carried from #286 (the AGENTS.md "run for real" sentence and the edge-case test assertions) are fixed here now. With #286 merged, this PR's diff against development is its own commit only.
No new findings. Approved.
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
Jira: https://contentstack.atlassian.net/browse/CL-8765
Fixes #194
What
tslibmoves from devDependencies to dependencies. tsconfig setsimportHelpers, so the compiled commandsrequire("tslib"), but csdx skips devDependencies when it installs the plugin. On strict installs (pnpm) every launch command fails withCannot find module 'tslib'.@oclif/plugin-pluginsentry fromoclif.plugins. Its dependency was removed in 5662149, so oclif already skipped it; help output and the generated manifest are identical without it.oclif.pluginsentry, that isn't a production dependency.Tests
--omit=dev --install-strategy=linked): before,launch,launch:deployments,launch:logsandlaunch:openall fail withMODULE_NOT_FOUND tslib; after, all loadpackage.jsonand passes nownpm test: unit + Jest 140 passed, integration 33 passedcsdx 1.x depends on
cli-launch ^1.11.3, so a 1.11.5 patch reaches csdx users without a CLI release.#claude_code#
🤖 Generated with Claude Code