Repository navigation
Conversation
…ccess `create-refine-app --example` installed the example's dependencies and then printed a green `Success!` box regardless of the result. When the install failed (for example the starter-vite template pinning an unpublished `@refinedev/core` range), the user was told to run `dev` on a project that could not start, with a zero exit code. The final box now depends on the install result: failure prints an `Incomplete` box that lists `install` before `dev` and sets a non-zero exit code, and the spinner points at the package manager command to reproduce the error. A test covers both branches. Fixes refinedev#7687
🦋 Changeset detectedLatest commit: eda58a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch has not been deployed
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.
What is the current behavior?
create-refine-app --exampleprints a greenSuccess!box even whennpm installfailed, and exits with code 0.Following the tutorial's Quick Setup (
npm create refine-app@latest -- --example starter-vite,documentation/tutorial/essentials/setup/index.md:18) currently ends with:The install failure itself is swallowed by
installDependencies(), which usesstdio: "ignore"and only returns a boolean (packages/create-refine-app/src/example/install-dependencies.ts). The final box is built fromchalk\{bold.green Success!}`unconditionally (packages/create-refine-app/src/example/index.ts), andprocess.exitCode` is never set, so a broken project is reported — and scripted — as a working one.The tutorial's
starter-vitetemplate pins"@refinedev/core": "^5.2.0", and5.1.0/5.2.0were never published to npm (latest is5.0.12), so the documented Quick Setup hits this path every time. That version pin is a release issue tracked separately in the linked report; this PR fixes the reporting, which is what makes the failure diagnosable at all.What is the new behavior?
The final box now follows the install result:
Success!box,cd+dev, exit code 0.Incompletebox that says dependencies were not installed and listscd→install→dev, and the process exits with code 1.The spinner message on failure now names the package manager command to run in the project directory (
Run "npm install" in the project directory to see the error and retry.), becausestdio: "ignore"means the actual error was never shown.Verification
Local, Node 24.12.0, npm 11.6.2, macOS (darwin 27.2.0 arm64).
Reproduced the failure end to end with the built CLI and the real template:
Before the change this printed the
Success!box above. After the change it prints theIncompletebox andecho $?gives1.Confirmed the failure is the unreleased range, not a local environment problem — the same
package.jsonwith@refinedev/coreset to^5.0.12installs cleanly:Tests (
npm testinpackages/create-refine-app, 2 passed):reports success when dependencies install—Success!andnpm run devpresent, exit code untouched.does not report success when dependency install fails— noSuccess!,Incompleteandnpm installpresent, exit code1.Reverting only the product code and re-running makes the second test fail on
expect(printed).not.toContain("Success!"), so the test is pinned to the fix rather than to the refactor.npx tsc --noEmit -p tsconfig.jsonpasses.vitestis added to the packagedevDependenciesbecause the packagetsconfig.jsonincludessrc, and the new spec file imports it; the declarations build already excludes**/*.spec.ts.biome checkon both changed files reports no issues.Notes for reviewers
@refinedev/core@^5.2.0pin inexamples/starter-vite/package.jsonis untouched — it is regenerated by the changesets version commit (fb4084ebumped it from^5.1.0), so it needs the release that publishes 5.1/5.2 rather than a manual edit here.process.exitCodeis set instead of callingprocess.exit(1)so the git step and existing output still flush.create-refine-app: patch; the config'signorelist explicitly keepscreate-refine-appversioned.Fixes #7687