Skip to content

Commit

Permalink
chore: init & import basic impl
Browse files Browse the repository at this point in the history
  • Loading branch information
magicdawn committed Aug 14, 2023
0 parents commit e6ad719
Show file tree
Hide file tree
Showing 18 changed files with 2,681 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules

lib
dist
19 changes: 19 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# root
root: true
parser: '@typescript-eslint/parser'
plugins: ['@typescript-eslint']

env:
mocha: true
node: true

extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/recommended'
- 'prettier'

rules:
'@typescript-eslint/ban-ts-comment': off
'@typescript-eslint/no-unused-vars': off
'@typescript-eslint/no-non-null-assertion': off
'@typescript-eslint/no-empty-function': 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
- pull_request

jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with: {version: 8}

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- run: pnpm install

# test
- run: pnpm test-cover

# test:report
- uses: codecov/codecov-action@v3
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
logs
*.log
.DS_Store

npm-debug.log*
node_modules

.nyc_output
coverage
coverage.*

# ts
**/*.tsbuildinfo
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules

lib
dist
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

## v0.0.1 2023-08-14

- first release
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 Magicdawn(magicdawn@qq.com)

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.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# @mgdn/bvid

> bilibili bvid
[![Build Status](https://img.shields.io/github/actions/workflow/status/magicdawn/@mgdn/bvid/ci.yml?style=flat-square&branch=main)](https://github.com/magicdawn/@mgdn/bvid/actions/workflows/ci.yml)
[![Coverage Status](https://img.shields.io/codecov/c/github/magicdawn/@mgdn/bvid.svg?style=flat-square)](https://codecov.io/gh/magicdawn/@mgdn/bvid)
[![npm version](https://img.shields.io/npm/v/@mgdn/bvid.svg?style=flat-square)](https://www.npmjs.com/package/@mgdn/bvid)
[![npm downloads](https://img.shields.io/npm/dm/@mgdn/bvid.svg?style=flat-square)](https://www.npmjs.com/package/@mgdn/bvid)
[![npm license](https://img.shields.io/npm/l/@mgdn/bvid.svg?style=flat-square)](http://magicdawn.mit-license.org)

## Install

```sh
$ pnpm add @mgdn/bvid
```

## API

```js
const mgdnBvid = require('@mgdn/bvid');
```

## Changelog

[CHANGELOG.md](CHANGELOG.md)

## License

the MIT License http://magicdawn.mit-license.org
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@mgdn/bvid",
"version": "0.0.1",
"description": "bilibili bvid",
"main": "index.js",
"scripts": {
"test": "vitest run",
"prepare": "husky install",
"test:dev": "vitest",
"test-cover": "vitest run --coverage",
"dev": "tsup --watch",
"build": "tsup"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/magicdawn/bvid.git"
},
"keywords": [
"bvid",
"bilibili"
],
"author": "magicdawn",
"license": "MIT",
"bugs": {
"url": "https://github.com/magicdawn/bvid/issues"
},
"homepage": "https://github.com/magicdawn/bvid#readme",
"devDependencies": {
"@magicdawn/prettier-config": "^0.0.2",
"@swc/core": "^1.3.76",
"@types/node": "^20.5.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@vitest/coverage-v8": "^0.34.1",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"husky": "^8.0.3",
"lint-staged": "^14.0.0",
"prettier": "^3.0.1",
"tsup": "^7.2.0",
"typescript": "^5.1.6",
"vitest": "^0.34.1"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,less,md}": [
"prettier --write"
]
}
}

0 comments on commit e6ad719

Please sign in to comment.