chore: restructure repository into packages/ folder (#3197)

We're having a growing number of packages in this repository. This PR
moves them into a `packages/` directory like it's commonly done in other
projects.
This commit is contained in:
Marvin Hagemeister
2025-08-06 15:52:45 +02:00
committed by GitHub
parent 27e407a1e3
commit 815b1940e3
184 changed files with 94 additions and 82 deletions
+47
View File
@@ -0,0 +1,47 @@
import * as path from "@std/path";
export interface FreshConfig {
/**
* Serve fresh from a base path instead of from the root.
* "/foo/bar" -> http://localhost:8000/foo/bar
* @default undefined
*/
basePath?: string;
/**
* The mode Fresh can run in.
*/
mode?: "development" | "production";
}
/**
* The final resolved Fresh configuration where fields the user didn't specify are set to the default values.
*/
export interface ResolvedFreshConfig {
root: string;
/**
* Serve fresh from a base path instead of from the root.
* "/foo/bar" -> http://localhost:8000/foo/bar
*/
basePath: string;
/**
* The mode Fresh can run in.
*/
mode: "development" | "production";
}
export function parseDirPath(
dirPath: string,
root: string,
): string {
if (dirPath.startsWith("file://")) {
dirPath = path.fromFileUrl(dirPath);
} else if (!path.isAbsolute(dirPath)) {
dirPath = path.join(root, dirPath);
}
if (Deno.build.os === "windows") {
dirPath = dirPath.replaceAll("\\", "/");
}
return dirPath;
}