Skip to content

Commit cc4b376

Browse files
committed
[add] Prototype version & Project scaffold
0 parents  commit cc4b376

File tree

12 files changed

+3209
-0
lines changed

12 files changed

+3209
-0
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
custom:
2+
- https://paypal.me/TechQuery
3+
- https://tech-query.me/image/TechQuery-Alipay.jpg

.github/workflows/main.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI & CD
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
Build-and-Publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- uses: pnpm/action-setup@v2
13+
with:
14+
version: 8
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
registry-url: https://registry.npmjs.org
19+
cache: pnpm
20+
- name: Install Dependencies
21+
run: pnpm i --frozen-lockfile
22+
23+
- name: Build & Publish
24+
run: npm publish
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27+
28+
- name: Update document
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
publish_dir: ./docs
32+
personal_token: ${{ secrets.GITHUB_TOKEN }}
33+
force_orphan: true

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
package-lock.json
3+
yarn.lock
4+
.parcel-cache/
5+
dist/
6+
docs/

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm test

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm run build

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.parcel-cache/
2+
docs/
3+
.husky/
4+
.github/

ReadMe.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# DOM Renderer
2+
3+
A light-weight DOM Renderer supports [Web components][1] standard & [TypeScript][2] language.
4+
5+
[![CI & CD](https://github.com/EasyWebApp/DOM-Renderer/actions/workflows/main.yml/badge.svg)][3]
6+
7+
[![Open in GitPod](https://img.shields.io/badge/GitPod-dev--now-blue?logo=gitpod)][4]
8+
9+
[![NPM](https://nodei.co/npm/dom-renderer.png?downloads=true&downloadRank=true&stars=true)][5]
10+
11+
## Usage
12+
13+
### JavaScript
14+
15+
```js
16+
import { DOMRenderer } from 'dom-renderer';
17+
18+
const newVNode = new DOMRenderer().patch(
19+
{
20+
tagName: 'body',
21+
node: document.body
22+
},
23+
{
24+
tagName: 'body',
25+
children: [
26+
{
27+
tagName: 'a',
28+
props: { href: 'https://idea2.app/' },
29+
style: { color: 'red' },
30+
children: [{ text: 'idea2app' }]
31+
}
32+
]
33+
}
34+
);
35+
36+
console.log(newVNode);
37+
```
38+
39+
## Original
40+
41+
### Inspiration
42+
43+
[![SnabbDOM](https://github.com/snabbdom.png)][6]
44+
45+
### Prototype
46+
47+
[![Edit DOM renderer](https://codesandbox.io/static/img/play-codesandbox.svg)][7]
48+
49+
[1]: https://www.webcomponents.org/
50+
[2]: https://www.typescriptlang.org/
51+
[3]: https://github.com/EasyWebApp/DOM-Renderer/actions/workflows/main.yml
52+
[4]: https://gitpod.io/#https://github.com/EasyWebApp/DOM-Renderer
53+
[5]: https://nodei.co/npm/dom-renderer/
54+
[6]: https://github.com/snabbdom/snabbdom
55+
[7]: https://codesandbox.io/s/dom-renderer-pglxkx?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Findex.ts&theme=dark

package.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "dom-renderer",
3+
"version": "2.0.0-alpha.0",
4+
"license": "LGPL-3.0-or-later",
5+
"author": "[email protected]",
6+
"description": "A light-weight DOM Renderer supports Web components standard & TypeScript language",
7+
"keywords": [
8+
"light-weight",
9+
"dom",
10+
"render",
11+
"web",
12+
"component",
13+
"typescript"
14+
],
15+
"homepage": "https://web-cell.dev/DOM-Renderer/",
16+
"repository": {
17+
"type": "git",
18+
"url": "git+https://github.com/EasyWebApp/DOM-Renderer.git"
19+
},
20+
"bugs": {
21+
"url": "https://github.com/EasyWebApp/DOM-Renderer/issues"
22+
},
23+
"source": "source/index.ts",
24+
"types": "dist/index.d.ts",
25+
"module": "dist/index.esm.js",
26+
"main": "dist/index.js",
27+
"dependencies": {
28+
"@swc/helpers": "~0.4.14",
29+
"web-utility": "^4.1.0"
30+
},
31+
"devDependencies": {
32+
"@parcel/packager-ts": "~2.8.3",
33+
"@parcel/transformer-typescript-types": "~2.8.3",
34+
"husky": "^8.0.3",
35+
"lint-staged": "^13.2.3",
36+
"open-cli": "^7.2.0",
37+
"parcel": "~2.8.3",
38+
"prettier": "^3.0.0",
39+
"typedoc": "^0.24.8",
40+
"typedoc-plugin-mdn-links": "^3.0.3",
41+
"typescript": "~5.1.6"
42+
},
43+
"prettier": {
44+
"singleQuote": true,
45+
"trailingComma": "none",
46+
"arrowParens": "avoid",
47+
"tabWidth": 4
48+
},
49+
"lint-staged": {
50+
"*.{md,json,yml,ts}": "prettier --write"
51+
},
52+
"browserslist": "> 0.5%, last 2 versions, not dead, IE 11",
53+
"targets": {
54+
"main": {
55+
"optimize": true
56+
}
57+
},
58+
"scripts": {
59+
"prepare": "husky install",
60+
"test": "lint-staged",
61+
"build": "rm -rf dist/ docs/ && typedoc source/ && parcel build",
62+
"start": "typedoc source/ && open-cli docs/index.html",
63+
"prepublishOnly": "npm test && npm run build"
64+
}
65+
}

0 commit comments

Comments
 (0)