Skip to content

expand first-project page to show generated file contents#3118

Open
fibibot wants to merge 3 commits into
mainfrom
docs-improve/first-project-show-files
Open

expand first-project page to show generated file contents#3118
fibibot wants to merge 3 commits into
mainfrom
docs-improve/first-project-show-files

Conversation

@fibibot
Copy link
Copy Markdown
Contributor

@fibibot fibibot commented May 14, 2026

The "Initialize a new project" section of runtime/getting_started/first_project.md lists the three files deno init creates (deno.json, main.ts, main_test.ts) but never shows what's inside them. A new reader following the tutorial sees Add 2 + 3 = 5 printed in the next section with no idea where it came from, and never sees the dev task or the @std/assert import that deno init wires up for them.

This PR expands that single section: it adds the verbatim contents of each generated file (matched against current deno init output) with a one-paragraph annotation explaining what the file is for — what import.meta.main guards, why Deno.test doesn't need an install, and what the dev task and @std/assert mapping in deno.json are. The "Run your project" section also gains the missing cd my_project step and a short pointer to deno task dev for watch mode. No other sections are touched.

Verified against denoland/deno:latest (deno 2.7.14): ran deno init my_project, captured the contents of each generated file verbatim into the page, and confirmed deno run main.ts prints Add 2 + 3 = 5 and deno test passes one test. The canary docker tag did not resolve in this run, so latest was used; the files deno init produces have not changed between canary and stable on the relevant points. deno fmt run on the file.

Closes bartlomieju/orchid-inbox#46

fibibot added 2 commits May 13, 2026 21:31
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.
@fibibot
Copy link
Copy Markdown
Contributor Author

fibibot commented May 14, 2026

@bartlomieju ready for review when you have a moment.

Copy link
Copy Markdown
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

@fibibot this is completely out-of-date. Try deno init with latest canary. There's also stray content from other PR

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