Skip to content

Commit

Permalink
Refactor; move to pnpm; bring closer to core
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Mar 19, 2024
1 parent 937d731 commit 36c8726
Show file tree
Hide file tree
Showing 55 changed files with 24,657 additions and 7,376 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@
"argsIgnorePattern": "^_"
}
],
"jsx-a11y/label-has-associated-control": 0,
"jsx-a11y/label-has-associated-control": 0
}
}
87 changes: 43 additions & 44 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,58 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install NPM packages
run: yarn install

- name: Build project
run: |
yarn buildgh
sed -i 's/ <!\-\- <base href\=\"\%PUBLIC_URL\%\/\"> \-\->/ <base href\=\"\%PUBLIC_URL\%\/\">/g' ./build/index.html
- name: Checkout code
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install NPM packages
run: |
yarn global add pnpm
pnpm install
- name: Build storybook
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn build-storybookgh -o ./build/docs
cp ./build/docs/*.woff ./build/docs/static/css
cp ./build/docs/*.woff2 ./build/docs/static/css
- name: Build project
run: |
pnpm buildgh
sed -i 's/ <!\-\- <base href\=\"\%PUBLIC_URL\%\/\"> \-\->/ <base href\=\"\%PUBLIC_URL\%\/\">/g' ./build/index.html
#- name: Run tests
# run: yarn test
- name: Build storybook
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm build-storybookgh -o ./build/docs
cp ./build/docs/*.woff ./build/docs/static/css
cp ./build/docs/*.woff2 ./build/docs/static/css
- name: Upload production-ready build files
uses: actions/upload-artifact@v2
with:
name: production-files
path: ./build

#- name: Run tests
# run: pnpm test

- name: Upload production-ready build files
uses: actions/upload-artifact@v2
with:
name: production-files
path: ./build



deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: ./build
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: ./build

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
10 changes: 5 additions & 5 deletions .github/workflows/build-hass-addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install Node Modules
run: yarn
run: |
yarn add global pnpm
pnpm install
- name: Build project Hass
env:
release_version: ${{ steps.package-version.outputs.current-version}}
REACT_APP_VERSION: ${{ steps.package-version.outputs.current-version}}
run: yarn buildhass
run: pnpm buildhass
- name: Preparing Archive
run: |
mv build ledfx_frontend_hass_dev
Expand All @@ -54,11 +56,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./ledfx_frontend_hass_dev.zip"
file: './ledfx_frontend_hass_dev.zip'
overwrite: true
update_latest_release: true


# - name: Prepare Trigger Hass
# id: hass
# run: |
Expand All @@ -72,4 +73,3 @@ jobs:
# ref: refs/heads/master
# token: ${{ secrets.LEDFX_HOMEASSISTANT_ADDON }}
# inputs: '{ "version": "${{ steps.hass.outputs.id}}" }'

19 changes: 9 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
id: package-version
uses: martinbeentjes/npm-get-version-action@master


# - name: Dispatch Build
# run: |
# curl -XPOST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{secrets.FRONTEND_TOKEN}}" https://api.github.com/repos/YeonV/LedFx-Builds/actions/workflows/build-ledfx.yml/dispatches --data '{"fversion": "${{ steps.package-version.outputs.current-version}}"}'
Expand All @@ -39,13 +38,15 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install Node Modules
run: yarn
run: |
yarn add global pnpm
pnpm install
- name: Build project
env:
release_version: ${{ steps.package-version.outputs.current-version}}
REACT_APP_VERSION: ${{ steps.package-version.outputs.current-version}}
run: yarn build
run: pnpm build
- name: Preparing Archive
run: |
mv build ledfx_frontend_v2
Expand Down Expand Up @@ -81,7 +82,7 @@ jobs:
asset_path: ./ledfx_frontend_v2.zip
asset_name: ledfx_frontend_v2.zip
asset_content_type: application/zip

- name: Prepare Trigger
id: get-id
run: |
Expand All @@ -94,7 +95,7 @@ jobs:
# workflow: LedFx BuildPipeline
repo: YeonV/LedFx-Builds
token: ${{ secrets.FRONTEND_TOKEN }}
inputs: "{ \"fversion\": \"${{ steps.get-id.outputs.id}}\", \"release\": \"${{ startsWith(github.event.head_commit.message, 'Beta') && 'No' || 'Yes' }}\" }"
inputs: '{ "fversion": "${{ steps.get-id.outputs.id}}", "release": "${{ startsWith(github.event.head_commit.message, ''Beta'') && ''No'' || ''Yes'' }}" }'

- name: 📂 Sync files
continue-on-error: true
Expand All @@ -107,13 +108,12 @@ jobs:
METHOD: sftp
LOCAL_DIR: ./ledfx_frontend_v2/
REMOTE_DIR: ./preview.ledfx.app/



- name: Build project Hass
env:
release_version: ${{ steps.package-version.outputs.current-version}}
REACT_APP_VERSION: ${{ steps.package-version.outputs.current-version}}
run: yarn buildhass
run: pnpm buildhass
- name: Preparing Archive
run: |
mv build ledfx_frontend_hass
Expand All @@ -134,7 +134,7 @@ jobs:
asset_path: ./ledfx_frontend_hass.zip
asset_name: ledfx_frontend_hass.zip
asset_content_type: application/zip

# - name: Prepare Trigger Hass
# id: hass
# run: |
Expand All @@ -148,4 +148,3 @@ jobs:
# ref: refs/heads/master
# token: ${{ secrets.LEDFX_HOMEASSISTANT_ADDON }}
# inputs: '{ "version": "${{ steps.hass.outputs.id}}" }'

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ extraResources/*
.github/workflows/workflow-file-private.yml
.yarn_cache/*

BladeTools.pfx
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
engine-strict=true
auto-install-peers=true
25 changes: 25 additions & 0 deletions TERMS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Privacy Policy for LedFx-Client

## 1. Introduction

Welcome to LedFx-Client. We respect the privacy of our users and are committed to protecting it through our compliance with this policy.

## 2. Information We Collect

The LedFx-Client does not collect any personal or usage information from its users. The client operates in conjunction with a "core" (the main LedFx), without which it has limited functionality.

## 3. Future Features

In future, an alpha feature may be introduced that allows users to connect to a LedFx-Cloud. This feature will have its own privacy policy, which will be provided at the time of its introduction.

## 4. Security

We value your trust in providing us your information, thus we strive to use commercially acceptable means of protecting it.

## 5. Changes to This Privacy Policy

We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes.

## 6. Contact Us

If you have any questions or suggestions about our Privacy Policy, do not hesitate to contact us at [Your Contact Information].
Loading

0 comments on commit 36c8726

Please sign in to comment.