Skip to content

Commit

Permalink
feat: first blood, should just work
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jul 30, 2022
1 parent 267e372 commit 47b52d6
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": [
"@changesets/changelog-github",
{
"repo": "un-ts/lib-boilerplate"
"repo": "un-ts/ab64"
}
],
"commit": false,
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist
lib
CHANGELOG.md
/pnpm-lock.yaml
!/.github
!/.*.cjs
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"root": true,
"extends": "@1stg",
"overrides": [
{
"files": ".github/*.yml",
"rules": {
"unicorn/filename-case": "off"
}
},
{
"files": "docs/**/*.tsx",
"rules": {
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy GitHub Pages

on:
push:
branches:
- main

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

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

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

- name: Install Dependencies
run: pnpm i

- name: Build Docs
run: yarn docs:build

- name: Add misc files
run: |
touch dist/.nojekyll
echo ab64.js.org > dist/CNAME
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
with:
publish: pnpm release
version: pnpm run version
commit: 'chore: release lib-boilerplate'
title: 'chore: release lib-boilerplate'
commit: 'chore: release ab64'
title: 'chore: release ab64'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
# eslint-disable-next-line yml/no-empty-mapping-value
pull_request_target:

jobs:
Expand Down
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# lib-boilerplate
# ab64

[![GitHub Actions](https://github.com/un-ts/lib-boilerplate/workflows/CI/badge.svg)](https://github.com/un-ts/lib-boilerplate/actions/workflows/ci.yml)
[![Codecov](https://img.shields.io/codecov/c/github/un-ts/lib-boilerplate.svg)](https://codecov.io/gh/un-ts/lib-boilerplate)
[![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)
[![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)
[![npm](https://img.shields.io/npm/v/lib-boilerplate.svg)](https://www.npmjs.com/package/lib-boilerplate)
[![GitHub Release](https://img.shields.io/github/release/un-ts/lib-boilerplate)](https://github.com/un-ts/lib-boilerplate/releases)
[![GitHub Actions](https://github.com/un-ts/ab64/workflows/CI/badge.svg)](https://github.com/un-ts/ab64/actions/workflows/ci.yml)
[![Codecov](https://img.shields.io/codecov/c/github/un-ts/ab64.svg)](https://codecov.io/gh/un-ts/ab64)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/un-ts/ab64.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/un-ts/ab64/context:javascript)
[![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%2Fab64%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
[![npm](https://img.shields.io/npm/v/ab64.svg)](https://www.npmjs.com/package/ab64)
[![GitHub Release](https://img.shields.io/github/release/un-ts/ab64)](https://github.com/un-ts/ab64/releases)

[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/changesets/changesets)

A simple library boilerplate.
The smallest and fastest Base64 implementation in JavaScript

## TOC <!-- omit in toc -->

Expand All @@ -31,21 +31,35 @@ A simple library boilerplate.

```sh
# pnpm
pnpm add lib-boilerplate
pnpm add ab64

# yarn
yarn add lib-boilerplate
yarn add ab64

# npm
npm i lib-boilerplate
npm i ab64
```

### API

```js
import echo from 'lib-boilerplate'
import { decode, decodeUrl, encode, encodeUrl } from 'ab64'

echo()
encode('Hello World!') // SGVsbG8gV29ybGQh

encode('dankogai') // ZGFua29nYWk=
encodeUrl('dankogai') // ZGFua29nYWk

encode('小飼弾') // 5bCP6aO85by+
encodeUrl('小飼弾') // 5bCP6aO85by-

decode('SGVsbG8gV29ybGQh') // Hello World!

decode('ZGFua29nYWk=') // dankogai
decodeUrl('ZGFua29nYWk') // dankogai

decode('5bCP6aO85by+') // 小飼弾
decodeUrl('5bCP6aO85by-') // 小飼弾
```

## Sponsors
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lib-boilerplate-docs",
"name": "ab64-docs",
"type": "commonjs",
"description": "A simple library boilerplate."
"description": "The smallest and fastest Base64 implementation in JavaScript"
}
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "lib-boilerplate",
"version": "0.0.2",
"name": "ab64",
"version": "0.0.0",
"type": "module",
"description": "A simple library boilerplate.",
"repository": "git+https://github.com/un-ts/lib-boilerplate.git",
"description": "The smallest and fastest Base64 implementation in JavaScript",
"repository": "git+https://github.com/un-ts/ab64.git",
"author": "JounQin (https://www.1stG.me) <[email protected]>",
"donate": {
"recipients": [
Expand Down Expand Up @@ -62,10 +62,11 @@
"postversion": "pnpm i --no-frozen-lockfile",
"prepare": "simple-git-hooks",
"prerelease": "pnpm build",
"prevercel-build": "pnpm build",
"release": "changeset publish",
"serve": "sirv dist -s",
"test": "vitest run --coverage",
"test": "run-p test:*",
"test:browser": "vitest run --coverage",
"test:node": "cross-env TEST_ENV=node vitest run --coverage",
"typecov": "type-coverage",
"vercel-build": "pnpm docs:build",
"version": "changeset version"
Expand All @@ -87,8 +88,9 @@
"@types/react-dom": "^18.0.6",
"@types/web": "^0.0.70",
"c8": "^7.12.0",
"cross-env": "^7.0.3",
"edge-runtime": "1.1.0-beta.23",
"github-markdown-css": "^5.1.0",
"lib-boilerplate": "link:.",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.3.0",
Expand All @@ -104,14 +106,16 @@
"module": "./lib/index.js",
"exports": {
"types": "./lib/index.d.ts",
"browser": "./lib/browser.js",
"import": "./lib/index.js",
"require": "./lib/index.cjs"
},
"types": "./lib/index.d.ts"
},
"size-limit": [
{
"path": "lib/index.js"
"path": "lib/browser.js",
"limit": "280B"
}
],
"typeCoverage": {
Expand Down
77 changes: 75 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 47b52d6

Please sign in to comment.