wayBetter for X

This commit is contained in:
CRTkafa 2026-10-01 06:01:13 +07:00
commit df5dff619e
720 changed files with 147465 additions and 0 deletions

64
apps/web/site.config.ts Normal file
View file

@ -0,0 +1,64 @@
// The site's facts in one place. Pages, meta tags, the sitemap, the Store pages and the Store
// checks (scripts/check-store.mjs) read them from here; nothing else spells these out.
/** Where the site is served. */
export const SITE_URL = 'https://waybetter.fyi';
/**
* The project's home: Forgejo on git.crt.fyi. THE one constant every repository link on the site
* comes from (pull requests, issues, docs, source, the catalog schema).
*/
export const FORGE_URL = 'https://git.crt.fyi/CRT';
export const FORGE_HOST = new URL(FORGE_URL).host;
/** wayBetter for X: the app, this site and the Store's source (store/). Contributions go here. */
export const REPO_URL = `${FORGE_URL}/better-twttr`;
/**
* The wayBetter for X repository opens with the release. Until then its links do not load for
* visitors, and /store/submit/ says so. Set this to true on the day it is public.
*/
export const REPO_PUBLIC = false;
/** The wayBetter framework (npm `waybetter`): shared Store format, signing, the CLI. */
export const FRAMEWORK_REPO_URL = `${FORGE_URL}/waybetter`;
const BRANCH = 'main';
/** A file (or folder) of a repository, as the forge shows it. */
export const repoFile = (path: string, repo: string = REPO_URL): string => `${repo}/src/branch/${BRANCH}/${path}`;
export const repoLinks = {
pulls: `${REPO_URL}/pulls`,
fork: `${REPO_URL}/fork`,
newIssue: `${REPO_URL}/issues/new/choose`,
signUp: `https://${FORGE_HOST}/user/sign_up`,
catalogSchema: repoFile('packages/waybetter/store-catalog.schema.json', FRAMEWORK_REPO_URL),
frameworkStoreDoc: repoFile('docs/STORE.md', FRAMEWORK_REPO_URL),
};
/** Who publishes (footer, twitter:creator). */
export const AUTHOR_HANDLE = '@CRTkafa';
/**
* The oldest wayBetter for X that answers a waybetter:// link (one-click install): the first public
* release. THE one place this number is written. No page and no catalog spells it out: every
* sentence that names it ("One-click install needs wayBetter for X … or newer") has a {version}
* placeholder, in every language (tests/seo.test.ts keeps it that way).
*/
export const MIN_APP_VERSION = '1.0.0';
/**
* The apps in the shared Store catalog (`apps` of every item). An id that is not listed here still
* appears in the Store, under its id, so a new app needs no change to show up.
*/
export type AppInfo = { name: string; site: string; page: string | null; oneClickSince: string | null };
export const APPS: Record<string, AppInfo> = {
// One-click install (waybetter:// links) works from the first public release on.
x: { name: 'wayBetter for X', site: 'X', page: 'x/', oneClickSince: MIN_APP_VERSION },
};
export const appInfo = (id: string): AppInfo => APPS[id] ?? { name: `wayBetter for ${id}`, site: id, page: null, oneClickSince: null };
/**
* The site's languages, English (the source) first. English lives at the root (/, /x/, /store/…),
* every other language under its code (/tr/, /tr/x/, /zh-Hant/store/…). A language is published
* once its catalog exists (locales/<code>.json); the API redirects /<code> → /<code>/ for exactly
* these (SITE_LANGUAGES in apps/api/src/app.ts, kept equal by its test).
*/
export const LANGUAGES = ['en', 'ja', 'es', 'ar', 'id', 'de', 'pt', 'tr', 'fr', 'th', 'ko', 'nl', 'vi', 'zh-Hant', 'it', 'hi', 'ru'] as const;
export const SOURCE_LANGUAGE = 'en';