git-repokit 0.9.10__py3-none-any.whl
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.
- git_repokit-0.9.10.dist-info/METADATA +422 -0
- git_repokit-0.9.10.dist-info/RECORD +174 -0
- git_repokit-0.9.10.dist-info/WHEEL +5 -0
- git_repokit-0.9.10.dist-info/entry_points.txt +2 -0
- git_repokit-0.9.10.dist-info/licenses/LICENSE +9 -0
- git_repokit-0.9.10.dist-info/top_level.txt +1 -0
- repokit/__init__.py +8 -0
- repokit/__main__.py +12 -0
- repokit/__version__.py +4 -0
- repokit/_vendor/__init__.py +0 -0
- repokit/_vendor/ailib/__init__.py +1 -0
- repokit/_vendor/ailib/analyzer.py +177 -0
- repokit/_vendor/ailib/backend.py +95 -0
- repokit/_vendor/ailib/cache.py +97 -0
- repokit/_vendor/ailib/parsers.py +52 -0
- repokit/_vendor/ailib/transports/__init__.py +16 -0
- repokit/_vendor/ailib/transports/cli.py +312 -0
- repokit/_vendor/ailib/transports/openai_compat.py +383 -0
- repokit/_vendor/ailib/transports/prompt_file.py +41 -0
- repokit/_vendor/ailib/types.py +224 -0
- repokit/auth_integration.py +244 -0
- repokit/badges.py +183 -0
- repokit/branch_utils.py +364 -0
- repokit/cli.py +2997 -0
- repokit/common_kit.py +202 -0
- repokit/config.py +686 -0
- repokit/defaults.py +220 -0
- repokit/directory_analyzer.py +1244 -0
- repokit/directory_profiles.py +423 -0
- repokit/git_config.py +370 -0
- repokit/github_create.py +142 -0
- repokit/github_setup.py +248 -0
- repokit/guardrails.py +707 -0
- repokit/history_cleaner.py +449 -0
- repokit/history_protection.py +434 -0
- repokit/hooks/pre-commit-guardrails +122 -0
- repokit/hooks/pre-commit-template +28 -0
- repokit/layers.py +510 -0
- repokit/licenses/0bsd.txt +14 -0
- repokit/licenses/LICENSES.md +27 -0
- repokit/licenses/__init__.py +142 -0
- repokit/licenses/agpl-3.0.txt +661 -0
- repokit/licenses/all-rights-reserved.txt +10 -0
- repokit/licenses/apache-2.0.txt +201 -0
- repokit/licenses/bsd-2-clause.txt +24 -0
- repokit/licenses/bsd-3-clause.txt +28 -0
- repokit/licenses/bsl-1.0.txt +23 -0
- repokit/licenses/cc-by-4.0.txt +395 -0
- repokit/licenses/cc-by-sa-4.0.txt +427 -0
- repokit/licenses/cc0-1.0.txt +121 -0
- repokit/licenses/epl-2.0.txt +277 -0
- repokit/licenses/gpl-2.0.txt +339 -0
- repokit/licenses/gpl-3.0.txt +674 -0
- repokit/licenses/isc.txt +15 -0
- repokit/licenses/lgpl-2.1.txt +504 -0
- repokit/licenses/lgpl-3.0.txt +165 -0
- repokit/licenses/mit.txt +21 -0
- repokit/licenses/mpl-2.0.txt +373 -0
- repokit/licenses/unlicense.txt +24 -0
- repokit/readme_blocks.py +112 -0
- repokit/remote_integration.py +627 -0
- repokit/repo_manager.py +2796 -0
- repokit/template_engine.py +391 -0
- repokit/templates/ai/claude/CLAUDE-nested.md.template +25 -0
- repokit/templates/ai/claude/CLAUDE.md.template +98 -0
- repokit/templates/ai/claude/instructions/step1_context_rebuilder.md +33 -0
- repokit/templates/ai/claude/instructions/step2_dev_workflow_process.md +67 -0
- repokit/templates/ai/claude/instructions/step3_context_bridge.md +52 -0
- repokit/templates/common/CHANGELOG.md.template +15 -0
- repokit/templates/common/CONTRIBUTING.md.template +31 -0
- repokit/templates/common/README.md.template +30 -0
- repokit/templates/common/gitattributes.template +17 -0
- repokit/templates/common/gitignore.template +141 -0
- repokit/templates/extras/FUNDING.yml.template +13 -0
- repokit/templates/extras/ROADMAP.md.template +17 -0
- repokit/templates/extras/dependabot.yml.template +22 -0
- repokit/templates/extras/one-offs-README.md.template +28 -0
- repokit/templates/extras/platform-support.md.template +11 -0
- repokit/templates/extras/pull_request_template.md.template +25 -0
- repokit/templates/extras/release-template.md.template +34 -0
- repokit/templates/extras/settings.json.template +11 -0
- repokit/templates/extras/stale.yml.template +14 -0
- repokit/templates/github/CODEOWNERS.template +11 -0
- repokit/templates/github/ISSUE_TEMPLATE/bug-report.md.template +29 -0
- repokit/templates/github/ISSUE_TEMPLATE/feature-request.md.template +19 -0
- repokit/templates/github/issues/notes.md.template +18 -0
- repokit/templates/github/issues/roadmap.md.template +15 -0
- repokit/templates/hooks/pre-commit.template +64 -0
- repokit/templates/layers/archetypes/any/claude-plugin/.claude-plugin/marketplace.json +20 -0
- repokit/templates/layers/archetypes/any/claude-plugin/plugin/.claude-plugin/plugin.json +15 -0
- repokit/templates/layers/archetypes/any/claude-plugin/plugin/README.md +28 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/.github/workflows/ci-c-cpp.yml +24 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/.repokit-common.toml.rkappend +4 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/launch.json +29 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/tasks.json +26 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakeLists.txt +47 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakePresets.json +23 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/cmake/GenerateStamp.cmake +45 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/src/main.cpp +27 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/tests/test_version.cpp +20 -0
- repokit/templates/layers/archetypes/c-cpp/cmake-app/vcpkg.json +5 -0
- repokit/templates/layers/archetypes/c-cpp/minimal/.vscode/launch.json +27 -0
- repokit/templates/layers/archetypes/c-cpp/minimal/Makefile +10 -0
- repokit/templates/layers/archetypes/c-cpp/minimal/build.bat +7 -0
- repokit/templates/layers/archetypes/c-cpp/minimal/src/__RK_SNAKE__.c +26 -0
- repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/launch.json +17 -0
- repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/tasks.json +20 -0
- repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.sln +19 -0
- repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.vcxproj +41 -0
- repokit/templates/layers/archetypes/c-cpp/msbuild/src/main.cpp +26 -0
- repokit/templates/layers/archetypes/js-ts/claude-plugin/.repokit-common.toml +28 -0
- repokit/templates/layers/archetypes/js-ts/claude-plugin/.vscode/launch.json +34 -0
- repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/hooks/hooks.json +15 -0
- repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/hooks/scripts/session-start.mjs +23 -0
- repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/tests/manifest.test.js +30 -0
- repokit/templates/layers/archetypes/js-ts/node/.repokit-common.toml.rkappend +6 -0
- repokit/templates/layers/archetypes/js-ts/node/package.json +13 -0
- repokit/templates/layers/archetypes/js-ts/node-package/.github/workflows/release.yml +39 -0
- repokit/templates/layers/archetypes/js-ts/node-package/package.json +32 -0
- repokit/templates/layers/archetypes/js-ts/node-package/src/index.ts +13 -0
- repokit/templates/layers/archetypes/js-ts/node-package/tests/index.test.ts +11 -0
- repokit/templates/layers/archetypes/js-ts/script/.vscode/launch.json +34 -0
- repokit/templates/layers/archetypes/js-ts/script/__RK_PROJECT__.js +37 -0
- repokit/templates/layers/archetypes/js-ts/script/tests/version.test.js +26 -0
- repokit/templates/layers/archetypes/js-ts/ts/package.json +18 -0
- repokit/templates/layers/archetypes/js-ts/ts/tsconfig.json +15 -0
- repokit/templates/layers/archetypes/python/claude-plugin/.github/workflows/ci-python.yml +44 -0
- repokit/templates/layers/archetypes/python/claude-plugin/.repokit-common.toml +21 -0
- repokit/templates/layers/archetypes/python/claude-plugin/.vscode/launch.json +33 -0
- repokit/templates/layers/archetypes/python/claude-plugin/VERSION +1 -0
- repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/hooks.json +15 -0
- repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/run-hook.mjs +42 -0
- repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/session_start.py +31 -0
- repokit/templates/layers/archetypes/python/claude-plugin/plugin/tests/test_manifest.py +42 -0
- repokit/templates/layers/archetypes/python/pypi/.github/workflows/release.yml +63 -0
- repokit/templates/layers/archetypes/python/pypi/.vscode/launch.json +43 -0
- repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__init__.py +5 -0
- repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__main__.py +6 -0
- repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/_version.py +96 -0
- repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/cli.py +18 -0
- repokit/templates/layers/archetypes/python/pypi/pyproject.toml +71 -0
- repokit/templates/layers/archetypes/python/pypi/tests/conftest.py +11 -0
- repokit/templates/layers/archetypes/python/pypi/tests/test_version.py +50 -0
- repokit/templates/layers/archetypes/python/script/.github/workflows/ci-python.yml +43 -0
- repokit/templates/layers/archetypes/python/script/.repokit-common.toml +14 -0
- repokit/templates/layers/archetypes/python/script/.vscode/launch.json +33 -0
- repokit/templates/layers/archetypes/python/script/VERSION +1 -0
- repokit/templates/layers/archetypes/python/script/__RK_PROJECT__.py +40 -0
- repokit/templates/layers/archetypes/python/script/tests/test_version.py +25 -0
- repokit/templates/layers/archetypes/python/setuppy/requirements.txt +8 -0
- repokit/templates/layers/archetypes/python/setuppy/setup.py +23 -0
- repokit/templates/layers/languages/c-cpp/.gitignore.rkappend +20 -0
- repokit/templates/layers/languages/c-cpp/.repokit-common.toml +7 -0
- repokit/templates/layers/languages/c-cpp/include/__RK_SNAKE__/version.h +20 -0
- repokit/templates/layers/languages/c-cpp/src/app.rc +25 -0
- repokit/templates/layers/languages/js-ts/.editorconfig +15 -0
- repokit/templates/layers/languages/js-ts/.github/workflows/ci-js-ts.yml +41 -0
- repokit/templates/layers/languages/js-ts/.gitignore.rkappend +13 -0
- repokit/templates/layers/languages/js-ts/.repokit-common.toml +19 -0
- repokit/templates/layers/languages/js-ts/.vscode/launch.json +24 -0
- repokit/templates/layers/languages/js-ts/VERSION +1 -0
- repokit/templates/layers/languages/python/.github/workflows/ci-python.yml +76 -0
- repokit/templates/layers/languages/python/.gitignore.rkappend +15 -0
- repokit/templates/layers/languages/python/.vscode/launch.json +33 -0
- repokit/templates/layers/manifest.toml +302 -0
- repokit/templates/vault/CLAUDE.md +29 -0
- repokit/templates/vault/claude/_maps/MOC-project.md +15 -0
- repokit/templates/vault/claude/_oracle/backlinks.md +3 -0
- repokit/templates/vault/claude/_oracle/concepts.md +12 -0
- repokit/templates/vault/claude/_oracle/manifest.md +10 -0
- repokit/templates/vault/claude/_todo/ACTIVE-WORK.md +18 -0
- repokit/templates/vault/claude/_todo/OPEN-LOOPS.md +14 -0
- repokit/utils.py +316 -0
- repokit/vault.py +248 -0
repokit/readme_blocks.py
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""The README's and CONTRIBUTING's per-preset sections (0.9.6).
|
|
2
|
+
|
|
3
|
+
Until 0.9.6 every README said "# Installation instructions here" and
|
|
4
|
+
"Feature 1", and CONTRIBUTING was generic text; git-repokit-template's own
|
|
5
|
+
README and CONTRIBUTING carried the real commands for a Python package. This
|
|
6
|
+
module holds those commands for every built preset, taken from the preset's
|
|
7
|
+
own files (its CI workflow, package.json, CMake presets), so a new project's
|
|
8
|
+
README says how to install, run, build and test it from the first commit.
|
|
9
|
+
|
|
10
|
+
`sections(...)` returns the markdown blocks the templates place; an empty
|
|
11
|
+
block means the preset has nothing to say there and the heading is left out.
|
|
12
|
+
`floors()` is what the badges read; tests/test_readme_blocks.py checks each
|
|
13
|
+
floor against the layer file it comes from.
|
|
14
|
+
"""
|
|
15
|
+
from typing import Dict, List, Optional
|
|
16
|
+
|
|
17
|
+
# preset -> the minimum runtime its own files declare (badge, prerequisites)
|
|
18
|
+
FLOORS: Dict[str, Dict[str, str]] = {
|
|
19
|
+
"python/pypi": {"python": "3.10"}, # pyproject.toml requires-python
|
|
20
|
+
"python/setuppy": {"python": "3.6"}, # setup.py python_requires
|
|
21
|
+
"python/script": {"python": "3.9"}, # the oldest Python its CI runs
|
|
22
|
+
"python/claude-plugin": {"python": "3.10"}, # the oldest Python its CI runs
|
|
23
|
+
"js-ts/node-package": {"node": "20"}, # package.json engines
|
|
24
|
+
"js-ts/script": {"node": "20"},
|
|
25
|
+
"js-ts/claude-plugin": {"node": "20"},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def floors(archetype: Optional[str]) -> Dict[str, str]:
|
|
30
|
+
return dict(FLOORS.get(archetype or "", {}))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _code(*lines: str) -> str:
|
|
34
|
+
return "```bash\n" + "\n".join(lines) + "\n```"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _section(title: str, body: str) -> str:
|
|
38
|
+
return f"## {title}\n\n{body}\n\n" if body else ""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def sections(archetype: Optional[str], language: str, name: str, owner: str,
|
|
42
|
+
vendored_common: bool) -> Dict[str, str]:
|
|
43
|
+
"""The README's install/usage sections and the development text both
|
|
44
|
+
files use, for one project. Keys: install_section, usage_section,
|
|
45
|
+
prerequisites, setup_block, test_block."""
|
|
46
|
+
snake = name.replace("-", "_")
|
|
47
|
+
clone = [f"git clone https://github.com/{owner}/{name}.git", f"cd {name}"]
|
|
48
|
+
hooks = ["bash scripts/repokit-common/install-hooks.sh"] if vendored_common else []
|
|
49
|
+
a = archetype or ""
|
|
50
|
+
fl = floors(a)
|
|
51
|
+
prereq: List[str] = []
|
|
52
|
+
install = usage = test = ""
|
|
53
|
+
setup = clone
|
|
54
|
+
|
|
55
|
+
if a in ("python/pypi", "python/setuppy"):
|
|
56
|
+
prereq = [f"Python {fl['python']}+", "Git"]
|
|
57
|
+
if a == "python/pypi":
|
|
58
|
+
install = _code(f"pip install {name}") + "\n\nFrom source:\n\n" + _code(*clone, 'pip install -e ".[dev]"')
|
|
59
|
+
usage = _code(f"{name} --help", f"python -m {snake} --version")
|
|
60
|
+
setup = clone + ["python -m venv .venv",
|
|
61
|
+
"source .venv/bin/activate # Windows: .venv\\Scripts\\activate",
|
|
62
|
+
'pip install -e ".[dev]"'] + hooks
|
|
63
|
+
else:
|
|
64
|
+
install = _code(*clone, "pip install -e .")
|
|
65
|
+
setup = clone + ["python -m venv .venv",
|
|
66
|
+
"source .venv/bin/activate # Windows: .venv\\Scripts\\activate",
|
|
67
|
+
"pip install -e .", "pip install -r requirements.txt"] + hooks
|
|
68
|
+
test = _code("python -m pytest tests/ -v")
|
|
69
|
+
elif a == "python/script":
|
|
70
|
+
prereq = [f"Python {fl['python']}+", "Git"]
|
|
71
|
+
usage = _code(f"python {name}.py --version")
|
|
72
|
+
setup = clone + hooks
|
|
73
|
+
test = _code("python -m pytest tests/ -v")
|
|
74
|
+
elif a in ("python/claude-plugin", "js-ts/claude-plugin"):
|
|
75
|
+
prereq = ["Claude Code", "Git"] + ([f"Python {fl['python']}+"] if "python" in fl else [f"Node.js {fl['node']}+"])
|
|
76
|
+
install = ("In Claude Code:\n\n"
|
|
77
|
+
+ _code(f"/plugin marketplace add {owner}/{name}", f"/plugin install {name}@{name}"))
|
|
78
|
+
setup = clone + hooks + ["# then, in Claude Code: /plugin marketplace add ./"]
|
|
79
|
+
test = _code("python -m pytest plugin/tests -q") if a.startswith("python") else _code("npm test")
|
|
80
|
+
elif a == "js-ts/node-package":
|
|
81
|
+
prereq = [f"Node.js {fl['node']}+", "Git"]
|
|
82
|
+
install = _code(f"npm install {name}")
|
|
83
|
+
setup = clone + ["npm install", "npm run build"] + hooks
|
|
84
|
+
test = _code("npm test")
|
|
85
|
+
elif a == "js-ts/script":
|
|
86
|
+
prereq = [f"Node.js {fl['node']}+", "Git"]
|
|
87
|
+
usage = _code(f"node {name}.js --version")
|
|
88
|
+
setup = clone + hooks
|
|
89
|
+
test = _code("npm test")
|
|
90
|
+
elif a == "c-cpp/cmake-app":
|
|
91
|
+
prereq = ["CMake", "A C++ compiler (MSVC, GCC or Clang)", "vcpkg (`VCPKG_ROOT` set)", "Git"]
|
|
92
|
+
setup = clone + hooks + [
|
|
93
|
+
"cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake",
|
|
94
|
+
"cmake --build build --config Release"]
|
|
95
|
+
test = _code("ctest --test-dir build -C Release --output-on-failure")
|
|
96
|
+
elif a == "c-cpp/minimal":
|
|
97
|
+
prereq = ["A C compiler (GCC/Clang with make, or MSVC)", "Git"]
|
|
98
|
+
setup = clone + hooks + ["make # or, on Windows from a Developer Command Prompt: build.bat"]
|
|
99
|
+
usage = _code(f"build/{name} --version")
|
|
100
|
+
elif a == "c-cpp/msbuild":
|
|
101
|
+
prereq = ["Visual Studio 2022 Build Tools (MSBuild, the C++ workload)", "Git"]
|
|
102
|
+
setup = clone + hooks + [f"msbuild {name}.sln -p:Configuration=Debug -p:Platform=x64"]
|
|
103
|
+
else:
|
|
104
|
+
setup = clone + hooks
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
"install_section": _section("Installation", install),
|
|
108
|
+
"usage_section": _section("Usage", usage),
|
|
109
|
+
"prerequisites": "\n".join(f"- {p}" for p in prereq) if prereq else "- Git",
|
|
110
|
+
"setup_block": _code(*setup),
|
|
111
|
+
"test_block": test or "This project has no test suite yet.",
|
|
112
|
+
}
|