Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.5 #22

Merged
merged 3 commits into from
Jul 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🆕 Feature request
about: Suggest an idea for this project
title: ''
labels: ['enhancement']
assignees: []
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/
*.tgz
yarn-error.log
yarn-error.log
.vscode
.idea
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [v1.0.5](https://github.com/consumet/consumet-extentions/compare/v1.0.4...v1.0.5)

### Merged

- FIX: fixed getComcis page [`#21`](https://github.com/consumet/consumet-extentions/pull/21)

### Commits

- chore: bump dist build [`73d2f27`](https://github.com/consumet/consumet-extentions/commit/73d2f27e4a4294f35e334680cc6d79d0c0e5143b)
- refactor [skip ci]: `consumet extensions` -> `consumet.ts` [`e53078e`](https://github.com/consumet/consumet-extentions/commit/e53078ef6d364f0812879256f0f65be719c4295a)
- refactor (issue_template): new dropbox [`0e5f282`](https://github.com/consumet/consumet-extentions/commit/0e5f282506c4895bd98757fe5dc15a99605f26fe)

## [v1.0.4](https://github.com/consumet/consumet-extentions/compare/v1.0.3...v1.0.4) - 2022-07-13

### Commits

- temp commit [`c18f14f`](https://github.com/consumet/consumet-extentions/commit/c18f14fbb7559cc348388f3b3f65e6d09747ce4f)
- chore: bump patch version `1.0.2` -> `1.0.3` [`e3ca4b3`](https://github.com/consumet/consumet-extentions/commit/e3ca4b34b2768310883de84e51ae65920b392860)
- feat: new meta provider [`4e86e0d`](https://github.com/consumet/consumet-extentions/commit/4e86e0d13253dda00100fdf1dff577ced711a127)
- feat(anilist): updated docs [`28fb0c5`](https://github.com/consumet/consumet-extentions/commit/28fb0c5a548d5cce120f7ea35680d1fa04ca89f4)
Expand Down
99 changes: 70 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ See our [informal contributing guide](./docs/guides/contributing.md) for more de

- [Prerequisites](#prerequisites)
- [Cloning the repository](#cloning-the-repository)
- [Project structure](#project-structure)
- [Writing a provider](#writing-a-provider)
- [Project structure](#project-structure)
- [Setting up the provider](#setting-up-the-provider)
- [Updaing codebase](#updaing-codebase)
- [Updating documentation](#updating-documentation)
- [Fixing a provider](#fixing-a-provider)
- [Commit message](#commit-message)


## Prerequisites
Expand All @@ -24,22 +28,47 @@ To contribute to Consumet code, you need to know the following:
- [DevTools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools)

### Cloning the repository
1. Clone the repository.
```bash
git clone https://github.com/consumet/extensions.git
1. [Fork the repository](https://github.com/consumet/consumet.ts/fork)
2. Clone your fork to your local machine using the following command **(make sure to change `<your_username>` to your GitHub username)**:
```sh
git clone https://github.com/<your-username>/consumet-api.git
```
2. Install dependencies. **Using Yarn**.
```bash
yarn install
3. Create a new branch:
```sh
git checkout -b <new-branch-name>
```
3. create a new branch using the name of the provider (source) you want to add.
```bash
git checkout -b <provider-name> # or any name you find suitable

### Project structure
I believe that project structure is needed to make it simple to contribute to consumet.ts.

***\<category>*** is the category of the provider. For example, `anime` or `book`, `etc`.\
***\<provider-name>*** is the name of the provider. For example, `libgen` or `gogoanime`, `etc`. (must be in camel case)

```sh
> tree
docs/
├── guides/
| ├── ...
| ├── anime.md
| ├── getting-started.md
│ └── contributing.md (informal guide)
├── providers/
│ └── <provider-name>.md (provider documentation)
├── README.md
src/
├── index.ts
|── models
├── providers
│ ├── <category>
│ │ ├── index.ts
│ │ └── <provider-name>.ts
│ └── <category>
└── utils
```

## Writing a provider
Each provider is a class that extends abstract class. For example, `Libgen` provider extends `BooksParser` class, and `Gogoanime` extends `AnimeParser`. the parser abstract classes can be found in the `src/models/` folder as follows:
```bash
```sh
src/models/anime-parser.ts # AnimeParser
src/models/book-parser.ts # BookParser
src/models/lightnovel-parser.ts # LightNovelParser
Expand Down Expand Up @@ -97,26 +126,38 @@ You are welcome to add anything to the abstract class that you believe will be b
</details>


#### Project structure
***\<category>*** is the category of the provider. For example, `anime` or `book`, `etc`.\
***\<provider-name>*** is the name of the provider. For example, `libgen` or `gogoanime`, `etc`. (must be in camel case)


```bash
> tree src/
src/
├── index.ts
|── models
├── providers
│ ├── <category>
│ │ ├── index.ts
│ │ └── <provider-name>.ts
│ └── <category>
└── utils
```
#### Setting up the provider
1. Create a new file in the `src/providers/<category>/<provider-name>.ts` folder.
2. Import the abstract class from the `src/models/<category>-parser.ts` file. for example: if you are writing an anime provider, you would need to implement the abstract class `AnimeParser`, which is defined in the `src/models/anime-parser.ts` file.
3. Start writing your provider code.
4. Add the provider to the `src/providers/<category>/index.ts` file.
5. Make a [Pull Request](https://github.com/consumet/extensions/pulls) of the changes.


## Updaing codebase
### Updating documentation
1. Update the documentation.
2. [Commit the changes](#commit-message).

### Fixing a provider
1. Update the provider code.
2. [Commit the changes](#commit-message).

## Commit message
When you've made changes to one or more files, you have to *commit* that file. You also need a
*message* for that *commit*.

You should read [these](https://www.freecodecamp.org/news/writing-good-commit-messages-a-practical-guide/) guidelines, or that summarized:

- Short and detailed
- Prefix one of these commit types:
- `feat:` A feature, possibly improving something already existing
- `fix:` A fix, for example of a bug
- `refactor:` Refactoring a specific section of the codebase
- `test:` Everything related to testing
- `docs:` Everything related to documentation
- `chore:` Code maintenance

Examples:
- `feat: Speed up parsing with new technique`
- `fix: Fix 9anime search`
- `refactor: Reformat code at 9anime.ts`
2 changes: 1 addition & 1 deletion dist/providers/comics/getComics.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ declare class getComics extends ComicParser {
readonly name = "GetComics";
readonly logo = "https://scontent-lga3-1.xx.fbcdn.net/v/t31.18172-8/10923821_1548503832063793_2041220008970231476_o.png?_nc_cat=102&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=aQyuLlPZtQAAX8dJviD&_nc_ht=scontent-lga3-1.xx&oh=00_AT_yPS4uuNDGirSqXnTwl2VGS9leFv4-Ujt7l6l5_FZeLw&oe=62D00D68";
readonly classPath = "COMICS.GetComics";
search: (query: string, page?: number) => Promise<ComicRes>;
search: (query: string, page?: number | undefined) => Promise<ComicRes>;
}
export default getComics;
2 changes: 1 addition & 1 deletion dist/providers/comics/getComics.js.map

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

Loading