-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C3] Skip empty summary rows #5483
Conversation
🦋 Changeset detectedLatest commit: 200ae27 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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-wrangler-5483 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5483/npm-package-wrangler-5483 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-wrangler-5483 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-create-cloudflare-5483 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-cloudflare-kv-asset-handler-5483 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-miniflare-5483 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-cloudflare-pages-shared-5483 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-cloudflare-vitest-pool-workers-5483 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5483 +/- ##
==========================================
+ Coverage 72.28% 72.49% +0.21%
==========================================
Files 330 331 +1
Lines 16990 17298 +308
Branches 4325 4422 +97
==========================================
+ Hits 12281 12541 +260
- Misses 4709 4757 +48 |
Hi @DaniFoldi 😄👋 Thanks a lot for the fix 🙂 but I feel like the change is not the right solution, I think that instead of filtering the thing out we should just not add it in the summary in the first place I think that this code is slightly off: workers-sdk/packages/create-cloudflare/src/summary.ts Lines 15 to 17 in 940ad89
And changing it in the following way should fix the issue:
const dirRelativePath = relative(ctx.originalCWD, ctx.project.path);
const nextSteps = [
- dirRelativePath
- ? ["Navigate to the new directory", `cd ${dirRelativePath}`]
- : [],
+ ...(dirRelativePath
+ ? [["Navigate to the new directory", `cd ${dirRelativePath}`]]
+ : []),
[
"Run the development server",
quoteShellArgs([npm, "run", ctx.template.devScript ?? "start"]), what do you think? 🙂 |
Hey @dario-piotrowicz, Thanks, good idea! I've pushed a new commit changing it to your suggestion, I agree it's cleaner. Looked at the option of adding an explicit type annotation to prevent future issues, but ts couldn't validate all of them as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks a bunch @DaniFoldi ❤️ 🙂
yeah I agree, if it's going to add unnecessary complexity it doesn't really feel worth it 🙂 |
Co-authored-by: Dario Piotrowicz <dario.piotrowicz@gmail.com>
What this PR solves / how to test
Hi 👋,
Before getting side-tracked with #5482, I found that when using
.
as the project location, there was nowhere tocd
to, so the first line in the next steps output summary was skipped. Instead of being properly skipped,undefined undefined
was printed (see screenshot). This change should skip over these lines where a step is excluded.Author has addressed the following