-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bac3c1
commit cf1b35c
Showing
23 changed files
with
3,329 additions
and
12,537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"reporter": ["text", "lcov"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,50 @@ | ||
name: Release | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- next | ||
- main | ||
- beta | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
|
||
jobs: | ||
release: | ||
name: CD | ||
runs-on: ubuntu-18.04 | ||
build: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- name: Installing dependencies | ||
run: npm i | ||
- name: Lint | ||
run: npm run lint | ||
- name: Test | ||
run: npm run test | ||
- name: Release | ||
node-version: 14 | ||
|
||
# pnpm stuff | ||
- name: pnpm — install | ||
run: npm i pnpm@latest -g | ||
- name: pnpm - config | ||
run: pnpm config set store-dir $PNPM_CACHE_FOLDER | ||
- name: pnpm - install | ||
run: pnpm install | ||
|
||
# build | ||
- name: lint | ||
run: pnpm lint | ||
- name: build | ||
run: pnpm build # bae — before everything else | ||
- name: test | ||
run: pnpm t | ||
|
||
- name: coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# release | ||
- name: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release | ||
run: pnpm exec semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,49 @@ | ||
name: Lint & Test | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
|
||
jobs: | ||
build: | ||
name: CI | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- name: Installing dependencies | ||
run: npm i | ||
- name: Lint | ||
run: npm run lint | ||
- name: Test | ||
run: npm run test | ||
- name: Release | ||
node-version: 14 | ||
|
||
# pnpm stuff | ||
- name: pnpm — install | ||
run: npm i pnpm@latest -g | ||
- name: pnpm - config | ||
run: pnpm config set store-dir $PNPM_CACHE_FOLDER | ||
- name: pnpm - install | ||
run: pnpm install | ||
|
||
# build | ||
- name: lint | ||
run: pnpm lint | ||
- name: build | ||
run: pnpm build # bae — before everything else | ||
- name: test | ||
run: pnpm t | ||
|
||
- name: coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# release | ||
- name: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release -d | ||
run: pnpm exec semantic-release -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.DS_Store | ||
*.map | ||
node_modules/ | ||
dist | ||
.nyc_output | ||
.pnpm* | ||
coverage | ||
|
||
# built files | ||
index.js | ||
index.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
pnpm exec commitlint --edit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
pnpm t && pnpm run format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/bench | ||
/lib | ||
.c8rc | ||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
commitlint.config.js | ||
release.config.js | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
node_modules | ||
bench | ||
demo | ||
fixtures | ||
test/fixtures | ||
dist | ||
build | ||
.nyc_output | ||
coverage | ||
pnpm-lock.yaml | ||
.pnpm* | ||
.changeset | ||
|
||
index.js | ||
index.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"tabWidth": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,68 @@ | ||
const aliases = { | ||
className: 'class', | ||
htmlFor: 'for' | ||
} | ||
|
||
const voids = [ | ||
'area', | ||
'base', | ||
'br', | ||
'col', | ||
'embed', | ||
'hr', | ||
'img', | ||
'input', | ||
'link', | ||
'meta', | ||
'param', | ||
'source', | ||
'track', | ||
'wbr' | ||
] | ||
|
||
function styleObjectToString (style) { | ||
let s = '' | ||
|
||
for (const p in style) { | ||
const k = p.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase() | ||
s += k + ':' + style[p] + ';' | ||
var c = Object.defineProperty, | ||
k = Object.defineProperties, | ||
N = Object.getOwnPropertyDescriptor, | ||
S = Object.getOwnPropertyDescriptors, | ||
g = Object.getOwnPropertyNames, | ||
y = Object.getOwnPropertySymbols | ||
var a = Object.prototype.hasOwnProperty, | ||
T = Object.prototype.propertyIsEnumerable | ||
var h = (t, e, o) => (e in t ? c(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : (t[e] = o)), | ||
u = (t, e) => { | ||
for (var o in e || (e = {})) a.call(e, o) && h(t, o, e[o]) | ||
if (y) for (var o of y(e)) T.call(e, o) && h(t, o, e[o]) | ||
return t | ||
}, | ||
d = (t, e) => k(t, S(e)), | ||
C = (t) => c(t, '__esModule', { value: !0 }) | ||
var H = (t, e) => { | ||
for (var o in e) c(t, o, { get: e[o], enumerable: !0 }) | ||
}, | ||
P = (t, e, o, i) => { | ||
if ((e && typeof e == 'object') || typeof e == 'function') | ||
for (let r of g(e)) | ||
!a.call(t, r) && | ||
(o || r !== 'default') && | ||
c(t, r, { get: () => e[r], enumerable: !(i = N(e, r)) || i.enumerable }) | ||
return t | ||
} | ||
|
||
return s | ||
var x = ( | ||
(t) => (e, o) => | ||
(t && t.get(e)) || ((o = P(C({}), e, 1)), t && t.set(e, o), o) | ||
)(typeof WeakMap != 'undefined' ? new WeakMap() : 0) | ||
var v = {} | ||
H(v, { h: () => w, styleObjectToString: () => m }) | ||
var $ = { className: 'class', htmlFor: 'for' }, | ||
j = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'] | ||
function m(t) { | ||
let e = '' | ||
for (let o in t) e += o.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase() + ':' + t[o] + ';' | ||
return e | ||
} | ||
|
||
function h (t, props, ...children) { | ||
if (t.children) return t.children.join('') | ||
|
||
props = props || {} | ||
|
||
const c = [] | ||
|
||
children = children.length ? children : props.children || [] | ||
|
||
while (children.length) { | ||
const child = children.shift() | ||
if (child) { | ||
child.pop ? children.push(...child) : c.push(child) | ||
} | ||
function w(t, e, ...o) { | ||
if (typeof t == 'object' && t.children) return t.children.join('') | ||
e = e || {} | ||
let i = [] | ||
for (o = o.length ? o : e.children || []; o.length; ) { | ||
let n = o.shift() | ||
!n || (typeof n == 'string' ? i.push(n) : o.push(...n)) | ||
} | ||
|
||
if (t.call) return t({ ...props, children: c }) | ||
|
||
let attrs = '' | ||
|
||
for (const k in props) { | ||
if (k === 'children') continue | ||
|
||
let v = props[k] | ||
const key = aliases[k] || k | ||
|
||
if (typeof v === 'boolean') { | ||
attrs += `${key}` | ||
if (typeof t == 'function') return t(d(u({}, e), { children: i })) | ||
let r = '' | ||
for (let n of Object.keys(e)) { | ||
if (n === 'children') continue | ||
let s = e[n], | ||
f = $[n] || n | ||
if (typeof s == 'boolean') { | ||
r += `${f}` | ||
continue | ||
} | ||
|
||
if (k === 'style') v = styleObjectToString(v) | ||
|
||
attrs += `${key}="${v}"` | ||
} | ||
|
||
const a = attrs ? ' ' + attrs : '' | ||
const v = voids.indexOf(t) > -1 | ||
|
||
let childs = '' | ||
|
||
while (c.length) { | ||
childs += c.shift() | ||
n === 'style' && (s = m(s)), (r += `${f}="${s}"`) | ||
} | ||
|
||
return v ? '<' + t + a + ' />' : '<' + t + a + '>' + childs + '</' + t + '>' | ||
let p = r ? ' ' + r : '', | ||
b = j.indexOf(t) > -1, | ||
l = '' | ||
for (; i.length; ) l += i.shift() | ||
return b ? '<' + t + p + ' />' : '<' + t + p + '>' + l + '</' + t + '>' | ||
} | ||
|
||
module.exports = { h, styleObjectToString } | ||
module.exports = x(v) | ||
0 && (module.exports = { h, styleObjectToString }) |
Oops, something went wrong.