Set up the workspace on the first run when npm blocked the install script - #33
Merged
Merged
Conversation
…did not run Recent npm versions block a package's install scripts until they are approved, so on a fresh install the postinstall that created `.uidx/`, the `uidx` npm scripts, the `.mcp.json` entry and the skills never ran, and `npx uidx dev` dead-ended with "No uidx workspace found". `uidx dev` inside an npm project with no workspace now performs that same setup itself and reports what it added; a directory that is not an npm project still gets the `uidx init` hint. The READMEs describe npm's approval prompt and the `npm install-scripts approve` alternative. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merged
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.
Why
Recent npm versions do not run a package's install scripts until the user approves them (
npm warn install-scripts … not yet covered by allowScripts). On such a machine a freshnpm i -D @uidxkit/uidxsucceeds, but the postinstall never runs: no.uidx/, nouidx/uidx:mcpscripts, no.mcp.jsonentry, no skills. The documented next step,npm run uidx, does not exist, andnpx uidx devstopped with "No uidx workspace found". Reported from a Windows machine on 0.1.5.What changes
uidx dev(anduidx openon a directory) inside an npm project with no workspace now runs the sameinitProjectsetup the postinstall performs, then serves, and prints what it added.OpenResult.initializedcarries the project root so the CLI can say so.package.jsonabove it still gets theuidx inithint, and a setup failure (for example a taken script name) is reported with the--scriptadvice.npm install-scripts approve @uidxkit/uidxalternative, and that the first run sets things up; changelog entry under Unreleased.Verification
open.test.ts: first run sets up a fresh npm project (manifest, welcome page, scripts) and serves; a non-project directory is refused; an existing workspace reportsinitialized: null. Theinit.test.tsexpectation for the missing-workspace message moved to the non-project case.--ignore-scripts(what a blocked postinstall looks like), thennpx uidx dev --no-open: the workspace, scripts and skills are created and the server starts.🤖 Generated with Claude Code