This commit is contained in:
2026-03-15 08:30:54 +01:00
parent 6dd00f2561
commit ec2dc0c4dc
26 changed files with 673 additions and 247 deletions
+16 -54
View File
@@ -3,10 +3,10 @@ import path from "path";
export default function grabDirNames() {
const ROOT_DIR = process.cwd();
const SRC_DIR = path.join(ROOT_DIR, "src");
const ROUTES_DIR = path.join(SRC_DIR, "routes");
const API_DIR = path.join(ROUTES_DIR, "api");
const PAGES_DIR = path.join(SRC_DIR, "pages");
const API_DIR = path.join(PAGES_DIR, "api");
const PUBLIC_DIR = path.join(ROOT_DIR, "public");
const HYDRATION_DST_DIR = path.join(PUBLIC_DIR, "routes");
const HYDRATION_DST_DIR = path.join(PUBLIC_DIR, "pages");
const CONFIG_FILE = path.join(ROOT_DIR, "bunext.config.ts");
const BUNX_CWD_DIR = path.resolve(ROOT_DIR, ".bunext");
@@ -14,15 +14,22 @@ export default function grabDirNames() {
const BUNX_HYDRATION_SRC_DIR = path.resolve(
BUNX_CWD_DIR,
"client",
"hydration-src"
"hydration-src",
);
const BUNX_ROOT_DIR = path.resolve(__dirname, "../../");
const BUNX_ROOT_SRC_DIR = path.join(BUNX_ROOT_DIR, "src");
const BUNX_ROOT_PRESETS_DIR = path.join(BUNX_ROOT_SRC_DIR, "presets");
const BUNX_ROOT_500_FILE_NAME = `server-error`;
const BUNX_ROOT_500_PRESET_COMPONENT = path.join(
BUNX_ROOT_PRESETS_DIR,
`${BUNX_ROOT_500_FILE_NAME}.tsx`,
);
return {
ROOT_DIR,
SRC_DIR,
ROUTES_DIR,
PAGES_DIR,
API_DIR,
PUBLIC_DIR,
HYDRATION_DST_DIR,
@@ -30,54 +37,9 @@ export default function grabDirNames() {
CONFIG_FILE,
BUNX_TMP_DIR,
BUNX_HYDRATION_SRC_DIR,
BUNX_ROOT_SRC_DIR,
BUNX_ROOT_PRESETS_DIR,
BUNX_ROOT_500_PRESET_COMPONENT,
BUNX_ROOT_500_FILE_NAME,
};
}
// const rootDir = params?.dir || process.cwd();
// const appDir = path.resolve(__dirname, "..");
// const entrypoint = path.join(
// appDir,
// "functions",
// "server",
// "start-server.ts"
// );
// const bunextDir = path.join(rootDir, ".bunext");
// const bunextClientDir = path.join(bunextDir, "client");
// const bunextClientRoutesDir = path.join(bunextClientDir, "routes");
// const bunextClientRoutesSrcDir = path.join(bunextClientRoutesDir, "src");
// const bunextClientRoutesDstDir = path.join(bunextClientRoutesDir, "dst");
// const bunextServerDir = path.join(bunextDir, "server");
// const bunextServerPagesDir = path.join(bunextServerDir, "pages");
// const publicDir = path.join(rootDir, "public");
// const configFile = path.join(rootDir, "bunext.config.ts");
// const srcDir = path.join(rootDir, "src");
// const pagesDir = path.join(srcDir, "pages");
// const componentsDir = path.join(srcDir, "components");
// const stylesDir = path.join(srcDir, "styles");
// const utilsDir = path.join(srcDir, "utils");
// const typesDir = path.join(srcDir, "types");
// return {
// rootDir,
// pagesDir,
// componentsDir,
// publicDir,
// stylesDir,
// utilsDir,
// typesDir,
// configFile,
// appDir,
// entrypoint,
// srcDir,
// bunextDir,
// bunextClientDir,
// bunextClientRoutesDir,
// bunextClientRoutesSrcDir,
// bunextClientRoutesDstDir,
// bunextServerDir,
// bunextServerPagesDir,
// };