Skip to content

Commit

Permalink
attempt to fix with module
Browse files Browse the repository at this point in the history
  • Loading branch information
AvidDabbler committed Jul 16, 2024
1 parent 150bc52 commit f431c9b
Show file tree
Hide file tree
Showing 6 changed files with 11,877 additions and 14,782 deletions.
4 changes: 2 additions & 2 deletions app/config.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from "fs";
import path from "path";

import { z } from "zod";

const loadEnv = () => {
Expand All @@ -18,6 +17,7 @@ const loadEnv = () => {
envLines.forEach((line) => {
const [key, value] = line.split("=");
if (key && value)
// @ts-ignore idk
process.env[key.trim()] = value.trim().replaceAll('"', "");
});
} catch {
Expand All @@ -37,7 +37,7 @@ const config = () => {
GTFS_URL: z.string(),
S3_BUCKET: z.string(),
AWS_ACCESS_KEY_ID: z.string(),
AWS_SECRET_ACCESS_KEY: z.string()
AWS_SECRET_ACCESS_KEY: z.string(),
})
.parse(process.env);
return _config;
Expand Down
13 changes: 8 additions & 5 deletions app/gtfs/gtfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ import gtfsToHtml from "gtfs-to-html";

import { gtfsConfig, envConfig } from "../config.server";

Check failure on line 8 in app/gtfs/gtfs.ts

View workflow job for this annotation

GitHub Actions / ʦ TypeScript

Cannot find module '../config.server' or its corresponding type declarations.

export const load = async () => {
export const load = () => {
try {
await importGtfs(gtfsConfig);
await gtfsToHtml(gtfsConfig)
importGtfs(gtfsConfig)
.then(() => {
gtfsToHtml(gtfsConfig);
})
.then(() => {
console.log("HTML Generation Successful");
process.exit();
})
// @ts-expect-error no types
.then(() => {
gtfsToGeoJSON(gtfsConfig as any);
})
.catch((err) => {
console.error(err);
process.exit(1);
});
await gtfsToGeoJSON(gtfsConfig);
} catch (error) {
console.error(error);
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"type": "module",
"name": "transit-agency-site-4f17",
"private": true,
"sideEffects": false,
Expand Down
Loading

0 comments on commit f431c9b

Please sign in to comment.