Skip to content

Commit 0c6f33c

Browse files
authored
Initial commit
0 parents  commit 0c6f33c

16 files changed

+4847
-0
lines changed

.eslintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@antfu"
3+
}

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [antfu]

.github/workflows/ci.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@v2
20+
21+
- name: Set node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18.x
25+
cache: pnpm
26+
27+
- name: Setup
28+
run: npm i -g @antfu/ni
29+
30+
- name: Install
31+
run: nci
32+
33+
- name: Lint
34+
run: nr lint
35+
36+
typecheck:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
41+
- name: Install pnpm
42+
uses: pnpm/action-setup@v2
43+
44+
- name: Set node
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: 18.x
48+
cache: pnpm
49+
50+
- name: Setup
51+
run: npm i -g @antfu/ni
52+
53+
- name: Install
54+
run: nci
55+
56+
- name: Typecheck
57+
run: nr typecheck
58+
59+
test:
60+
runs-on: ${{ matrix.os }}
61+
62+
strategy:
63+
matrix:
64+
node: [16.x, 18.x]
65+
os: [ubuntu-latest, windows-latest, macos-latest]
66+
fail-fast: false
67+
68+
steps:
69+
- uses: actions/checkout@v3
70+
71+
- name: Install pnpm
72+
uses: pnpm/action-setup@v2
73+
74+
- name: Set node ${{ matrix.node }}
75+
uses: actions/setup-node@v3
76+
with:
77+
node-version: ${{ matrix.node }}
78+
cache: pnpm
79+
80+
- name: Setup
81+
run: npm i -g @antfu/ni
82+
83+
- name: Install
84+
run: nci
85+
86+
- name: Build
87+
run: nr build
88+
89+
- name: Test
90+
run: nr test

.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v2
21+
22+
- name: Set node
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: 18.x
26+
cache: pnpm
27+
28+
- run: npx changelogithub
29+
env:
30+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.cache
2+
.DS_Store
3+
.idea
4+
*.log
5+
*.tgz
6+
coverage
7+
dist
8+
lib-cov
9+
logs
10+
node_modules
11+
temp

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore-workspace-root-check=true

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please refer to https://github.com/antfu/contribute

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Anthony Fu <https://github.com/antfu>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# pkg-name
2+
3+
[![NPM version](https://img.shields.io/npm/v/pkg-name?color=a1b858&label=)](https://www.npmjs.com/package/pkg-name)
4+
5+
## Sponsors
6+
7+
<p align="center">
8+
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
9+
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
10+
</a>
11+
</p>
12+
13+
## License
14+
15+
[MIT](./LICENSE) License © 2022 [Anthony Fu](https://github.com/antfu)

build.config.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: [
5+
'src/index',
6+
],
7+
declaration: true,
8+
clean: true,
9+
rollup: {
10+
emitCJS: true,
11+
},
12+
})

package.json

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"name": "pkg-name",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"packageManager": "[email protected]",
6+
"description": "",
7+
"author": "Anthony Fu <[email protected]>",
8+
"license": "MIT",
9+
"funding": "https://github.com/sponsors/antfu",
10+
"homepage": "https://github.com/antfu/pkg-name#readme",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/antfu/pkg-name.git"
14+
},
15+
"bugs": "https://github.com/antfu/pkg-name/issues",
16+
"keywords": [],
17+
"sideEffects": false,
18+
"exports": {
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"require": "./dist/index.cjs",
22+
"import": "./dist/index.mjs"
23+
}
24+
},
25+
"main": "./dist/index.mjs",
26+
"module": "./dist/index.mjs",
27+
"types": "./dist/index.d.ts",
28+
"typesVersions": {
29+
"*": {
30+
"*": [
31+
"./dist/*",
32+
"./dist/index.d.ts"
33+
]
34+
}
35+
},
36+
"files": [
37+
"dist"
38+
],
39+
"scripts": {
40+
"build": "unbuild",
41+
"dev": "unbuild --stub",
42+
"lint": "eslint .",
43+
"prepublishOnly": "nr build",
44+
"release": "bumpp && npm publish",
45+
"start": "esno src/index.ts",
46+
"test": "vitest",
47+
"typecheck": "tsc --noEmit"
48+
},
49+
"devDependencies": {
50+
"@antfu/eslint-config": "^0.39.4",
51+
"@antfu/ni": "^0.21.3",
52+
"@antfu/utils": "^0.7.4",
53+
"@types/node": "^18.16.16",
54+
"bumpp": "^9.1.0",
55+
"eslint": "^8.41.0",
56+
"esno": "^0.16.3",
57+
"lint-staged": "^13.2.2",
58+
"pnpm": "^8.6.0",
59+
"rimraf": "^5.0.1",
60+
"simple-git-hooks": "^2.8.1",
61+
"typescript": "^5.0.4",
62+
"unbuild": "^1.2.1",
63+
"vite": "^4.3.9",
64+
"vitest": "^0.31.3"
65+
},
66+
"simple-git-hooks": {
67+
"pre-commit": "pnpm lint-staged"
68+
},
69+
"lint-staged": {
70+
"*": "eslint --fix"
71+
}
72+
}

0 commit comments

Comments
 (0)