Skip to content

Commit 35a6087

Browse files
fix: pages path for src: yes errors on startup, add recommended extensions
1 parent 816d365 commit 35a6087

5 files changed

Lines changed: 37 additions & 4 deletions

File tree

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@
22

33
Quick start wizard for new pywire projects.
44

5-
## Usage
5+
<!-- INSTALL_MESSAGE_TEMPLATE_START -->
6+
## 🚀 Quick Start
7+
8+
If you already have [uv](https://docs.astral.sh/uv/) installed, you can get started instantly:
69

710
```bash
811
uvx create-pywire-app
912
```
1013

14+
If you don't have `uv` installed or aren't sure, use our installer script which handles the setup for you:
15+
16+
### macOS / Linux
17+
```bash
18+
curl -fsSL pywire.dev/install | sh
19+
```
20+
21+
### Windows (PowerShell)
22+
```powershell
23+
irm pywire.dev/install.ps1 | iex
24+
```
25+
<!-- INSTALL_MESSAGE_TEMPLATE_END -->
26+
1127
<!-- SUPPORT_MESSAGE_TEMPLATE_START -->
1228
## ❤️ Support pywire
1329

src/create_pywire_app/main.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def generate(self) -> None:
113113
self._generate_gitignore()
114114
self._generate_main()
115115
self._generate_error_page()
116+
self._generate_vscode_settings()
116117

117118
# Generate template-specific files
118119
if self.template == "counter":
@@ -150,10 +151,19 @@ def _generate_gitignore(self) -> None:
150151
"""Generate .gitignore."""
151152
self.renderer.copy_static("common/.gitignore", self.project_path / ".gitignore")
152153

154+
def _generate_vscode_settings(self) -> None:
155+
"""Generate VS Code settings."""
156+
vscode_dir = self.project_path / ".vscode"
157+
vscode_dir.mkdir(exist_ok=True)
158+
self.renderer.copy_static("common/extensions.json", vscode_dir / "extensions.json")
159+
153160
def _generate_main(self) -> None:
154161
"""Generate main.py."""
155162
template_name = "main-path.py.j2" if self.routing_strategy == "path" else "main-explicit.py.j2"
156-
content = self.renderer.render(f"common/{template_name}", {})
163+
context = {
164+
"pages_dir": "src/pages" if self.use_src else "pages",
165+
}
166+
content = self.renderer.render(f"common/{template_name}", context)
157167
(self.app_root / "main.py").write_text(content)
158168

159169
def _generate_error_page(self) -> None:
@@ -396,6 +406,8 @@ def main():
396406
Run the following commands to enter the environment:
397407
398408
{cmd_text}
409+
410+
> **Tip:** Install the **PyWire** extension (id: `pywire.pywire`) in VS Code for syntax highlighting and snippets.
399411
"""
400412
),
401413
border_style="cyan",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"pywire.pywire"
4+
]
5+
}

src/create_pywire_app/templates/common/main-explicit.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ from pywire import PyWire
33
# Create application instance
44
app = PyWire(
55
path_based_routing=False,
6-
pages_dir="pages",
6+
pages_dir="{{ pages_dir }}",
77
enable_pjax=True,
88
debug=True,
99
)

src/create_pywire_app/templates/common/main-path.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from pywire import PyWire
22

33
# Create application instance
44
app = PyWire(
5-
pages_dir="pages",
5+
pages_dir="{{ pages_dir }}",
66
enable_pjax=True,
77
debug=True,
88
)

0 commit comments

Comments
 (0)