@azohra/meteo.station 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/air.d.ts +13 -0
- package/dist/air.js +76 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +4 -0
- package/dist/client/poll.d.ts +42 -0
- package/dist/client/poll.js +121 -0
- package/dist/client/stores.d.ts +46 -0
- package/dist/client/stores.js +128 -0
- package/dist/client/ticker.d.ts +4 -0
- package/dist/client/ticker.js +19 -0
- package/dist/contract.d.ts +381 -0
- package/dist/contract.js +143 -0
- package/dist/derive.d.ts +54 -0
- package/dist/derive.js +134 -0
- package/dist/display.d.ts +28 -0
- package/dist/display.js +27 -0
- package/dist/elements/elements/AirMatrixElement.d.ts +14 -0
- package/dist/elements/elements/AirMatrixElement.js +83 -0
- package/dist/elements/elements/CurrentConditionsElement.d.ts +9 -0
- package/dist/elements/elements/CurrentConditionsElement.js +52 -0
- package/dist/elements/elements/DailyPatternElement.d.ts +15 -0
- package/dist/elements/elements/DailyPatternElement.js +200 -0
- package/dist/elements/elements/DialElement.d.ts +9 -0
- package/dist/elements/elements/DialElement.js +128 -0
- package/dist/elements/elements/FreshnessBadgeElement.d.ts +8 -0
- package/dist/elements/elements/FreshnessBadgeElement.js +22 -0
- package/dist/elements/elements/SparklineElement.d.ts +9 -0
- package/dist/elements/elements/SparklineElement.js +74 -0
- package/dist/elements/elements/StationCardElement.d.ts +53 -0
- package/dist/elements/elements/StationCardElement.js +211 -0
- package/dist/elements/elements/StationFeedElement.d.ts +32 -0
- package/dist/elements/elements/StationFeedElement.js +215 -0
- package/dist/elements/elements/StationStripElement.d.ts +9 -0
- package/dist/elements/elements/StationStripElement.js +43 -0
- package/dist/elements/elements/StationTableElement.d.ts +18 -0
- package/dist/elements/elements/StationTableElement.js +102 -0
- package/dist/elements/elements/TrendChartElement.d.ts +10 -0
- package/dist/elements/elements/TrendChartElement.js +174 -0
- package/dist/elements/elements/WindArrowElement.d.ts +8 -0
- package/dist/elements/elements/WindArrowElement.js +14 -0
- package/dist/elements/elements/WindHistoryChartElement.d.ts +10 -0
- package/dist/elements/elements/WindHistoryChartElement.js +277 -0
- package/dist/elements/elements/WindRoseElement.d.ts +17 -0
- package/dist/elements/elements/WindRoseElement.js +106 -0
- package/dist/elements/elements/atoms.d.ts +48 -0
- package/dist/elements/elements/atoms.js +131 -0
- package/dist/elements/index.d.ts +48 -0
- package/dist/elements/index.js +57 -0
- package/dist/elements/lib/ambient.d.ts +15 -0
- package/dist/elements/lib/ambient.js +5 -0
- package/dist/elements/lib/attributes.js +21 -0
- package/dist/elements/lib/base.d.ts +45 -0
- package/dist/elements/lib/base.js +152 -0
- package/dist/elements/lib/context.js +28 -0
- package/dist/elements/lib/fragments.js +45 -0
- package/dist/elements/lib/h.js +35 -0
- package/dist/elements/register.d.ts +1 -0
- package/dist/elements/register.js +5 -0
- package/dist/endpoints.d.ts +5 -0
- package/dist/endpoints.js +10 -0
- package/dist/fixtures.d.ts +23 -0
- package/dist/fixtures.js +67 -0
- package/dist/format.d.ts +31 -0
- package/dist/format.js +82 -0
- package/dist/geometry.d.ts +84 -0
- package/dist/geometry.js +333 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/instruments.d.ts +75 -0
- package/dist/instruments.js +173 -0
- package/dist/merge-current.d.ts +13 -0
- package/dist/merge-current.js +54 -0
- package/dist/react/components/AirMatrix.d.ts +11 -0
- package/dist/react/components/AirMatrix.js +82 -0
- package/dist/react/components/CurrentConditions.d.ts +17 -0
- package/dist/react/components/CurrentConditions.js +98 -0
- package/dist/react/components/DailyPattern.d.ts +19 -0
- package/dist/react/components/DailyPattern.js +212 -0
- package/dist/react/components/Dial.d.ts +17 -0
- package/dist/react/components/Dial.js +133 -0
- package/dist/react/components/FreshnessBadge.d.ts +10 -0
- package/dist/react/components/FreshnessBadge.js +20 -0
- package/dist/react/components/Sparkline.d.ts +17 -0
- package/dist/react/components/Sparkline.js +60 -0
- package/dist/react/components/StationCard.d.ts +46 -0
- package/dist/react/components/StationCard.js +140 -0
- package/dist/react/components/StationFeedProvider.d.ts +27 -0
- package/dist/react/components/StationFeedProvider.js +40 -0
- package/dist/react/components/StationStrip.d.ts +16 -0
- package/dist/react/components/StationStrip.js +84 -0
- package/dist/react/components/StationTable.d.ts +18 -0
- package/dist/react/components/StationTable.js +115 -0
- package/dist/react/components/TrendChart.d.ts +14 -0
- package/dist/react/components/TrendChart.js +150 -0
- package/dist/react/components/WindArrow.d.ts +7 -0
- package/dist/react/components/WindArrow.js +21 -0
- package/dist/react/components/WindHistoryChart.d.ts +18 -0
- package/dist/react/components/WindHistoryChart.js +278 -0
- package/dist/react/components/WindRose.d.ts +17 -0
- package/dist/react/components/WindRose.js +99 -0
- package/dist/react/components/atoms.d.ts +33 -0
- package/dist/react/components/atoms.js +136 -0
- package/dist/react/hooks/useFreshness.d.ts +6 -0
- package/dist/react/hooks/useFreshness.js +21 -0
- package/dist/react/hooks/usePolledJson.js +17 -0
- package/dist/react/hooks/useStation.d.ts +23 -0
- package/dist/react/hooks/useStation.js +42 -0
- package/dist/react/hooks/useStationCurrent.d.ts +23 -0
- package/dist/react/hooks/useStationCurrent.js +32 -0
- package/dist/react/hooks/useStationFeed.d.ts +22 -0
- package/dist/react/hooks/useStationFeed.js +28 -0
- package/dist/react/index.d.ts +20 -0
- package/dist/react/index.js +21 -0
- package/dist/react/lib/cells.js +29 -0
- package/dist/scene/air-matrix.js +71 -0
- package/dist/scene/atoms.js +102 -0
- package/dist/scene/card.js +54 -0
- package/dist/scene/chart.js +28 -0
- package/dist/scene/current.js +66 -0
- package/dist/scene/daily-pattern.js +81 -0
- package/dist/scene/dial.js +141 -0
- package/dist/scene/glyphs.js +24 -0
- package/dist/scene/rose.js +120 -0
- package/dist/scene/sparkline.js +73 -0
- package/dist/scene/strip.js +63 -0
- package/dist/scene/table.js +76 -0
- package/dist/scene/trend.js +160 -0
- package/dist/scene/wind-history.js +148 -0
- package/dist/scene/wind-plot.js +214 -0
- package/dist/server/adapter.d.ts +28 -0
- package/dist/server/adapter.js +32 -0
- package/dist/server/adapters/campbell.d.ts +112 -0
- package/dist/server/adapters/campbell.js +414 -0
- package/dist/server/adapters/tempest.d.ts +27 -0
- package/dist/server/adapters/tempest.js +137 -0
- package/dist/server/adapters/windnerd.d.ts +39 -0
- package/dist/server/adapters/windnerd.js +159 -0
- package/dist/server/config.d.ts +135 -0
- package/dist/server/config.js +57 -0
- package/dist/server/environment.d.ts +48 -0
- package/dist/server/environment.js +128 -0
- package/dist/server/feed.d.ts +31 -0
- package/dist/server/feed.js +216 -0
- package/dist/server/handler.d.ts +17 -0
- package/dist/server/handler.js +133 -0
- package/dist/server/index.d.ts +10 -0
- package/dist/server/index.js +10 -0
- package/dist/strings.d.ts +118 -0
- package/dist/strings.js +237 -0
- package/dist/windnerd.d.ts +5 -0
- package/dist/windnerd.js +25 -0
- package/package.json +97 -0
- package/schema/README.md +14 -0
- package/schema/example-current.json +48 -0
- package/schema/example-feed.json +147 -0
- package/schema/stationcurrent.schema.json +641 -0
- package/schema/stationfeed.schema.json +656 -0
- package/styles.css +1141 -0
package/dist/strings.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { speedUnitLabel } from "./derive.js";
|
|
2
|
+
//#region src/strings.ts
|
|
3
|
+
const defaultStrings = {
|
|
4
|
+
averageLabel: "Average",
|
|
5
|
+
avgLabel: "avg",
|
|
6
|
+
calm: "Calm",
|
|
7
|
+
calmHistory: "Calm for the entire period",
|
|
8
|
+
degC: "°C",
|
|
9
|
+
feelsLikeLabel: "feels like",
|
|
10
|
+
fromLabel: "from",
|
|
11
|
+
gustLabel: "gust",
|
|
12
|
+
inspectHint: "hover or tap to inspect",
|
|
13
|
+
km: "km",
|
|
14
|
+
lullLabel: "lull",
|
|
15
|
+
minLabel: "Min",
|
|
16
|
+
noHistory: "No history available",
|
|
17
|
+
notMeasured: "Not measured here",
|
|
18
|
+
notReporting: "Not reporting",
|
|
19
|
+
peakLabel: "Peak",
|
|
20
|
+
tempRangeLabel: "Temp",
|
|
21
|
+
trendPressure: "Pressure",
|
|
22
|
+
trendTemperature: "Temperature",
|
|
23
|
+
toLabel: "TO",
|
|
24
|
+
windRunLabel: "Wind run",
|
|
25
|
+
elevation: (metres) => `${metres} m`,
|
|
26
|
+
percentCalm: (percent) => `${percent}% calm`,
|
|
27
|
+
percentShare: (percent) => `${percent}%`,
|
|
28
|
+
dailyPatternSamples: (sampleCount) => `${sampleCount} samples`,
|
|
29
|
+
dailyPatternCoverage: (sampleCount, expectedCount) => `${sampleCount} samples · ${Math.round(sampleCount / Math.max(1, expectedCount) * 100)}%`,
|
|
30
|
+
compassSpoken: {
|
|
31
|
+
N: "north",
|
|
32
|
+
NNE: "north-northeast",
|
|
33
|
+
NE: "northeast",
|
|
34
|
+
ENE: "east-northeast",
|
|
35
|
+
E: "east",
|
|
36
|
+
ESE: "east-southeast",
|
|
37
|
+
SE: "southeast",
|
|
38
|
+
SSE: "south-southeast",
|
|
39
|
+
S: "south",
|
|
40
|
+
SSW: "south-southwest",
|
|
41
|
+
SW: "southwest",
|
|
42
|
+
WSW: "west-southwest",
|
|
43
|
+
W: "west",
|
|
44
|
+
WNW: "west-northwest",
|
|
45
|
+
NW: "northwest",
|
|
46
|
+
NNW: "north-northwest"
|
|
47
|
+
},
|
|
48
|
+
updated: {
|
|
49
|
+
justNow: "just now",
|
|
50
|
+
minutesAgo: (minutes) => `${minutes} min ago`,
|
|
51
|
+
hoursAgo: (hours) => `${hours} hr ago`
|
|
52
|
+
},
|
|
53
|
+
freshness: {
|
|
54
|
+
live: "Live",
|
|
55
|
+
aging: "Aging",
|
|
56
|
+
stale: "Stale"
|
|
57
|
+
},
|
|
58
|
+
reasons: {
|
|
59
|
+
upstream_error: "Station not responding",
|
|
60
|
+
contract_break: "Station sent unreadable data",
|
|
61
|
+
timeout: "Station timed out",
|
|
62
|
+
not_configured: "Station not configured",
|
|
63
|
+
rate_limited: "Update limit reached"
|
|
64
|
+
},
|
|
65
|
+
speedUnits: {
|
|
66
|
+
kmh: speedUnitLabel("kmh"),
|
|
67
|
+
knots: speedUnitLabel("knots"),
|
|
68
|
+
mph: speedUnitLabel("mph"),
|
|
69
|
+
mps: speedUnitLabel("mps")
|
|
70
|
+
},
|
|
71
|
+
table: {
|
|
72
|
+
station: "Station",
|
|
73
|
+
wind: "Wind",
|
|
74
|
+
lull: "Lull",
|
|
75
|
+
gust: "Gust",
|
|
76
|
+
from: "From",
|
|
77
|
+
temp: "Temp",
|
|
78
|
+
updated: "Updated"
|
|
79
|
+
},
|
|
80
|
+
air: {
|
|
81
|
+
title: "Air and precipitation",
|
|
82
|
+
summaryFallback: "Humidity, pressure, rain and lightning",
|
|
83
|
+
summaryHumidity: (percent) => `humidity ${percent}%`,
|
|
84
|
+
summaryRaining: (mmPerHour) => `raining ${mmPerHour} mm/h`,
|
|
85
|
+
summaryRainToday: (mm) => `rain ${mm} mm today`,
|
|
86
|
+
summaryDry: "dry today",
|
|
87
|
+
summaryStrikes: (count) => `${count} ${count === 1 ? "strike" : "strikes"} past hour`,
|
|
88
|
+
noStrike: "No lightning strike on record.",
|
|
89
|
+
lastStrike: (distanceKm, time) => `Last recorded strike ${distanceKm} km away, ${time}.`,
|
|
90
|
+
lastStrikeNoDistance: (time) => `Last recorded strike ${time}, distance unknown.`,
|
|
91
|
+
trendFalling: "falling",
|
|
92
|
+
trendRising: "rising",
|
|
93
|
+
trendSteady: "steady",
|
|
94
|
+
feelsLike: "Feels like",
|
|
95
|
+
humidity: "Humidity",
|
|
96
|
+
dewPoint: "Dew point",
|
|
97
|
+
pressure: "Pressure",
|
|
98
|
+
pressureTrend: "Trend",
|
|
99
|
+
solar: "Solar",
|
|
100
|
+
uv: "UV index",
|
|
101
|
+
rainRate: "Rain rate",
|
|
102
|
+
rainToday: "Rain today",
|
|
103
|
+
rainMinutes: "Raining today",
|
|
104
|
+
lightning: "Lightning",
|
|
105
|
+
unitPercent: "%",
|
|
106
|
+
unitHpa: "hPa",
|
|
107
|
+
unitWm2: "W/m²",
|
|
108
|
+
unitIndex: "index",
|
|
109
|
+
unitMmPerHour: "mm/h",
|
|
110
|
+
unitMm: "mm",
|
|
111
|
+
unitMinutes: "minutes",
|
|
112
|
+
unitStrikesPastHour: "strikes past hour"
|
|
113
|
+
},
|
|
114
|
+
aria: {
|
|
115
|
+
air: (stationCount) => `Air and precipitation readings from ${stationCount} stations`,
|
|
116
|
+
chart: (stationName) => `Wind history at ${stationName}: the band spans lull to gust, the line is the average, and the vanes below point where the wind blew to.`,
|
|
117
|
+
table: (stationCount) => `Live readings from ${stationCount} stations`,
|
|
118
|
+
current: (stationName) => `Current conditions at ${stationName}`,
|
|
119
|
+
dailyPattern: (stationName) => `Typical day at ${stationName}, averaged across the full history`,
|
|
120
|
+
dailyPatternGeneric: "Typical day, averaged across the full history",
|
|
121
|
+
direction: (spoken, deg) => `from ${spoken}, ${deg} degrees`,
|
|
122
|
+
readout: (stationName) => `Inspected reading at ${stationName}`,
|
|
123
|
+
rose: (stationName) => `Wind direction distribution at ${stationName}`,
|
|
124
|
+
roseFavorable: (sectors) => `The outer ring marks favorable directions: from ${sectors}.`,
|
|
125
|
+
roseGeneric: "Wind direction distribution",
|
|
126
|
+
sparkline: (stationName) => `six hours of wind at ${stationName}`,
|
|
127
|
+
strip: (stationName) => `Latest reading at ${stationName}`,
|
|
128
|
+
summary: (endedAtFormatted) => `Summary of the period ending ${endedAtFormatted}`,
|
|
129
|
+
trend: (stationName, seriesName) => `${seriesName} history at ${stationName}`
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
function resolveStrings(overrides) {
|
|
133
|
+
if (!overrides) return defaultStrings;
|
|
134
|
+
return {
|
|
135
|
+
...defaultStrings,
|
|
136
|
+
...overrides,
|
|
137
|
+
compassSpoken: {
|
|
138
|
+
...defaultStrings.compassSpoken,
|
|
139
|
+
...overrides.compassSpoken
|
|
140
|
+
},
|
|
141
|
+
updated: {
|
|
142
|
+
...defaultStrings.updated,
|
|
143
|
+
...overrides.updated
|
|
144
|
+
},
|
|
145
|
+
freshness: {
|
|
146
|
+
...defaultStrings.freshness,
|
|
147
|
+
...overrides.freshness
|
|
148
|
+
},
|
|
149
|
+
reasons: {
|
|
150
|
+
...defaultStrings.reasons,
|
|
151
|
+
...overrides.reasons
|
|
152
|
+
},
|
|
153
|
+
speedUnits: {
|
|
154
|
+
...defaultStrings.speedUnits,
|
|
155
|
+
...overrides.speedUnits
|
|
156
|
+
},
|
|
157
|
+
table: {
|
|
158
|
+
...defaultStrings.table,
|
|
159
|
+
...overrides.table
|
|
160
|
+
},
|
|
161
|
+
air: {
|
|
162
|
+
...defaultStrings.air,
|
|
163
|
+
...overrides.air
|
|
164
|
+
},
|
|
165
|
+
aria: {
|
|
166
|
+
...defaultStrings.aria,
|
|
167
|
+
...overrides.aria
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function mergeStringOverrides(outer, inner) {
|
|
172
|
+
if (!outer) return inner;
|
|
173
|
+
if (!inner) return outer;
|
|
174
|
+
return {
|
|
175
|
+
...outer,
|
|
176
|
+
...inner,
|
|
177
|
+
compassSpoken: {
|
|
178
|
+
...outer.compassSpoken,
|
|
179
|
+
...inner.compassSpoken
|
|
180
|
+
},
|
|
181
|
+
updated: {
|
|
182
|
+
...outer.updated,
|
|
183
|
+
...inner.updated
|
|
184
|
+
},
|
|
185
|
+
freshness: {
|
|
186
|
+
...outer.freshness,
|
|
187
|
+
...inner.freshness
|
|
188
|
+
},
|
|
189
|
+
reasons: {
|
|
190
|
+
...outer.reasons,
|
|
191
|
+
...inner.reasons
|
|
192
|
+
},
|
|
193
|
+
speedUnits: {
|
|
194
|
+
...outer.speedUnits,
|
|
195
|
+
...inner.speedUnits
|
|
196
|
+
},
|
|
197
|
+
table: {
|
|
198
|
+
...outer.table,
|
|
199
|
+
...inner.table
|
|
200
|
+
},
|
|
201
|
+
air: {
|
|
202
|
+
...outer.air,
|
|
203
|
+
...inner.air
|
|
204
|
+
},
|
|
205
|
+
aria: {
|
|
206
|
+
...outer.aria,
|
|
207
|
+
...inner.aria
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const timeFormats = /* @__PURE__ */ new Map();
|
|
212
|
+
function timeFormat(locale) {
|
|
213
|
+
const key = locale ?? "";
|
|
214
|
+
let format = timeFormats.get(key);
|
|
215
|
+
if (format == null) {
|
|
216
|
+
format = new Intl.DateTimeFormat(locale, {
|
|
217
|
+
hour: "numeric",
|
|
218
|
+
minute: "2-digit"
|
|
219
|
+
});
|
|
220
|
+
timeFormats.set(key, format);
|
|
221
|
+
}
|
|
222
|
+
return format;
|
|
223
|
+
}
|
|
224
|
+
function defaultFormatTime(date) {
|
|
225
|
+
return timeFormat(void 0).format(date);
|
|
226
|
+
}
|
|
227
|
+
const localeFormatTimes = /* @__PURE__ */ new Map();
|
|
228
|
+
function localeFormatTime(locale) {
|
|
229
|
+
let format = localeFormatTimes.get(locale);
|
|
230
|
+
if (format == null) {
|
|
231
|
+
format = (date) => timeFormat(locale).format(date);
|
|
232
|
+
localeFormatTimes.set(locale, format);
|
|
233
|
+
}
|
|
234
|
+
return format;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
export { defaultFormatTime, defaultStrings, localeFormatTime, mergeStringOverrides, resolveStrings };
|
package/dist/windnerd.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/windnerd.ts
|
|
2
|
+
const WINDNERD_HOST = "windnerd.net";
|
|
3
|
+
const WINDNERD_KEY = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
4
|
+
function normalizeWindnerdStationKey(value) {
|
|
5
|
+
const candidate = value?.trim();
|
|
6
|
+
if (!candidate) return null;
|
|
7
|
+
if (WINDNERD_KEY.test(candidate)) return candidate;
|
|
8
|
+
let url;
|
|
9
|
+
try {
|
|
10
|
+
url = new URL(candidate);
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (url.protocol !== "https:" || url.hostname !== WINDNERD_HOST) return null;
|
|
15
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
16
|
+
const key = segments[1];
|
|
17
|
+
if (segments.length !== 2 || segments[0] !== "en" || !key || !WINDNERD_KEY.test(key)) return null;
|
|
18
|
+
return key;
|
|
19
|
+
}
|
|
20
|
+
function windnerdStationUrl(stationKey) {
|
|
21
|
+
if (!WINDNERD_KEY.test(stationKey)) throw new Error("Invalid WindNerd station key.");
|
|
22
|
+
return `https://${WINDNERD_HOST}/en/${stationKey}`;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { normalizeWindnerdStationKey, windnerdStationUrl };
|
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@azohra/meteo.station",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "The station capability of meteo by Azohra: live weather-station reading, derivation, and display - the wire contract, provider adapters, a polling client, a Node server, and React and custom-element display bindings.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"weather-station",
|
|
7
|
+
"wind",
|
|
8
|
+
"live-wind",
|
|
9
|
+
"paragliding",
|
|
10
|
+
"free-flight",
|
|
11
|
+
"web-components",
|
|
12
|
+
"react"
|
|
13
|
+
],
|
|
14
|
+
"author": "Justin Watts",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/azohra/meteo.git",
|
|
19
|
+
"directory": "station"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"!dist/internal",
|
|
25
|
+
"schema",
|
|
26
|
+
"styles.css"
|
|
27
|
+
],
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"**/*.css",
|
|
30
|
+
"./dist/elements/register.js"
|
|
31
|
+
],
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./client": {
|
|
38
|
+
"types": "./dist/client/index.d.ts",
|
|
39
|
+
"default": "./dist/client/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./fixtures": {
|
|
42
|
+
"types": "./dist/fixtures.d.ts",
|
|
43
|
+
"default": "./dist/fixtures.js"
|
|
44
|
+
},
|
|
45
|
+
"./server": {
|
|
46
|
+
"types": "./dist/server/index.d.ts",
|
|
47
|
+
"default": "./dist/server/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./react": {
|
|
50
|
+
"types": "./dist/react/index.d.ts",
|
|
51
|
+
"default": "./dist/react/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./elements": {
|
|
54
|
+
"types": "./dist/elements/index.d.ts",
|
|
55
|
+
"default": "./dist/elements/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./elements/register": {
|
|
58
|
+
"types": "./dist/elements/register.d.ts",
|
|
59
|
+
"default": "./dist/elements/register.js"
|
|
60
|
+
},
|
|
61
|
+
"./styles.css": "./styles.css",
|
|
62
|
+
"./schema/*.json": "./schema/*.json",
|
|
63
|
+
"./package.json": "./package.json"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"zod": "^4.0.0",
|
|
67
|
+
"@azohra/meteo.core": "0.1.1"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"react": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@testing-library/react": "^16.1.0",
|
|
79
|
+
"@types/node": "^22.10.0",
|
|
80
|
+
"@types/react": "^19.0.0",
|
|
81
|
+
"@types/react-dom": "^19.2.4",
|
|
82
|
+
"jsdom": "^26.0.0",
|
|
83
|
+
"react": "^19.0.0",
|
|
84
|
+
"react-dom": "^19.0.0",
|
|
85
|
+
"typescript": "^5.6.0",
|
|
86
|
+
"vitest": "^4.0.0"
|
|
87
|
+
},
|
|
88
|
+
"engines": {
|
|
89
|
+
"node": ">=22"
|
|
90
|
+
},
|
|
91
|
+
"homepage": "https://meteo.azohra.com",
|
|
92
|
+
"scripts": {
|
|
93
|
+
"build": "pnpm --dir ../core build && vp pack",
|
|
94
|
+
"test": "pnpm --dir ../core build && vp test",
|
|
95
|
+
"typecheck": "pnpm --dir ../core build && tsc -p tsconfig.json --noEmit"
|
|
96
|
+
}
|
|
97
|
+
}
|
package/schema/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Wire contract artifacts
|
|
2
|
+
|
|
3
|
+
The station capability's wire contract in language-neutral form: JSON
|
|
4
|
+
Schemas emitted from the zod contract (`station/contract.ts`), plus two
|
|
5
|
+
annotated example documents. Never edited by hand — regenerate with
|
|
6
|
+
`pnpm schemas` at the workspace root, which must reproduce every file
|
|
7
|
+
byte-identical (the drift guard is this package's own test suite).
|
|
8
|
+
|
|
9
|
+
They are committed rather than build-generated so contract changes appear
|
|
10
|
+
as reviewable diffs, and they ship in the npm tarball (`files` lists this
|
|
11
|
+
directory, exported as `@azohra/meteo.station/schema/*.json`) so non-JavaScript
|
|
12
|
+
consumers can validate against them without a TypeScript build. Every
|
|
13
|
+
schema carries a `$id` under `https://meteo.azohra.com/schema/`, and the
|
|
14
|
+
site build publishes this directory at those URLs.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Example @azohra/meteo.station current document. Validates against stationcurrent.schema.json; readers must ignore unknown keys (this one included).",
|
|
3
|
+
"schemaVersion": 2,
|
|
4
|
+
"servedAt": "2026-08-05T22:13:00.000Z",
|
|
5
|
+
"station": {
|
|
6
|
+
"id": "meadow",
|
|
7
|
+
"name": "Ridge Meadow",
|
|
8
|
+
"sourceLabel": "Tempest",
|
|
9
|
+
"pageUrl": "https://example.com/stations/ridge-meadow",
|
|
10
|
+
"latitude": 49.5,
|
|
11
|
+
"longitude": -118.5,
|
|
12
|
+
"timeZone": "America/Vancouver",
|
|
13
|
+
"elevationM": 1180,
|
|
14
|
+
"capabilities": {
|
|
15
|
+
"gustLull": true,
|
|
16
|
+
"temperature": true,
|
|
17
|
+
"conditions": true,
|
|
18
|
+
"history": false
|
|
19
|
+
},
|
|
20
|
+
"samplingWindowSeconds": 60,
|
|
21
|
+
"recommendedPollSeconds": 60,
|
|
22
|
+
"status": "ok",
|
|
23
|
+
"reading": {
|
|
24
|
+
"observedAt": "2026-08-05T22:13:00.000Z",
|
|
25
|
+
"windAvgMps": 2.5,
|
|
26
|
+
"windDirectionDeg": 273,
|
|
27
|
+
"windGustMps": 4.2,
|
|
28
|
+
"windLullMps": 1.1,
|
|
29
|
+
"temperatureC": 21.5,
|
|
30
|
+
"windChillC": 20.9,
|
|
31
|
+
"conditions": {
|
|
32
|
+
"dewPointC": 7.5,
|
|
33
|
+
"lastLightningStrikeAt": null,
|
|
34
|
+
"lastLightningStrikeDistanceKm": null,
|
|
35
|
+
"lightningStrikeCountLastHour": null,
|
|
36
|
+
"precipitationMinutesToday": 0,
|
|
37
|
+
"precipitationRateMmPerHour": 0,
|
|
38
|
+
"precipitationTodayMm": 0,
|
|
39
|
+
"pressureTrend": "steady",
|
|
40
|
+
"relativeHumidityPercent": 40,
|
|
41
|
+
"seaLevelPressureHpa": 1014.2,
|
|
42
|
+
"solarRadiationWm2": 645,
|
|
43
|
+
"uvIndex": 5.8
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"history": null
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Example @azohra/meteo.station feed document. Validates against stationfeed.schema.json; readers must ignore unknown keys (this one included).",
|
|
3
|
+
"schemaVersion": 2,
|
|
4
|
+
"servedAt": "2026-08-05T22:13:00.000Z",
|
|
5
|
+
"primaryStationId": "meadow",
|
|
6
|
+
"stations": [
|
|
7
|
+
{
|
|
8
|
+
"id": "meadow",
|
|
9
|
+
"name": "Ridge Meadow",
|
|
10
|
+
"sourceLabel": "Tempest",
|
|
11
|
+
"pageUrl": "https://example.com/stations/ridge-meadow",
|
|
12
|
+
"latitude": 49.5,
|
|
13
|
+
"longitude": -118.5,
|
|
14
|
+
"timeZone": "America/Vancouver",
|
|
15
|
+
"elevationM": 1180,
|
|
16
|
+
"capabilities": {
|
|
17
|
+
"gustLull": true,
|
|
18
|
+
"temperature": true,
|
|
19
|
+
"conditions": true,
|
|
20
|
+
"history": false
|
|
21
|
+
},
|
|
22
|
+
"samplingWindowSeconds": 60,
|
|
23
|
+
"recommendedPollSeconds": 60,
|
|
24
|
+
"status": "ok",
|
|
25
|
+
"reading": {
|
|
26
|
+
"observedAt": "2026-08-05T22:13:00.000Z",
|
|
27
|
+
"windAvgMps": 2.5,
|
|
28
|
+
"windDirectionDeg": 273,
|
|
29
|
+
"windGustMps": 4.2,
|
|
30
|
+
"windLullMps": 1.1,
|
|
31
|
+
"temperatureC": 21.5,
|
|
32
|
+
"windChillC": 20.9,
|
|
33
|
+
"conditions": {
|
|
34
|
+
"dewPointC": 7.5,
|
|
35
|
+
"lastLightningStrikeAt": null,
|
|
36
|
+
"lastLightningStrikeDistanceKm": null,
|
|
37
|
+
"lightningStrikeCountLastHour": null,
|
|
38
|
+
"precipitationMinutesToday": 0,
|
|
39
|
+
"precipitationRateMmPerHour": 0,
|
|
40
|
+
"precipitationTodayMm": 0,
|
|
41
|
+
"pressureTrend": "steady",
|
|
42
|
+
"relativeHumidityPercent": 40,
|
|
43
|
+
"seaLevelPressureHpa": 1014.2,
|
|
44
|
+
"solarRadiationWm2": 645,
|
|
45
|
+
"uvIndex": 5.8
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"history": null
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "bluff",
|
|
52
|
+
"name": "Bluff Launch",
|
|
53
|
+
"sourceLabel": "WindNerd",
|
|
54
|
+
"pageUrl": "https://example.com/stations/bluff-launch",
|
|
55
|
+
"latitude": 49.7,
|
|
56
|
+
"longitude": -118.2,
|
|
57
|
+
"timeZone": "America/Vancouver",
|
|
58
|
+
"elevationM": 1370,
|
|
59
|
+
"capabilities": {
|
|
60
|
+
"gustLull": true,
|
|
61
|
+
"temperature": true,
|
|
62
|
+
"conditions": true,
|
|
63
|
+
"history": true
|
|
64
|
+
},
|
|
65
|
+
"samplingWindowSeconds": 60,
|
|
66
|
+
"recommendedPollSeconds": 60,
|
|
67
|
+
"status": "ok",
|
|
68
|
+
"reading": {
|
|
69
|
+
"observedAt": "2026-08-05T22:12:45.000Z",
|
|
70
|
+
"windAvgMps": 2.5,
|
|
71
|
+
"windDirectionDeg": 290,
|
|
72
|
+
"windGustMps": 3.9,
|
|
73
|
+
"windLullMps": 1.7,
|
|
74
|
+
"temperatureC": 22.6,
|
|
75
|
+
"windChillC": null,
|
|
76
|
+
"conditions": {
|
|
77
|
+
"dewPointC": null,
|
|
78
|
+
"lastLightningStrikeAt": null,
|
|
79
|
+
"lastLightningStrikeDistanceKm": null,
|
|
80
|
+
"lightningStrikeCountLastHour": null,
|
|
81
|
+
"precipitationMinutesToday": null,
|
|
82
|
+
"precipitationRateMmPerHour": null,
|
|
83
|
+
"precipitationTodayMm": null,
|
|
84
|
+
"pressureTrend": "steady",
|
|
85
|
+
"relativeHumidityPercent": null,
|
|
86
|
+
"seaLevelPressureHpa": 1006.1,
|
|
87
|
+
"solarRadiationWm2": null,
|
|
88
|
+
"uvIndex": null
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"history": {
|
|
92
|
+
"periodMinutes": 1,
|
|
93
|
+
"points": [
|
|
94
|
+
{
|
|
95
|
+
"observedAt": "2026-08-05T22:10:45.000Z",
|
|
96
|
+
"windAvgMps": 1.7,
|
|
97
|
+
"windGustMps": 2.2,
|
|
98
|
+
"windLullMps": 1.1,
|
|
99
|
+
"windDirectionDeg": 300,
|
|
100
|
+
"temperatureC": 20.2,
|
|
101
|
+
"seaLevelPressureHpa": 1007.7
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"observedAt": "2026-08-05T22:11:45.000Z",
|
|
105
|
+
"windAvgMps": 3.3,
|
|
106
|
+
"windGustMps": 5.8,
|
|
107
|
+
"windLullMps": 1.9,
|
|
108
|
+
"windDirectionDeg": 310,
|
|
109
|
+
"temperatureC": null,
|
|
110
|
+
"seaLevelPressureHpa": null
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"observedAt": "2026-08-05T22:12:45.000Z",
|
|
114
|
+
"windAvgMps": 2.5,
|
|
115
|
+
"windGustMps": 3.9,
|
|
116
|
+
"windLullMps": 1.7,
|
|
117
|
+
"windDirectionDeg": 290,
|
|
118
|
+
"temperatureC": 22.6,
|
|
119
|
+
"seaLevelPressureHpa": 1006.1
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "narrows",
|
|
126
|
+
"name": "Gorge Narrows",
|
|
127
|
+
"sourceLabel": "Campbell logger",
|
|
128
|
+
"pageUrl": "https://example.com/stations/gorge-narrows",
|
|
129
|
+
"latitude": 49.3,
|
|
130
|
+
"longitude": -118.8,
|
|
131
|
+
"timeZone": "America/Vancouver",
|
|
132
|
+
"elevationM": 460,
|
|
133
|
+
"capabilities": {
|
|
134
|
+
"gustLull": true,
|
|
135
|
+
"temperature": true,
|
|
136
|
+
"conditions": false,
|
|
137
|
+
"history": true
|
|
138
|
+
},
|
|
139
|
+
"samplingWindowSeconds": 3,
|
|
140
|
+
"recommendedPollSeconds": 15,
|
|
141
|
+
"status": "unavailable",
|
|
142
|
+
"reason": "upstream_error",
|
|
143
|
+
"reading": null,
|
|
144
|
+
"history": null
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|