12 Commits
Author SHA1 Message Date
dqnid 8dcbdd526c WIP: juker 2026-10-21 13:14:47 +02:00
dqnid 6d63d932e0 WIP: minimal data structure implemented 2026-09-12 12:16:12 +02:00
dqnid a940243aea feat: live build setup implemented without any external tool
Those external tools also removed from the dev-dependencies
2026-09-11 11:39:32 +02:00
dqnid b3357b83f2 docs: juker added to readme 2026-09-11 11:17:45 +02:00
dqnid ed26c29593 feat: new juker base project with ts support
Not yet live edit working, some issues with ts-node.
2026-09-10 13:16:58 +02:00
dqnid cf07ab9d88 fix: cleanup 2026-01-09 00:34:17 +01:00
dqnid 8c4c093d49 Merge pull request 'feature/raw-processor' (#1) from feature/raw-processor into main
Reviewed-on: #1
2026-01-09 00:24:22 +01:00
dqnid 5803891b60 feat: build features 2026-01-09 00:19:30 +01:00
dqnid 7d78cc8058 feat: final details + docs 2026-01-09 00:11:37 +01:00
dqnid 1c642ee207 feat: basic image management done 2026-01-08 20:28:35 +01:00
dqnid a1f3c0638d basic processing done 2026-01-06 19:34:25 +01:00
dqnid 275d53d1dc feat: image-converter project init 2026-01-05 14:35:11 +01:00
21 changed files with 803 additions and 0 deletions

No files matched your search

+2
View File
@@ -3,3 +3,5 @@
My personal set of tools to ease and speed up my development experience.
1. `colorizer`: color model converter.
2. `image-converter`: simple image formate and size converter.
3. `juker`: API faker.
+16
View File
@@ -0,0 +1,16 @@
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
[*.{md,py}]
charset = utf-8
[*.py]
indent_style = tab
indent_size = 4
[Makefile]
indent_style = tab
+6
View File
@@ -0,0 +1,6 @@
/venv
/venv/*
__pycache__/
/build
/dist
*.spec
+16
View File
@@ -0,0 +1,16 @@
install:
echo ">>> Installing dependencies"
pip install --upgrade pip
pip install -r requirements.txt
build:
pyinstaller src/main.py --onefile
save:
pip freeze > requirements.txt
run:
python src/main.py
setenv:
python -m venv venv
+21
View File
@@ -0,0 +1,21 @@
# Image converter
Simple tool to convert images on mass.
- Resize
- Format
## Usage
- `-H <height>` : max height of vertical images.
- `-W <width>` : max width of horizontal images.
- `-e <extension>` : extension of the output files.
- `-d <directory>` : input directory path.
- `-f <file/s>` : file or list of files (paths) to parse.
- `-o <directory>` : output directory path.
- `-h` : print help.
### Examples of usage
- `python converter.py -d ./assets -f ./another/file.png ./yet\ one\ more/file2.CR2 -e png -W 1000` : convert every file inside assets plus both `file.png` and `file2.CR2` into `PNG` with a with of 1000.
+6
View File
@@ -0,0 +1,6 @@
iniconfig==2.3.0
packaging==25.0
pillow==12.1.0
pluggy==1.6.0
Pygments==2.19.2
pytest==9.0.2
Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.
+18
View File
@@ -0,0 +1,18 @@
from modules.image_parser import (parse_image, parse_whole_directory)
from modules.argument_parser import (generate_argument_parser)
if __name__ == "__main__":
arg_parser = generate_argument_parser()
args = arg_parser.parse_args()
print(args, args.extension)
# Parse directory
if (args.directory != None):
parse_whole_directory(args.directory, args.output, args.height, args.width, args.extension)
# Parse individual files
if (args.files != None):
for file in args.files:
parse_image(file, args.output, args.height, args.width, args.extension)
@@ -0,0 +1,11 @@
import argparse
def generate_argument_parser():
parser = argparse.ArgumentParser(prog="Image Processor", description="A simple image format convert and resize tool.", epilog="Use any combination of arguments.")
parser.add_argument("-H", "--height", type=int, help="max height for vertical images")
parser.add_argument("-W", "--width", type=int, help="max width for horizontal images")
parser.add_argument("-e", "--extension", type=str, default="png",help="extension of the processed files")
parser.add_argument("-d", "--directory", type=str, help="directory of files to process")
parser.add_argument("-f", "--files", nargs="+", help="list of files to process")
parser.add_argument("-o", "--output", type=str, default="./",help="directory for the output files")
return parser
@@ -0,0 +1,43 @@
from PIL import Image
import os
import math
def parse_image(src: str, target_src: str, max_vertical_size_px: int, max_horizontal_size_px: int, target_extension: str):
if (src == None):
return
if (target_extension == None):
target_extension = "png"
rawImage = Image.open(src)
if (rawImage.height > rawImage.width):
if (max_vertical_size_px == None or max_vertical_size_px < 1):
max_vertical_size_px = rawImage.height
target_height = max_vertical_size_px
target_width = math.ceil(rawImage.width * max_vertical_size_px / rawImage.height)
else:
if (max_horizontal_size_px == None or max_horizontal_size_px < 1):
max_horizontal_size_px = rawImage.width
target_width = max_horizontal_size_px
target_height = math.ceil(rawImage.height * max_horizontal_size_px / rawImage.width)
rawImage = rawImage.resize((target_width, target_height))
filename = os.path.basename(src)
last_dot = filename.rfind(".")
filename = filename[:last_dot] + "." + target_extension
if (target_src == None):
target_src = os.path.abspath(os.path.dirname(src))
else:
target_src = os.path.abspath(target_src)
full_path = os.path.join(target_src, filename)
rawImage.save(full_path)
def parse_whole_directory(dir_src: str, target_src: str, max_vertical_size_px: int, max_horizontal_size_px: int, target_extension: str):
for file_path in get_file_path_iter(dir_src):
parse_image(file_path,target_src, max_vertical_size_px, max_horizontal_size_px, target_extension)
def get_file_path_iter(directory):
for dirpath,_,filenames in os.walk(directory):
for f in filenames:
yield os.path.abspath(os.path.join(dirpath, f))
+2
View File
@@ -0,0 +1,2 @@
node_modules
dist
+30
View File
@@ -0,0 +1,30 @@
{
"name": "juker",
"version": "1.0.0",
"description": "Compact API faker.",
"main": "app.ts",
"scripts": {
"dev:tsc": "tsc --watch --preserveWatchOutput",
"dev:tsc:silent": "tsc --watch >/dev/null",
"dev:node": "node --watch-preserve-output --watch-path=./dist dist/app.js",
"dev": "pnpm run dev:tsc:silent & pnpm run dev:node",
"build": "tsc",
"start": "node dist/app.js",
"run": "pnpm run build && pnpm run start"
},
"keywords": [],
"author": "",
"license": "ISC",
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "^11.3.0",
"onFail": "download"
}
},
"devDependencies": {
"@types/express": "^5.0.6",
"@types/node": "^26.5.0",
"typescript": "^7.0.2"
}
}
+506
View File
@@ -0,0 +1,506 @@
---
lockfileVersion: '9.0'
importers:
.:
configDependencies: {}
packageManagerDependencies:
'@pnpm/exe':
specifier: ^11.3.0
version: 11.26.0
pnpm:
specifier: ^11.3.0
version: 11.26.0
packages:
'@pnpm/exe@11.26.0':
resolution: {integrity: sha512-eeiNi7WeXulOO1BzDAU9HIk+N3dokG+xwKPUupNQoZT5auL3rh2pFW9DqdIEnCC2xtt/hZd6UGtKyb6OMpqndw==}
hasBin: true
'@pnpm/linux-arm64@11.26.0':
resolution: {integrity: sha512-M0IDuD4hbXxpLBsj1/I9pODcxu/gxTDtbyQmsVGYu1TZwCCpf6YU1x3lzq8aCGjrysmXYQAtCiY8GBjdw4UGFg==}
cpu: [arm64]
os: [linux]
'@pnpm/linux-x64@11.26.0':
resolution: {integrity: sha512-nUuNRsFCGVje3FHtOaWxIQl2EP4NBktKr+PpLN7uhuWnJCCMN/F9RKjNJAM+dUPyvAZs8VDvS0kA8J55kyybyg==}
cpu: [x64]
os: [linux]
'@pnpm/linuxstatic-arm64@11.26.0':
resolution: {integrity: sha512-+dXROkvdWjskrQtjwJAFuJI7Q2uTkghBfLsd0vqRmorX3fPuinhoRjJJ/UPtWXzJqwcByJBmdJRW+q2964m5qQ==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@pnpm/linuxstatic-x64@11.26.0':
resolution: {integrity: sha512-0eXE6spzIBdCbYhJZQ0u/sIOD0v30sqk2PrzoixzsNMc7S/lhd7EkBMVJ6cCPiCL2TXvOsrJC2SpWPBK769A9A==}
cpu: [x64]
os: [linux]
libc: [musl]
'@pnpm/macos-arm64@11.26.0':
resolution: {integrity: sha512-Za3kKV89Zj0SFzQf6zEUTUIy13xH8UiNyb7aILDRjPiTvTaUSCh3q+nvljISfGH1XcopXvo+p3K8Q2nrKYWAug==}
cpu: [arm64]
os: [darwin]
'@pnpm/win-arm64@11.26.0':
resolution: {integrity: sha512-5akeLtbqbFDdJtCV4qgLmDBV3R+XNs6E7h7Xb4ZBzS3rLRp8e/y/ZdgrZaGF5Kjo45g0BLAxdGUREHbU2/lGUw==}
cpu: [arm64]
os: [win32]
'@pnpm/win-x64@11.26.0':
resolution: {integrity: sha512-f15SfIo7nppxBII+STy6jpd1z3LgGTZh6skfuxKA/xHmkzopnQJQXr4hBnl1rJLJAnmuOhN8BssaC4LiXmS78w==}
cpu: [x64]
os: [win32]
'@reflink/reflink-darwin-arm64@0.1.19':
resolution: {integrity: sha512-ruy44Lpepdk1FqDz38vExBY/PVUsjxZA+chd9wozjUH9JjuDT/HEaQYA6wYN9mf041l0yLVar6BCZuWABJvHSA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
'@reflink/reflink-darwin-x64@0.1.19':
resolution: {integrity: sha512-By85MSWrMZa+c26TcnAy8SDk0sTUkYlNnwknSchkhHpGXOtjNDUOxJE9oByBnGbeuIE1PiQsxDG3Ud+IVV9yuA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@reflink/reflink-linux-arm64-gnu@0.1.19':
resolution: {integrity: sha512-7P+er8+rP9iNeN+bfmccM4hTAaLP6PQJPKWSA4iSk2bNvo6KU6RyPgYeHxXmzNKzPVRcypZQTpFgstHam6maVg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@reflink/reflink-linux-arm64-musl@0.1.19':
resolution: {integrity: sha512-37iO/Dp6m5DDaC2sf3zPtx/hl9FV3Xze4xoYidrxxS9bgP3S8ALroxRK6xBG/1TtfXKTvolvp+IjrUU6ujIGmA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [musl]
'@reflink/reflink-linux-x64-gnu@0.1.19':
resolution: {integrity: sha512-jbI8jvuYCaA3MVUdu8vLoLAFqC+iNMpiSuLbxlAgg7x3K5bsS8nOpTRnkLF7vISJ+rVR8W+7ThXlXlUQ93ulkw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [glibc]
'@reflink/reflink-linux-x64-musl@0.1.19':
resolution: {integrity: sha512-e9FBWDe+lv7QKAwtKOt6A2W/fyy/aEEfr0g6j/hWzvQcrzHCsz07BNQYlNOjTfeytrtLU7k449H1PI95jA4OjQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [musl]
'@reflink/reflink-win32-arm64-msvc@0.1.19':
resolution: {integrity: sha512-09PxnVIQcd+UOn4WAW73WU6PXL7DwGS6wPlkMhMg2zlHHG65F3vHepOw06HFCq+N42qkaNAc8AKIabWvtk6cIQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
'@reflink/reflink-win32-x64-msvc@0.1.19':
resolution: {integrity: sha512-E//yT4ni2SyhwP8JRjVGWr3cbnhWDiPLgnQ66qqaanjjnMiu3O/2tjCPQXlcGc/DEYofpDc9fvhv6tALQsMV9w==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@reflink/reflink@0.1.19':
resolution: {integrity: sha512-DmCG8GzysnCZ15bres3N5AHCmwBwYgp0As6xjhQ47rAUTUXxJiK+lLUxaGsX3hd/30qUpVElh05PbGuxRPgJwA==}
engines: {node: '>= 10'}
detect-libc@2.1.2:
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
engines: {node: '>=8'}
pnpm@11.26.0:
resolution: {integrity: sha512-/A4r+JC5+YNhHxq2jAY3vOkUOQZTaZ+DwaeLAF7SXyyB53kgyP2O7i7PC1iyjNywCoTZf2m898VrLzRHECOGZA==}
engines: {node: '>=22.13'}
hasBin: true
snapshots:
'@pnpm/exe@11.26.0':
dependencies:
'@reflink/reflink': 0.1.19
detect-libc: 2.1.2
optionalDependencies:
'@pnpm/linux-arm64': 11.26.0
'@pnpm/linux-x64': 11.26.0
'@pnpm/linuxstatic-arm64': 11.26.0
'@pnpm/linuxstatic-x64': 11.26.0
'@pnpm/macos-arm64': 11.26.0
'@pnpm/win-arm64': 11.26.0
'@pnpm/win-x64': 11.26.0
'@pnpm/linux-arm64@11.26.0':
optional: true
'@pnpm/linux-x64@11.26.0':
optional: true
'@pnpm/linuxstatic-arm64@11.26.0':
optional: true
'@pnpm/linuxstatic-x64@11.26.0':
optional: true
'@pnpm/macos-arm64@11.26.0':
optional: true
'@pnpm/win-arm64@11.26.0':
optional: true
'@pnpm/win-x64@11.26.0':
optional: true
'@reflink/reflink-darwin-arm64@0.1.19':
optional: true
'@reflink/reflink-darwin-x64@0.1.19':
optional: true
'@reflink/reflink-linux-arm64-gnu@0.1.19':
optional: true
'@reflink/reflink-linux-arm64-musl@0.1.19':
optional: true
'@reflink/reflink-linux-x64-gnu@0.1.19':
optional: true
'@reflink/reflink-linux-x64-musl@0.1.19':
optional: true
'@reflink/reflink-win32-arm64-msvc@0.1.19':
optional: true
'@reflink/reflink-win32-x64-msvc@0.1.19':
optional: true
'@reflink/reflink@0.1.19':
optionalDependencies:
'@reflink/reflink-darwin-arm64': 0.1.19
'@reflink/reflink-darwin-x64': 0.1.19
'@reflink/reflink-linux-arm64-gnu': 0.1.19
'@reflink/reflink-linux-arm64-musl': 0.1.19
'@reflink/reflink-linux-x64-gnu': 0.1.19
'@reflink/reflink-linux-x64-musl': 0.1.19
'@reflink/reflink-win32-arm64-msvc': 0.1.19
'@reflink/reflink-win32-x64-msvc': 0.1.19
detect-libc@2.1.2: {}
pnpm@11.26.0: {}
---
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
devDependencies:
'@types/express':
specifier: ^5.0.6
version: 5.0.6
'@types/node':
specifier: ^26.5.0
version: 26.5.0
typescript:
specifier: ^7.0.2
version: 7.0.2
packages:
'@types/body-parser@1.19.6':
resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==}
'@types/connect@3.4.38':
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
'@types/express-serve-static-core@5.1.3':
resolution: {integrity: sha512-dPfW8NFiOF4wOHc7+N/QSxlY9cfSsenewGbAz8C8U/MULPd/YZ27LvJUIlzaXie7e6Ove9YunJGgC9tbHD2cKw==}
'@types/express@5.0.6':
resolution: {integrity: sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==}
'@types/http-errors@2.0.5':
resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==}
'@types/node@26.5.0':
resolution: {integrity: sha512-dVSGpriSoCgz8WnDNTuSSuSv1PC/ALXihO4ulRZt7Md8k9mlbdin3lGOcDE8SnWOgf513ByWlXd7BK4azmyg/A==}
'@types/qs@6.15.1':
resolution: {integrity: sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==}
'@types/range-parser@1.2.7':
resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==}
'@types/send@1.2.1':
resolution: {integrity: sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==}
'@types/serve-static@2.2.0':
resolution: {integrity: sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ==}
'@typescript/typescript-aix-ppc64@7.0.2':
resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [aix]
'@typescript/typescript-darwin-arm64@7.0.2':
resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [darwin]
'@typescript/typescript-darwin-x64@7.0.2':
resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [darwin]
'@typescript/typescript-freebsd-arm64@7.0.2':
resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [freebsd]
'@typescript/typescript-freebsd-x64@7.0.2':
resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [freebsd]
'@typescript/typescript-linux-arm64@7.0.2':
resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [linux]
'@typescript/typescript-linux-arm@7.0.2':
resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==}
engines: {node: '>=16.20.0'}
cpu: [arm]
os: [linux]
'@typescript/typescript-linux-loong64@7.0.2':
resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==}
engines: {node: '>=16.20.0'}
cpu: [loong64]
os: [linux]
'@typescript/typescript-linux-mips64el@7.0.2':
resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==}
engines: {node: '>=16.20.0'}
cpu: [mips64el]
os: [linux]
'@typescript/typescript-linux-ppc64@7.0.2':
resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [linux]
'@typescript/typescript-linux-riscv64@7.0.2':
resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==}
engines: {node: '>=16.20.0'}
cpu: [riscv64]
os: [linux]
'@typescript/typescript-linux-s390x@7.0.2':
resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==}
engines: {node: '>=16.20.0'}
cpu: [s390x]
os: [linux]
'@typescript/typescript-linux-x64@7.0.2':
resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [linux]
'@typescript/typescript-netbsd-arm64@7.0.2':
resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [netbsd]
'@typescript/typescript-netbsd-x64@7.0.2':
resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [netbsd]
'@typescript/typescript-openbsd-arm64@7.0.2':
resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [openbsd]
'@typescript/typescript-openbsd-x64@7.0.2':
resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [openbsd]
'@typescript/typescript-sunos-x64@7.0.2':
resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [sunos]
'@typescript/typescript-win32-arm64@7.0.2':
resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [win32]
'@typescript/typescript-win32-x64@7.0.2':
resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [win32]
typescript@7.0.2:
resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==}
engines: {node: '>=16.20.0'}
hasBin: true
undici-types@8.9.0:
resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==}
snapshots:
'@types/body-parser@1.19.6':
dependencies:
'@types/connect': 3.4.38
'@types/node': 26.5.0
'@types/connect@3.4.38':
dependencies:
'@types/node': 26.5.0
'@types/express-serve-static-core@5.1.3':
dependencies:
'@types/node': 26.5.0
'@types/qs': 6.15.1
'@types/range-parser': 1.2.7
'@types/send': 1.2.1
'@types/express@5.0.6':
dependencies:
'@types/body-parser': 1.19.6
'@types/express-serve-static-core': 5.1.3
'@types/serve-static': 2.2.0
'@types/http-errors@2.0.5': {}
'@types/node@26.5.0':
dependencies:
undici-types: 8.9.0
'@types/qs@6.15.1': {}
'@types/range-parser@1.2.7': {}
'@types/send@1.2.1':
dependencies:
'@types/node': 26.5.0
'@types/serve-static@2.2.0':
dependencies:
'@types/http-errors': 2.0.5
'@types/node': 26.5.0
'@typescript/typescript-aix-ppc64@7.0.2':
optional: true
'@typescript/typescript-darwin-arm64@7.0.2':
optional: true
'@typescript/typescript-darwin-x64@7.0.2':
optional: true
'@typescript/typescript-freebsd-arm64@7.0.2':
optional: true
'@typescript/typescript-freebsd-x64@7.0.2':
optional: true
'@typescript/typescript-linux-arm64@7.0.2':
optional: true
'@typescript/typescript-linux-arm@7.0.2':
optional: true
'@typescript/typescript-linux-loong64@7.0.2':
optional: true
'@typescript/typescript-linux-mips64el@7.0.2':
optional: true
'@typescript/typescript-linux-ppc64@7.0.2':
optional: true
'@typescript/typescript-linux-riscv64@7.0.2':
optional: true
'@typescript/typescript-linux-s390x@7.0.2':
optional: true
'@typescript/typescript-linux-x64@7.0.2':
optional: true
'@typescript/typescript-netbsd-arm64@7.0.2':
optional: true
'@typescript/typescript-netbsd-x64@7.0.2':
optional: true
'@typescript/typescript-openbsd-arm64@7.0.2':
optional: true
'@typescript/typescript-openbsd-x64@7.0.2':
optional: true
'@typescript/typescript-sunos-x64@7.0.2':
optional: true
'@typescript/typescript-win32-arm64@7.0.2':
optional: true
'@typescript/typescript-win32-x64@7.0.2':
optional: true
typescript@7.0.2:
optionalDependencies:
'@typescript/typescript-aix-ppc64': 7.0.2
'@typescript/typescript-darwin-arm64': 7.0.2
'@typescript/typescript-darwin-x64': 7.0.2
'@typescript/typescript-freebsd-arm64': 7.0.2
'@typescript/typescript-freebsd-x64': 7.0.2
'@typescript/typescript-linux-arm': 7.0.2
'@typescript/typescript-linux-arm64': 7.0.2
'@typescript/typescript-linux-loong64': 7.0.2
'@typescript/typescript-linux-mips64el': 7.0.2
'@typescript/typescript-linux-ppc64': 7.0.2
'@typescript/typescript-linux-riscv64': 7.0.2
'@typescript/typescript-linux-s390x': 7.0.2
'@typescript/typescript-linux-x64': 7.0.2
'@typescript/typescript-netbsd-arm64': 7.0.2
'@typescript/typescript-netbsd-x64': 7.0.2
'@typescript/typescript-openbsd-arm64': 7.0.2
'@typescript/typescript-openbsd-x64': 7.0.2
'@typescript/typescript-sunos-x64': 7.0.2
'@typescript/typescript-win32-arm64': 7.0.2
'@typescript/typescript-win32-x64': 7.0.2
undici-types@8.9.0: {}
+4
View File
@@ -0,0 +1,4 @@
import { readJSON } from "./modules/parser/json.parser";
console.log("TS is working!!!");
readJSON("./src/modules/parser/fixtures/mock.fixture.json").then(d => console.log(JSON.stringify(d)));
+19
View File
@@ -0,0 +1,19 @@
export type HTTPHeaders = Record<string, string>;
export interface RawJuke {
path: string;
responses: Object[];
}
export interface Juke<T = unknown> {
path: string;
status: {
condition: (body: T, headers: HTTPHeaders) => boolean;
response: HTTPMinimalResponse<T>;
}[]
}
export interface HTTPMinimalResponse<T> {
code: number;
body?: T;
}
View File
Whitespace-only changes.
@@ -0,0 +1,40 @@
{
"routes": [
{
"path": "/test",
"responses": [
{
"code": "401",
"when": "body.name !== 'test' || headers['Content-Type'] !== 'application/json'"
},
{
"code": "200",
"when": "",
"body": {
"name": "$request.body.name",
"param": "$query.id",
"data": [{
"title": "$word",
"subtitle": "$word",
"description": "$text"
}],
"limitedData": {
"$array": {
"$array.count": 15,
"$array.content": {
"title": "$word",
"subtitle": "$word",
"description": "$text"
}
}
},
"pagination": {
"page": "$number",
"total": "$number"
}
}
}
]
}
]
}
+27
View File
@@ -0,0 +1,27 @@
import { readFile } from "node:fs/promises";
import { RawJuke } from "../core/juker.types";
export async function readJSON(path: string): Promise<RawJuke[]> {
try {
const jukes: RawJuke[] = [];
const f = await readFile(path);
const j = JSON.parse(f.toString());
if ("routes" in j && Array.isArray(j.routes)) {
j.routes.forEach((route: RawJuke) => {
if ("path" in route && "responses" in route && Array.isArray(route.responses)) {
jukes.push({ path: route.path, responses: route.responses })
} else {
console.error("[!!] Route entry wrong format");
}
})
} else {
throw Error("incorrect format, 'routes' not present at the root of the file.")
}
return jukes;
} catch (e) {
console.error("[!!] Reading JSON error", e);
return [];
}
}
+13
View File
@@ -0,0 +1,13 @@
import { Juke, RawJuke } from "../core/juker.types";
export function parseJuke(raw: RawJuke): Juke {
}
function parseObject(input: Object): Object {
}
function parseMock(input: string): unknown {
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "es6",
"module": "nodenext",
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"rootDir": "./src",
"outDir": "./dist",
"forceConsistentCasingInFileNames": true,
"strict": true,
"esModuleInterop": true,
"typeRoots": [
"./node_modules/@types"
],
"types": [
"node"
]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}