Skip to content

Commit

Permalink
Revert "fix(api): don't treat project as a module"
Browse files Browse the repository at this point in the history
This reverts commit 2c86ab0.
  • Loading branch information
jeremyckahn committed Aug 30, 2024
1 parent 66ae575 commit 04bf198
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
10 changes: 5 additions & 5 deletions api/get-market-data.js
Original file line number Diff line number Diff line change
@@ -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.
const { promisify } = require('util')
import { promisify } from 'util'

require('redis')
require('../src/common/utils')
import 'redis'
import '../src/common/utils'
// End explicit requires for serverless builds

const {
import {
allowCors,
getRedisClient,
getRoomData,
getRoomName,
} = require('../api-etc/utils')
} from '../api-etc/utils'

const client = getRedisClient()

Expand Down
16 changes: 8 additions & 8 deletions api/post-day-results.js
Original file line number Diff line number Diff line change
@@ -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.
require('redis')
require('../src/common/utils')
require('../src/common/constants')
require('../api-etc/constants')
import 'redis'
import '../src/common/utils'
import '../src/common/constants'
import '../api-etc/constants'
// End explicit requires for serverless builds

const { promisify } = require('util')
import { promisify } from 'util'

const {
import {
allowCors,
getRedisClient,
getRoomData,
getRoomName,
} = require('../api-etc/utils')
const { random } = require('../src/common/utils')
} from '../api-etc/utils'
import { random } from '../src/common/utils'

const client = getRedisClient()

Expand Down
16 changes: 8 additions & 8 deletions api/publish-global-market-values-to-discord.js
Original file line number Diff line number Diff line change
@@ -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.
require('redis')
require('../src/common/utils')
require('../src/common/constants')
require('../api-etc/constants')
import 'redis'
import '../src/common/utils'
import '../src/common/constants'
import '../api-etc/constants'
// End explicit requires for serverless builds

const { promisify } = require('util')
import { promisify } from 'util'

const axios = require('axios')
import axios from 'axios'

const { MARKET_SUMMARY_FOR_DISCORD } = require('../api-etc/templates')
const { allowCors, getRedisClient, getRoomData } = require('../api-etc/utils')
import { MARKET_SUMMARY_FOR_DISCORD } from '../api-etc/templates'
import { allowCors, getRedisClient, getRoomData } from '../api-etc/utils'

const client = getRedisClient()

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"main": "public/electron.js",
"unpkg": "build/index.html",
"homepage": "https://www.farmhand.life/",
"type": "module",
"scripts": {
"build": "vite build",
"build:native": "npm run build -- --base='./' && electron-builder --publish=always",
Expand Down

0 comments on commit 04bf198

Please sign in to comment.