Skip to content

Commit d94e406

Browse files
committed
Convert tools to TypeScript, extract helpers
1 parent d1177f6 commit d94e406

File tree

14 files changed

+811
-80
lines changed

14 files changed

+811
-80
lines changed

.github/workflows/updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: npm install
2626

2727
- name: Run NOAA stations update
28-
run: tools/update-noaa-stations
28+
run: tools/update-noaa-stations.ts
2929

3030
- name: Check for changes
3131
id: changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ You can also manually trigger the workflow from the Actions tab in GitHub.
6767
To manually update NOAA stations:
6868

6969
```bash
70-
$ tools/update-noaa-stations
70+
$ tools/update-noaa-stations.ts
7171
```
7272

7373
This will scan all existing NOAA station files, fetch any new stations from NOAA's API, and update harmonic constituents for all stations.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@
2323
"doc": "docs"
2424
},
2525
"scripts": {
26-
"build": "vite build",
26+
"build": "tsc -b && tsc -p tsconfig.node.json && vite build",
2727
"prepare": "npm run build",
2828
"test": "vitest"
2929
},
3030
"devDependencies": {
31+
"@neaps/tide-predictor": "^0.2.1",
32+
"@types/make-fetch-happen": "^10.0.4",
33+
"@types/node": "^25.0.3",
3134
"ajv": "^8.17.1",
3235
"ajv-formats": "^3.0.1",
36+
"country-code-lookup": "^0.1.3",
3337
"geo-tz": "^8.1.4",
3438
"make-fetch-happen": "^15.0.3",
3539
"moment": "^2.30.1",
40+
"sort-object-keys": "^2.0.1",
3641
"vite": "^7.2.6",
3742
"vite-plugin-dts": "^4.5.4",
3843
"vitest": "^4.0.15"

schemas/station.schema.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@
137137
"name",
138138
"id",
139139
"published_harmonics",
140-
"url",
141-
"source_url"
140+
"url"
142141
],
143142
"additionalProperties": true,
144143
"properties": {
@@ -161,11 +160,6 @@
161160
"type": "string",
162161
"format": "uri",
163162
"description": "URL to this station's data or information in the source's website"
164-
},
165-
"source_url": {
166-
"type": "string",
167-
"format": "uri",
168-
"description": "URL to the source API endpoint for this station's data"
169163
}
170164
}
171165
},

0 commit comments

Comments
 (0)