mirror of
https://github.com/stackblitz-labs/bolt.diy.git
synced 2025-06-18 01:49:07 +01:00
* Fix: error building my application #1414 * fix for vite * Update vite.config.ts * Update root.tsx * fix the root.tsx and the debugtab * lm studio fix and fix for the api key * Update api.enhancer for prompt enhancement * bugfixes * Revert api.enhancer.ts back to original code * Update api.enhancer.ts * Update api.git-proxy.$.ts * Update api.git-proxy.$.ts * Update api.enhancer.ts
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { json, type LoaderFunction } from '@remix-run/cloudflare';
|
|
|
|
interface GitInfo {
|
|
local: {
|
|
commitHash: string;
|
|
branch: string;
|
|
commitTime: string;
|
|
author: string;
|
|
email: string;
|
|
remoteUrl: string;
|
|
repoName: string;
|
|
};
|
|
github?: {
|
|
currentRepo?: {
|
|
fullName: string;
|
|
defaultBranch: string;
|
|
stars: number;
|
|
forks: number;
|
|
openIssues?: number;
|
|
};
|
|
};
|
|
isForked?: boolean;
|
|
}
|
|
|
|
// These values will be replaced at build time
|
|
declare const __COMMIT_HASH: string;
|
|
declare const __GIT_BRANCH: string;
|
|
declare const __GIT_COMMIT_TIME: string;
|
|
declare const __GIT_AUTHOR: string;
|
|
declare const __GIT_EMAIL: string;
|
|
declare const __GIT_REMOTE_URL: string;
|
|
declare const __GIT_REPO_NAME: string;
|
|
|
|
export const loader: LoaderFunction = async () => {
|
|
const gitInfo: GitInfo = {
|
|
local: {
|
|
commitHash: typeof __COMMIT_HASH !== 'undefined' ? __COMMIT_HASH : 'development',
|
|
branch: typeof __GIT_BRANCH !== 'undefined' ? __GIT_BRANCH : 'main',
|
|
commitTime: typeof __GIT_COMMIT_TIME !== 'undefined' ? __GIT_COMMIT_TIME : new Date().toISOString(),
|
|
author: typeof __GIT_AUTHOR !== 'undefined' ? __GIT_AUTHOR : 'development',
|
|
email: typeof __GIT_EMAIL !== 'undefined' ? __GIT_EMAIL : 'development@local',
|
|
remoteUrl: typeof __GIT_REMOTE_URL !== 'undefined' ? __GIT_REMOTE_URL : 'local',
|
|
repoName: typeof __GIT_REPO_NAME !== 'undefined' ? __GIT_REPO_NAME : 'bolt.diy',
|
|
},
|
|
};
|
|
|
|
return json(gitInfo);
|
|
};
|