Skip to content

Commit

Permalink
Merge pull request #397 from open-pv/396-code-cleaning
Browse files Browse the repository at this point in the history
Code Cleaning and Linters
  • Loading branch information
FlorianK13 authored Jan 13, 2025
2 parents 81aee74 + eb590b1 commit 1dd494f
Show file tree
Hide file tree
Showing 59 changed files with 316,020 additions and 1,497 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/" # Location of package manifest
- package-ecosystem: 'npm'
directory: '/' # Location of package manifest
schedule:
interval: "weekly"
interval: 'weekly'
30 changes: 30 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
pull_request:
branches:
- main

jobs:
run-linters:
if: github.event.pull_request.draft == false
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Prettier
run: npm install prettier

- name: Run linters
uses: wearerequired/lint-action@v2
with:
eslint: false
prettier: true
10 changes: 6 additions & 4 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# prettier config
semi: false # No semicolons
singleQuote: false # use single quotes in regular js files
jsxSingleQuote: false # use single quotes in jsx files
semi: false
singleQuote: true
jsxSingleQuote: true
endOfLine: 'lf'
trailingComma: 'all'
tabWidth: 2
8 changes: 1 addition & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,5 @@
"editor.suggest.insertMode": "replace"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.sortImports": "explicit"
},
"prettier.semi": false,
"prettier.jsxSingleQuote": false
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[![Website](https://img.shields.io/website?url=https%3A%2F%2Fwww.openpv.de%2F)](https://www.openpv.de/)


# The OpenPV website

This is the base repository for the website [openpv.de](https://www.openpv.de). The website is built using
* [React](https://react.dev/)
* [Chakra-UI](https://v2.chakra-ui.com)
* [Three.js](https://threejs.org/)

- [React](https://react.dev/)
- [Chakra-UI](https://v2.chakra-ui.com)
- [Three.js](https://threejs.org/)

The whole site is **static**, reducing the hosting costs as much as possible. The shading simulation happens in the browser, using
our npm package [simshady](https://github.com/open-pv/simshady).
Expand All @@ -16,24 +17,26 @@ If you want to deploy this website locally, you need to follow these steps:

1. Clone the repository and enter it.
2. Make sure that you have [node](https://nodejs.org/en) and the node package manager npm installed. Check this by running
```
node --version
npm --version
```
```
node --version
npm --version
```
3. Install all required packages from `package.json` by running
```shell
npm install
```
```shell
npm install
```
4. To build the code and host it in a development environment, run
```shell
npm run dev
```
and visit [localhost:5173](http://localhost:5173).
```shell
npm run dev
```
and visit [localhost:5173](http://localhost:5173).

## How does this work?
We have a detailed description in german and english on our [About Page](https://www.openpv.de/about).

We have a detailed description in german and english on our [About Page](https://www.openpv.de/about). Also check out our [blog](https://blog.openpv.de).

## Funding

We thank our sponsors.

<a href="https://prototypefund.de/">
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html itemscope="" itemtype="http://schema.org/WebPage" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
Expand Down
17 changes: 16 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"build": "vite build",
"preview": "vite preview",
"deploy": "gh-pages -d dist -b build",
"deploy:test": "gh-pages -d dist -b gh-pages"
"deploy:test": "gh-pages -d dist -b gh-pages",
"format": "prettier --write ."
},
"dependencies": {
"@chakra-ui/react": "^2.10.1",
Expand All @@ -17,7 +18,6 @@
"i18next-http-backend": "^3.0.1",
"jszip": "^3.10.1",
"maplibre-gl": "^4.7.1",
"pako": "^2.1.0",
"proj4": "^2.15.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -31,6 +31,7 @@
"devDependencies": {
"@vitejs/plugin-react": "^4.3.4",
"gh-pages": "^6.2.0",
"prettier": "3.4.2",
"vite": "^6.0.7"
},
"browserslist": {
Expand Down
16 changes: 8 additions & 8 deletions public/draco/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Draco is an open-source library for compressing and decompressing 3D geometric m

This folder contains three utilities:

* `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser.
* `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices.
* `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder.
- `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser.
- `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices.
- `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder.

Each file is provided in two variations:

* **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco).
* **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension).
- **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco).
- **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension).

Either variation may be used with `THREE.DRACOLoader`:

```js
var dracoLoader = new THREE.DRACOLoader();
dracoLoader.setDecoderPath('path/to/decoders/');
dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
var dracoLoader = new THREE.DRACOLoader()
dracoLoader.setDecoderPath('path/to/decoders/')
dracoLoader.setDecoderConfig({ type: 'js' }) // (Optional) Override detection of WASM support.
```

Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).
Expand Down
74,076 changes: 74,048 additions & 28 deletions public/draco/draco_decoder.js

Large diffs are not rendered by default.

91,274 changes: 91,247 additions & 27 deletions public/draco/draco_encoder.js

Large diffs are not rendered by default.

Loading

0 comments on commit 1dd494f

Please sign in to comment.