Skip to content

Commit 244858a

Browse files
committed
feat: first blood, should just work
1 parent c19fa56 commit 244858a

22 files changed

Lines changed: 2534 additions & 2832 deletions

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"changelog": [
44
"@changesets/changelog-github",
55
{
6-
"repo": "un-ts/lib-boilerplate"
6+
"repo": "un-ts/domiso"
77
}
88
],
99
"commit": false,

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ dist
33
lib
44
CHANGELOG.md
55
/pnpm-lock.yaml
6+
!/.github
67
!/.*.cjs

.eslintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
{
22
"root": true,
33
"extends": "@1stg",
4+
"rules": {
5+
"unicorn/template-indent": "off"
6+
},
47
"overrides": [
8+
{
9+
"files": ".github/*.yml",
10+
"rules": {
11+
"unicorn/filename-case": "off"
12+
}
13+
},
514
{
615
"files": "docs/**/*.tsx",
716
"rules": {

.github/workflows/pkg-size.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout Repo
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515
with:
1616
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1717
fetch-depth: 0
@@ -35,8 +35,8 @@ jobs:
3535
with:
3636
publish: pnpm release
3737
version: pnpm run version
38-
commit: 'chore: release lib-boilerplate'
39-
title: 'chore: release lib-boilerplate'
38+
commit: 'chore: release domiso'
39+
title: 'chore: release domiso'
4040
env:
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242
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:
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
# eslint-disable-next-line yml/no-empty-mapping-value
78
pull_request:
89

910
jobs:

.npmrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@ auto-install-peers=true
22
enable-pre-post-scripts=true
33
public-hoist-pattern[]=@1stg/*
44
public-hoist-pattern[]=@commitlint/*
5-
public-hoist-pattern[]=@jest/types
65
public-hoist-pattern[]=@pkgr/*
76
public-hoist-pattern[]=@types/*
8-
public-hoist-pattern[]=cross-env
97
public-hoist-pattern[]=core-js
108
public-hoist-pattern[]=*eslint*
119
public-hoist-pattern[]=*/loader
1210
public-hoist-pattern[]=*-loader
13-
public-hoist-pattern[]=jest
1411
public-hoist-pattern[]=lint-staged
1512
public-hoist-pattern[]=npm-run-all
1613
public-hoist-pattern[]=*prettier*
1714
public-hoist-pattern[]=simple-git-hooks
1815
public-hoist-pattern[]=*stylelint*
19-
public-hoist-pattern[]=tslib
2016
strict-peer-dependencies=false

.stylelintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ lib
44
LICENSE
55
*.json
66
*.log
7+
*.patch
78
*.yaml
89
*.yml

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# lib-boilerplate
1+
# domiso
22

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

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

16-
A simple library boilerplate.
16+
Dom sanitizer based on browser native DOMParser
1717

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

@@ -31,21 +31,22 @@ A simple library boilerplate.
3131

3232
```sh
3333
# pnpm
34-
pnpm add lib-boilerplate
34+
pnpm add domiso
3535

3636
# yarn
37-
yarn add lib-boilerplate
37+
yarn add domiso
3838

3939
# npm
40-
npm i lib-boilerplate
40+
npm i domiso
4141
```
4242

4343
### API
4444

4545
```js
46-
import echo from 'lib-boilerplate'
46+
import { sanitize, sanitizeSvg } from 'domiso'
4747

48-
echo()
48+
sanitize(`<!-- HTML content -->`)
49+
sanitizeSvg(`<svg>SVG content</svg>`)
4950
```
5051

5152
## Sponsors

0 commit comments

Comments
 (0)