Skip to content

Commit

Permalink
feat(database): create module
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Jan 11, 2024
1 parent 1b370a1 commit 2c0e7cf
Show file tree
Hide file tree
Showing 10 changed files with 658 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@types/node": "^20.11.0",
"breadc": "^0.9.7",
"bumpp": "latest",
"drizzle-kit": "^0.20.10",
"fs-extra": "^11.2.0",
"https-proxy-agent": "^7.0.2",
"ofetch": "^1.3.3",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"dependencies": {
"@animegarden/scraper": "workspace:*",
"@animegarden/database": "workspace:*",
"@breadc/color": "^0.9.7",
"animegarden": "workspace:*",
"breadc": "^0.9.7",
Expand Down
18 changes: 18 additions & 0 deletions packages/database/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 🌸 AnimeGarden Database

[![AnimeGarden](https://img.shields.io/endpoint?url=https://pages.onekuma.cn/project/animegarden&label=AnimeGarden)](https://garden.onekuma.cn)
[![CI](https://github.com/yjl9903/AnimeGarden/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/AnimeGarden/actions/workflows/ci.yml)

The database for [AnimeGarden](https://garden.onekuma.cn/).

## Credits

+ [動漫花園](https://share.dmhy.org/)
+ [Bangumi 番组计划](https://bgm.tv/)
+ [bangumi-data](https://github.com/bangumi-data/bangumi-data)
+ [erengy/anitomy](https://github.com/erengy/anitomy)
+ [tabratton/AnitomySharp](https://github.com/tabratton/AnitomySharp)

## License

MIT License © 2023 [XLor](https://github.com/yjl9903)
10 changes: 10 additions & 0 deletions packages/database/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: ['src/index'],
declaration: true,
clean: true,
rollup: {
emitCJS: true
}
});
53 changes: 53 additions & 0 deletions packages/database/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@animegarden/database",
"version": "0.0.33",
"private": true,
"description": "Database implementation for AnimeGarden.",
"keywords": [
"dmhy",
"scraper",
"animegarden",
"animespace"
],
"homepage": "https://github.com/yjl9903/AnimeGarden#readme",
"bugs": {
"url": "https://github.com/yjl9903/AnimeGarden/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/yjl9903/AnimeGarden.git"
},
"license": "MIT",
"author": "XLor",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"drizzle": "drizzle-kit",
"format": "prettier --write src/**/*.ts test/**/*.ts",
"test": "vitest",
"test:ci": "vitest --run",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"animegarden": "workspace:*",
"drizzle-orm": "^0.29.3",
"postgres": "^3.4.3"
},
"engines": {
"node": ">=v18.16.0"
}
}
1 change: 1 addition & 0 deletions packages/database/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const hello = 1;
7 changes: 7 additions & 0 deletions packages/database/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, it, expect } from 'vitest';

describe('hello', () => {
it('should work', () => {
expect(1 + 1).toBe(2);
});
});
7 changes: 7 additions & 0 deletions packages/database/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
1 change: 1 addition & 0 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@animegarden/database": "workspace:*",
"@animegarden/scraper": "workspace:*",
"animegarden": "workspace:*",
"simptrad": "^0.1.0",
Expand Down
Loading

0 comments on commit 2c0e7cf

Please sign in to comment.