Skip to content

Commit

Permalink
Merge branch 'main' into mntor-3806
Browse files Browse the repository at this point in the history
  • Loading branch information
flozia committed Jan 13, 2025
2 parents 322d990 + 0fb9f97 commit b99a3a6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
37 changes: 24 additions & 13 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@sentry/nextjs": "^8.47.0",
"@sentry/node": "^8.0.0",
"@sentry/utils": "^8.47.0",
"@stripe/stripe-js": "^5.2.0",
"@stripe/stripe-js": "^5.5.0",
"@types/jsdom": "^21.1.7",
"@types/node": "^22.10.2",
"@types/react": "^18.3.12",
Expand Down Expand Up @@ -157,13 +157,13 @@
"lint-staged": "^15.3.0",
"mjml-browser": "^4.15.3",
"prettier": "3.4.2",
"sass": "^1.83.0",
"sass": "^1.83.1",
"storybook": "^8.4.6",
"stylelint": "^16.12.0",
"stylelint-config-recommended-scss": "^14.1.0",
"stylelint-scss": "^6.10.0",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"yaml": "^2.6.1"
"yaml": "^2.7.0"
}
}
2 changes: 1 addition & 1 deletion src/scripts/build/uploadAutoCompleteLocations.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import os from "os";
import path from "path";
import fs from "fs";
import AdmZip from "adm-zip";
import { uploadToS3 } from "../../utils/s3.js";

const REMOTE_DATA_URL = "https://download.geonames.org/export/dump";
const DATA_COUNTRY_CODE = "US";
Expand Down Expand Up @@ -328,7 +329,6 @@ try {
if (process.argv.includes("--skip-upload")) {
console.debug("Skipping S3 upload");
} else {
const uploadToS3 = await import("../s3.js");
await uploadToS3(`autocomplete/${LOCATIONS_DATA_FILE}`, readStream);
}

Expand Down
10 changes: 7 additions & 3 deletions src/utils/s3.ts → src/utils/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const s3 = new S3({
},
});

export async function uploadToS3(fileName: string, fileStream: Buffer) {
/**
* @param {string} fileName
* @param {Buffer} fileStream
*/
export async function uploadToS3(fileName, fileStream) {
console.log("Attempt to upload to s3: ", fileName);
const uploadParams = {
Bucket,
Expand All @@ -37,7 +41,7 @@ export async function uploadToS3(fileName: string, fileStream: Buffer) {
params: uploadParams,
}).done();
console.log("Successfully uploaded data to " + Bucket + "/" + fileName);
} catch (err) {
console.error(err, (err as Error).stack);
} catch (/** @type {any} */ err) {
console.error(err, err.stack);
}
}

0 comments on commit b99a3a6

Please sign in to comment.