belazywithreact 0.1.0__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.
- belazywithreact-0.1.0/.gitignore +34 -0
- belazywithreact-0.1.0/CONTRIBUTING.md +29 -0
- belazywithreact-0.1.0/LICENSE +21 -0
- belazywithreact-0.1.0/PKG-INFO +205 -0
- belazywithreact-0.1.0/README.md +175 -0
- belazywithreact-0.1.0/RELEASING.md +137 -0
- belazywithreact-0.1.0/SECURITY.md +16 -0
- belazywithreact-0.1.0/pyproject.toml +46 -0
- belazywithreact-0.1.0/scripts/check_dist.py +38 -0
- belazywithreact-0.1.0/scripts/check_version.py +17 -0
- belazywithreact-0.1.0/src/belazywithreact/__init__.py +1 -0
- belazywithreact-0.1.0/src/belazywithreact/cli.py +102 -0
- belazywithreact-0.1.0/src/belazywithreact/scaffold.py +367 -0
- belazywithreact-0.1.0/src/belazywithreact/validators.py +60 -0
- belazywithreact-0.1.0/tests/test_cli.py +76 -0
- belazywithreact-0.1.0/tests/test_scaffold.py +149 -0
- belazywithreact-0.1.0/tests/test_validators.py +57 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
.pytest_cache/
|
|
4
|
+
.coverage
|
|
5
|
+
htmlcov/
|
|
6
|
+
.venv/
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
venv/
|
|
11
|
+
env/
|
|
12
|
+
.*-venv/
|
|
13
|
+
.tox/
|
|
14
|
+
.nox/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
.coverage.*
|
|
18
|
+
coverage.xml
|
|
19
|
+
node_modules/
|
|
20
|
+
.env
|
|
21
|
+
.env.*
|
|
22
|
+
!.env.example
|
|
23
|
+
*.pem
|
|
24
|
+
*.key
|
|
25
|
+
.pypirc
|
|
26
|
+
.npmrc
|
|
27
|
+
.idea/
|
|
28
|
+
.vscode/
|
|
29
|
+
.DS_Store
|
|
30
|
+
Thumbs.db
|
|
31
|
+
*.log
|
|
32
|
+
# Existing local generated app: preserved, excluded from the package repository.
|
|
33
|
+
/lazy/
|
|
34
|
+
/.release-check/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Use Python 3.10+ and an even-numbered Node.js release >=22.13 (24 LTS recommended).
|
|
4
|
+
The release scripts use Python 3.12. Clone the repository, then create a virtual
|
|
5
|
+
environment. On Windows no activation or execution-policy change is necessary:
|
|
6
|
+
|
|
7
|
+
```powershell
|
|
8
|
+
py -m venv .venv
|
|
9
|
+
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
|
10
|
+
.\.venv\Scripts\python.exe -m pytest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
On macOS/Linux use `python3 -m venv .venv` and `.venv/bin/python` instead.
|
|
14
|
+
|
|
15
|
+
Keep changes focused and describe their behavior and validation in a pull request.
|
|
16
|
+
Tests mock npm for offline unit checks. Add regression tests for fixes, including
|
|
17
|
+
Windows launcher behavior where relevant. Do not replace the `call "npm.cmd"`
|
|
18
|
+
launcher without testing it on Windows with paths containing spaces.
|
|
19
|
+
|
|
20
|
+
Before proposing a release, run the checks in [RELEASING.md](RELEASING.md).
|
|
21
|
+
Test a generated default app with `npm ci`, `npm test`, `npm run lint`, and
|
|
22
|
+
`npm run build`; also build a minimal app with all optional tools disabled.
|
|
23
|
+
Never commit generated apps, node_modules, secrets, or virtual environments.
|
|
24
|
+
Update both Python version declarations together when a release requires a bump.
|
|
25
|
+
|
|
26
|
+
Treat other contributors respectfully. Offer specific, constructive feedback;
|
|
27
|
+
harassment, discrimination, threats, and disclosure of private information are
|
|
28
|
+
not welcome. Maintainers may remove inappropriate content and restrict participation.
|
|
29
|
+
For security concerns, follow [SECURITY.md](SECURITY.md).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 belazywithreact contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
18
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
19
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
20
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
+
DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: belazywithreact
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python CLI that scaffolds ready-to-use React projects.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Sanju2911/belazywithreact
|
|
6
|
+
Project-URL: Repository, https://github.com/Sanju2911/belazywithreact
|
|
7
|
+
Project-URL: Issues, https://github.com/Sanju2911/belazywithreact/issues
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: cli,react,scaffold,typescript,vite
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: rich<15.0,>=13.7
|
|
23
|
+
Requires-Dist: typer<1.0,>=0.12
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: twine>=6.0; extra == 'dev'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# belazywithreact
|
|
32
|
+
|
|
33
|
+
[](https://github.com/Sanju2911/belazywithreact/actions/workflows/tests.yml)
|
|
34
|
+
|
|
35
|
+
A Python CLI that creates a React + TypeScript app with Vite and a useful starter
|
|
36
|
+
structure. Version **0.1.0** is the initial release. npm is the supported package
|
|
37
|
+
manager.
|
|
38
|
+
|
|
39
|
+
## Prerequisites
|
|
40
|
+
|
|
41
|
+
- Python 3.10 or newer.
|
|
42
|
+
- An even-numbered Node.js release >=22.13; Node.js 24 LTS is recommended.
|
|
43
|
+
- npm on PATH and internet access to download packages from the npm registry.
|
|
44
|
+
|
|
45
|
+
Check `python --version`, `node --version`, and `npm --version`.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
Install a published release from PyPI:
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
python -m pip install belazywithreact
|
|
53
|
+
belazywithreact --help
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Install from a local checkout:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
python -m pip install .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For development on Windows, a virtual environment avoids global changes and
|
|
63
|
+
does not require changing PowerShell's execution policy:
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
py -m venv .venv
|
|
67
|
+
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
|
68
|
+
.\.venv\Scripts\belazywithreact.exe --help
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
On macOS/Linux use `python3 -m venv .venv`, then `.venv/bin/python` and
|
|
72
|
+
`.venv/bin/belazywithreact` instead.
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
belazywithreact create my-app
|
|
78
|
+
cd my-app
|
|
79
|
+
npm run dev
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Creation asks for confirmation. `--yes` skips that question and still refuses
|
|
83
|
+
to overwrite an existing destination, including an empty directory.
|
|
84
|
+
|
|
85
|
+
Defaults include CSS + Tailwind CSS 4, React Router, Axios, Zustand, ESLint,
|
|
86
|
+
Prettier, and Vitest. Tailwind uses its official Vite plugin and CSS import;
|
|
87
|
+
customize its theme in CSS. ESLint is explicitly configured for TypeScript and
|
|
88
|
+
React. `npm test` runs once, and `npm run test:watch` starts watch mode.
|
|
89
|
+
|
|
90
|
+
A minimal CSS app:
|
|
91
|
+
|
|
92
|
+
```powershell
|
|
93
|
+
belazywithreact create my-app --styling css --no-router --no-axios --no-zustand --no-eslint --no-prettier --no-vitest --yes
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
| Option | Default | Behavior |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `--styling css\|tailwind\|both` | `both` | Enables Tailwind in tailwind/both; custom starter CSS is always included |
|
|
99
|
+
| `--router` / `--no-router` | enabled | Home and fallback routes with BrowserRouter |
|
|
100
|
+
| `--axios` / `--no-axios` | enabled | Axios API client and public API base URL example |
|
|
101
|
+
| `--zustand` / `--no-zustand` | enabled | Example counter store |
|
|
102
|
+
| `--eslint` / `--no-eslint` | enabled | ESLint config, dependencies, and lint script |
|
|
103
|
+
| `--prettier` / `--no-prettier` | enabled | Format script and ignore file |
|
|
104
|
+
| `--vitest` / `--no-vitest` | enabled | Test scripts and example unit test |
|
|
105
|
+
| `--package-manager npm` | `npm` | Only npm is supported in 0.1.0 |
|
|
106
|
+
| `--yes`, `-y` | disabled | Skip confirmation |
|
|
107
|
+
|
|
108
|
+
Use `belazywithreact create --help` for all options.
|
|
109
|
+
|
|
110
|
+
## Generated structure
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
my-app/
|
|
114
|
+
src/
|
|
115
|
+
assets/
|
|
116
|
+
components/Button.tsx
|
|
117
|
+
hooks/
|
|
118
|
+
layouts/
|
|
119
|
+
pages/HomePage.tsx
|
|
120
|
+
services/api.ts # when Axios is enabled
|
|
121
|
+
store/useAppStore.ts # when Zustand is enabled
|
|
122
|
+
styles/index.css
|
|
123
|
+
styles/tailwind.css
|
|
124
|
+
types/
|
|
125
|
+
utils/example.test.ts # when Vitest is enabled
|
|
126
|
+
App.tsx
|
|
127
|
+
main.tsx
|
|
128
|
+
.env.example
|
|
129
|
+
eslint.config.js # when ESLint is enabled
|
|
130
|
+
vite.config.ts
|
|
131
|
+
package.json
|
|
132
|
+
package-lock.json
|
|
133
|
+
README.md
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The Button supports native button props and children. Customize the generated
|
|
137
|
+
components, folders, API client, and store after creation. Empty starter folders
|
|
138
|
+
contain .gitkeep files. The scaffold does not provide authentication, backend
|
|
139
|
+
services, deployment, or arbitrary folder/component generation flags.
|
|
140
|
+
|
|
141
|
+
Validate your generated app:
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
npm ci
|
|
145
|
+
npm test
|
|
146
|
+
npm run lint
|
|
147
|
+
npm run build
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Test and lint commands require their respective enabled options.
|
|
151
|
+
BrowserRouter deployments need a server fallback to index.html for route URLs.
|
|
152
|
+
All `VITE_` environment variables are public browser values, never secrets.
|
|
153
|
+
|
|
154
|
+
## Troubleshooting
|
|
155
|
+
|
|
156
|
+
- **Missing Node/npm or WinError 2:** install Node.js 24 LTS and reopen the
|
|
157
|
+
terminal so PATH updates. On Windows, check `where.exe node` and
|
|
158
|
+
`where.exe npm`; `npm.cmd --version` should work. The CLI preserves its
|
|
159
|
+
tested `call "<resolved npm.cmd>"` launch method for paths containing spaces.
|
|
160
|
+
- **Unsupported Node version:** upgrade to an even-numbered release >=22.13.
|
|
161
|
+
The generated tooling needs a newer Node version than some older Vite releases.
|
|
162
|
+
- **Invalid name:** use a directory name starting with a letter or number and
|
|
163
|
+
containing only letters, numbers, dots, underscores, or hyphens. Names cannot
|
|
164
|
+
end in a dot, exceed 214 characters, use Windows device names like CON/LPT1,
|
|
165
|
+
or use npm-reserved names. Path separators and shell operators are rejected.
|
|
166
|
+
Vite normalizes uppercase directory names to valid npm package names.
|
|
167
|
+
- **Destination exists:** choose another name; existing files are preserved.
|
|
168
|
+
- **npm failure or interruption:** read npm's output and check network/PATH.
|
|
169
|
+
Partial projects are preserved. Inspect them before manually removing or
|
|
170
|
+
repairing them; a retry with the same name will refuse to overwrite them.
|
|
171
|
+
- **Dependency advisory:** run `npm audit` and review compatible upgrades;
|
|
172
|
+
do not blindly force a major upgrade.
|
|
173
|
+
|
|
174
|
+
## Architecture and development
|
|
175
|
+
|
|
176
|
+
`cli.py` parses options with Typer and prints progress/errors with Rich.
|
|
177
|
+
`validators.py` validates names, destination boundaries, and Node prerequisites.
|
|
178
|
+
`scaffold.py` invokes create-vite **9.2.1**, writes the starter files, installs
|
|
179
|
+
selected tools, updates package.json, and synchronizes package-lock.json. npm
|
|
180
|
+
output remains visible, and failures return nonzero status. Interruption during
|
|
181
|
+
creation returns 130. The CLI never deletes a partial project automatically.
|
|
182
|
+
|
|
183
|
+
The Vite creator and optional-tool install requests specify reviewed versions;
|
|
184
|
+
Vite's base template and npm semver ranges can still resolve newer compatible
|
|
185
|
+
dependencies. Commit the generated lockfile and use `npm ci` for reproducible
|
|
186
|
+
app installations. Revalidate dependencies before a future CLI release.
|
|
187
|
+
|
|
188
|
+
```powershell
|
|
189
|
+
python -m pytest
|
|
190
|
+
python -m build
|
|
191
|
+
python -m twine check --strict dist/*
|
|
192
|
+
python scripts/check_dist.py
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Unit tests mock npm and run offline. CI checks Python 3.10, 3.12, and 3.14 on
|
|
196
|
+
Windows, macOS, and Linux, validates distributions, and builds real default and
|
|
197
|
+
minimal React apps. See [CONTRIBUTING.md](CONTRIBUTING.md) for contributions,
|
|
198
|
+
[SECURITY.md](SECURITY.md) for security reporting, and
|
|
199
|
+
[RELEASING.md](RELEASING.md) for TestPyPI-first Trusted Publishing and explicit
|
|
200
|
+
production-release approval. GitHub and both package-index accounts must be
|
|
201
|
+
configured separately before publication.
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
[MIT](LICENSE).
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# belazywithreact
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Sanju2911/belazywithreact/actions/workflows/tests.yml)
|
|
4
|
+
|
|
5
|
+
A Python CLI that creates a React + TypeScript app with Vite and a useful starter
|
|
6
|
+
structure. Version **0.1.0** is the initial release. npm is the supported package
|
|
7
|
+
manager.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- Python 3.10 or newer.
|
|
12
|
+
- An even-numbered Node.js release >=22.13; Node.js 24 LTS is recommended.
|
|
13
|
+
- npm on PATH and internet access to download packages from the npm registry.
|
|
14
|
+
|
|
15
|
+
Check `python --version`, `node --version`, and `npm --version`.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Install a published release from PyPI:
|
|
20
|
+
|
|
21
|
+
```powershell
|
|
22
|
+
python -m pip install belazywithreact
|
|
23
|
+
belazywithreact --help
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Install from a local checkout:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
python -m pip install .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For development on Windows, a virtual environment avoids global changes and
|
|
33
|
+
does not require changing PowerShell's execution policy:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
py -m venv .venv
|
|
37
|
+
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
|
38
|
+
.\.venv\Scripts\belazywithreact.exe --help
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
On macOS/Linux use `python3 -m venv .venv`, then `.venv/bin/python` and
|
|
42
|
+
`.venv/bin/belazywithreact` instead.
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
belazywithreact create my-app
|
|
48
|
+
cd my-app
|
|
49
|
+
npm run dev
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Creation asks for confirmation. `--yes` skips that question and still refuses
|
|
53
|
+
to overwrite an existing destination, including an empty directory.
|
|
54
|
+
|
|
55
|
+
Defaults include CSS + Tailwind CSS 4, React Router, Axios, Zustand, ESLint,
|
|
56
|
+
Prettier, and Vitest. Tailwind uses its official Vite plugin and CSS import;
|
|
57
|
+
customize its theme in CSS. ESLint is explicitly configured for TypeScript and
|
|
58
|
+
React. `npm test` runs once, and `npm run test:watch` starts watch mode.
|
|
59
|
+
|
|
60
|
+
A minimal CSS app:
|
|
61
|
+
|
|
62
|
+
```powershell
|
|
63
|
+
belazywithreact create my-app --styling css --no-router --no-axios --no-zustand --no-eslint --no-prettier --no-vitest --yes
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Option | Default | Behavior |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `--styling css\|tailwind\|both` | `both` | Enables Tailwind in tailwind/both; custom starter CSS is always included |
|
|
69
|
+
| `--router` / `--no-router` | enabled | Home and fallback routes with BrowserRouter |
|
|
70
|
+
| `--axios` / `--no-axios` | enabled | Axios API client and public API base URL example |
|
|
71
|
+
| `--zustand` / `--no-zustand` | enabled | Example counter store |
|
|
72
|
+
| `--eslint` / `--no-eslint` | enabled | ESLint config, dependencies, and lint script |
|
|
73
|
+
| `--prettier` / `--no-prettier` | enabled | Format script and ignore file |
|
|
74
|
+
| `--vitest` / `--no-vitest` | enabled | Test scripts and example unit test |
|
|
75
|
+
| `--package-manager npm` | `npm` | Only npm is supported in 0.1.0 |
|
|
76
|
+
| `--yes`, `-y` | disabled | Skip confirmation |
|
|
77
|
+
|
|
78
|
+
Use `belazywithreact create --help` for all options.
|
|
79
|
+
|
|
80
|
+
## Generated structure
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
my-app/
|
|
84
|
+
src/
|
|
85
|
+
assets/
|
|
86
|
+
components/Button.tsx
|
|
87
|
+
hooks/
|
|
88
|
+
layouts/
|
|
89
|
+
pages/HomePage.tsx
|
|
90
|
+
services/api.ts # when Axios is enabled
|
|
91
|
+
store/useAppStore.ts # when Zustand is enabled
|
|
92
|
+
styles/index.css
|
|
93
|
+
styles/tailwind.css
|
|
94
|
+
types/
|
|
95
|
+
utils/example.test.ts # when Vitest is enabled
|
|
96
|
+
App.tsx
|
|
97
|
+
main.tsx
|
|
98
|
+
.env.example
|
|
99
|
+
eslint.config.js # when ESLint is enabled
|
|
100
|
+
vite.config.ts
|
|
101
|
+
package.json
|
|
102
|
+
package-lock.json
|
|
103
|
+
README.md
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The Button supports native button props and children. Customize the generated
|
|
107
|
+
components, folders, API client, and store after creation. Empty starter folders
|
|
108
|
+
contain .gitkeep files. The scaffold does not provide authentication, backend
|
|
109
|
+
services, deployment, or arbitrary folder/component generation flags.
|
|
110
|
+
|
|
111
|
+
Validate your generated app:
|
|
112
|
+
|
|
113
|
+
```powershell
|
|
114
|
+
npm ci
|
|
115
|
+
npm test
|
|
116
|
+
npm run lint
|
|
117
|
+
npm run build
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Test and lint commands require their respective enabled options.
|
|
121
|
+
BrowserRouter deployments need a server fallback to index.html for route URLs.
|
|
122
|
+
All `VITE_` environment variables are public browser values, never secrets.
|
|
123
|
+
|
|
124
|
+
## Troubleshooting
|
|
125
|
+
|
|
126
|
+
- **Missing Node/npm or WinError 2:** install Node.js 24 LTS and reopen the
|
|
127
|
+
terminal so PATH updates. On Windows, check `where.exe node` and
|
|
128
|
+
`where.exe npm`; `npm.cmd --version` should work. The CLI preserves its
|
|
129
|
+
tested `call "<resolved npm.cmd>"` launch method for paths containing spaces.
|
|
130
|
+
- **Unsupported Node version:** upgrade to an even-numbered release >=22.13.
|
|
131
|
+
The generated tooling needs a newer Node version than some older Vite releases.
|
|
132
|
+
- **Invalid name:** use a directory name starting with a letter or number and
|
|
133
|
+
containing only letters, numbers, dots, underscores, or hyphens. Names cannot
|
|
134
|
+
end in a dot, exceed 214 characters, use Windows device names like CON/LPT1,
|
|
135
|
+
or use npm-reserved names. Path separators and shell operators are rejected.
|
|
136
|
+
Vite normalizes uppercase directory names to valid npm package names.
|
|
137
|
+
- **Destination exists:** choose another name; existing files are preserved.
|
|
138
|
+
- **npm failure or interruption:** read npm's output and check network/PATH.
|
|
139
|
+
Partial projects are preserved. Inspect them before manually removing or
|
|
140
|
+
repairing them; a retry with the same name will refuse to overwrite them.
|
|
141
|
+
- **Dependency advisory:** run `npm audit` and review compatible upgrades;
|
|
142
|
+
do not blindly force a major upgrade.
|
|
143
|
+
|
|
144
|
+
## Architecture and development
|
|
145
|
+
|
|
146
|
+
`cli.py` parses options with Typer and prints progress/errors with Rich.
|
|
147
|
+
`validators.py` validates names, destination boundaries, and Node prerequisites.
|
|
148
|
+
`scaffold.py` invokes create-vite **9.2.1**, writes the starter files, installs
|
|
149
|
+
selected tools, updates package.json, and synchronizes package-lock.json. npm
|
|
150
|
+
output remains visible, and failures return nonzero status. Interruption during
|
|
151
|
+
creation returns 130. The CLI never deletes a partial project automatically.
|
|
152
|
+
|
|
153
|
+
The Vite creator and optional-tool install requests specify reviewed versions;
|
|
154
|
+
Vite's base template and npm semver ranges can still resolve newer compatible
|
|
155
|
+
dependencies. Commit the generated lockfile and use `npm ci` for reproducible
|
|
156
|
+
app installations. Revalidate dependencies before a future CLI release.
|
|
157
|
+
|
|
158
|
+
```powershell
|
|
159
|
+
python -m pytest
|
|
160
|
+
python -m build
|
|
161
|
+
python -m twine check --strict dist/*
|
|
162
|
+
python scripts/check_dist.py
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Unit tests mock npm and run offline. CI checks Python 3.10, 3.12, and 3.14 on
|
|
166
|
+
Windows, macOS, and Linux, validates distributions, and builds real default and
|
|
167
|
+
minimal React apps. See [CONTRIBUTING.md](CONTRIBUTING.md) for contributions,
|
|
168
|
+
[SECURITY.md](SECURITY.md) for security reporting, and
|
|
169
|
+
[RELEASING.md](RELEASING.md) for TestPyPI-first Trusted Publishing and explicit
|
|
170
|
+
production-release approval. GitHub and both package-index accounts must be
|
|
171
|
+
configured separately before publication.
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
[MIT](LICENSE).
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Releasing belazywithreact
|
|
2
|
+
|
|
3
|
+
The first release candidate is **0.1.0**, retaining the existing version.
|
|
4
|
+
No tag or PyPI publication is implied by these instructions. On 2026-10-13,
|
|
5
|
+
the PyPI and TestPyPI JSON endpoints returned 404 for this name. That does not
|
|
6
|
+
guarantee name availability: pending publishers do not reserve names.
|
|
7
|
+
Check again immediately before publishing. Do not replace a project owned by
|
|
8
|
+
someone else or attempt to reuse an already uploaded version/file.
|
|
9
|
+
|
|
10
|
+
On 2026-10-14, production PyPI's pending publisher was registered with explicit
|
|
11
|
+
approval for configuration only. TestPyPI's publisher was registered and its
|
|
12
|
+
workflow successfully published 0.1.0 from commit 590bfb9; clean-environment
|
|
13
|
+
installation, package origin, dependency checks, and CLI execution were verified.
|
|
14
|
+
Production publication still requires separate explicit approval. The final
|
|
15
|
+
release documentation was updated afterward; the tested CLI source is preserved.
|
|
16
|
+
|
|
17
|
+
## GitHub setup
|
|
18
|
+
|
|
19
|
+
The public repository is [Sanju2911/belazywithreact](https://github.com/Sanju2911/belazywithreact),
|
|
20
|
+
created and verified on 2026-10-14.
|
|
21
|
+
Do not initialize a second README, license, or .gitignore remotely. Verify
|
|
22
|
+
`git remote -v` before setting origin and pushing `main`; never force-push.
|
|
23
|
+
Update project URLs in pyproject.toml only after verifying the repository exists.
|
|
24
|
+
Wait for the **CI** workflow to pass, including all three operating systems.
|
|
25
|
+
|
|
26
|
+
The GitHub environments **testpypi** and **pypi** were created on 2026-10-14.
|
|
27
|
+
The **pypi** environment requires review by **Sanju2911**, disallows administrator
|
|
28
|
+
bypass, and permits only tags matching `v*`. Self-review remains allowed so the
|
|
29
|
+
sole maintainer can approve a release. Verify these protections under Settings >
|
|
30
|
+
Environments before each production release. Environment names in PyPI
|
|
31
|
+
configuration must match the workflow exactly.
|
|
32
|
+
|
|
33
|
+
The workflow file alone does not create these protections. If they are removed,
|
|
34
|
+
publishing a non-prerelease GitHub Release could start the production upload.
|
|
35
|
+
Do not publish a GitHub Release until the final artifacts have been reviewed and
|
|
36
|
+
the owner has explicitly approved production publication.
|
|
37
|
+
|
|
38
|
+
## Account and Trusted Publisher setup
|
|
39
|
+
|
|
40
|
+
Create/access your accounts directly at [PyPI](https://pypi.org/account/register/)
|
|
41
|
+
and [TestPyPI](https://test.pypi.org/account/register/). They are separate services.
|
|
42
|
+
Verify email and complete their required account security setup. Never paste
|
|
43
|
+
passwords, tokens, or recovery codes into chat or repository files.
|
|
44
|
+
|
|
45
|
+
For a new package, use the account's **Publishing** page to add a pending
|
|
46
|
+
GitHub publisher. For an existing package you own, use its **Publishing** settings.
|
|
47
|
+
Set these fields separately for each service:
|
|
48
|
+
|
|
49
|
+
| Field | Production PyPI | TestPyPI |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| PyPI project name | `belazywithreact` | `belazywithreact` |
|
|
52
|
+
| GitHub owner | `Sanju2911` | `Sanju2911` |
|
|
53
|
+
| GitHub repository | `belazywithreact` | `belazywithreact` |
|
|
54
|
+
| Workflow filename | `publish.yml` | `testpypi.yml` |
|
|
55
|
+
| GitHub environment | `pypi` | `testpypi` |
|
|
56
|
+
|
|
57
|
+
The workflow filename is the basename, not `.github/workflows/publish.yml`.
|
|
58
|
+
OIDC uses `id-token: write` only in the upload job. Build jobs have read-only
|
|
59
|
+
repository access. No API-token secrets are needed. Actions are pinned to
|
|
60
|
+
verified commit SHAs; review and update those pins periodically.
|
|
61
|
+
|
|
62
|
+
## Local validation
|
|
63
|
+
|
|
64
|
+
Use Python 3.12 for release scripts, in a development virtual environment:
|
|
65
|
+
|
|
66
|
+
```powershell
|
|
67
|
+
python -m pip install --upgrade build twine
|
|
68
|
+
python -m pip install -e ".[dev]"
|
|
69
|
+
python -m pytest
|
|
70
|
+
python scripts/check_version.py
|
|
71
|
+
python -m build
|
|
72
|
+
python -m twine check --strict dist/*
|
|
73
|
+
python scripts/check_dist.py
|
|
74
|
+
Get-FileHash dist/* -Algorithm SHA256
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Keep dist limited to the current wheel and sdist. Move old artifacts aside before
|
|
78
|
+
building another version. The upload-set checker rejects extra files.
|
|
79
|
+
Check that wheel metadata, README, license and verified project URLs are correct.
|
|
80
|
+
Test the wheel in a new venv, then run `belazywithreact --help` and scaffold an app.
|
|
81
|
+
For the generated default app run `npm ci`, `npm test`, `npm run lint`, and
|
|
82
|
+
`npm run build`. Also build with all optional features disabled.
|
|
83
|
+
|
|
84
|
+
## TestPyPI first
|
|
85
|
+
|
|
86
|
+
After configuring its publisher and environment and authorizing a test upload,
|
|
87
|
+
run GitHub Actions > **Publish to TestPyPI** > **Run workflow**, selecting the
|
|
88
|
+
reviewed branch/ref. This manual workflow never publishes to production.
|
|
89
|
+
Check the upload job result and inspect the actual TestPyPI package page.
|
|
90
|
+
|
|
91
|
+
Use a clean environment to verify that the artifact comes from TestPyPI:
|
|
92
|
+
|
|
93
|
+
```powershell
|
|
94
|
+
py -m venv .testpypi-venv
|
|
95
|
+
.\.testpypi-venv\Scripts\python.exe -m pip install --index-url https://test.pypi.org/simple/ --no-deps belazywithreact==0.1.0
|
|
96
|
+
.\.testpypi-venv\Scripts\python.exe -m pip install --index-url https://pypi.org/simple/ "typer>=0.12,<1" "rich>=13.7,<15"
|
|
97
|
+
.\.testpypi-venv\Scripts\python.exe -m pip check
|
|
98
|
+
.\.testpypi-venv\Scripts\belazywithreact.exe --help
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Then scaffold and validate an app. Installing the package without dependencies
|
|
102
|
+
first ensures its origin; dependencies are obtained separately from normal PyPI.
|
|
103
|
+
The conventional alternative is `--index-url https://test.pypi.org/simple/
|
|
104
|
+
--extra-index-url https://pypi.org/simple/`, but pip combines indexes without
|
|
105
|
+
prioritizing the primary one. Confirm the downloaded artifact's source if using it.
|
|
106
|
+
|
|
107
|
+
## First production release
|
|
108
|
+
|
|
109
|
+
Show the owner: version **0.1.0**, the two filenames
|
|
110
|
+
`belazywithreact-0.1.0-py3-none-any.whl` and `belazywithreact-0.1.0.tar.gz`,
|
|
111
|
+
their SHA256 hashes, local validation, successful CI, and TestPyPI verification.
|
|
112
|
+
Obtain explicit approval for the exact action: create tag `v0.1.0` at the reviewed
|
|
113
|
+
commit and publish a non-prerelease GitHub Release for that tag, triggering
|
|
114
|
+
`publish.yml`; then approve the protected **pypi** environment upload job.
|
|
115
|
+
Do not perform this action merely because the repository is ready.
|
|
116
|
+
|
|
117
|
+
The production workflow tests, verifies tag/version consistency, builds, checks,
|
|
118
|
+
and transfers only those two distributions to a separate publishing job.
|
|
119
|
+
Prereleases are ignored. After upload, verify the actual PyPI project page and
|
|
120
|
+
install `belazywithreact==0.1.0` from normal PyPI in a clean environment. An
|
|
121
|
+
existing workflow or green build is not evidence of successful publication.
|
|
122
|
+
|
|
123
|
+
## Future versions
|
|
124
|
+
|
|
125
|
+
Update `project.version` in pyproject.toml and `__version__` in
|
|
126
|
+
src/belazywithreact/__init__.py together. Document the changes, repeat validation,
|
|
127
|
+
commit and push, wait for CI, publish to TestPyPI, and obtain production approval.
|
|
128
|
+
Create a matching `v<version>` release tag only after approval. Never overwrite
|
|
129
|
+
or re-upload an existing release's files; fixes require a new version.
|
|
130
|
+
|
|
131
|
+
Official references:
|
|
132
|
+
|
|
133
|
+
- [PyPI pending publishers](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/)
|
|
134
|
+
- [PyPI OIDC publishing and TestPyPI endpoint](https://docs.pypi.org/trusted-publishers/using-a-publisher/)
|
|
135
|
+
- [Python Packaging workflow guide](https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/)
|
|
136
|
+
- [GitHub environment protection](https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments)
|
|
137
|
+
- [Official PyPA publishing action](https://github.com/pypa/gh-action-pypi-publish)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
This initial release does not promise long-term support. Security fixes should
|
|
4
|
+
be applied by upgrading to a maintained release when one is available.
|
|
5
|
+
|
|
6
|
+
Do not include credentials, tokens, `.env` values, or personal data in public
|
|
7
|
+
issues. Private vulnerability reporting is enabled: use GitHub's
|
|
8
|
+
**Report a vulnerability** feature under the repository's Security tab.
|
|
9
|
+
If that feature becomes unavailable, request a private contact channel without
|
|
10
|
+
disclosing exploit details in public.
|
|
11
|
+
|
|
12
|
+
The CLI downloads and runs create-vite and npm packages from the npm registry.
|
|
13
|
+
Review generated package.json and package-lock.json before deployment, and run
|
|
14
|
+
`npm audit` to check the generated project's dependencies. The CLI does not
|
|
15
|
+
disable npm security checks. All `VITE_` environment variables are exposed to
|
|
16
|
+
the browser; never place secrets in them.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27,<2"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "belazywithreact"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A Python CLI that scaffolds ready-to-use React projects."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
keywords = ["react", "vite", "typescript", "scaffold", "cli"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
]
|
|
26
|
+
dependencies = ["typer>=0.12,<1.0", "rich>=13.7,<15.0"]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/Sanju2911/belazywithreact"
|
|
30
|
+
Repository = "https://github.com/Sanju2911/belazywithreact"
|
|
31
|
+
Issues = "https://github.com/Sanju2911/belazywithreact/issues"
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = ["pytest>=8.0", "pytest-cov>=5.0", "build>=1.2", "twine>=6.0"]
|
|
35
|
+
|
|
36
|
+
[project.scripts]
|
|
37
|
+
belazywithreact = "belazywithreact.cli:app"
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.wheel]
|
|
40
|
+
packages = ["src/belazywithreact"]
|
|
41
|
+
|
|
42
|
+
[tool.hatch.build.targets.sdist]
|
|
43
|
+
include = ["/src", "/tests", "/scripts", "/pyproject.toml", "/README.md", "/LICENSE", "/CONTRIBUTING.md", "/RELEASING.md", "/SECURITY.md"]
|
|
44
|
+
|
|
45
|
+
[tool.pytest.ini_options]
|
|
46
|
+
testpaths = ["tests"]
|