-
Notifications
You must be signed in to change notification settings - Fork 1
nirvlife structure round 2 #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default { | ||
module.exports = { | ||
extends: "../../.eslintrc.cjs", | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
build/**/* | ||
tsconfig.tsbuildinfo |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as path from "path"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put this file back into the devServer file |
||
import { rm } from "node:fs/promises"; | ||
|
||
const PROJECT_ROOT = import.meta.dir; | ||
const BUILD_DIR = path.resolve(PROJECT_ROOT, "build"); | ||
|
||
// fake watching | ||
import("./src/main.tsx").catch((e) => e); | ||
|
||
export const buildApp = async () => | ||
rm(BUILD_DIR, { force: true, recursive: true }).then(() => | ||
Bun.build({ | ||
entrypoints: ["./src/main.tsx"], | ||
target: "browser", | ||
outdir: BUILD_DIR, | ||
}) | ||
.then((output) => output) | ||
.catch((e) => { | ||
console.info("\n\n error in build", e); | ||
}) | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
import * as path from "path"; | ||
import type { ServeOptions } from "bun"; | ||
import { rm, stat } from "node:fs/promises"; | ||
import { stat } from "node:fs/promises"; | ||
import { buildApp } from "./devbuilder"; | ||
|
||
const PROJECT_ROOT = import.meta.dir; | ||
const PUBLIC_DIR = path.resolve(PROJECT_ROOT, "public"); | ||
const BUILD_DIR = path.resolve(PROJECT_ROOT, "build"); | ||
|
||
// TODO(noah): see if theres a `bun` way to do this | ||
// ^ i think bun accepts all the esbuild options so there should be | ||
await rm(BUILD_DIR, { force: true, recursive: true }).then(() => | ||
Bun.build({ | ||
entrypoints: ["./src/main.tsx"], | ||
outdir: BUILD_DIR, | ||
}) | ||
.then((output) => { | ||
console.info("\n\n built output", output); | ||
}) | ||
.catch((e) => { | ||
console.info("\n\n error in build", e); | ||
}) | ||
); | ||
// @see https://bun.sh/docs/bundler#outputs | ||
const { outputs, success, logs, ...buildData } = await buildApp(); | ||
|
||
console.info(`built success ${success}: total files`, outputs.length); | ||
// generally we want to figure out how to serve assets | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this comment shouldnt be needed anymore |
||
|
||
async function serveFromDir(config: { | ||
directory: string; | ||
|
@@ -42,7 +34,24 @@ async function serveFromDir(config: { | |
} | ||
|
||
export default { | ||
development: true, | ||
error(e: Error) { | ||
// for server side errors | ||
return new Response(`<pre>${e}\n${e.stack}</pre>`, { | ||
headers: { | ||
"Content-Type": "text/html", | ||
}, | ||
}); | ||
}, | ||
async fetch(request) { | ||
if (!success) { | ||
for (const message of logs) { | ||
// Bun will pretty print the message object | ||
console.error(message); | ||
} | ||
throw new Error(`build failed`); | ||
} | ||
|
||
let reqPath = new URL(request.url).pathname; | ||
console.log(request.method, reqPath); | ||
if (reqPath === "/") reqPath = "/index.html"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// @see https://github.com/kentcdodds/kcd-scripts/blob/main/src/config/prettierrc.js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move this to a prettier package and use the one we created for nodeproto |
||
export default { | ||
arrowParens: "avoid", | ||
bracketSameLine: false, | ||
bracketSpacing: false, | ||
embeddedLanguageFormatting: "auto", | ||
endOfLine: "lf", | ||
htmlWhitespaceSensitivity: "css", | ||
insertPragma: false, | ||
jsxSingleQuote: false, | ||
printWidth: 80, | ||
proseWrap: "always", | ||
quoteProps: "as-needed", | ||
requirePragma: false, | ||
semi: true, | ||
singleAttributePerLine: false, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: "all", | ||
useTabs: false, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,22 @@ import { useTheme } from "@mui/material"; | |
|
||
import { Img, TextCopy } from "Library"; | ||
import { ctaStacks, nirvaiRef, taglineRef } from "data"; | ||
import { ReactFP, FPContainer, FPItem } from "react-fullerpage"; | ||
// <img src={"/img/logo_main.png"} className="img" alt="nirvai" /> | ||
// import { ReactFP, FPContainer, FPItem } from "react-fullerpage"; | ||
import { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use the main package as we can now develop with react-cosmos and dont need to copypaste into node_modules also check on the bun issue with bun link not working |
||
ReactFP, | ||
FPContainer, | ||
FPItem, | ||
} from "../../../node_modules/react-fullerpage/src"; | ||
import girljumping from "./imgs/girljumping.jpg"; | ||
|
||
const screenId = "app-landing-screen"; | ||
export const AppLandingScreen = () => { | ||
const theme = useTheme(); | ||
|
||
// {/* <Img key="img" uris={["/img/girljumping.jpg"]} width={500} height={500} /> */} | ||
return ( | ||
<ReactFP style={{}}> | ||
<FPContainer style={{}} transitionTiming={700}> | ||
<div>hello</div> | ||
<FPContainer> | ||
<FPItem | ||
style={{ | ||
backgroundColor: "lime", | ||
|
@@ -22,6 +27,8 @@ export const AppLandingScreen = () => { | |
> | ||
<article> | ||
<TextCopy data={ctaStacks[0][0]} /> | ||
{/* <Img key="img" uris={["/img/girljumping.jpg"]} width={300} /> */} | ||
<Img key="img" uris={[girljumping]} width={300} /> | ||
</article> | ||
</FPItem> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import type { FC } from "react"; | ||
|
||
import IdealImage from "react-ideal-image"; | ||
import { IdealImage } from "react-idealer-image"; | ||
// import { IdealImage } from "../../../node_modules/react-ideal-image/src"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete this |
||
|
||
import { useMemo, useEffect, useState } from "react"; | ||
|
||
export interface ImgInterface { | ||
|
@@ -28,13 +30,7 @@ export const Img: FC<ImgInterface> = ({ | |
|
||
return ( | ||
<section {...props}> | ||
<IdealImage | ||
placeholder={{ color: "black" }} | ||
alt={alt} | ||
srcSet={srcSet} | ||
height={height} | ||
width={width} | ||
/> | ||
<IdealImage alt={alt} srcSet={srcSet} height={height} width={width} /> | ||
</section> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
declare module "*.(svg|jpg|png)" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dunno why this doenst fkn work |
||
declare module "*.svg" { | ||
const content: any; | ||
export default content; | ||
} | ||
|
||
declare module "*.jpg" { | ||
const content: any; | ||
export default content; | ||
} | ||
|
||
declare module "*.png" { | ||
const content: any; | ||
export default content; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { reportWebVitals } from "reportWebVitals"; | ||
import React, { StrictMode } from "react"; | ||
import ReactDOM, { createRoot } from "react-dom/client"; | ||
|
||
console.info("lol"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete this |
||
import { QueryProvider } from "./Api"; | ||
import { Router } from "Router"; | ||
|
||
|
@@ -19,7 +19,5 @@ root.render( | |
</StrictMode> | ||
); | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(console.log); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,12 @@ | ||
{ | ||
"name": "nirvai-fullstackjs", | ||
"private": true, | ||
"type": "module", | ||
"workspaces": [ | ||
"packages/*", | ||
"apps/*" | ||
], | ||
"scripts": { | ||
"pkgfix": "manypkg fix" | ||
}, | ||
"dependencies": { | ||
"@babel/core": "7.20.5", | ||
"@babel/plugin-syntax-flow": "7.18.6", | ||
"@babel/plugin-transform-react-jsx": "7.19.0", | ||
"@lukemorales/query-key-factory": "^1.2.0", | ||
"@manypkg/cli": "0.19.2", | ||
"@tanstack/eslint-plugin-query": "4.29.4", | ||
"@typescript-eslint/eslint-plugin": "5.46.1", | ||
"@typescript-eslint/parser": "5.46.1", | ||
"bun-types": "canary", | ||
"eslint": "8.29.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"eslint-config-react-app": "7.0.1", | ||
"husky": "8.0.2", | ||
"turbo": "^1.9.8", | ||
"typescript": "beta" | ||
}, | ||
"type": "module" | ||
"devDependencies": { | ||
"bun-types": "canary" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract this to an eslint package