debugging making app work again

This commit is contained in:
Triston Armstrong 2023-12-31 09:35:22 -06:00
parent 250081b32a
commit 78f98d4f1b
7 changed files with 33 additions and 17 deletions

BIN
bun.lockb

Binary file not shown.

2
next-env.d.ts vendored
View File

@ -1,6 +1,4 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference types="next" /> /// <reference types="next" />
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
// NOTE: This file should not be edited // NOTE: This file should not be edited

View File

@ -1,4 +1,4 @@
export default function webpack(config) { export function webpack(config) {
config.resolve.fallback = { ...config.resolve.fallback, fs: false } config.resolve.fallback = { ...config.resolve.fallback, fs: false }
return config return config
} }

View File

@ -58,8 +58,10 @@
"vfile-reporter": "latest" "vfile-reporter": "latest"
}, },
"devDependencies": { "devDependencies": {
"@types/bun": "^1.0.0",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"bimap": "latest", "bimap": "latest",
"bun-types": "latest",
"cytoscape": "latest", "cytoscape": "latest",
"eslint": "^8.0.1", "eslint": "^8.0.1",
"eslint-config-next": "latest", "eslint-config-next": "latest",
@ -68,8 +70,7 @@
"remark-react": "latest", "remark-react": "latest",
"remark-stringify": "latest", "remark-stringify": "latest",
"tailwindcss": "latest", "tailwindcss": "latest",
"uuid": "latest", "uuid": "latest"
"bun-types": "latest"
}, },
"resolutions": { "resolutions": {
"react": "^18", "react": "^18",

View File

@ -1,11 +1,17 @@
import Layout from "../../components/Layout"; import Layout from "components/Layout";
import Util from '../../lib/utils' import Util from 'lib/utils'
import FolderTree from "../../components/FolderTree"; import FolderTree from "components/FolderTree";
import MDContent from "../../components/MDContent"; import MDContent from "components/MDContent";
interface HomeProps {
content: string
tree: Record<string, unknown>
flattenNodes: unknown[]
backLinks: unknown[]
}
// This trick is to dynamically load component that interact with window object (browser only) // This trick is to dynamically load component that interact with window object (browser only)
export default function Home({ content, tree, flattenNodes, backLinks }) { export default function Home({ content, tree, flattenNodes, backLinks }: HomeProps) {
return ( return (
<Layout> <Layout>
<div className='notes-container'> <div className='notes-container'>
@ -21,12 +27,21 @@ export default function Home({ content, tree, flattenNodes, backLinks }) {
export function getStaticProps() { export function getStaticProps() {
const { nodes, edges } = Util.constructGraphData() const { nodes, edges }: { nodes: unknown[], edges: unknown[] } = Util.constructGraphData()
const tree = Util.convertObject(Util.getDirectoryData()); const tree = Util.convertObject(Util.getDirectoryData());
const contentData = Util.getSinglePost("index"); const contentData = Util.getSinglePost("index");
const flattenNodes = Util.getFlattenArray(tree) const flattenNodes = Util.getFlattenArray(tree)
const listOfEdges = edges.filter(anEdge => anEdge.target === "index") const listOfEdges = edges
const internalLinks = listOfEdges.map(anEdge => nodes.find(aNode => aNode.slug === anEdge.source)).filter(element => element !== undefined) .filter((anEdge) => (
anEdge as { target: string }).target === "index"
)
const internalLinks = listOfEdges.map(
anEdge => nodes
.find(
aNode => (
aNode as { slug: string }).slug === (anEdge as { source: string }).source))
.filter(
element => element !== undefined)
const backLinks = [...new Set(internalLinks)] const backLinks = [...new Set(internalLinks)]
return { return {

6
postcss.config.cjs Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}

View File

@ -1,4 +0,0 @@
export const plugins = {
tailwindcss: {},
autoprefixer: {}
}