diff --git a/gulp/publish-frontend.mjs b/gulp/publish-frontend.mjs index f2d3f30..6293480 100644 --- a/gulp/publish-frontend.mjs +++ b/gulp/publish-frontend.mjs @@ -1,4 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies */ import 'dotenv/config'; import { src, dest, series, parallel, @@ -58,15 +57,6 @@ const jsVendorSources = [ 'server/scripts/vendor/auto/suncalc.js', ]; -// Copy metar-taf-parser separately since it's an ES module with locale dependencies -const metarVendorSources = [ - 'server/scripts/vendor/auto/metar-taf-parser.mjs', - 'server/scripts/vendor/auto/locale/en.js', -]; - -const copyMetarVendor = () => src(metarVendorSources, { base: 'server/scripts/vendor/auto' }) - .pipe(dest(`${RESOURCES_PATH}/vendor/auto`)); - const compressJsVendor = () => src(jsVendorSources) .pipe(concat('vendor.min.js')) .pipe(terser()) @@ -210,7 +200,7 @@ const buildPlaylist = async () => { return file('playlist.json', JSON.stringify(playlist)).pipe(dest('./dist')); }; -const buildDist = series(clean, parallel(buildJs, compressJsVendor, copyMetarVendor, copyCss, compressHtml, copyOtherFiles, copyDataFiles, copyImageSources, buildPlaylist)); +const buildDist = series(clean, parallel(buildJs, compressJsVendor, copyCss, compressHtml, copyOtherFiles, copyDataFiles, copyImageSources, buildPlaylist)); // upload_images could be in parallel with upload, but _images logs a lot and has little changes // by running upload last the majority of the changes will be at the bottom of the log for easy viewing diff --git a/gulp/update-vendor.mjs b/gulp/update-vendor.mjs index 550ff21..2dbc215 100644 --- a/gulp/update-vendor.mjs +++ b/gulp/update-vendor.mjs @@ -1,4 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies */ import { src, series, dest } from 'gulp'; import { deleteAsync } from 'del'; import rename from 'gulp-rename'; diff --git a/server/scripts/modules/utils/metar.mjs b/server/scripts/modules/utils/metar.mjs index 98b371e..97359b1 100644 --- a/server/scripts/modules/utils/metar.mjs +++ b/server/scripts/modules/utils/metar.mjs @@ -1,5 +1,7 @@ // METAR parsing utilities using metar-taf-parser library import { parseMetar } from '../../vendor/auto/metar-taf-parser.mjs'; +// eslint-disable-next-line import/extensions +import en from '../../vendor/auto/locale/en.js'; /** * Augment observation data by parsing METAR when API fields are missing @@ -14,7 +16,7 @@ const augmentObservationWithMetar = (observation) => { const metar = { ...observation }; try { - const metarData = parseMetar(observation.rawMessage); + const metarData = parseMetar(observation.rawMessage, { locale: en }); if (observation.windSpeed?.value === null && metarData.wind?.speed !== undefined) { metar.windSpeed = { diff --git a/ws4kp.code-workspace b/ws4kp.code-workspace index 67581ec..2069d89 100644 --- a/ws4kp.code-workspace +++ b/ws4kp.code-workspace @@ -44,7 +44,8 @@ "mwood", "unmuted", "dumpio", - "mesonet" + "mesonet", + "metar" ], "cSpell.ignorePaths": [ "**/package-lock.json", @@ -82,4 +83,4 @@ "j69.ejs-beautify", ] } -} +} \ No newline at end of file