feat(tasks): multi-ecosystem task discovery + bootcamp tasks command#102
Merged
Conversation
… tasks` Answer the #1 Day-1 question — "how do I build / test / run this repo?" — across ecosystems, not just npm. Previously command extraction covered only package.json scripts and Makefile targets and only fed the AI-generated docs, so non-npm repos surfaced zero runnable commands and there was no standalone "what can I run?" command. - src/fs-safe.ts: extract the symlink-safe readContainedFile reader into a shared, dependency-free module (avoids a circular import from the engine). - src/tasks.ts: discoverTasks() engine with pure, tested parsers for package.json (package-manager aware), Makefile, justfile, Taskfile (go-task), docker-compose, pyproject (poetry / PEP-621) and composer.json; plus categorizeTask, detectPackageManager, toCommands and suggestGettingStarted. - src/commands/tasks-command.ts: deterministic `bootcamp tasks <repo-url>` with --json and --category, a human report grouped by category and a getting-started sequence. - src/ingest.ts: reuse discoverTasks (npm-forced for byte-identical `npm run <name>` strings) so generated kits also gain justfile / Taskfile / compose / poetry / composer commands. - Wiring: package.json ./tasks export, src/api.ts re-export, src/cli.ts command registration. - Tests: test/tasks.test.ts, test/tasks-command.test.ts. - Docs: README task-discovery section + command table row, CHANGELOG entry. Verified: typecheck, lint, test (1459), test:coverage, build, verify:packaging. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a deterministic, cross-ecosystem task discovery engine and exposes it both as a new bootcamp tasks <repo-url> CLI command and as a reusable API surface, while also reusing the same engine in ingest so onboarding kits can surface runnable commands beyond npm/Makefile.
Changes:
- Introduces
src/tasks.tsfor multi-ecosystem task discovery (package.json, Makefile, justfile, Taskfile, docker-compose, pyproject, composer) with categorization + “getting started” suggestions. - Adds
bootcamp taskscommand with human report +--jsonand--categoryfiltering. - Extracts symlink-safe fixed-name file reads into
src/fs-safe.tsand updates ingestion/impact to use it.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/tasks.test.ts | Unit tests for task parsing, categorization, package-manager detection, aggregation, and getting-started suggestions. |
| test/tasks-command.test.ts | CLI-level tests for bootcamp tasks output modes, filtering, and exit behavior. |
| test/api.test.ts | Extends export allow-list coverage for the new tasks API exports. |
| src/tasks.ts | New deterministic task discovery/parsing engine + helpers and types. |
| src/ingest.ts | Replaces legacy package.json/Makefile command extraction with discoverTasks(...)+toCommands(...) and uses fs-safe reader. |
| src/impact.ts | Switches symlink-safe reader import to src/fs-safe.ts. |
| src/fs-safe.ts | New shared symlink-safe fixed-name file reader (with size cap). |
| src/commands/tasks-command.ts | New bootcamp tasks command implementation (grouped report, JSON mode, category filtering). |
| src/cli.ts | Registers tasks subcommand and wires options/flag handling. |
| src/api.ts | Re-exports task discovery APIs and types for external consumers. |
| README.md | Documents the new bootcamp tasks command and updates feature list/command table. |
| package.json | Adds ./tasks package export subpath for compiled artifacts. |
| CHANGELOG.md | Adds release note entry for the new task discovery feature and exports. |
Move `--category` validation ahead of `withResolvedRepo` so a typo fails fast without cloning a remote repo first, and drop `command` from the dedupe key since it is derivable from (source, name), matching the documented intent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Summary
src/tasks.ts) and a newbootcamp tasks <repo-url>command that answers the chore(deps): bump actions/checkout from 4 to 6 #1 Day-1 onboarding question: "how do I build / test / run this repo?" The engine has pure, tested parsers forpackage.json(package-manager aware), Makefile, justfile, Taskfile (go-task), docker-compose, pyproject (Poetry / PEP-621), and composer.json, and groups results into categories (Build, Test, Lint, Develop, Run, Release, Other) with a suggested getting-started sequence.ingest.tsnow reuses the same engine so generated onboarding kits also pick up non-npm commands.package.jsonscripts and Makefile targets, and only fed the AI-generated docs. Non-npm repos (Rust/just, Go/Task, Python/Poetry, Compose, PHP/Composer) surfaced zero runnable commands, and there was no standalone, deterministic "what can I run?" command.Approach notes
src/fs-safe.tsso the engine andingest.tscan share it without a circular import.ingest.tscallsdiscoverTasks(..., { packageManager: "npm" })so existing kits keep byte-identicalnpm run <name>strings (backward compatible); the change is purely additive.--jsonand--categoryfilters.Type of change
Testing
npm run lintnpm run buildnpm testAll six CI gates verified green:
typecheckpass,lintpass (--max-warnings=0)testpass: 1459 passed / 87 filestest:coveragepass (branches 77.3% >= 70, lines 88.1% >= 80)buildpass,verify:packagingpassEnd-to-end smoke test on this repo:
Checklist
Linked issues
N/A (no linked issue)
Breaking changes
The
ingest.tspath is npm-forced to preserve byte-identical command strings, so existing onboarding-kit output is unchanged.