Skip to content

Commit

Permalink
[refactor] transform HTML & MarkDown strings to JSX components based …
Browse files Browse the repository at this point in the history
…on DOM Renderer 2 (#2)
  • Loading branch information
TechQuery authored Sep 9, 2024
1 parent e5061e2 commit f2ca18a
Show file tree
Hide file tree
Showing 11 changed files with 700 additions and 495 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,33 @@ jobs:
Build-and-Publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: pnpm

- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Generate files
run: pnpm generate

- name: Deploy for Global
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./public
personal_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true
cname: polyfill.web-cell.dev

- name: Deploy for China mainland
uses: bacongobbler/azure-blob-storage-upload@v2.0.0
uses: bacongobbler/azure-blob-storage-upload@v3.0.0
with:
source_dir: ./public
container_name: $web
Expand Down
8 changes: 4 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Web polyfill

An automatic [CDN][1] service for [Web polyfills][2], which is based on [TypeScript][3], [Node.js][4] & [JSDelivr][5].
An automatic [CDN][1] service for [Web polyfills][2], which is based on [TypeScript][3], [Node.js][4] & [UnPkg][5].

[![CI & CD](https://github.com/EasyWebApp/Web-polyfill/actions/workflows/main.yml/badge.svg)][6]

## Usage example

1. Find a Web feature in the [Polyfill directory][7]
2. Copy the `class` name of the selected polyfill, then write it into a specific Script URL (shown below)
3. the above script will detect whether current environment needs to be patched, then load the polyfill script original from JSDelivr
3. the above script will detect whether current environment needs to be patched, then load the polyfill script original from UnPkg

### Web pages

Expand Down Expand Up @@ -71,12 +71,12 @@ LAN_HOST=https://polyfill.example.kp
[2]: https://remysharp.com/2010/10/08/what-is-a-polyfill
[3]: https://www.typescriptlang.org/
[4]: https://nodejs.org/
[5]: https://www.jsdelivr.com/
[5]: https://unpkg.com/
[6]: https://github.com/EasyWebApp/Web-polyfill/actions/workflows/main.yml
[7]: https://github.com/EasyWebApp/Web-polyfill/blob/master/source/list
[8]: https://github.com/EasyWebApp/Web-polyfill/issues/new?assignees=TechQuery&labels=package&template=package.yml
[9]: https://github.com/features/actions
[10]: https://github.com/EasyWebApp/Web-polyfill
[11]: https://github.com/EasyWebApp/Web-polyfill/blob/master/.github/workflows/main.yml#L27
[11]: https://github.com/EasyWebApp/Web-polyfill/blob/master/.github/workflows/main.yml#L31
[12]: https://pages.github.com/
[13]: https://kaiyuanshe.cn/
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "web-polyfill",
"version": "0.7.0",
"version": "0.8.0",
"license": "AGPL-3.0",
"author": "shiy2008@gmail.com",
"description": "An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & JSDelivr.",
"description": "An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & UnPkg.",
"keywords": [
"web",
"polyfill",
Expand All @@ -26,19 +26,22 @@
},
"dependencies": {
"@tech_query/node-toolkit": "^1.2.1",
"dom-renderer": "^2.3.0",
"dotenv": "^16.4.5",
"fs-extra": "^11.2.0",
"happy-dom": "^15.7.3",
"koapache": "^2.2.2",
"marked": "^13.0.3"
"marked": "^14.1.2",
"tslib": "^2.7.0"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/node": "^18.19.42",
"husky": "^9.1.4",
"lint-staged": "^15.2.7",
"@types/node": "^20.16.5",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"tsx": "^4.16.5",
"typescript": "~5.5.4"
"tsx": "^4.19.0",
"typescript": "~5.6.2"
},
"prettier": {
"singleQuote": true,
Expand All @@ -51,7 +54,7 @@
},
"scripts": {
"prepare": "husky",
"test": "lint-staged",
"test": "lint-staged && tsc --noEmit",
"generate": "rm -rf public/ && tsx source/",
"start": "web-server public/ -p 8080"
}
Expand Down
Loading

0 comments on commit f2ca18a

Please sign in to comment.