dev-ready 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. {dev_ready-0.2.0 → dev_ready-0.2.1}/PKG-INFO +1 -1
  2. {dev_ready-0.2.0 → dev_ready-0.2.1}/pyproject.toml +1 -1
  3. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/__init__.py +1 -1
  4. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/generate.py +16 -0
  5. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/manifest/loader.py +28 -4
  6. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/manifest.json +1 -0
  7. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/overlay/__init__.py +8 -2
  8. dev_ready-0.2.1/src/dev_ready/templates/readme/README.md.tmpl +27 -0
  9. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/integration/test_fetch_real.py +4 -1
  10. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_generate.py +4 -2
  11. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_manifest.py +10 -2
  12. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_overlay.py +27 -1
  13. {dev_ready-0.2.0 → dev_ready-0.2.1}/uv.lock +1 -1
  14. {dev_ready-0.2.0 → dev_ready-0.2.1}/.bob/qa.md +0 -0
  15. {dev_ready-0.2.0 → dev_ready-0.2.1}/.bob/security.md +0 -0
  16. {dev_ready-0.2.0 → dev_ready-0.2.1}/.bob/sre.md +0 -0
  17. {dev_ready-0.2.0 → dev_ready-0.2.1}/.github/dependabot.yml +0 -0
  18. {dev_ready-0.2.0 → dev_ready-0.2.1}/.github/workflows/ci.yml +0 -0
  19. {dev_ready-0.2.0 → dev_ready-0.2.1}/.github/workflows/release.yml +0 -0
  20. {dev_ready-0.2.0 → dev_ready-0.2.1}/.github/workflows/upstream-bump.yml +0 -0
  21. {dev_ready-0.2.0 → dev_ready-0.2.1}/.gitignore +0 -0
  22. {dev_ready-0.2.0 → dev_ready-0.2.1}/.python-version +0 -0
  23. {dev_ready-0.2.0 → dev_ready-0.2.1}/CLAUDE.md +0 -0
  24. {dev_ready-0.2.0 → dev_ready-0.2.1}/LICENSE +0 -0
  25. {dev_ready-0.2.0 → dev_ready-0.2.1}/README-pypi.md +0 -0
  26. {dev_ready-0.2.0 → dev_ready-0.2.1}/README.md +0 -0
  27. {dev_ready-0.2.0 → dev_ready-0.2.1}/THIRD_PARTY_NOTICES.md +0 -0
  28. {dev_ready-0.2.0 → dev_ready-0.2.1}/docs/architecture.md +0 -0
  29. {dev_ready-0.2.0 → dev_ready-0.2.1}/docs/cli-spec.md +0 -0
  30. {dev_ready-0.2.0 → dev_ready-0.2.1}/docs/releasing.md +0 -0
  31. {dev_ready-0.2.0 → dev_ready-0.2.1}/docs/requirements.md +0 -0
  32. {dev_ready-0.2.0 → dev_ready-0.2.1}/docs/v0.1-overview.md +0 -0
  33. {dev_ready-0.2.0 → dev_ready-0.2.1}/scripts/bump_upstream.py +0 -0
  34. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/README.md +0 -0
  35. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/__main__.py +0 -0
  36. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/cli.py +0 -0
  37. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/errors.py +0 -0
  38. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/fetch/__init__.py +0 -0
  39. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/fetch/snapshot.py +0 -0
  40. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/manifest/__init__.py +0 -0
  41. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/manifest/models.py +0 -0
  42. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/prompts/__init__.py +0 -0
  43. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/prompts/_questionary_asker.py +0 -0
  44. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/prompts/answers.py +0 -0
  45. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/prompts/asker.py +0 -0
  46. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/prompts/collect.py +0 -0
  47. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/report/__init__.py +0 -0
  48. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/report/render.py +0 -0
  49. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/templates/claude/CLAUDE.md.tmpl +0 -0
  50. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/templates/claude/skills/project-orientation/SKILL.md +0 -0
  51. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/templates/docs/architecture.md.tmpl +0 -0
  52. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/templates/docs/requirements.md.tmpl +0 -0
  53. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/templates/mcp/mcp.json +0 -0
  54. {dev_ready-0.2.0 → dev_ready-0.2.1}/src/dev_ready/verify.py +0 -0
  55. {dev_ready-0.2.0 → dev_ready-0.2.1}/templates/README.md +0 -0
  56. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/README.md +0 -0
  57. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/e2e/.gitkeep +0 -0
  58. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/e2e/test_init_real.py +0 -0
  59. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/integration/.gitkeep +0 -0
  60. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_bump_upstream.py +0 -0
  61. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_cli.py +0 -0
  62. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_fetch.py +0 -0
  63. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_prompts.py +0 -0
  64. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_report.py +0 -0
  65. {dev_ready-0.2.0 → dev_ready-0.2.1}/tests/unit/test_verify.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dev-ready
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Scaffold AI-development-ready FastAPI projects: pinned upstream template plus Claude Code skills, MCP config, and design docs
5
5
  License: MIT License
6
6
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dev-ready"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Scaffold AI-development-ready FastAPI projects: pinned upstream template plus Claude Code skills, MCP config, and design docs"
5
5
  readme = "README-pypi.md"
6
6
  license = { file = "LICENSE" }
@@ -4,4 +4,4 @@ Bootstrap phase: package structure only, no business logic yet.
4
4
  See docs/architecture.md for module boundaries.
5
5
  """
6
6
 
7
- __version__ = "0.2.0"
7
+ __version__ = "0.2.1"
@@ -40,6 +40,7 @@ def generate(answers: Answers, pin: UpstreamPin) -> list[Path]:
40
40
  fetch_snapshot(pin, project_staging, _template_data(answers))
41
41
  written = apply_overlay(answers, project_staging)
42
42
  verify_project(project_staging)
43
+ _prune_empty_dirs(project_staging)
43
44
  _finalize(project_staging, answers.target_dir)
44
45
  finally:
45
46
  shutil.rmtree(staging_root, ignore_errors=True)
@@ -102,3 +103,18 @@ def _finalize(staging_dir: Path, target_dir: Path) -> None:
102
103
  raise TargetDirectoryError(
103
104
  f"failed to write generated project into {target_dir}: {error}"
104
105
  ) from error
106
+
107
+
108
+ def _prune_empty_dirs(root: Path) -> None:
109
+ """Recursively remove empty directories from bottom to top."""
110
+ import os
111
+ for dirpath, _, _ in os.walk(root, topdown=False):
112
+ path = Path(dirpath)
113
+ if path == root:
114
+ continue
115
+ if not any(path.iterdir()):
116
+ try:
117
+ path.rmdir()
118
+ except OSError:
119
+ pass
120
+
@@ -120,7 +120,21 @@ def _parse_pin(name: str, entry: object, source: str) -> UpstreamPin:
120
120
 
121
121
 
122
122
  def _parse_path_list(name: str, entry: dict, source: str, field: str) -> tuple[str, ...]:
123
- """Validate optional per-pin path lists (exclude or prune)."""
123
+ """Validate optional per-pin path lists (exclude or prune).
124
+
125
+ Entries are gitwildmatch patterns handed to Copier's path matcher, never to
126
+ filesystem APIs. Two accepted shapes:
127
+
128
+ - relative pattern (``img/**``, ``CONTRIBUTING.md``): gitwildmatch treats a
129
+ slash-free pattern as matching at ANY depth.
130
+ - root-anchored pattern with a single leading ``/`` (``/README.md``): the
131
+ leading slash anchors the match to the template root, so it hits only the
132
+ top-level entry and not same-named entries in subdirectories. The ``/`` is
133
+ a match anchor, not an absolute filesystem path.
134
+
135
+ Rejected in every case: backslash-prefixed entries, a double leading slash,
136
+ ``..`` path segments, and empty strings.
137
+ """
124
138
  raw = entry.get(field)
125
139
  if raw is None:
126
140
  return ()
@@ -132,10 +146,20 @@ def _parse_path_list(name: str, entry: dict, source: str, field: str) -> tuple[s
132
146
  raise ManifestError(
133
147
  f"{source}: upstream '{name}' '{field}' entries must be non-empty strings"
134
148
  )
135
- if item.startswith(("/", "\\")) or ".." in item.split("/"):
149
+ # A single leading '/' is a gitwildmatch root anchor, not an absolute
150
+ # path; strip it before the traversal checks. Backslash prefixes and
151
+ # double leading slashes stay rejected.
152
+ unanchored = item[1:] if item.startswith("/") else item
153
+ if (
154
+ item.startswith("\\")
155
+ or unanchored.startswith(("/", "\\"))
156
+ or not unanchored
157
+ or ".." in unanchored.split("/")
158
+ ):
136
159
  raise ManifestError(
137
- f"{source}: upstream '{name}' '{field}' entries must be relative"
138
- f" paths without '..', got {item!r}"
160
+ f"{source}: upstream '{name}' '{field}' entries must be relative paths"
161
+ f" (an optional single leading '/' root anchor is allowed),"
162
+ f" without '..', got {item!r}"
139
163
  )
140
164
  patterns.append(item)
141
165
  return tuple(patterns)
@@ -30,6 +30,7 @@
30
30
  ".github/labeler.yml",
31
31
  "CONTRIBUTING.md",
32
32
  "release-notes.md",
33
+ "/README.md",
33
34
  "img/**",
34
35
  "scripts/add_latest_release_date.py",
35
36
  "hooks/**"
@@ -22,7 +22,7 @@ _TEMPLATE_TOKEN = "{{project_name}}"
22
22
  def apply_overlay(answers: Answers, project_dir: Path) -> list[Path]:
23
23
  """Apply the selected overlay components onto `project_dir`.
24
24
 
25
- CLAUDE.md is always applied; `.claude/skills/`, `.mcp.json`, and `docs/`
25
+ CLAUDE.md and README.md are always applied; `.claude/skills/`, `.mcp.json`, and `docs/`
26
26
  follow `answers.include_skills` / `include_mcp` / `include_docs`.
27
27
 
28
28
  Returns the paths written, relative to `project_dir`. Raises
@@ -38,7 +38,13 @@ def apply_overlay(answers: Answers, project_dir: Path) -> list[Path]:
38
38
  project_dir,
39
39
  Path("CLAUDE.md"),
40
40
  answers.project_name,
41
- )
41
+ ),
42
+ _apply_file(
43
+ templates_root.joinpath("readme", "README.md.tmpl"),
44
+ project_dir,
45
+ Path("README.md"),
46
+ answers.project_name,
47
+ ),
42
48
  ]
43
49
 
44
50
  if answers.include_skills:
@@ -0,0 +1,27 @@
1
+ # {{project_name}}
2
+
3
+ {{project_name}} is a full-stack FastAPI project — a FastAPI + SQLModel + PostgreSQL backend and a React + TypeScript + Vite frontend, wired together with Docker Compose. It was scaffolded by [dev-ready](https://github.com/MoofonLi/dev-ready) on top of [fastapi/full-stack-fastapi-template](https://github.com/fastapi/full-stack-fastapi-template).
4
+
5
+ ## Stack
6
+
7
+ - **Backend**: FastAPI, SQLModel, PostgreSQL, Pydantic — `backend/`
8
+ - **Frontend**: React, TypeScript, Vite — `frontend/`
9
+ - **Infra**: Docker Compose, Traefik reverse proxy — `compose.yml`
10
+
11
+ ## Commands
12
+
13
+ - `docker compose up -d` — start the full stack (backend, frontend, database, proxy)
14
+ - `docker compose watch` — start with live reload for local development
15
+ - `docker compose down` — stop the stack
16
+ - Backend only: `cd backend && uv run fastapi dev app/main.py`
17
+ - Frontend only: `cd frontend && npm install && npm run dev`
18
+ - Backend tests: `cd backend && bash scripts/test.sh`
19
+
20
+ ## Documentation
21
+
22
+ - Per-service setup lives in `backend/README.md` and `frontend/README.md`.
23
+ - `CLAUDE.md` — guidance for AI agents working in this repo (added by dev-ready).
24
+
25
+ ## Credits
26
+
27
+ Generated by [dev-ready](https://github.com/MoofonLi/dev-ready). Base template: [fastapi/full-stack-fastapi-template](https://github.com/fastapi/full-stack-fastapi-template) (MIT).
@@ -18,4 +18,7 @@ def test_fetch_real_pinned_snapshot(tmp_path: Path) -> None:
18
18
  result = fetch_snapshot(pin, dest)
19
19
 
20
20
  assert result == dest
21
- assert (dest / "README.md").exists()
21
+ # Root README.md is in the manifest prune list since phase 2 (FR-8):
22
+ # the snapshot must NOT contain it, while subdir READMEs survive.
23
+ assert not (dest / "README.md").exists()
24
+ assert (dest / "backend" / "README.md").exists()
@@ -35,7 +35,6 @@ def _fake_fetch_ok(
35
35
  pin: UpstreamPin, dest: Path, template_data: dict[str, str] | None = None
36
36
  ) -> Path:
37
37
  dest.mkdir(parents=True)
38
- (dest / "README.md").write_text("hello", encoding="utf-8")
39
38
  (dest / "backend").mkdir()
40
39
  (dest / "backend" / "main.py").write_text("print('hi')", encoding="utf-8")
41
40
  # Every path verify_project checks for must be present, or the happy-path
@@ -60,7 +59,10 @@ def test_generate_happy_path_merges_upstream_and_overlay(
60
59
 
61
60
  written = generate(answers, PIN)
62
61
 
63
- assert (target_dir / "README.md").read_text(encoding="utf-8") == "hello"
62
+ assert (target_dir / "README.md").exists()
63
+ readme = (target_dir / "README.md").read_text(encoding="utf-8")
64
+ assert "my-app" in readme
65
+ assert "MoofonLi/dev-ready" in readme
64
66
  assert (target_dir / "backend" / "main.py").exists()
65
67
  assert (target_dir / "CLAUDE.md").exists()
66
68
  assert (target_dir / ".mcp.json").exists()
@@ -166,7 +166,7 @@ def test_exclude_entries_must_be_non_empty_strings(bad_entry: object) -> None:
166
166
  parse_manifest(json.dumps(data))
167
167
 
168
168
 
169
- @pytest.mark.parametrize("bad_entry", ["/etc/passwd", "\\windows", "../outside", "a/../b"])
169
+ @pytest.mark.parametrize("bad_entry", ["//etc/passwd", "\\windows", "../outside", "a/../b"])
170
170
  def test_exclude_entries_must_be_relative_without_traversal(bad_entry: str) -> None:
171
171
  data = json.loads(json.dumps(VALID))
172
172
  data["upstream"]["base_template"]["exclude"] = [bad_entry]
@@ -201,7 +201,7 @@ def test_prune_entries_must_be_non_empty_strings(bad_entry: object) -> None:
201
201
  parse_manifest(json.dumps(data))
202
202
 
203
203
 
204
- @pytest.mark.parametrize("bad_entry", ["/etc/passwd", "\\windows", "../outside", "a/../b"])
204
+ @pytest.mark.parametrize("bad_entry", ["//etc/passwd", "\\windows", "../outside", "a/../b"])
205
205
  def test_prune_entries_must_be_relative_without_traversal(bad_entry: str) -> None:
206
206
  data = json.loads(json.dumps(VALID))
207
207
  data["upstream"]["base_template"]["prune"] = [bad_entry]
@@ -209,6 +209,14 @@ def test_prune_entries_must_be_relative_without_traversal(bad_entry: str) -> Non
209
209
  parse_manifest(json.dumps(data))
210
210
 
211
211
 
212
+ @pytest.mark.parametrize("field", ["exclude", "prune"])
213
+ def test_path_list_accepts_single_leading_slash_root_anchor(field: str) -> None:
214
+ data = json.loads(json.dumps(VALID))
215
+ data["upstream"]["base_template"][field] = ["/README.md"]
216
+ pin = parse_manifest(json.dumps(data)).upstream["base_template"]
217
+ assert getattr(pin, field) == ("/README.md",) # stored verbatim, anchor kept
218
+
219
+
212
220
  def test_bundled_manifest_is_valid() -> None:
213
221
  manifest = load_default_manifest()
214
222
  assert "base_template" in manifest.upstream
@@ -25,6 +25,7 @@ def test_happy_path_writes_every_component_with_substitution(tmp_path: Path) ->
25
25
  written = apply_overlay(_answers(tmp_path), project_dir)
26
26
 
27
27
  assert (project_dir / "CLAUDE.md").exists()
28
+ assert (project_dir / "README.md").exists()
28
29
  assert (project_dir / ".claude" / "skills" / "project-orientation" / "SKILL.md").exists()
29
30
  assert (project_dir / ".mcp.json").exists()
30
31
  assert (project_dir / "docs" / "architecture.md").exists()
@@ -90,13 +91,38 @@ def test_claude_md_always_present_even_with_all_components_disabled(tmp_path: Pa
90
91
  project_dir,
91
92
  )
92
93
 
93
- assert written == [Path("CLAUDE.md")]
94
+ assert written == [Path("CLAUDE.md"), Path("README.md")]
94
95
  assert (project_dir / "CLAUDE.md").exists()
96
+ assert (project_dir / "README.md").exists()
95
97
  assert not (project_dir / ".claude").exists()
96
98
  assert not (project_dir / ".mcp.json").exists()
97
99
  assert not (project_dir / "docs").exists()
98
100
 
99
101
 
102
+ def test_readme_is_about_the_project_not_the_template(tmp_path: Path) -> None:
103
+ project_dir = tmp_path / "project"
104
+ project_dir.mkdir()
105
+
106
+ apply_overlay(_answers(tmp_path), project_dir)
107
+
108
+ readme = (project_dir / "README.md").read_text(encoding="utf-8")
109
+ assert "my-app" in readme
110
+ assert "{{" not in readme
111
+ assert "MoofonLi/dev-ready" in readme
112
+ assert "img/" not in readme
113
+
114
+
115
+ def test_collision_on_existing_readme_raises_overlay_error(tmp_path: Path) -> None:
116
+ project_dir = tmp_path / "project"
117
+ project_dir.mkdir()
118
+ (project_dir / "README.md").write_text("pre-existing", encoding="utf-8")
119
+
120
+ with pytest.raises(OverlayError, match="README.md"):
121
+ apply_overlay(_answers(tmp_path), project_dir)
122
+
123
+ assert (project_dir / "README.md").read_text(encoding="utf-8") == "pre-existing"
124
+
125
+
100
126
  def test_collision_on_existing_claude_md_raises_overlay_error(tmp_path: Path) -> None:
101
127
  project_dir = tmp_path / "project"
102
128
  project_dir.mkdir()
@@ -46,7 +46,7 @@ wheels = [
46
46
 
47
47
  [[package]]
48
48
  name = "dev-ready"
49
- version = "0.2.0"
49
+ version = "0.2.1"
50
50
  source = { editable = "." }
51
51
  dependencies = [
52
52
  { name = "copier" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes