-
-
Notifications
You must be signed in to change notification settings - Fork 14
Development
The skin uses the Cheetah templating engine provided by weewx in combination with carbon web components and a react entry point to render the diagrams written in TypeScript via nivo. Bundling for Typescript and SCSS is done via webpack.
To start developing, you first need to have Node (npm) installed (>= v14). Then, install yarn (https://yarnpkg.com/getting-started/install).
Install the dependencies: yarn install
Starts webpack in watch mode
Builds the assets
Only works if weewx is installed via package, see https://weewx.com/docs/setup.htm. Copies all skin files in the corresponding weewx installation folders, restarts weewx and triggers a new generation of files via wee_reports:
sudo cp -R ./skins/weewx-wdc /etc/weewx/skins && sudo cp -r ./bin/user/. /usr/share/weewx/user/ && sudo systemctl restart weewx && sudo /usr/share/weewx/wee_reports
Only works if weewx is installed via package, see https://weewx.com/docs/setup.htm. Starts a nginx docker container to serve the generated files.
docker run -it --rm -d -p 8080:80 --name web -v /var/www/html/weewx:/usr/share/nginx/html nginx
cd weewx-wdc
yarn install
yarn run build
If you want to test out a change from a commit or a updated file from the maintainer, follow these steps: Do not change the files in you web directory (files generated by weewx) - the changes will be lost when the next report runs because the files are getting overridden!
You need to change the files inside the WeeWX SKIN_ROOT
directory. For a pip
installation this would be in ~/weewx-data/skins/weewx-wdc
, for other installation types please see https://weewx.com/docs/5.0/usersguide/where/#location-of-weewx-components.
After you updated or copied the files over, you need to wait for the next report run or start one manually.
If you are dealing with .css
or .js
files make sure to clear your browser cache before testing or use an incognito tab!