Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
baozouai committed Jul 2, 2023
0 parents commit 79896b1
Show file tree
Hide file tree
Showing 21 changed files with 5,314 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
target: 95%
patch:
default:
target: 95%
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.md
test
vitest.config.ts
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

module.exports = {
extends: '@antfu',
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'off',
},
}
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint

typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [16.x, 18.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Test
run: nr test --run --coverage

- name: Build
run: nr build

# - name: Upload coverage report to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: coverage/lcov.info
# fail_ci_if_error: true
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'

- name: ChangeLog
run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Release
run: nr release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
.idea
.vscode
npm-debug.log
yarn-error.log
.stylelintcache
.eslintcache
node_modules
dist
coverage/
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

lint-staged
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry = http://registry.npmjs.org
auto-install-peers=false
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.14
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 暴走老七

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.
65 changes: 65 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

<p align="center">
<h1 align="center">template</h1>
</p>

<div align="center">

[![NPM version][npm-image]][npm-url] ![NPM downloads][download-image]

![Test][test-badge] ![codecov][codecov-badge]


[npm-image]: https://img.shields.io/npm/v/template.svg?style=flat-square
[npm-url]: http://npmjs.org/package/template


[download-image]: https://img.shields.io/npm/dm/template.svg?style=flat-square



[test-badge]: https://github.com/baozouai/template/actions/workflows/test.yml/badge.svg

[codecov-badge]: https://codecov.io/github/baozouai/template/branch/master/graph/badge.svg


</div>


中文 | [英文](./README.md)

## 关于

一个模板

eg:


```ts

```

加插件后:
```ts

```


## 📦 安装

```sh
pnpm add template -D
# or
yarn add template -D
# or
npm i template -D
```

## 🔨 使用

```js

```
## 📄 License

template is [MIT licensed](./LICENSE).
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

<p align="center">
<h1 align="center">template</h1>
</p>

<div align="center">


[![NPM version][npm-image]][npm-url] ![NPM downloads][download-image]

![Test][test-badge] ![codecov][codecov-badge]


[npm-image]: https://img.shields.io/npm/v/template.svg?style=flat-square
[npm-url]: http://npmjs.org/package/template


[download-image]: https://img.shields.io/npm/dm/template.svg?style=flat-square



[test-badge]: https://github.com/baozouai/template/actions/workflows/ci.yml/badge.svg

[codecov-badge]: https://codecov.io/github/baozouai/template/branch/master/graph/badge.svg

</div>

English | [中文](./README-zh_CN.md)
## About

this is a template


## Options

```ts

```
eg:


```ts

```


```ts

```


## 📦 Install

```sh
pnpm add template -D
# or
yarn add template -D
# or
npm i template -D
```

## 🔨 Usage

```js

```
## 📄 License

template is [MIT licensed](./LICENSE).
4 changes: 4 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: ['@commitlint/config-conventional'], // 检测规则
rules: {},
}
Loading

0 comments on commit 79896b1

Please sign in to comment.