Skip to content

Commit 6aa7221

Browse files
committed
[STRUCTURE] monorepo for docs
1 parent 8c51ce9 commit 6aa7221

33 files changed

Lines changed: 191 additions & 130 deletions

README.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

package.json

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,12 @@
11
{
2-
"name": "spreadsheet-orm",
3-
"version": "0.1.0",
4-
"description": "ORM for Google Spreadsheet - Query Builder and Schema Management for spreadsheet database",
5-
"keywords": [
6-
"google-spreadsheet",
7-
"spreadsheet-orm",
8-
"spreadsheet-database",
9-
"google-sheets-api",
10-
"orm",
11-
"database",
12-
"query-builder"
13-
],
14-
"license": "MIT",
15-
"main": "dist/index.js",
16-
"types": "dist/index.d.ts",
17-
"files": [
18-
"dist"
19-
],
20-
"packageManager": "yarn@4.5.3",
21-
"dependencies": {
22-
"gaxios": "^6.7.1",
23-
"googleapis": "^144.0.0"
24-
},
25-
"devDependencies": {
26-
"@types/node": "^22.10.2",
27-
"nodemon": "^3.1.9",
28-
"tsx": "^4.19.2",
29-
"typescript": "^5.7.2"
30-
},
31-
"scripts": {
32-
"build": "tsc",
33-
"start": "tsx test/index.ts",
34-
"dev": "nodemon --exec tsx test/index.ts",
35-
"prepublishOnly": "yarn build"
36-
},
37-
"type": "module",
38-
"repository": {
39-
"type": "git",
40-
"url": "https://github.com/codingbotPark/spreadsheet-orm.git"
41-
}
42-
}
2+
"private": true,
3+
"workspaces": [
4+
"packages/*"
5+
],
6+
"packageManager": "yarn@4.5.3",
7+
"scripts": {
8+
"build": "turbo run build",
9+
"dev": "turbo run dev",
10+
"test": "turbo run test"
11+
}
12+
}
File renamed without changes.

packages/core/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# spreadsheet-orm
2+
3+
## Overview
4+
`spreadsheet-orm` is an Object-Relational Mapping (ORM) library designed for using Google Spreadsheets as a database. It provides a query builder and schema management features for spreadsheet data.
5+
6+
## Features
7+
- **Google Sheets API Integration**: Seamlessly connects and interacts with Google Sheets.
8+
- **Schema Management**: Defines and manages the schema of spreadsheets.
9+
- **Query Builder**: Builds and executes queries for spreadsheet data.
10+
11+
## Installation
12+
To install the package, use Yarn:
13+
```bash
14+
yarn add spreadsheet-orm
15+
```
16+
17+
## Usage
18+
### Basic Setup
19+
20+
```typescript
21+
import { ConnectionConfig } from 'spreadsheet-orm';
22+
const config = new ConnectionConfig({
23+
spreadsheetID: 'your-spreadsheet-id',
24+
email: 'your-email@example.com',
25+
privateKey: 'your-private-key',
26+
});
27+
const connection = new BaseConnection({ config });
28+
```
29+
30+
### Error Handling
31+
Errors may occur while working with the Google Sheets API. Here's how to handle them:
32+
33+
```typescript
34+
private async checkValidSpreadsheetID(spreadsheetID: string) {
35+
try {
36+
const response = await this.spreadsheetAPI.spreadsheets.get({
37+
spreadsheetId: spreadsheetID,
38+
});
39+
return response.data;
40+
} catch (error: unknown) {
41+
if ((error as GaxiosError).response) {
42+
const err = error as GaxiosError;
43+
const statusCode = err.response?.status;
44+
const errorMessage = err.response?.data?.error?.message;
45+
// Handle specific error cases
46+
}
47+
throw error;
48+
}
49+
}
50+
```
51+
52+
## Development
53+
### Scripts
54+
- **Build**: Compiles TypeScript files.
55+
```bash
56+
yarn build
57+
```
58+
- **Start**: Runs the application.
59+
```bash
60+
yarn start
61+
```
62+
- **Development**: Starts the application in development mode with hot reloading.
63+
```bash
64+
yarn dev
65+
```
66+
67+
## Contributing
68+
Contributions are welcome! Open an issue or submit a pull request.
69+
70+
## License
71+
This project is licensed under the MIT License.

packages/core/package.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "spreadsheet-orm",
3+
"version": "0.1.2",
4+
"description": "ORM for Google Spreadsheet - Query Builder and Schema Management for spreadsheet database",
5+
"keywords": [
6+
"google-spreadsheet",
7+
"spreadsheet-orm",
8+
"spreadsheet-database",
9+
"google-sheets-api",
10+
"orm",
11+
"database",
12+
"query-builder"
13+
],
14+
"license": "MIT",
15+
"main": "dist/index.js",
16+
"types": "dist/index.d.ts",
17+
"files": [
18+
"dist"
19+
],
20+
"packageManager": "yarn@4.5.3",
21+
"dependencies": {
22+
"gaxios": "^6.7.1",
23+
"googleapis": "^144.0.0"
24+
},
25+
"devDependencies": {
26+
"@types/node": "^22.10.2",
27+
"nodemon": "^3.1.9",
28+
"tsx": "^4.19.2",
29+
"typescript": "^5.7.2"
30+
},
31+
"scripts": {
32+
"build": "tsc -p tsconfig.build.json",
33+
"test": "tsx test/index.ts",
34+
"dev": "nodemon --exec tsx test/index.ts",
35+
"prepublishOnly": "yarn build"
36+
},
37+
"type": "module",
38+
"repository": {
39+
"type": "git",
40+
"url": "https://github.com/codingbotPark/spreadsheet-orm.git"
41+
}
42+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)