Skip to content

Commit

Permalink
Implement prettier (automatic changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jul 29, 2024
1 parent c4371b9 commit f89e65d
Show file tree
Hide file tree
Showing 146 changed files with 4,559 additions and 4,038 deletions.
12 changes: 6 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"image": "mcr.microsoft.com/devcontainers/javascript-node:18",
"image": "mcr.microsoft.com/devcontainers/javascript-node:18",

"postCreateCommand": "npm install",
"postCreateCommand": "npm install",

"portsAttributes": {
"8080": {
"label": "client"
"portsAttributes": {
"8080": {
"label": "client"
}
}
}
}
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
78 changes: 39 additions & 39 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@ name: Build ⚙ and Deploy 🚀
on: [push, pull_request]

concurrency:
group: ${{ github.ref }}
group: ${{ github.ref }}

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🚚
uses: actions/checkout@v4
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🚚
uses: actions/checkout@v4

- name: Setup pnpm ⚗
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup pnpm ⚗
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js ⚗
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Setup Node.js ⚗
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies 🌐
run: pnpm install --frozen-lockfile
- name: Install dependencies 🌐
run: pnpm install --frozen-lockfile

- name: Lint
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: pnpm run pretty:check
- name: Lint
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: pnpm run pretty:check

- name: Build 🛠
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: pnpm run build
- name: Build 🛠
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: pnpm run build

- name: Run tests 🩺
run: pnpm run test
- name: Run tests 🩺
run: pnpm run test

- name: Add build.txt 🗓
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: |
git log --pretty=format:'%h' -n 1 > dist/build.txt
echo >> dist/build.txt
date +%F_%T >> dist/build.txt
- name: Add build.txt 🗓
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: |
git log --pretty=format:'%h' -n 1 > dist/build.txt
echo >> dist/build.txt
date +%F_%T >> dist/build.txt
- name: Deploy 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
single-commit: true
clean: true
- name: Deploy 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
single-commit: true
clean: true
# clean-exclude: |
# develop

Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/merge_master_to_dev.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Merge master to develop

on:
push:
branches:
- master
push:
branches:
- master

jobs:
merge_master_to_dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Merge master -> develop
uses: devmasx/merge-branch@master
with:
type: now
head_to_merge: master
target_branch: develop
github_token: ${{ github.token }}
merge_master_to_dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Merge master -> develop
uses: devmasx/merge-branch@master
with:
type: now
head_to_merge: master
target_branch: develop
github_token: ${{ github.token }}
26 changes: 13 additions & 13 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: "Close stale issues/pull requests"
name: 'Close stale issues/pull requests'
on:
schedule:
- cron: "0 0 * * *"
schedule:
- cron: '0 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days'
stale-pr-message: 'This pull request is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days'
days-before-stale: 180
days-before-close: 30
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days'
stale-pr-message: 'This pull request is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days'
days-before-stale: 180
days-before-close: 30
122 changes: 61 additions & 61 deletions .github/workflows/update-algolia-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,71 @@ name: Update Algolia-Search index

# Only trigger, when the build workflow succeeded on branch master
on:
workflow_run:
workflows: [ "Build ⚙ and Deploy 🚀" ]
branches: [ master ]
types: [ completed ]
workflow_run:
workflows: ['Build ⚙ and Deploy 🚀']
branches: [master]
types: [completed]

concurrency:
group: algolia-update
cancel-in-progress: true
group: algolia-update
cancel-in-progress: true

jobs:
update-algolia-index:
runs-on: ubuntu-latest
steps:
# Try to workaround time gap between newly gh-pages deployment is available (cache cleared?)
- name: Wait for deployment is published
run: |
CNT=1
echo Waiting for deployment ${GITHUB_SHA:0:7} is published
sleep 60
while ! curl -sS https://www.zigbee2mqtt.io/build.txt | grep -qF ${GITHUB_SHA:0:7} ; do
CNT=$((CNT+1))
sleep 1
if [ $CNT -gt 300 ]; then
>&2 echo "build.txt does not match current commit"
>&2 curl -sS https://www.zigbee2mqtt.io/build.txt
exit 1
fi
done
update-algolia-index:
runs-on: ubuntu-latest
steps:
# Try to workaround time gap between newly gh-pages deployment is available (cache cleared?)
- name: Wait for deployment is published
run: |
CNT=1
echo Waiting for deployment ${GITHUB_SHA:0:7} is published
sleep 60
while ! curl -sS https://www.zigbee2mqtt.io/build.txt | grep -qF ${GITHUB_SHA:0:7} ; do
CNT=$((CNT+1))
sleep 1
if [ $CNT -gt 300 ]; then
>&2 echo "build.txt does not match current commit"
>&2 curl -sS https://www.zigbee2mqtt.io/build.txt
exit 1
fi
done
- name: Create algolia scraper config
run: |
cat << EOF > algolia.json
{
"index_name": "zigbee2mqtt.io",
"sitemap_urls": ["https://www.zigbee2mqtt.io/sitemap.xml"],
"stop_urls": [],
"selectors": {
"lvl0": {
"selector": "header .router-link-active",
"global": true,
"default_value": "Miscellaneous"
},
"lvl1": ".content-page h1, .device-page h1",
"lvl2": ".content-page h2, .device-page h1 + table tbody tr:nth-child(3) td:nth-child(2)",
"lvl3": ".content-page h3",
"lvl4": ".content-page h4",
"lvl5": ".content-page h5",
"text": ".content-page p, .content-page li, .content-page code, .content-page td",
"lang": {
"selector": "/html/@lang",
"type": "xpath",
"global": true
}
},
"custom_settings": {
"attributesForFaceting": ["lang"]
}
}
EOF
- name: Create algolia scraper config
run: |
cat << EOF > algolia.json
{
"index_name": "zigbee2mqtt.io",
"sitemap_urls": ["https://www.zigbee2mqtt.io/sitemap.xml"],
"stop_urls": [],
"selectors": {
"lvl0": {
"selector": "header .router-link-active",
"global": true,
"default_value": "Miscellaneous"
},
"lvl1": ".content-page h1, .device-page h1",
"lvl2": ".content-page h2, .device-page h1 + table tbody tr:nth-child(3) td:nth-child(2)",
"lvl3": ".content-page h3",
"lvl4": ".content-page h4",
"lvl5": ".content-page h5",
"text": ".content-page p, .content-page li, .content-page code, .content-page td",
"lang": {
"selector": "/html/@lang",
"type": "xpath",
"global": true
}
},
"custom_settings": {
"attributesForFaceting": ["lang"]
}
}
EOF
- run: curl -sSL https://www.zigbee2mqtt.io/build.txt
- run: curl -sSL https://www.zigbee2mqtt.io/build.txt

- name: Update algolia docsearch
uses: psi-4ward/algolia-docsearch-action@master
with:
algolia_application_id: K1BM3QYQ34
algolia_api_key: ${{ secrets.ALGOLIA_INDEX_APIKEY }}
file: 'algolia.json'
- name: Update algolia docsearch
uses: psi-4ward/algolia-docsearch-action@master
with:
algolia_application_id: K1BM3QYQ34
algolia_api_key: ${{ secrets.ALGOLIA_INDEX_APIKEY }}
file: 'algolia.json'
Loading

0 comments on commit f89e65d

Please sign in to comment.