feat(ocr): add whitelist presets and improve UI for OCR tool

refactor: format code and improve mobile menu accessibility
style: fix whitespace and formatting in multiple files
docs: update documentation with better formatting and examples
This commit is contained in:
abdullahalam123
2025-10-20 18:51:49 +05:30
parent 59b351eee4
commit 0e7c53560a
19 changed files with 755 additions and 363 deletions

View File

@@ -18,7 +18,7 @@ function getCurrentVersion() {
function updateVersion(type) {
const currentVersion = getCurrentVersion();
const [major, minor, patch] = currentVersion.split('.').map(Number);
let newVersion;
switch (type) {
case 'major':
@@ -32,23 +32,30 @@ function updateVersion(type) {
newVersion = `${major}.${minor}.${patch + 1}`;
break;
}
packageJson.version = newVersion;
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
fs.writeFileSync(
packageJsonPath,
JSON.stringify(packageJson, null, 2) + '\n'
);
return newVersion;
}
function createGitTag(version) {
const tagName = `v${version}`;
try {
// Check if tag already exists
execSync(`git rev-parse "v${version}" >/dev/null 2>&1`, { stdio: 'ignore' });
execSync(`git rev-parse "v${version}" >/dev/null 2>&1`, {
stdio: 'ignore',
});
console.log(`✅ Tag v${version} already exists`);
return tagName;
} catch {
// Tag doesn't exist, create it
execSync(`git tag -a "v${version}" -m "Release v${version}"`, { stdio: 'inherit' });
execSync(`git tag -a "v${version}" -m "Release v${version}"`, {
stdio: 'inherit',
});
console.log(`✅ Created tag v${version}`);
return tagName;
}
@@ -56,36 +63,36 @@ function createGitTag(version) {
function main() {
const type = process.argv[2] || 'patch';
if (!['major', 'minor', 'patch'].includes(type)) {
console.error('❌ Invalid version type. Use: major, minor, or patch');
process.exit(1);
}
console.log(`🚀 Releasing ${type} version...`);
// 1. Update version in package.json
const newVersion = updateVersion(type);
console.log(`📦 Updated version to ${newVersion}`);
// 2. Add and commit changes
execSync('git add package.json', { stdio: 'inherit' });
execSync(`git commit -m "Release v${newVersion}"`, { stdio: 'inherit' });
console.log(`💾 Committed version change`);
// 3. Create git tag
const tagName = createGitTag(newVersion);
// 4. Push everything to main
console.log(`📤 Pushing to main...`);
execSync('git push origin main', { stdio: 'inherit' });
execSync(`git push origin ${tagName}`, { stdio: 'inherit' });
console.log(`🎉 Release v${newVersion} complete!`);
console.log(`📦 Docker image: bentopdf/bentopdf:${newVersion}`);
console.log(`🏷️ GitHub release: https://github.com/AltuisticIsopod/bentopdf/releases/tag/${tagName}`);
console.log(
`🏷️ GitHub release: https://github.com/AltuisticIsopod/bentopdf/releases/tag/${tagName}`
);
}
main();