Skip to content

Commit

Permalink
chore: separate websit
Browse files Browse the repository at this point in the history
  • Loading branch information
arshad-yaseen committed Nov 6, 2024
1 parent 80b2ee4 commit bc60b72
Show file tree
Hide file tree
Showing 24 changed files with 52 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sourceType": "module",
"project": "./tsconfig.json"
},
"ignorePatterns": ["node_modules/**/*", "build/**/*", "tests/ui/**/*"],
"ignorePatterns": ["node_modules/**/*", "build/**/*", "website/**/*"],
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-unused-vars": "warn",
Expand Down
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Fast, ultra-accurate text extraction from images and PDFs with structured markdo
- [Input Sources](#input-sources)
- [API Reference](#api-reference)
- [Error Handling](#error-handling)
- [How it Works](#how-it-works)
- [Used Models](#used-models)
- [Contributing](#contributing)

Expand Down Expand Up @@ -102,24 +101,6 @@ try {
}
```

## How it Works

Ocra processes documents in several steps:

1. **Input Processing**

- Validates and normalizes input (file, URL, base64, or buffer)
- Converts PDFs to high-quality images for processing

2. **Text Extraction**

- Sends images to the selected provider's vision model
- Processes multiple pages concurrently for PDFs

3. **Output Formatting**
- Structures extracted text as clean markdown
- Includes metadata about the processing

## Used Models

| Provider | Model |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"build": "tsup src/index.ts",
"dev": "tsup src/index.ts --watch",
"dev:ui": "pnpm -C tests/ui dev",
"dev:website": "pnpm -C website dev",
"test": "vitest",
"tsc": "tsc --noEmit",
"lint": "eslint . --ext .ts,.tsx --fix",
Expand Down
60 changes: 25 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- '.'
- 'tests/ui'
- 'website'
2 changes: 1 addition & 1 deletion src/utils/call-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createProviderHeaders,
createRequestBody,
parseProviderChatCompletion,
} from './providers';
} from './provider';

/**
* Calls the Language Model to extract text from the image.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

"types": ["vitest/globals"]
},
"include": ["src", "tests", "tsup.config.ts"],
"exclude": ["node_modules", "build", "examples", "tests/ui"]
"include": ["src", "tests", "tsup.config.ts", "ui"],
"exclude": ["node_modules", "build", "examples", "ui"]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion tests/ui/package.json → website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"preinstall": "node scripts/change-ocra-package.js"
},
"dependencies": {
"@radix-ui/react-slot": "^1.1.0",
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions website/scripts/change-ocra-package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const fs = require('fs');
const path = require('path');

const rootPackagePath = path.join(__dirname, '..', '..', 'package.json');
const rootPackage = JSON.parse(fs.readFileSync(rootPackagePath, 'utf8'));
const ocraVersion = rootPackage.version;

const websitePackagePath = path.join(__dirname, '..', 'package.json');
const websitePackage = JSON.parse(fs.readFileSync(websitePackagePath, 'utf8'));

websitePackage.dependencies.ocra = ocraVersion;

fs.writeFileSync(
websitePackagePath,
JSON.stringify(websitePackage, null, 2) + '\n',
'utf8',
);

console.log(`Updated ocra package version to ${ocraVersion}`);
File renamed without changes.
File renamed without changes.

0 comments on commit bc60b72

Please sign in to comment.