Skip to content

fix(demo): run the CLI from the repository root - #23

Merged
RodolpheKouyoumdjian merged 1 commit into
mainfrom
fix/demo-cli-command
Sep 9, 2026
Merged

RodolpheKouyoumdjian merged 1 commit into
mainfrom
fix/demo-cli-command

Conversation

@RodolpheKouyoumdjian

Copy link
Copy Markdown
Contributor

drift analyze --dir demos/<ecosystem> does not analyse the demo. It
reports every dependency as removed rather than upgraded, so the terminal half
of the demo would have shown

None of the 2 dependency changes found match the analysis criteria in drift.yml

next to a panel listing six breaking changes — the worst possible first
impression, and the two halves contradicting each other.

Cause

A path-relativity mismatch in Drift. git status --porcelain prints paths
relative to the repository root, and Drift replays them as pathspecs from
the analysis directory:

warning: could not open directory 'demos/npm/demos/npm/': No such file or directory
fatal: pathspec 'demos/npm/package.json' did not match any files

The temporary working-tree commit therefore contains no manifest, and every
dependency looks deleted. This is a Drift bug (it affects any analysis of a
subdirectory of the git root, monorepos included) and is being reported
separately; this PR only stops the demo from tripping over it.

Fix

Run from the root. It costs nothing: only the demo that was prepared has a
dirty manifest, so exactly one dependency change is detected either way.

Verified against the published @usedrift/[email protected] on a clone of this
repository — 1 dependency change, 6 breaking changes, 4 impact sites, 1 file
affected.

Also

Gitignores the lockfiles a setup step writes. npm install in the npm demo left
an untracked package-lock.json, which contradicted the git status --short
that DEMO.md points at to prove only the manifest changed. That command now
prints exactly one line again.

🤖 Generated with Claude Code

`drift analyze --dir demos/<ecosystem>` does not analyse the demo. It reports
every dependency as *removed* rather than upgraded, so the terminal half of the
demo would have shown "None of the 2 dependency changes found match the
analysis criteria" next to a panel listing six breaking changes.

The cause is a path-relativity mismatch in Drift: `git status --porcelain`
prints paths relative to the repository root, and Drift replays them as
pathspecs from the analysis directory, so `demos/npm/package.json` is looked
for at `demos/npm/demos/npm/package.json`. The temporary working-tree commit
then has no manifest in it and every dependency looks deleted.

Running from the root avoids it entirely, and costs nothing: only the demo that
was prepared has a dirty manifest, so exactly one dependency change is detected
either way. Verified against the published CLI on a clone of this repository —
6 breaking changes, 4 impact sites, 1 file affected.

Also gitignores the lockfiles a setup step writes. `npm install` in the npm
demo left an untracked `package-lock.json`, which contradicted the
`git status --short` that DEMO.md points at to show only the manifest changed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 9, 2026 22:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RodolpheKouyoumdjian
RodolpheKouyoumdjian merged commit a61381b into main Sep 9, 2026
1 check passed
@RodolpheKouyoumdjian
RodolpheKouyoumdjian deleted the fix/demo-cli-command branch September 9, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants