Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 34 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,44 @@ on:
jobs:
Build-and-Deploy:
runs-on: ubuntu-latest
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
node-version: '14'
- name: Install & build
run: |
npm install
npm run build
- name: Deploy
version: 8
- uses: actions/setup-node@v3
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
run: pnpm i --frozen-lockfile

- name: Build Production
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
run: pnpm build

- name: Deploy Production
uses: peaceiris/actions-gh-pages@v3
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
publish_dir: ./dist
cname: material.web-cell.dev
personal_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./
vercel-args: --prod
27 changes: 27 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pull Request
on:
push:
branches-ignore:
- master
jobs:
Build-and-Deploy:
runs-on: ubuntu-latest
permissions:
contents: write
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- uses: actions/checkout@v4
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ node_modules/
package-lock.json
yarn.lock
dist/
.cache/
.vscode/
.parcel-cache/
.vscode/
.vercel/
4 changes: 0 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"

npm test
4 changes: 0 additions & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"

npm run build
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers = false
8 changes: 8 additions & 0 deletions .parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.{ts,tsx}": [
"@parcel/transformer-typescript-tsc"
]
}
}
6 changes: 2 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Official **Document site** of [Material Web Components][1] wrapper
based on [WebCell][2], [BootCell][3], [Material Cell][4] & [MarkCell][5]

[![NPM Dependency](https://david-dm.org/EasyWebApp/material-cell-document.svg)][6]
[![CI & CD](https://github.com/EasyWebApp/material-cell-document/workflows/CI%20&%20CD/badge.svg)][7]
[![CI & CD](https://github.com/EasyWebApp/material-cell-document/actions/workflows/main.yml/badge.svg)][7]

[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)][8]

Expand All @@ -13,6 +12,5 @@ based on [WebCell][2], [BootCell][3], [Material Cell][4] & [MarkCell][5]
[3]: https://bootstrap.web-cell.dev/
[4]: https://web-cell.dev/material-cell/
[5]: https://web-cell.dev/MarkCell/
[6]: https://david-dm.org/EasyWebApp/material-cell-document
[7]: https://github.com/EasyWebApp/material-cell-document/actions
[7]: https://github.com/EasyWebApp/material-cell-document/actions/workflows/main.yml
[8]: https://open.vscode.dev/EasyWebApp/material-cell-document
87 changes: 30 additions & 57 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "material-cell-document",
"version": "1.0.0-rc",
"version": "2.0.0-rc",
"license": "AGPL-3.0",
"author": "shiy2008@gmail.com",
"homepage": "https://material.web-cell.dev/",
Expand All @@ -11,53 +11,33 @@
"bugs": {
"url": "https://github.com/EasyWebApp/material-cell-document/issues"
},
"main": "source/index.html",
"dependencies": {
"@material/mwc-button": "^0.22.1",
"@material/mwc-checkbox": "^0.22.1",
"@material/mwc-circular-progress": "^0.22.1",
"@material/mwc-circular-progress-four-color": "^0.22.1",
"@material/mwc-dialog": "^0.22.1",
"@material/mwc-drawer": "^0.22.1",
"@material/mwc-fab": "^0.22.1",
"@material/mwc-formfield": "^0.22.1",
"@material/mwc-icon": "^0.22.1",
"@material/mwc-icon-button": "^0.22.1",
"@material/mwc-icon-button-toggle": "^0.22.1",
"@material/mwc-linear-progress": "^0.22.1",
"@material/mwc-list": "^0.22.1",
"@material/mwc-menu": "^0.22.1",
"@material/mwc-radio": "^0.22.1",
"@material/mwc-select": "^0.22.1",
"@material/mwc-slider": "^0.22.1",
"@material/mwc-snackbar": "^0.22.1",
"@material/mwc-switch": "^0.22.1",
"@material/mwc-tab": "^0.22.1",
"@material/mwc-tab-bar": "^0.22.1",
"@material/mwc-textarea": "^0.22.1",
"@material/mwc-textfield": "^0.22.1",
"@material/mwc-top-app-bar": "^0.22.1",
"@material/mwc-top-app-bar-fixed": "^0.22.1",
"boot-cell": "^1.9.5",
"cell-router": "^2.0.4",
"classnames": "^2.3.1",
"github-web-widget": "^3.0.0-beta.9",
"material-cell": "^2.0.0-rc.3",
"web-cell": "2.3.0",
"web-utility": "^2.6.0"
"@material/web": "^1.2.0",
"boot-cell": "^2.0.0-beta.18",
"cell-router": "^3.0.0-rc.5",
"classnames": "^2.5.1",
"dom-renderer": "^2.1.3",
"github-web-widget": "^4.0.0-rc.2",
"mobx": "^6.12.0",
"mobx-react": "^9.1.0",
"web-cell": "^3.0.0-rc.15",
"web-utility": "^4.1.3"
},
"devDependencies": {
"@types/classnames": "^2.3.1",
"autoprefixer": "^9.8.6",
"husky": "^7.0.1",
"less": "^4.1.1",
"lint-staged": "^11.0.1",
"mark-cell": "^0.4.8",
"parcel-bundler": "^1.12.5",
"postcss-modules": "^3.2.2",
"prettier": "^2.3.2",
"typescript": "^4.3.5",
"workbox-cli": "^6.1.5"
"@parcel/config-default": "~2.11.0",
"@parcel/packager-raw-url": "~2.11.0",
"@parcel/transformer-less": "~2.11.0",
"@parcel/transformer-typescript-tsc": "~2.11.0",
"@parcel/transformer-webmanifest": "~2.11.0",
"@types/node": "^18.19.15",
"husky": "^9.0.10",
"lint-staged": "^15.2.2",
"parcel": "~2.11.0",
"postcss": "^8.4.35",
"postcss-modules": "^4.3.1",
"prettier": "^3.2.5",
"typescript": "~5.3.3",
"workbox-cli": "^7.0.0"
},
"prettier": {
"singleQuote": true,
Expand All @@ -68,21 +48,14 @@
"lint-staged": {
"*.{html,md,mdx,css,less,json,yml,js,ts,tsx}": "prettier --write"
},
"postcss": {
"modules": true,
"plugins": {
"autoprefixer": {
"grid": true
}
}
},
"scripts": {
"prepare": "husky install",
"prepare": "husky",
"test": "lint-staged",
"pack-mdx": "mark-cell document/source -p web-cell -f createCell",
"pack-tsx": "parcel build source/index.html --public-url .",
"pack-test": "cd document/test/ && parcel build index.html --public-url . -d ../../dist/test/",
"build": "rm -rf dist/ document/dist/ && npm run pack-mdx && npm run pack-tsx && npm run pack-test && workbox generateSW",
"start": "npm run pack-mdx && parcel source/index.html --open"
"pack-test": "cd document/test/ && parcel build index.html --public-url . --dist-dir ../../dist/test/",
"clean": "rm -rf dist/ .parcel-cache/",
"build": "npm run clean && npm run pack-tsx && workbox generateSW",
"start": "npm run clean && parcel source/index.html --open"
}
}
Loading