Skip to content

Commit

Permalink
Initial commit for github-readme-packagist-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
agonyz committed Jul 11, 2023
0 parents commit 40ca02e
Show file tree
Hide file tree
Showing 19 changed files with 6,727 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-var-requires": "off"
}
}
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci

- name: Format with Prettier
run: npm run format

- name: Lint with ESLint
run: npm run lint
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
node_modules/
.idea
.vercel
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"semi": true
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 agonyz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## GitHub Readme Packagist Stats
Get dynamically generated stats for your top packagist bundles

## Features
- [Top bundles](#top-bundles)
- [By vendor](#by-vendor)
- [By maintainer](#by-maintainer)
- [Caching](#caching)

## Top bundles
### By vendor
- Retrieves the top bundles for the given vendor
- How to use:
- https://github-readme-packagist-stats.vercel.app/api/packagist/card?vendor={your-packagist-user}
- Example:
```markdown
![Packagist Top Bundles](https://github-readme-packagist-stats.vercel.app/api/packagist/card?vendor=agonyz)
```
![Packagist Top Bundles](https://github-readme-packagist-stats.vercel.app/api/packagist/card?vendor=agonyz)

### By maintainer
- Retrieves the top bundles for the given maintainer from the given vendor
- How to use:
- https://github-readme-packagist-stats.vercel.app/api/packagist/card?vendor={your-example-organization}&maintainer={your-packagist-user}
- Example:
```markdown
![Packagist Top Bundles](https://github-readme-packagist-stats.vercel.app/api/packagist/card?vendor={your-example-organization}&maintainer={your-packagist-user})
```

## Caching
- In order to not overuse the packagist api a cache time of `12 hours` was implemented.
Loading

0 comments on commit 40ca02e

Please sign in to comment.