expand first-project page to show generated file contents#3118
Open
fibibot wants to merge 3 commits into
Open
Conversation
The previous example used a hypothetical Database class with no imports or runnable definition. Swap in a self-contained HTTP-service test that shows the actual win of beforeAll/afterAll over beforeEach/afterEach: expensive setup amortised across cases. Adds a caution callout about shared-state pitfalls and the verified deno test output.
Expand the "Initialize a new project" section of runtime/getting_started/first_project.md so it shows the contents of the three files deno init creates (main.ts, main_test.ts, deno.json) with a short note on what each does. Previously the section listed the file names but never showed what was in them, so when "Run your project" prints "Add 2 + 3 = 5" a new reader had no context for where that came from. Also adds the cd step before deno run and points at the generated dev task for watch mode.
Contributor
Author
|
@bartlomieju ready for review when you have a moment. |
3 tasks
bartlomieju
requested changes
May 14, 2026
Member
bartlomieju
left a comment
There was a problem hiding this comment.
@fibibot this is completely out-of-date. Try deno init with latest canary. There's also stray content from other PR
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.
The "Initialize a new project" section of
runtime/getting_started/first_project.mdlists the three filesdeno initcreates (deno.json,main.ts,main_test.ts) but never shows what's inside them. A new reader following the tutorial seesAdd 2 + 3 = 5printed in the next section with no idea where it came from, and never sees thedevtask or the@std/assertimport thatdeno initwires up for them.This PR expands that single section: it adds the verbatim contents of each generated file (matched against current
deno initoutput) with a one-paragraph annotation explaining what the file is for — whatimport.meta.mainguards, whyDeno.testdoesn't need an install, and what thedevtask and@std/assertmapping indeno.jsonare. The "Run your project" section also gains the missingcd my_projectstep and a short pointer todeno task devfor watch mode. No other sections are touched.Verified against
denoland/deno:latest(deno 2.7.14): randeno init my_project, captured the contents of each generated file verbatim into the page, and confirmeddeno run main.tsprintsAdd 2 + 3 = 5anddeno testpasses one test. The canary docker tag did not resolve in this run, solatestwas used; the filesdeno initproduces have not changed between canary and stable on the relevant points.deno fmtrun on the file.Closes bartlomieju/orchid-inbox#46