Skip to content

Commit

Permalink
fix!: relative imports for word list
Browse files Browse the repository at this point in the history
  • Loading branch information
royce-mathew committed Jan 10, 2025
1 parent 44c15c1 commit be45780
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/app/(app)/apps/wordle/get-word.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

import fs from "fs/promises"

const words_file = await fs.readFile("./words.txt", "utf8")
const words_file = await fs.readFile(
process.cwd() + "/src/app/(app)/apps/wordle/words.txt",
"utf8"
)
const valid_words = words_file.split("\n").map((word) => word.trim())

const all_words_file = await fs.readFile("./possible_words.txt", "utf8")
const all_words_file = await fs.readFile(
process.cwd() + "/src/app/(app)/apps/wordle/possible-words.txt",
"utf8"
)
const all_words = all_words_file.split("\n").map((word) => word.trim())

// Get a random word
Expand Down
3 changes: 2 additions & 1 deletion src/app/(app)/apps/wordle/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable tailwindcss/classnames-order */
"use client"

import React, { useEffect, useState } from "react"
Expand Down Expand Up @@ -95,7 +96,7 @@ const WordlePage: React.FC = () => {

return (
<main className="flex min-h-screen flex-col items-center">
<h1 className="font-cal mt-16 w-full py-3 text-center text-5xl font-bold md:space-x-8 md:text-6xl">
<h1 className="mt-16 w-full py-3 text-center font-cal text-5xl font-bold md:space-x-8 md:text-6xl">
Wordle
</h1>
<p className="w-1/3 text-center text-lg">
Expand Down

0 comments on commit be45780

Please sign in to comment.