Skip to content
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

Sounding release 4.0.0-beta.1 #267

Merged
merged 16 commits into from
Jul 13, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/upload-windy-sounding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: |
npm ci --no-audit
npm --prefix libs/windy-sounding ci --no-audit
npx nx prepare windy-sounding
npx nx build windy-sounding
- name: Publish Plugin
run: |
npx nx upload windy-sounding
2 changes: 1 addition & 1 deletion libs/secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"dependencies": {
"@nx/webpack": "19.4.1",
"@nx/webpack": "19.4.2",
"dotenv-webpack": "^8.1.0"
}
}
2 changes: 1 addition & 1 deletion libs/windy-sounding/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "**/node_modules/*", "generate-manifest.js", "**/vite.config.ts"],
"ignorePatterns": ["!**/*", "/node_modules", "/generate-manifest.js", "/vite.config.ts", "/types"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
3 changes: 2 additions & 1 deletion libs/windy-sounding/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.env.local
/.env.local
/types
6 changes: 6 additions & 0 deletions libs/windy-sounding/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release history

## 4.0.0-beta.1 - July 13, 2024

- Split the state into multiple slices
- Check for update
vicb marked this conversation as resolved.
Show resolved Hide resolved
- Perf improvements

## 4.0.0-alpha.2 - July 10, 2024

- Fix elevation steps in ft (3000ft)
Expand Down
35 changes: 28 additions & 7 deletions libs/windy-sounding/package-lock.json

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

8 changes: 6 additions & 2 deletions libs/windy-sounding/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "windy-plugin-sounding",
"version": "4.0.0-alpha.2",
"version": "4.0.0-beta.1",
"type": "module",
"private": true,
"description": "Soundings for paraglider pilots",
Expand All @@ -16,8 +16,12 @@
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"date-fns": "^3.6.0",
"geojson": "^0.5.0",
"preact": "10.22.1",
"preact": "^10.22.1",
"react-redux": "^9.1.2",
"semver": "^7.6.2",
"svelte": "^4.2.18"
},
"devDependencies": {
"@types/semver": "^7.5.8"
}
}
15 changes: 13 additions & 2 deletions libs/windy-sounding/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,26 @@
"options": {
"commands": [
"rm -rf dist/libs/windy-sounding",
"npx nx build windy-sounding --configuration=production",
"npx nx build windy-sounding --configuration=development",
"npx nx build windy-sounding --configuration=production --skip-nx-cache",
"npx nx build windy-sounding --configuration=development --skip-nx-cache",
"BUILD_PLUGIN_CONFIG=true npx nx build windy-sounding --configuration production --skip-nx-cache",
"node libs/windy-sounding/generate-manifest.js dist/libs/windy-sounding"
],
"parallel": false
}
},

"upload": {
"executor": "nx:run-commands",
"dependsOn": ["prepare"],
"options": {
"commands": [
"libs/windy-sounding/upload.sh"
],
"parallel": false
}
},

"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
Expand Down
12 changes: 11 additions & 1 deletion libs/windy-sounding/src/Plugin.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@
let pluginElement: HTMLElement;

export const onopen = (parameters: any) => {
// Legacys URL do not have the model.
// old format /:lat/:lon
// new format /:model/:lat/:lon
const isNumeric = (value: string) => value as any == parseFloat(value);
if (isNumeric(parameters?.modelName) && isNumeric(parameters?.lat)) {
parameters.lon = parameters.lat;
parameters.lat = parameters.model;
parameters.model = 'ecmwf';
}

const mapCenter = W.map.map.getCenter();
const lat = Number(parameters?.lat ?? mapCenter.lat);
const lon = Number(parameters?.long ?? mapCenter.lng);
const lon = Number(parameters?.lon ?? mapCenter.lng);
const modelName = parameters?.modelName ?? 'ecmwf';
openPlugin({ lat, lon, modelName });
};
Expand Down
12 changes: 6 additions & 6 deletions libs/windy-sounding/src/components/favorites.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ export function Favorites({ favorites, location, isMobile, onSelected, modelName
data-icon-after="g"
onClick={toggleModelSelect}
>
<small class="size-m">{modelName}</small>
<small className="size-m">{modelName}</small>
</div>
<div
className={`select ${isLocationExpanded ? 'active' : ''}`}
data-icon="D"
data-icon-after="g"
onClick={toggleLocationSelect}
>
<small class="size-m">{currentFavorite}</small>
<small className="size-m">{currentFavorite}</small>
</div>
<a style="margin: 0 10px 3px 5px" href="https://buymeacoffee.com/vic.b" target="_blank">
<a style={{ margin: '0 10px 3px 5px' }} href="https://buymeacoffee.com/vic.b" target="_blank">
☕️
</a>
</section>

{isModelExpanded && (
<div class="options">
<div className="options">
{models.map((model: string) => (
<span className={model == modelName ? 'selected' : ''} onClick={() => W.store.set('product', model)}>
{model}
Expand All @@ -91,7 +91,7 @@ export function Favorites({ favorites, location, isMobile, onSelected, modelName
)}

{isLocationExpanded && (
<div class="options">
<div className="options">
{favorites.length === 0 ? (
<p>You do not have any favorites</p>
) : (
Expand All @@ -113,7 +113,7 @@ export function Favorites({ favorites, location, isMobile, onSelected, modelName
if (favorites.length == 0) {
return (
<div id="wsp-flyto" className="size-m">
<span data-icon="m" class="fg-icons"></span> Add favorites to windy to quickly check different locations.
<span data-icon="m" className="fg-icons"></span> Add favorites to windy to quickly check different locations.
</div>
);
}
Expand Down
9 changes: 5 additions & 4 deletions libs/windy-sounding/src/components/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
export function LoadingIndicator({ x, y }: { x: number; y: number }) {
export function LoadingIndicator({ width, height }: { width: number; height: number }) {
return (
vicb marked this conversation as resolved.
Show resolved Hide resolved
<svg width="100" height="100" viewBox="-25 -25 50 50" x={x - 50} y={y - 50}>
<g fill="none">
<circle r="18" stroke="#ddd" stroke-width="2" stroke-dasharray="90 20">
<svg {...{ width, height }}>
<rect {...{ width, height }} fill="#eee" />
<g transform={`translate(${width / 2 - 9} ${height / 2 - 9}) scale(3)`}>
<circle r="18" stroke="black" fill="none" stroke-width="2" stroke-dasharray="90 20">
<animateTransform
attributeName="transform"
type="rotate"
Expand Down
15 changes: 15 additions & 0 deletions libs/windy-sounding/src/components/message.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type MessageProps = {
width: number;
height: number;
// text or jsx
message: any;
};

export function Message({ width, height, message }: MessageProps) {
return (
<div className="wsp-message" style={{ height: `${height}px`, width: `${width}px` }}>
{/* the inner div is here so that there is only one direct child for styling */}
<div>{message}</div>
</div>
);
}
Loading
Loading