From 91277260258a6620121d99dd28fb83cd7e0ff457 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Thu, 29 Aug 2024 21:27:19 -0500 Subject: [PATCH] fix(api): don't treat project as a module --- api/get-market-data.js | 10 +++++----- api/post-day-results.js | 16 ++++++++-------- api/publish-global-market-values-to-discord.js | 16 ++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/api/get-market-data.js b/api/get-market-data.js index c538fb679..e2f01a81e 100644 --- a/api/get-market-data.js +++ b/api/get-market-data.js @@ -1,18 +1,18 @@ // Dependencies required by ./utils (see below) need to be explicitly required // here to ensure that that they are included in serverless builds. Do NOT // remove them unless they are not needed by any upstream modules. -import { promisify } from 'util' +const { promisify } = require('util') -import 'redis' -import '../src/common/utils' +require('redis') +require('../src/common/utils') // End explicit requires for serverless builds -import { +const { allowCors, getRedisClient, getRoomData, getRoomName, -} from '../api-etc/utils' +} = require('../api-etc/utils') const client = getRedisClient() diff --git a/api/post-day-results.js b/api/post-day-results.js index d781d3c31..e26e9fd42 100644 --- a/api/post-day-results.js +++ b/api/post-day-results.js @@ -1,21 +1,21 @@ // Dependencies required by ./utils (see below) need to be explicitly required // here to ensure that that they are included in serverless builds. Do NOT // remove them unless they are not needed by any upstream modules. -import 'redis' -import '../src/common/utils' -import '../src/common/constants' -import '../api-etc/constants' +require('redis') +require('../src/common/utils') +require('../src/common/constants') +require('../api-etc/constants') // End explicit requires for serverless builds -import { promisify } from 'util' +const { promisify } = require('util') -import { +const { allowCors, getRedisClient, getRoomData, getRoomName, -} from '../api-etc/utils' -import { random } from '../src/common/utils' +} = require('../api-etc/utils') +const { random } = require('../src/common/utils') const client = getRedisClient() diff --git a/api/publish-global-market-values-to-discord.js b/api/publish-global-market-values-to-discord.js index b32ff0795..119caa118 100644 --- a/api/publish-global-market-values-to-discord.js +++ b/api/publish-global-market-values-to-discord.js @@ -1,18 +1,18 @@ // Dependencies required by ./utils (see below) need to be explicitly required // here to ensure that that they are included in serverless builds. Do NOT // remove them unless they are not needed by any upstream modules. -import 'redis' -import '../src/common/utils' -import '../src/common/constants' -import '../api-etc/constants' +require('redis') +require('../src/common/utils') +require('../src/common/constants') +require('../api-etc/constants') // End explicit requires for serverless builds -import { promisify } from 'util' +const { promisify } = require('util') -import axios from 'axios' +const axios = require('axios') -import { MARKET_SUMMARY_FOR_DISCORD } from '../api-etc/templates' -import { allowCors, getRedisClient, getRoomData } from '../api-etc/utils' +const { MARKET_SUMMARY_FOR_DISCORD } = require('../api-etc/templates') +const { allowCors, getRedisClient, getRoomData } = require('../api-etc/utils') const client = getRedisClient()