Skip to content

Commit 40510d6

Browse files
committed
Initial commit
0 parents  commit 40510d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+17962
-0
lines changed

.browserslistrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends @1stg/browserslist-config/modern

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "un-ts/lib-boilerplate"
7+
}
8+
],
9+
"commit": false,
10+
"linked": [],
11+
"access": "public",
12+
"baseBranch": "main",
13+
"updateInternalDependencies": "patch",
14+
"ignore": []
15+
}

.codesandbox/ci.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"node": "16",
3+
"installCommand": "codesandbox:install",
4+
"sandboxes": []
5+
}

.commitlintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@1stg"
3+
}

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage
2+
dist
3+
lib
4+
CHANGELOG.md
5+
/pnpm-lock.yaml
6+
!/.*.cjs

.eslintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"root": true,
3+
"extends": "@1stg",
4+
"overrides": [
5+
{
6+
"files": "docs/**/*.tsx",
7+
"rules": {
8+
"react/react-in-jsx-scope": "off"
9+
}
10+
}
11+
]
12+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto eol=lf
2+
pnpm-lock.yaml -diff

.github/FUNDING.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
github:
2+
- JounQin
3+
- 1stG
4+
- rxts
5+
- unts
6+
patreon: 1stG
7+
open_collective: unts
8+
custom:
9+
- https://opencollective.com/1stG
10+
- https://opencollective.com/rxts
11+
- https://afdian.net/@JounQin

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
ci:
9+
name: Lint and Test with Node.js ${{ matrix.node }} on ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
node:
13+
- 14
14+
- 16
15+
- 18
16+
os:
17+
- macos-latest
18+
- windows-latest
19+
- ubuntu-latest
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout Repo
23+
uses: actions/checkout@v3
24+
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@v2
27+
with:
28+
version: latest
29+
30+
- name: Setup Node.js ${{ matrix.node }}
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.node }}
34+
cache: pnpm
35+
36+
- name: Install Dependencies
37+
run: pnpm i
38+
39+
- name: Build, Lint and Test
40+
run: pnpm run-s build lint test
41+
env:
42+
EFF_NO_LINK_RULES: true
43+
PARSER_NO_WATCH: true
44+
45+
- name: Codecov
46+
uses: codecov/codecov-action@v3

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v3
15+
with:
16+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
17+
fetch-depth: 0
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v2
21+
with:
22+
version: latest
23+
24+
- name: Setup Node.js 16
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 16
28+
cache: pnpm
29+
30+
- name: Install Dependencies
31+
run: pnpm i
32+
33+
- name: Create Release Pull Request or Publish to npm
34+
uses: changesets/action@v1
35+
with:
36+
publish: pnpm release
37+
version: pnpm run version
38+
commit: 'chore: release lib-boilerplate'
39+
title: 'chore: release lib-boilerplate'
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/size-limit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Size Limit
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- main
7+
8+
jobs:
9+
size-limit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Setup pnpm
15+
uses: pnpm/action-setup@v2
16+
with:
17+
version: latest
18+
19+
- name: Setup Node.js 16
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
cache: pnpm
24+
25+
- name: Install Dependencies
26+
run: pnpm i
27+
28+
- uses: andresz1/size-limit-action@v1
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
skip_step: install
32+
script: pnpm size-limit --json

.github/workflows/vercel.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Vercel Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request_target:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Check Branch
16+
id: branch
17+
if: ${{ github.ref == 'refs/heads/main' }}
18+
run: |
19+
echo "::set-output name=args::--prod"
20+
echo "::set-output name=comment::false"
21+
22+
- name: Deploy
23+
uses: amondnet/vercel-action@v25
24+
with:
25+
vercel-args: ${{ steps.branch.outputs.args }}
26+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
27+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
28+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
29+
github-comment: ${{ steps.branch.outputs.comment != 'false' }}
30+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.*cache
2+
.type-coverage
3+
.vercel
4+
coverage
5+
dist
6+
lib
7+
node_modules

.lintstagedrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@1stg/lint-staged/tsc')

.npmrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
auto-install-peers=true
2+
enable-pre-post-scripts=true
3+
public-hoist-pattern[]=@1stg/*
4+
public-hoist-pattern[]=@commitlint/*
5+
public-hoist-pattern[]=@pkgr/*
6+
public-hoist-pattern[]=@types/*
7+
public-hoist-pattern[]=core-js
8+
public-hoist-pattern[]=*eslint*
9+
public-hoist-pattern[]=*/loader
10+
public-hoist-pattern[]=*-loader
11+
public-hoist-pattern[]=lint-staged
12+
public-hoist-pattern[]=npm-run-all
13+
public-hoist-pattern[]=*prettier*
14+
public-hoist-pattern[]=simple-git-hooks
15+
public-hoist-pattern[]=*stylelint*
16+
strict-peer-dependencies=false

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage
2+
dist
3+
/pnpm-lock.yaml

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@1stg/prettier-config"

.remarkrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"plugins": [
3+
"@1stg/remark-config"
4+
]
5+
}

.renovaterc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@1stg"
4+
]
5+
}

.simple-git-hooks.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@1stg/simple-git-hooks')

.stylelintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
coverage
2+
dist
3+
lib
4+
LICENSE
5+
*.json
6+
*.log
7+
*.patch
8+
*.yaml
9+
*.yml

.stylelintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@1stg/stylelint-config"
3+
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Change Log

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021-present UnTS
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

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# lib-boilerplate
2+
3+
[![GitHub Actions](https://github.com/un-ts/lib-boilerplate/workflows/CI/badge.svg)](https://github.com/un-ts/lib-boilerplate/actions/workflows/ci.yml)
4+
[![Codecov](https://img.shields.io/codecov/c/github/un-ts/lib-boilerplate.svg)](https://codecov.io/gh/un-ts/lib-boilerplate)
5+
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/un-ts/lib-boilerplate.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/un-ts/lib-boilerplate/context:javascript)
6+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Flib-boilerplate%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
7+
[![npm](https://img.shields.io/npm/v/lib-boilerplate.svg)](https://www.npmjs.com/package/lib-boilerplate)
8+
[![GitHub Release](https://img.shields.io/github/release/un-ts/lib-boilerplate)](https://github.com/un-ts/lib-boilerplate/releases)
9+
10+
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
11+
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
12+
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
13+
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
14+
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/changesets/changesets)
15+
16+
A simple library boilerplate.
17+
18+
## TOC <!-- omit in toc -->
19+
20+
- [Usage](#usage)
21+
- [Install](#install)
22+
- [API](#api)
23+
- [Sponsors](#sponsors)
24+
- [Backers](#backers)
25+
- [Changelog](#changelog)
26+
- [License](#license)
27+
28+
## Usage
29+
30+
### Install
31+
32+
```sh
33+
# pnpm
34+
pnpm add lib-boilerplate
35+
36+
# yarn
37+
yarn add lib-boilerplate
38+
39+
# npm
40+
npm i lib-boilerplate
41+
```
42+
43+
### API
44+
45+
```js
46+
import echo from 'lib-boilerplate'
47+
48+
echo()
49+
```
50+
51+
## Sponsors
52+
53+
| 1stG | RxTS | UnTS |
54+
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
55+
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) |
56+
57+
## Backers
58+
59+
| 1stG | RxTS | UnTS |
60+
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
61+
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |
62+
63+
## Changelog
64+
65+
Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).
66+
67+
## License
68+
69+
[MIT][] © [JounQin][]@[1stG.me][]
70+
71+
[1stg.me]: https://www.1stg.me
72+
[jounqin]: https://GitHub.com/JounQin
73+
[mit]: http://opensource.org/licenses/MIT

0 commit comments

Comments
 (0)