Skip to content

Commit

Permalink
feat: init animegarden package
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Apr 30, 2023
1 parent fcb764a commit 46bedc3
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 5 deletions.
5 changes: 5 additions & 0 deletions packages/animegarden/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# AnimeGarden Integrations

## License

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

export default defineBuildConfig({
entries: ['src/index'],
declaration: true,
clean: true,
rollup: {
emitCJS: true
},
externals: ['breadc']
});
52 changes: 52 additions & 0 deletions packages/animegarden/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@animepaste/animegarden",
"version": "0.0.6",
"description": "Paste your favourite anime online",
"keywords": [
"anime",
"animegarden",
"dmhy",
"AnimePaste",
"XLorPaste",
"cli"
],
"homepage": "https://anime.docs.xlorpaste.cn/",
"bugs": {
"url": "https://github.com/XLorPaste/AnimePaste/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/XLorPaste/AnimePaste.git"
},
"license": "AGPL-3.0",
"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",
"*.mjs"
],
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"format": "prettier --write src/**/*.ts",
"test": "vitest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@animepaste/core": "workspace:*"
},
"engines": {
"node": ">=v16.0.0"
}
}
7 changes: 7 additions & 0 deletions packages/animegarden/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Plugin } from '@animepaste/core';

export function AnimeGarden(options: {}): Plugin {
return {
name: 'animegarden'
};
}
6 changes: 6 additions & 0 deletions packages/animegarden/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"src/**/*.ts"
],
}
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ It will automatically search the resources, download, and upload them to OSS bas

## License

AGPL-3.0 License © 2021 [XLor](https://github.com/yjl9903)
AGPL-3.0 License © 2023 [XLor](https://github.com/yjl9903)
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "animepaste",
"name": "animespace",
"version": "0.0.6",
"description": "Paste your favourite anime online",
"keywords": [
Expand Down Expand Up @@ -48,6 +48,7 @@
},
"dependencies": {
"@animepaste/core": "workspace:*",
"@animepaste/animegarden": "workspace:*",
"@breadc/color": "^0.9.3",
"@onekuma/map": "^0.1.9",
"axios": "^1.3.6",
Expand Down
10 changes: 8 additions & 2 deletions packages/cli/src/system/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import { loadSpace, createAnimeSystem } from '@animepaste/core';

export async function makeSystem() {
const root = inferRoot();
const space = await loadSpace(root, (entry) => {
return undefined;
const space = await loadSpace(root, async (entry) => {
switch (entry.name) {
case 'animegarden':
const { AnimeGarden } = await import('@animepaste/animegarden');
return AnimeGarden(entry);
default:
return undefined;
}
});
const system = createAnimeSystem(space);
return system;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ It provides internal abstraction for [AnimePaste](https://github.com/XLorPaste/A

## License

AGPL-3.0 License © 2021 [XLor](https://github.com/yjl9903)
AGPL-3.0 License © 2023 [XLor](https://github.com/yjl9903)
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"@animepaste/core": [
"./packages/core/src/index.ts"
],
"@animepaste/animegarden": [
"./packages/animegarden/src/index.ts"
],
}
},
"exclude": [
Expand Down

0 comments on commit 46bedc3

Please sign in to comment.