devscript 0.1.0__tar.gz → 0.1.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.
- {devscript-0.1.0 → devscript-0.1.1}/PKG-INFO +265 -4
- {devscript-0.1.0 → devscript-0.1.1}/README.md +264 -3
- {devscript-0.1.0 → devscript-0.1.1}/devscript.egg-info/PKG-INFO +265 -4
- {devscript-0.1.0 → devscript-0.1.1}/pyproject.toml +53 -52
- {devscript-0.1.0 → devscript-0.1.1}/LICENSE +0 -0
- {devscript-0.1.0 → devscript-0.1.1}/devscript/__init__.py +0 -0
- {devscript-0.1.0 → devscript-0.1.1}/devscript.egg-info/SOURCES.txt +0 -0
- {devscript-0.1.0 → devscript-0.1.1}/devscript.egg-info/dependency_links.txt +0 -0
- {devscript-0.1.0 → devscript-0.1.1}/devscript.egg-info/entry_points.txt +0 -0
- {devscript-0.1.0 → devscript-0.1.1}/devscript.egg-info/requires.txt +0 -0
- {devscript-0.1.0 → devscript-0.1.1}/devscript.egg-info/top_level.txt +0 -0
- {devscript-0.1.0 → devscript-0.1.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devscript
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A utility for managing custom development scripts via JSON or TOML configuration
|
|
5
5
|
Author-email: "Маг Ильяс DOMA (MagIlyasDOMA)" <magilyas.doma.09@list.ru>
|
|
6
6
|
License: GPL-3.0-only
|
|
@@ -24,7 +24,268 @@ License-File: LICENSE
|
|
|
24
24
|
Requires-Dist: pyyaml>=6.0.3
|
|
25
25
|
Dynamic: license-file
|
|
26
26
|
|
|
27
|
+
<a id="doc_en"></a>
|
|
27
28
|
# DevScript
|
|
29
|
+
#### [Документация на русском](#doc_ru)
|
|
30
|
+
|
|
31
|
+
DevScript is a simple utility for managing custom development scripts. It allows you to define commands in JSON or TOML files and execute them through a single interface. It is available in two implementations: **Python** and **TypeScript**.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
### Python version
|
|
36
|
+
```shell
|
|
37
|
+
pip install devscript
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Or install from source:
|
|
41
|
+
|
|
42
|
+
```shell
|
|
43
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
44
|
+
cd devscript
|
|
45
|
+
pip install -e .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### TypeScript version
|
|
49
|
+
```shell
|
|
50
|
+
npm install -D @hren/devscript
|
|
51
|
+
# or
|
|
52
|
+
yarn add -D @hren/devscript
|
|
53
|
+
# or
|
|
54
|
+
pnpm add -D @hren/devscript
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Or install from source:
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
61
|
+
cd devscript
|
|
62
|
+
npm install
|
|
63
|
+
npm run build
|
|
64
|
+
npm link
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Configuration formats
|
|
68
|
+
#### JSON (`devscript.json`)
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json",
|
|
72
|
+
"build": "python -m build",
|
|
73
|
+
"test": "pytest tests/",
|
|
74
|
+
"lint": "flake8 src/",
|
|
75
|
+
"dev": "python -m app --debug"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### YAML (`devscript.yaml`)
|
|
80
|
+
```yaml
|
|
81
|
+
build: "python -m build"
|
|
82
|
+
test: "pytest tests/"
|
|
83
|
+
lint: "flake8 src/"
|
|
84
|
+
dev: "python -m app --debug"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### TOML (`pyproject.toml`)
|
|
88
|
+
```toml
|
|
89
|
+
[devscript]
|
|
90
|
+
build = "python -m build"
|
|
91
|
+
test = "pytest tests/"
|
|
92
|
+
lint = "flake8 src/"
|
|
93
|
+
dev = "python -m app --debug"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### `package.json`
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"devscript": {
|
|
100
|
+
"build": "python -m build",
|
|
101
|
+
"test": "pytest tests/",
|
|
102
|
+
"lint": "flake8 src/",
|
|
103
|
+
"dev": "python -m app --debug"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Running commands
|
|
109
|
+
#### The package provides four CLI commands:
|
|
110
|
+
- `devscript` — full name
|
|
111
|
+
- `devscr` — abbreviation
|
|
112
|
+
- `devs` — short
|
|
113
|
+
- `dvs` — shortest
|
|
114
|
+
|
|
115
|
+
#### All of them work the same:
|
|
116
|
+
```shell
|
|
117
|
+
# Show the list of available commands
|
|
118
|
+
devscript --help
|
|
119
|
+
|
|
120
|
+
# Run a command
|
|
121
|
+
devscript build
|
|
122
|
+
devscr dev
|
|
123
|
+
devs test
|
|
124
|
+
dvs lint
|
|
125
|
+
|
|
126
|
+
# Pass arguments to a command
|
|
127
|
+
devscript dev --port 8000 --reload
|
|
128
|
+
```
|
|
129
|
+
Here is the translation of the text into English, with the markdown formatting preserved:
|
|
130
|
+
|
|
131
|
+
## Examples
|
|
132
|
+
### Example 1: Basic usage
|
|
133
|
+
```toml
|
|
134
|
+
# pyproject.toml
|
|
135
|
+
[devscript]
|
|
136
|
+
start = "uvicorn main:app --reload"
|
|
137
|
+
migrate = "alembic upgrade head"
|
|
138
|
+
shell = "ipython"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
```shell
|
|
142
|
+
devs start # Starts the uvicorn server
|
|
143
|
+
devs migrate # Applies migrations
|
|
144
|
+
devs shell # Starts IPython
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Example 2: Passing arguments
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"test": "pytest",
|
|
151
|
+
"cov": "pytest --cov=src"
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```shell
|
|
156
|
+
devs test tests/test_api.py -v # pytest tests/test_api.py -v
|
|
157
|
+
devs cov --cov-report=html # pytest --cov=src --cov-report=html
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Development
|
|
161
|
+
### Python version
|
|
162
|
+
```shell
|
|
163
|
+
# Clone the repository
|
|
164
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
165
|
+
cd devscript
|
|
166
|
+
|
|
167
|
+
# Install in development mode
|
|
168
|
+
pip install -e .
|
|
169
|
+
|
|
170
|
+
# Run tests
|
|
171
|
+
devs test
|
|
172
|
+
|
|
173
|
+
# Run linter
|
|
174
|
+
devs lint
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### TypeScript version
|
|
178
|
+
```shell
|
|
179
|
+
# Clone the repository
|
|
180
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
181
|
+
cd devscript
|
|
182
|
+
|
|
183
|
+
# Install dependencies
|
|
184
|
+
npm install
|
|
185
|
+
|
|
186
|
+
# Build the project
|
|
187
|
+
npm run build
|
|
188
|
+
|
|
189
|
+
# Install in development mode
|
|
190
|
+
npm link
|
|
191
|
+
|
|
192
|
+
# Run tests
|
|
193
|
+
devs test
|
|
194
|
+
|
|
195
|
+
# Run linter
|
|
196
|
+
devs lint
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Project structure
|
|
200
|
+
```text
|
|
201
|
+
devscript/
|
|
202
|
+
├── python/ # Python implementation
|
|
203
|
+
│ ├── devscript/
|
|
204
|
+
│ │ ├── __init__.py
|
|
205
|
+
│ │ └── py.typed
|
|
206
|
+
│ ├── pyproject.toml
|
|
207
|
+
│ └── README.md
|
|
208
|
+
├── typescript/ # TypeScript implementation
|
|
209
|
+
│ ├── devscript.ts
|
|
210
|
+
│ ├── package.json
|
|
211
|
+
│ ├── tsconfig.json
|
|
212
|
+
│ └── README.md
|
|
213
|
+
├── schema.json # JSON Schema for autocompletion
|
|
214
|
+
└── LICENSE
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## JSON Schema
|
|
218
|
+
For autocompletion and validation in code editors, use the schema:
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json"
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## API
|
|
226
|
+
### Using in code
|
|
227
|
+
#### Python
|
|
228
|
+
```python
|
|
229
|
+
from devscript import DevScriptCore
|
|
230
|
+
|
|
231
|
+
core = DevScriptCore()
|
|
232
|
+
print("Available commands:", core.commands_list())
|
|
233
|
+
core.run("build", ["--verbose"])
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### Typescript
|
|
237
|
+
```typescript
|
|
238
|
+
import { DevScriptCore } from 'devscript';
|
|
239
|
+
```
|
|
240
|
+
```javascript
|
|
241
|
+
const core = new DevScriptCore();
|
|
242
|
+
console.log("Available commands:", core.commands_list());
|
|
243
|
+
core.run("build", ["--verbose"]);
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Requirements
|
|
247
|
+
### Python version
|
|
248
|
+
- Python 3.8 or higher
|
|
249
|
+
- No external dependencies (uses the standard library)
|
|
250
|
+
|
|
251
|
+
### TypeScript version
|
|
252
|
+
- Node.js 14 or higher
|
|
253
|
+
- Dependencies: argparse, smol-toml
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
GPL-3.0-only
|
|
257
|
+
|
|
258
|
+
## Author
|
|
259
|
+
#### Mag Ilyas DOMA (MagIlyasDOMA)
|
|
260
|
+
- GitHub: [@MagIlyasDOMA](https://github.com/MagIlyasDOMA)
|
|
261
|
+
- Project: [devscript](https://github.com/MagIlyasDOMA/devscript)
|
|
262
|
+
|
|
263
|
+
## Contribution
|
|
264
|
+
1. Fork the repository
|
|
265
|
+
2. Create a branch for the feature (`git checkout -b feature/amazing-feature`)
|
|
266
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
267
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
268
|
+
5. Open a Pull Request
|
|
269
|
+
|
|
270
|
+
## Frequently Asked Questions
|
|
271
|
+
##### Q: Can I use both versions at the same time?
|
|
272
|
+
A: Yes, they do not conflict as they use different commands for installation (pip vs npm).
|
|
273
|
+
|
|
274
|
+
##### Q: Are other configuration formats supported?
|
|
275
|
+
A: Currently, JSON, YAML, pyproject.toml, and package.json are supported.
|
|
276
|
+
|
|
277
|
+
##### Q: How do I add a new command?
|
|
278
|
+
A: Just add a new entry in the configuration file with the command name and the corresponding shell command.
|
|
279
|
+
|
|
280
|
+
##### Q: Does it work on Windows?
|
|
281
|
+
A: Yes, both versions have been tested on Windows.
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
<a id="doc_ru"></a>
|
|
287
|
+
# DevScript
|
|
288
|
+
#### [Documentation in English](#doc_en)
|
|
28
289
|
|
|
29
290
|
DevScript — это простая утилита для управления пользовательскими скриптами разработки. Она позволяет определять команды в JSON или TOML файлах и запускать их через единый интерфейс. Доступна в двух реализациях: **Python** и **TypeScript**.
|
|
30
291
|
|
|
@@ -45,11 +306,11 @@ pip install -e .
|
|
|
45
306
|
|
|
46
307
|
### TypeScript версия
|
|
47
308
|
```shell
|
|
48
|
-
npm install -D devscript
|
|
309
|
+
npm install -D @hren/devscript
|
|
49
310
|
# или
|
|
50
|
-
yarn add -D devscript
|
|
311
|
+
yarn add -D @hren/devscript
|
|
51
312
|
# или
|
|
52
|
-
pnpm add -D devscript
|
|
313
|
+
pnpm add -D @hren/devscript
|
|
53
314
|
```
|
|
54
315
|
|
|
55
316
|
#### Или установка из исходного кода:
|
|
@@ -1,4 +1,265 @@
|
|
|
1
|
+
<a id="doc_en"></a>
|
|
1
2
|
# DevScript
|
|
3
|
+
#### [Документация на русском](#doc_ru)
|
|
4
|
+
|
|
5
|
+
DevScript is a simple utility for managing custom development scripts. It allows you to define commands in JSON or TOML files and execute them through a single interface. It is available in two implementations: **Python** and **TypeScript**.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### Python version
|
|
10
|
+
```shell
|
|
11
|
+
pip install devscript
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
#### Or install from source:
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
18
|
+
cd devscript
|
|
19
|
+
pip install -e .
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### TypeScript version
|
|
23
|
+
```shell
|
|
24
|
+
npm install -D @hren/devscript
|
|
25
|
+
# or
|
|
26
|
+
yarn add -D @hren/devscript
|
|
27
|
+
# or
|
|
28
|
+
pnpm add -D @hren/devscript
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Or install from source:
|
|
32
|
+
|
|
33
|
+
```shell
|
|
34
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
35
|
+
cd devscript
|
|
36
|
+
npm install
|
|
37
|
+
npm run build
|
|
38
|
+
npm link
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Configuration formats
|
|
42
|
+
#### JSON (`devscript.json`)
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json",
|
|
46
|
+
"build": "python -m build",
|
|
47
|
+
"test": "pytest tests/",
|
|
48
|
+
"lint": "flake8 src/",
|
|
49
|
+
"dev": "python -m app --debug"
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### YAML (`devscript.yaml`)
|
|
54
|
+
```yaml
|
|
55
|
+
build: "python -m build"
|
|
56
|
+
test: "pytest tests/"
|
|
57
|
+
lint: "flake8 src/"
|
|
58
|
+
dev: "python -m app --debug"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### TOML (`pyproject.toml`)
|
|
62
|
+
```toml
|
|
63
|
+
[devscript]
|
|
64
|
+
build = "python -m build"
|
|
65
|
+
test = "pytest tests/"
|
|
66
|
+
lint = "flake8 src/"
|
|
67
|
+
dev = "python -m app --debug"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### `package.json`
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"devscript": {
|
|
74
|
+
"build": "python -m build",
|
|
75
|
+
"test": "pytest tests/",
|
|
76
|
+
"lint": "flake8 src/",
|
|
77
|
+
"dev": "python -m app --debug"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Running commands
|
|
83
|
+
#### The package provides four CLI commands:
|
|
84
|
+
- `devscript` — full name
|
|
85
|
+
- `devscr` — abbreviation
|
|
86
|
+
- `devs` — short
|
|
87
|
+
- `dvs` — shortest
|
|
88
|
+
|
|
89
|
+
#### All of them work the same:
|
|
90
|
+
```shell
|
|
91
|
+
# Show the list of available commands
|
|
92
|
+
devscript --help
|
|
93
|
+
|
|
94
|
+
# Run a command
|
|
95
|
+
devscript build
|
|
96
|
+
devscr dev
|
|
97
|
+
devs test
|
|
98
|
+
dvs lint
|
|
99
|
+
|
|
100
|
+
# Pass arguments to a command
|
|
101
|
+
devscript dev --port 8000 --reload
|
|
102
|
+
```
|
|
103
|
+
Here is the translation of the text into English, with the markdown formatting preserved:
|
|
104
|
+
|
|
105
|
+
## Examples
|
|
106
|
+
### Example 1: Basic usage
|
|
107
|
+
```toml
|
|
108
|
+
# pyproject.toml
|
|
109
|
+
[devscript]
|
|
110
|
+
start = "uvicorn main:app --reload"
|
|
111
|
+
migrate = "alembic upgrade head"
|
|
112
|
+
shell = "ipython"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```shell
|
|
116
|
+
devs start # Starts the uvicorn server
|
|
117
|
+
devs migrate # Applies migrations
|
|
118
|
+
devs shell # Starts IPython
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Example 2: Passing arguments
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"test": "pytest",
|
|
125
|
+
"cov": "pytest --cov=src"
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```shell
|
|
130
|
+
devs test tests/test_api.py -v # pytest tests/test_api.py -v
|
|
131
|
+
devs cov --cov-report=html # pytest --cov=src --cov-report=html
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Development
|
|
135
|
+
### Python version
|
|
136
|
+
```shell
|
|
137
|
+
# Clone the repository
|
|
138
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
139
|
+
cd devscript
|
|
140
|
+
|
|
141
|
+
# Install in development mode
|
|
142
|
+
pip install -e .
|
|
143
|
+
|
|
144
|
+
# Run tests
|
|
145
|
+
devs test
|
|
146
|
+
|
|
147
|
+
# Run linter
|
|
148
|
+
devs lint
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### TypeScript version
|
|
152
|
+
```shell
|
|
153
|
+
# Clone the repository
|
|
154
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
155
|
+
cd devscript
|
|
156
|
+
|
|
157
|
+
# Install dependencies
|
|
158
|
+
npm install
|
|
159
|
+
|
|
160
|
+
# Build the project
|
|
161
|
+
npm run build
|
|
162
|
+
|
|
163
|
+
# Install in development mode
|
|
164
|
+
npm link
|
|
165
|
+
|
|
166
|
+
# Run tests
|
|
167
|
+
devs test
|
|
168
|
+
|
|
169
|
+
# Run linter
|
|
170
|
+
devs lint
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Project structure
|
|
174
|
+
```text
|
|
175
|
+
devscript/
|
|
176
|
+
├── python/ # Python implementation
|
|
177
|
+
│ ├── devscript/
|
|
178
|
+
│ │ ├── __init__.py
|
|
179
|
+
│ │ └── py.typed
|
|
180
|
+
│ ├── pyproject.toml
|
|
181
|
+
│ └── README.md
|
|
182
|
+
├── typescript/ # TypeScript implementation
|
|
183
|
+
│ ├── devscript.ts
|
|
184
|
+
│ ├── package.json
|
|
185
|
+
│ ├── tsconfig.json
|
|
186
|
+
│ └── README.md
|
|
187
|
+
├── schema.json # JSON Schema for autocompletion
|
|
188
|
+
└── LICENSE
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## JSON Schema
|
|
192
|
+
For autocompletion and validation in code editors, use the schema:
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json"
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## API
|
|
200
|
+
### Using in code
|
|
201
|
+
#### Python
|
|
202
|
+
```python
|
|
203
|
+
from devscript import DevScriptCore
|
|
204
|
+
|
|
205
|
+
core = DevScriptCore()
|
|
206
|
+
print("Available commands:", core.commands_list())
|
|
207
|
+
core.run("build", ["--verbose"])
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### Typescript
|
|
211
|
+
```typescript
|
|
212
|
+
import { DevScriptCore } from 'devscript';
|
|
213
|
+
```
|
|
214
|
+
```javascript
|
|
215
|
+
const core = new DevScriptCore();
|
|
216
|
+
console.log("Available commands:", core.commands_list());
|
|
217
|
+
core.run("build", ["--verbose"]);
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Requirements
|
|
221
|
+
### Python version
|
|
222
|
+
- Python 3.8 or higher
|
|
223
|
+
- No external dependencies (uses the standard library)
|
|
224
|
+
|
|
225
|
+
### TypeScript version
|
|
226
|
+
- Node.js 14 or higher
|
|
227
|
+
- Dependencies: argparse, smol-toml
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
GPL-3.0-only
|
|
231
|
+
|
|
232
|
+
## Author
|
|
233
|
+
#### Mag Ilyas DOMA (MagIlyasDOMA)
|
|
234
|
+
- GitHub: [@MagIlyasDOMA](https://github.com/MagIlyasDOMA)
|
|
235
|
+
- Project: [devscript](https://github.com/MagIlyasDOMA/devscript)
|
|
236
|
+
|
|
237
|
+
## Contribution
|
|
238
|
+
1. Fork the repository
|
|
239
|
+
2. Create a branch for the feature (`git checkout -b feature/amazing-feature`)
|
|
240
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
241
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
242
|
+
5. Open a Pull Request
|
|
243
|
+
|
|
244
|
+
## Frequently Asked Questions
|
|
245
|
+
##### Q: Can I use both versions at the same time?
|
|
246
|
+
A: Yes, they do not conflict as they use different commands for installation (pip vs npm).
|
|
247
|
+
|
|
248
|
+
##### Q: Are other configuration formats supported?
|
|
249
|
+
A: Currently, JSON, YAML, pyproject.toml, and package.json are supported.
|
|
250
|
+
|
|
251
|
+
##### Q: How do I add a new command?
|
|
252
|
+
A: Just add a new entry in the configuration file with the command name and the corresponding shell command.
|
|
253
|
+
|
|
254
|
+
##### Q: Does it work on Windows?
|
|
255
|
+
A: Yes, both versions have been tested on Windows.
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
<a id="doc_ru"></a>
|
|
261
|
+
# DevScript
|
|
262
|
+
#### [Documentation in English](#doc_en)
|
|
2
263
|
|
|
3
264
|
DevScript — это простая утилита для управления пользовательскими скриптами разработки. Она позволяет определять команды в JSON или TOML файлах и запускать их через единый интерфейс. Доступна в двух реализациях: **Python** и **TypeScript**.
|
|
4
265
|
|
|
@@ -19,11 +280,11 @@ pip install -e .
|
|
|
19
280
|
|
|
20
281
|
### TypeScript версия
|
|
21
282
|
```shell
|
|
22
|
-
npm install -D devscript
|
|
283
|
+
npm install -D @hren/devscript
|
|
23
284
|
# или
|
|
24
|
-
yarn add -D devscript
|
|
285
|
+
yarn add -D @hren/devscript
|
|
25
286
|
# или
|
|
26
|
-
pnpm add -D devscript
|
|
287
|
+
pnpm add -D @hren/devscript
|
|
27
288
|
```
|
|
28
289
|
|
|
29
290
|
#### Или установка из исходного кода:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devscript
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A utility for managing custom development scripts via JSON or TOML configuration
|
|
5
5
|
Author-email: "Маг Ильяс DOMA (MagIlyasDOMA)" <magilyas.doma.09@list.ru>
|
|
6
6
|
License: GPL-3.0-only
|
|
@@ -24,7 +24,268 @@ License-File: LICENSE
|
|
|
24
24
|
Requires-Dist: pyyaml>=6.0.3
|
|
25
25
|
Dynamic: license-file
|
|
26
26
|
|
|
27
|
+
<a id="doc_en"></a>
|
|
27
28
|
# DevScript
|
|
29
|
+
#### [Документация на русском](#doc_ru)
|
|
30
|
+
|
|
31
|
+
DevScript is a simple utility for managing custom development scripts. It allows you to define commands in JSON or TOML files and execute them through a single interface. It is available in two implementations: **Python** and **TypeScript**.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
### Python version
|
|
36
|
+
```shell
|
|
37
|
+
pip install devscript
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Or install from source:
|
|
41
|
+
|
|
42
|
+
```shell
|
|
43
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
44
|
+
cd devscript
|
|
45
|
+
pip install -e .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### TypeScript version
|
|
49
|
+
```shell
|
|
50
|
+
npm install -D @hren/devscript
|
|
51
|
+
# or
|
|
52
|
+
yarn add -D @hren/devscript
|
|
53
|
+
# or
|
|
54
|
+
pnpm add -D @hren/devscript
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Or install from source:
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
61
|
+
cd devscript
|
|
62
|
+
npm install
|
|
63
|
+
npm run build
|
|
64
|
+
npm link
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Configuration formats
|
|
68
|
+
#### JSON (`devscript.json`)
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json",
|
|
72
|
+
"build": "python -m build",
|
|
73
|
+
"test": "pytest tests/",
|
|
74
|
+
"lint": "flake8 src/",
|
|
75
|
+
"dev": "python -m app --debug"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### YAML (`devscript.yaml`)
|
|
80
|
+
```yaml
|
|
81
|
+
build: "python -m build"
|
|
82
|
+
test: "pytest tests/"
|
|
83
|
+
lint: "flake8 src/"
|
|
84
|
+
dev: "python -m app --debug"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### TOML (`pyproject.toml`)
|
|
88
|
+
```toml
|
|
89
|
+
[devscript]
|
|
90
|
+
build = "python -m build"
|
|
91
|
+
test = "pytest tests/"
|
|
92
|
+
lint = "flake8 src/"
|
|
93
|
+
dev = "python -m app --debug"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### `package.json`
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"devscript": {
|
|
100
|
+
"build": "python -m build",
|
|
101
|
+
"test": "pytest tests/",
|
|
102
|
+
"lint": "flake8 src/",
|
|
103
|
+
"dev": "python -m app --debug"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Running commands
|
|
109
|
+
#### The package provides four CLI commands:
|
|
110
|
+
- `devscript` — full name
|
|
111
|
+
- `devscr` — abbreviation
|
|
112
|
+
- `devs` — short
|
|
113
|
+
- `dvs` — shortest
|
|
114
|
+
|
|
115
|
+
#### All of them work the same:
|
|
116
|
+
```shell
|
|
117
|
+
# Show the list of available commands
|
|
118
|
+
devscript --help
|
|
119
|
+
|
|
120
|
+
# Run a command
|
|
121
|
+
devscript build
|
|
122
|
+
devscr dev
|
|
123
|
+
devs test
|
|
124
|
+
dvs lint
|
|
125
|
+
|
|
126
|
+
# Pass arguments to a command
|
|
127
|
+
devscript dev --port 8000 --reload
|
|
128
|
+
```
|
|
129
|
+
Here is the translation of the text into English, with the markdown formatting preserved:
|
|
130
|
+
|
|
131
|
+
## Examples
|
|
132
|
+
### Example 1: Basic usage
|
|
133
|
+
```toml
|
|
134
|
+
# pyproject.toml
|
|
135
|
+
[devscript]
|
|
136
|
+
start = "uvicorn main:app --reload"
|
|
137
|
+
migrate = "alembic upgrade head"
|
|
138
|
+
shell = "ipython"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
```shell
|
|
142
|
+
devs start # Starts the uvicorn server
|
|
143
|
+
devs migrate # Applies migrations
|
|
144
|
+
devs shell # Starts IPython
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Example 2: Passing arguments
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"test": "pytest",
|
|
151
|
+
"cov": "pytest --cov=src"
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```shell
|
|
156
|
+
devs test tests/test_api.py -v # pytest tests/test_api.py -v
|
|
157
|
+
devs cov --cov-report=html # pytest --cov=src --cov-report=html
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Development
|
|
161
|
+
### Python version
|
|
162
|
+
```shell
|
|
163
|
+
# Clone the repository
|
|
164
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
165
|
+
cd devscript
|
|
166
|
+
|
|
167
|
+
# Install in development mode
|
|
168
|
+
pip install -e .
|
|
169
|
+
|
|
170
|
+
# Run tests
|
|
171
|
+
devs test
|
|
172
|
+
|
|
173
|
+
# Run linter
|
|
174
|
+
devs lint
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### TypeScript version
|
|
178
|
+
```shell
|
|
179
|
+
# Clone the repository
|
|
180
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
181
|
+
cd devscript
|
|
182
|
+
|
|
183
|
+
# Install dependencies
|
|
184
|
+
npm install
|
|
185
|
+
|
|
186
|
+
# Build the project
|
|
187
|
+
npm run build
|
|
188
|
+
|
|
189
|
+
# Install in development mode
|
|
190
|
+
npm link
|
|
191
|
+
|
|
192
|
+
# Run tests
|
|
193
|
+
devs test
|
|
194
|
+
|
|
195
|
+
# Run linter
|
|
196
|
+
devs lint
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Project structure
|
|
200
|
+
```text
|
|
201
|
+
devscript/
|
|
202
|
+
├── python/ # Python implementation
|
|
203
|
+
│ ├── devscript/
|
|
204
|
+
│ │ ├── __init__.py
|
|
205
|
+
│ │ └── py.typed
|
|
206
|
+
│ ├── pyproject.toml
|
|
207
|
+
│ └── README.md
|
|
208
|
+
├── typescript/ # TypeScript implementation
|
|
209
|
+
│ ├── devscript.ts
|
|
210
|
+
│ ├── package.json
|
|
211
|
+
│ ├── tsconfig.json
|
|
212
|
+
│ └── README.md
|
|
213
|
+
├── schema.json # JSON Schema for autocompletion
|
|
214
|
+
└── LICENSE
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## JSON Schema
|
|
218
|
+
For autocompletion and validation in code editors, use the schema:
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json"
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## API
|
|
226
|
+
### Using in code
|
|
227
|
+
#### Python
|
|
228
|
+
```python
|
|
229
|
+
from devscript import DevScriptCore
|
|
230
|
+
|
|
231
|
+
core = DevScriptCore()
|
|
232
|
+
print("Available commands:", core.commands_list())
|
|
233
|
+
core.run("build", ["--verbose"])
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### Typescript
|
|
237
|
+
```typescript
|
|
238
|
+
import { DevScriptCore } from 'devscript';
|
|
239
|
+
```
|
|
240
|
+
```javascript
|
|
241
|
+
const core = new DevScriptCore();
|
|
242
|
+
console.log("Available commands:", core.commands_list());
|
|
243
|
+
core.run("build", ["--verbose"]);
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Requirements
|
|
247
|
+
### Python version
|
|
248
|
+
- Python 3.8 or higher
|
|
249
|
+
- No external dependencies (uses the standard library)
|
|
250
|
+
|
|
251
|
+
### TypeScript version
|
|
252
|
+
- Node.js 14 or higher
|
|
253
|
+
- Dependencies: argparse, smol-toml
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
GPL-3.0-only
|
|
257
|
+
|
|
258
|
+
## Author
|
|
259
|
+
#### Mag Ilyas DOMA (MagIlyasDOMA)
|
|
260
|
+
- GitHub: [@MagIlyasDOMA](https://github.com/MagIlyasDOMA)
|
|
261
|
+
- Project: [devscript](https://github.com/MagIlyasDOMA/devscript)
|
|
262
|
+
|
|
263
|
+
## Contribution
|
|
264
|
+
1. Fork the repository
|
|
265
|
+
2. Create a branch for the feature (`git checkout -b feature/amazing-feature`)
|
|
266
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
267
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
268
|
+
5. Open a Pull Request
|
|
269
|
+
|
|
270
|
+
## Frequently Asked Questions
|
|
271
|
+
##### Q: Can I use both versions at the same time?
|
|
272
|
+
A: Yes, they do not conflict as they use different commands for installation (pip vs npm).
|
|
273
|
+
|
|
274
|
+
##### Q: Are other configuration formats supported?
|
|
275
|
+
A: Currently, JSON, YAML, pyproject.toml, and package.json are supported.
|
|
276
|
+
|
|
277
|
+
##### Q: How do I add a new command?
|
|
278
|
+
A: Just add a new entry in the configuration file with the command name and the corresponding shell command.
|
|
279
|
+
|
|
280
|
+
##### Q: Does it work on Windows?
|
|
281
|
+
A: Yes, both versions have been tested on Windows.
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
<a id="doc_ru"></a>
|
|
287
|
+
# DevScript
|
|
288
|
+
#### [Documentation in English](#doc_en)
|
|
28
289
|
|
|
29
290
|
DevScript — это простая утилита для управления пользовательскими скриптами разработки. Она позволяет определять команды в JSON или TOML файлах и запускать их через единый интерфейс. Доступна в двух реализациях: **Python** и **TypeScript**.
|
|
30
291
|
|
|
@@ -45,11 +306,11 @@ pip install -e .
|
|
|
45
306
|
|
|
46
307
|
### TypeScript версия
|
|
47
308
|
```shell
|
|
48
|
-
npm install -D devscript
|
|
309
|
+
npm install -D @hren/devscript
|
|
49
310
|
# или
|
|
50
|
-
yarn add -D devscript
|
|
311
|
+
yarn add -D @hren/devscript
|
|
51
312
|
# или
|
|
52
|
-
pnpm add -D devscript
|
|
313
|
+
pnpm add -D @hren/devscript
|
|
53
314
|
```
|
|
54
315
|
|
|
55
316
|
#### Или установка из исходного кода:
|
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=70.0.0", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "devscript"
|
|
7
|
-
version = "0.1.
|
|
8
|
-
description = "A utility for managing custom development scripts via JSON or TOML configuration"
|
|
9
|
-
requires-python = ">=3.8"
|
|
10
|
-
license = {text = "GPL-3.0-only"}
|
|
11
|
-
|
|
12
|
-
readme = "README.md"
|
|
13
|
-
authors = [
|
|
14
|
-
{name = "Маг Ильяс DOMA (MagIlyasDOMA)", email = "magilyas.doma.09@list.ru"}
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
classifiers = [
|
|
18
|
-
"Programming Language :: Python :: 3",
|
|
19
|
-
"Programming Language :: Python :: 3.8",
|
|
20
|
-
"Programming Language :: Python :: 3.9",
|
|
21
|
-
"Programming Language :: Python :: 3.10",
|
|
22
|
-
"Programming Language :: Python :: 3.11",
|
|
23
|
-
"Programming Language :: Python :: 3.12",
|
|
24
|
-
"Programming Language :: Python :: 3.13",
|
|
25
|
-
"Programming Language :: Python :: 3.14",
|
|
26
|
-
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
27
|
-
"Operating System :: OS Independent",
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
keywords = ["cli", "scripts"]
|
|
31
|
-
dependencies = [
|
|
32
|
-
"pyyaml>=6.0.3",
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
[project.urls]
|
|
36
|
-
Homepage = "https://github.com/MagIlyasDOMA/devscript"
|
|
37
|
-
Repository = "https://github.com/MagIlyasDOMA/devscript.git"
|
|
38
|
-
BugTracker = "https://github.com/MagIlyasDOMA/devscript/issues"
|
|
39
|
-
|
|
40
|
-
[project.scripts]
|
|
41
|
-
devscript = "devscript:main"
|
|
42
|
-
devscr = "devscript:main"
|
|
43
|
-
devs = "devscript:main"
|
|
44
|
-
dvs = "devscript:main"
|
|
45
|
-
|
|
46
|
-
[tool.setuptools]
|
|
47
|
-
packages = ["devscript"]
|
|
48
|
-
|
|
49
|
-
[dependency-groups]
|
|
50
|
-
dev = [
|
|
51
|
-
"build>=1.2.2.post1",
|
|
52
|
-
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=70.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "devscript"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "A utility for managing custom development scripts via JSON or TOML configuration"
|
|
9
|
+
requires-python = ">=3.8"
|
|
10
|
+
license = {text = "GPL-3.0-only"}
|
|
11
|
+
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "Маг Ильяс DOMA (MagIlyasDOMA)", email = "magilyas.doma.09@list.ru"}
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.8",
|
|
20
|
+
"Programming Language :: Python :: 3.9",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: 3.14",
|
|
26
|
+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
keywords = ["cli", "scripts"]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"pyyaml>=6.0.3",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/MagIlyasDOMA/devscript"
|
|
37
|
+
Repository = "https://github.com/MagIlyasDOMA/devscript.git"
|
|
38
|
+
BugTracker = "https://github.com/MagIlyasDOMA/devscript/issues"
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
devscript = "devscript:main"
|
|
42
|
+
devscr = "devscript:main"
|
|
43
|
+
devs = "devscript:main"
|
|
44
|
+
dvs = "devscript:main"
|
|
45
|
+
|
|
46
|
+
[tool.setuptools]
|
|
47
|
+
packages = ["devscript"]
|
|
48
|
+
|
|
49
|
+
[dependency-groups]
|
|
50
|
+
dev = [
|
|
51
|
+
"build>=1.2.2.post1",
|
|
52
|
+
"pyinstaller>=6.19.0",
|
|
53
|
+
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|