Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new @joint/cli workspace package that provides a Node-based CLI for discovering and downloading JointJS demo examples from the clientIO/joint-demos repository.
Changes:
- Introduces
jointCLI entrypoint withlistanddownloadcommands (GitHub Trees API + git sparse checkout). - Adds supporting libs (GitHub API wrapper, git runner, simple ANSI logger) and package scaffolding (TypeScript config, README).
- Updates lockfile to include the new workspace and its dev dependencies.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds the new workspace entry and resolves new dev dependency ranges. |
| packages/joint-cli/package.json | Defines the new CLI package metadata, bin entry, scripts, and dev dependencies. |
| packages/joint-cli/tsconfig.json | TypeScript build configuration for emitting the CLI into dist/. |
| packages/joint-cli/src/cli.ts | CLI argument parsing, help/version handling, and command dispatch. |
| packages/joint-cli/src/constants.ts | Default repo constants and helpers to build repo/API URLs. |
| packages/joint-cli/src/commands/list.ts | Implements joint list output. |
| packages/joint-cli/src/commands/download.ts | Implements joint download validation, destination resolution, and copy behavior. |
| packages/joint-cli/src/lib/github.ts | Fetches the repository tree via GitHub API and derives available example folders. |
| packages/joint-cli/src/lib/git.ts | Performs sparse checkout and copies downloaded content into the destination. |
| packages/joint-cli/src/lib/logger.ts | Minimal colored logging helpers. |
| packages/joint-cli/README.md | CLI usage and installation documentation. |
| packages/joint-cli/.gitignore | Ignores node_modules/ and build output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix cp into existing directory (e.g. `.`) by copying entries individually - Throw error on 404 instead of returning empty list (bad --owner/--branch) - Add prepack script to ensure dist/ is built before packing - Fix success message for `.` destination Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses node:test with tsx for TypeScript support. Tests cover: - GitHub API response parsing, filtering, sorting, error handling - GITHUB_TOKEN header injection - Custom --owner/--branch URL construction - List command output - Download validation (not found, empty repo, naming logic) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- URL-encode branch name in GitHub API URL for branches with slashes - Add -- separator before user args in git commands to prevent option injection - Error on missing --owner/--branch value instead of silently using defaults - Use console.warn for warn() so stderr isn't mixed into piped stdout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add dist, lint, lint-fix scripts so root-level yarn commands work - Extend shared tsconfig.common.json for consistent compiler settings - Add eslint.config.mjs using @joint/eslint-config - Add --force flag required to overwrite existing files or non-empty dirs - Reject download to "." in non-empty directory without --force Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rough logger Add logger.log() for plain output and replace direct console.log calls in source files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
@joint/clipackage — a zero-dependency CLI tool for JointJSjoint list— lists available examples from the joint-demos repository via the GitHub Git Trees API (single API call)joint download <name> [dest]— downloads an example via git sparse checkout--ownerand--branchflags for working with forks--forceflag to overwrite existing directoriesGITHUB_TOKENenv var to avoid API rate limitingTest plan
node packages/joint-cli/dist/cli.js --helpshows usagenode packages/joint-cli/dist/cli.js --versionprints versionnode packages/joint-cli/dist/cli.js listlists examplesnode packages/joint-cli/dist/cli.js download <name>downloads an exampleyarn workspace @joint/cli test— all 15 tests passyarn workspace @joint/cli lint— no errors🤖 Generated with Claude Code