Create the course project
Everything you write in this course lives in one workspace. I want you to be able to find any program you've written weeks from now, so we set the structure up once, properly, and never think about it again. By the end of this step you'll have:
examples/
├── deno.json
└── programs/
Two things. That's the entire project skeleton. I promised you minimal setup, and I intend to keep it that way.
1. Create the project directory
Open your terminal and run:
mkdir examples
This creates a new folder in your current working directory (typically your home folder).
2. Open the project in Zed
Launch Zed and open the folder:
- macOS: Command-O
- Windows/Linux: Control-O
Select the examples folder and choose Open. If Zed asks whether to trust the folder, select Trust; this enables the project-specific settings we'll add in the next step.
3. Add the deno.json configuration
Right-click the examples folder in the Project Panel, choose New File, and name it deno.json. Insert this configuration:
{
"imports": {
"@std/assert": "jsr:@std/assert@1"
},
"lint": {
"rules": {
"exclude": ["no-import-prefix"]
}
}
}
deno.json is the project's one configuration file, and here's what you're putting in it:
- The
importssection arranges a borrow: it lets this project use@std/assert, an assertion library from Deno's standard collection, under a short name. You'll meet it a few lessons in, and it will do a lot of heavy lifting after that. - The
lintsection quiets one warning that would otherwise nag at some teaching examples. Harmless now, explained when we get to Deno's linter.
Yes, I'm asking you to configure things before you can understand them. It's the one time in this course I'll do that. Every line above gets explained on schedule.
4. Create the programs folder
Right-click examples and create a new folder called programs. Every program you write in this course goes in there.
5. Verify the configuration
Ask Deno to proofread what you typed. Open Zed's terminal (Control-`) and run:
deno fmt --check deno.json
Deno should report that the configuration file checks out. If it objects, compare your file against the block above; a missing comma or quote is the usual culprit.
Your setup check
Confirm these four conditions before proceeding:
- Zed has the
examplesfolder open. - The project contains
deno.jsonwith the imports and lint settings shown above. - An empty
programsfolder exists. - The format-check command runs successfully.
The skeleton is ready. One step remains before the first program: introducing your editor to your runtime.