-
Notifications
You must be signed in to change notification settings - Fork 12
feat(weather): redesigned weather app with TypeScript and web components #670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| node_modules/ | ||
| dist/ | ||
| *.log | ||
| .DS_Store | ||
| static/js/*.js | ||
| static/js/*.js.map |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Weather Edge App | ||
|
|
||
| A Screenly Edge App that displays the current weather and hourly forecast. | ||
|
|
||
| ## Settings | ||
|
|
||
| - **openweathermap_api_key** (required): OpenWeatherMap API key for weather data. | ||
| - **override_locale** (optional): Language code override (e.g., `en`, `fr`, `de`). Defaults to `en`. | ||
| - **override_coordinates** (optional): Comma-separated coordinates (e.g., `37.8267,-122.4233`). | ||
| - **enable_analytics** (optional): Enable or disable analytics integrations. | ||
| - **tag_manager_id** (optional): Google Tag Manager container ID. | ||
| - **sentry_dsn** (optional): Sentry DSN for error tracking. | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| bun install | ||
| bun run dev | ||
| ``` | ||
|
|
||
| ## Build | ||
|
|
||
| ```bash | ||
| bun run build | ||
| ``` | ||
|
|
||
| ## Deploy | ||
|
|
||
| ```bash | ||
| bun run deploy | ||
| ``` |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Weather - Screenly Edge App</title> | ||
| <script src="screenly.js?version=1"></script> | ||
| <link rel="stylesheet" href="dist/css/style.css" /> | ||
| </head> | ||
| <body> | ||
| <auto-scaler | ||
| reference-width="1920" | ||
| reference-height="1080" | ||
| orientation="auto" | ||
| > | ||
| <div id="app"> | ||
| <app-header class="header" show-date></app-header> | ||
|
|
||
| <main class="content"> | ||
| <section class="current-weather"> | ||
| <div class="city" data-location>--</div> | ||
| <div class="temperature-display" data-temperature>--°</div> | ||
| <div class="status-pill"> | ||
| <span class="weather-description" data-weather-description></span> | ||
| <div class="hi-lo"> | ||
| <span class="hi">↑ <span data-temp-high>--°</span></span> | ||
| <span class="lo">↓ <span data-temp-low>--°</span></span> | ||
| </div> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section class="forecast-card" data-forecast-card> | ||
| <div class="forecast-header"> | ||
| <img | ||
| src="static/images/icons/clear.svg" | ||
| class="forecast-header-icon" | ||
| alt="" | ||
| /> | ||
| <span>Forecast by Hour</span> | ||
| </div> | ||
| <div class="forecast-divider"></div> | ||
| <div class="forecast-items" data-forecast-items></div> | ||
| </section> | ||
| </main> | ||
| </div> | ||
| </auto-scaler> | ||
| <script src="dist/js/main.js"></script> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "weather", | ||
| "version": "1.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "prebuild": "bun run type-check", | ||
| "generate-mock-data": "screenly edge-app run --generate-mock-data", | ||
| "predev": "bun run generate-mock-data && edge-apps-scripts build", | ||
| "dev": "run-p build:dev edge-app-server", | ||
| "edge-app-server": "screenly edge-app run", | ||
| "build": "edge-apps-scripts build", | ||
| "build:dev": "edge-apps-scripts build:dev", | ||
| "build:prod": "edge-apps-scripts build", | ||
| "test": "bun test", | ||
| "test:unit": "bun test", | ||
| "lint": "edge-apps-scripts lint --fix", | ||
| "format": "prettier --write src/ README.md index.html", | ||
| "format:check": "prettier --check src/ README.md index.html", | ||
| "deploy": "bun run build && screenly edge-app deploy", | ||
| "type-check": "edge-apps-scripts type-check", | ||
| "prepare": "cd ../edge-apps-library && bun install && bun run build" | ||
| }, | ||
| "dependencies": {}, | ||
| "prettier": "../edge-apps-library/.prettierrc.json", | ||
| "devDependencies": { | ||
| "@screenly/edge-apps": "workspace:../edge-apps-library", | ||
| "@types/bun": "^1.3.7", | ||
| "@types/jsdom": "^27.0.0", | ||
| "bun-types": "^1.3.7", | ||
| "jsdom": "^27.4.0", | ||
| "npm-run-all2": "^8.0.4", | ||
| "prettier": "^3.8.1", | ||
| "typescript": "^5.9.3" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| syntax: manifest_v1 | ||
| ready_signal: true | ||
| description: Displays the current weather and time | ||
| icon: 'https://playground.srly.io/edge-apps/weather/static/images/icon.svg' | ||
| author: Screenly, Inc. | ||
| settings: | ||
| enable_analytics: | ||
| type: string | ||
| default_value: 'true' | ||
| title: Enable Analytics | ||
| optional: true | ||
| help_text: Enable or disable Sentry and Google Analytics integrations. | ||
| is_global: true | ||
| openweathermap_api_key: | ||
| type: secret | ||
| title: Openweathermap API Key | ||
| optional: false | ||
| is_global: true | ||
| help_text: | | ||
| Enter your OpenWeatherMap API key to access weather data. | ||
| You can get your API key from https://openweathermap.org/api. | ||
| tag_manager_id: | ||
| type: string | ||
| default_value: GTM-P98SPZ9Z | ||
| title: Google Tag Manager ID | ||
| optional: true | ||
| help_text: | | ||
| Enter your Google Tag Manager container ID to enable tracking and analytics. | ||
| is_global: true | ||
| override_coordinates: | ||
| type: string | ||
| default_value: '' | ||
| title: Override Coordinates | ||
| optional: true | ||
| help_text: | | ||
| Enter a comma-separated pair of coordinates (e.g., 37.8267,-122.4233). If not specified, the app will attempt to use the device's coordinates. | ||
| override_locale: | ||
| type: string | ||
| default_value: 'en' | ||
| title: Override Locale | ||
| optional: true | ||
| help_text: | | ||
| Override the default locale with a supported language code (e.g., en, fr, de). Defaults to English if not specified. | ||
| You can find the available locales here: https://momentjs.com/ | ||
| sentry_dsn: | ||
| type: secret | ||
| title: Sentry DSN | ||
| optional: true | ||
| is_global: true | ||
| help_text: | | ||
| Enter your Sentry DSN to enable error tracking and monitoring. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| syntax: manifest_v1 | ||
| ready_signal: true | ||
| description: Displays the current weather and time | ||
| icon: 'https://playground.srly.io/edge-apps/weather/static/images/icon.svg' | ||
| author: Screenly, Inc. | ||
| settings: | ||
| enable_analytics: | ||
| type: string | ||
| default_value: 'true' | ||
| title: Enable Analytics | ||
| optional: true | ||
| help_text: Enable or disable Sentry and Google Analytics integrations. | ||
| is_global: true | ||
| openweathermap_api_key: | ||
| type: secret | ||
| title: Openweathermap API Key | ||
| optional: false | ||
| is_global: true | ||
| help_text: | | ||
| Enter your OpenWeatherMap API key to access weather data. | ||
| You can get your API key from https://openweathermap.org/api. | ||
| tag_manager_id: | ||
| type: string | ||
| default_value: GTM-P98SPZ9Z | ||
| title: Google Tag Manager ID | ||
| optional: true | ||
| help_text: | | ||
| Enter your Google Tag Manager container ID to enable tracking and analytics. | ||
| is_global: true | ||
| override_coordinates: | ||
| type: string | ||
| default_value: '' | ||
| title: Override Coordinates | ||
| optional: true | ||
| help_text: | | ||
| Enter a comma-separated pair of coordinates (e.g., 37.8267,-122.4233). If not specified, the app will attempt to use the device's coordinates. | ||
| override_locale: | ||
| type: string | ||
| default_value: 'en' | ||
| title: Override Locale | ||
| optional: true | ||
| help_text: | | ||
| Override the default locale with a supported language code (e.g., en, fr, de). Defaults to English if not specified. | ||
| You can find the available locales here: https://momentjs.com/ | ||
|
Comment on lines
+31
to
+45
|
||
| sentry_dsn: | ||
| type: secret | ||
| title: Sentry DSN | ||
| optional: true | ||
| is_global: true | ||
| help_text: | | ||
| Enter your Sentry DSN to enable error tracking and monitoring. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This manifest includes
override_locale/override_coordinates, but the app also depends on settings not declared here:getTimeZone()supportsoverride_timezone, andgetMeasurementUnit()readsunit. Without declaring them, users can’t configure timezone override or imperial/metric units via settings. Consider addingoverride_timezoneandunit(as inedge-apps/clock/screenly.yml) and either wire upoverride_coordinatesor remove it.