Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions alchemy.run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createMapleApi } from "./apps/api/alchemy.run.ts"
import { createChatFlueWorker } from "./apps/chat-flue/alchemy.run.ts"
import { createElectricSyncWorker } from "./apps/electric-sync/alchemy.run.ts"
import { createLandingWorker } from "./apps/landing/alchemy.run.ts"
import { createLocalLandingWorker } from "./apps/local-landing/alchemy.run.ts"
import { createLocalUiWorker } from "./apps/local-ui/alchemy.run.ts"
import { createMapleWeb } from "./apps/web/alchemy.run.ts"

Expand Down Expand Up @@ -72,6 +73,8 @@ const landing = await createLandingWorker({ stage, domains })

const localUi = await createLocalUiWorker({ stage, domains })

const localLanding = await createLocalLandingWorker({ stage, domains })

const alerting = await createAlertingWorker({ stage, domains, mapleDb })

const summary = {
Expand All @@ -83,6 +86,7 @@ const summary = {
webUrl: domains.web ? `https://${domains.web}` : web.url,
landingUrl: domains.landing ? `https://${domains.landing}` : landing.url,
localUiUrl: domains.local ? `https://${domains.local}` : localUi.url,
localLandingUrl: domains.localLanding ? `https://${domains.localLanding}` : localLanding.url,
alertingWorker: alerting.name,
}

Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/components/live/LiveServiceMap.astro
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const VIEW_H = 400;
const y = ROWS_PER_COL[n.col][n.row] - NODE_H / 2;
const accent = serviceColorVar(n.label);
const errNum = n.err ? parseFloat(n.err) : 0;
const healthClass = errNum > 1 ? "svc-map-health--warn" : errNum > 0.05 ? "svc-map-health--info" : "svc-map-health--info";
const healthClass = errNum > 1 ? "svc-map-health--error" : errNum > 0.3 ? "svc-map-health--warn" : "svc-map-health--info";
return (
<g transform={`translate(${x} ${y})`} class={n.hot ? "svc-map-node svc-map-node--hot" : "svc-map-node"}>
{n.hot && (
Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/components/local/LocalCommandGrid.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Each card header links to the matching section of the CLI reference doc
* (slugs must stay in sync with the H2 headings in local-mode/cli-reference.md).
*/
const REFERENCE = "/docs/local-mode/cli-reference";
const REFERENCE = "https://maplelocal.dev/docs/reference/cli";

const groups: Array<{
name: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/components/local/LocalProductHero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const stats = [
View on GitHub
</a>
<a
href="/docs/local-mode"
href="https://maplelocal.dev/docs"
class="inline-flex h-9 items-center justify-center rounded-lg bg-primary px-3 text-xs font-medium text-primary-foreground transition-all hover:bg-primary/80"
>
Read the docs
Expand Down
1 change: 1 addition & 0 deletions apps/landing/src/content/docs/local-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: "Maple Local"
description: "Run Maple as a single binary on your machine — OTLP ingest, an embedded ClickHouse, a query API, and the dashboard, with no cloud and no auth."
group: "Local Mode"
order: 1
draft: true
---

import LocalHero from "../../components/local/LocalHero.astro"
Expand Down
1 change: 1 addition & 0 deletions apps/landing/src/content/docs/local-mode/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: "CLI Reference"
description: "Every maple command, argument, and flag — plus the server endpoints, environment variables, and troubleshooting for local mode."
group: "Local Mode"
order: 2
draft: true
---

The `maple` binary is one CLI with two backends: a local server (`maple start`) and a remote workspace (`maple login`). Every query command runs against whichever is [resolved](#auth-and-configuration) for that invocation. Output is JSON by default — clean enough to pipe into `jq` or an agent.
Expand Down
3 changes: 0 additions & 3 deletions apps/landing/src/lib/docs-nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const UNIVERSAL_GROUP_ORDER = [
"Infrastructure",
"Integrations",
"Alerting",
"Local Mode",
] as const

/** Order of SDK-scoped groups (Effect SDK pages). */
Expand Down Expand Up @@ -46,7 +45,6 @@ export const HEADER_NAV: HeaderNavItem[] = [
{ key: "Infrastructure", icon: "Infrastructure", kind: "group" },
{ key: "Integrations", icon: "Integrations", kind: "group" },
{ key: "Alerting", icon: "Alerting", kind: "group" },
{ key: "Local Mode", icon: "Local Mode", kind: "group" },
]

/** Group names (and the synthetic `sdks` key) that have a DocsCategoryIcon glyph. */
Expand All @@ -57,7 +55,6 @@ const CATEGORY_ICON_KEYS = new Set<string>([
"Infrastructure",
"Integrations",
"Alerting",
"Local Mode",
"sdks",
])

Expand Down
8 changes: 7 additions & 1 deletion apps/landing/src/pages/local.astro
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,17 @@ const valueProps = [

<div class="mt-7 flex flex-wrap items-center gap-3">
<a
href="/docs/local-mode"
href="https://maplelocal.dev/docs"
class="inline-flex h-9 items-center justify-center rounded-lg bg-primary px-3 text-xs font-medium text-primary-foreground transition-all hover:bg-primary/80"
>
Read the docs
</a>
<a
href="https://maplelocal.dev"
class="inline-flex h-9 items-center justify-center rounded-lg border border-input bg-input/30 px-3 text-xs font-medium text-fg transition-all hover:bg-input/50"
>
Visit maplelocal.dev
</a>
<a
href="https://github.com/Makisuo/maple/releases"
target="_blank"
Expand Down
14 changes: 13 additions & 1 deletion apps/landing/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ type Env = {
ASSETS: { fetch: (request: Request) => Promise<Response> }
}

// The Local Mode docs moved to the standalone Maple Local site
// (apps/local-landing). These 301s must ship together with (or after) the
// maplelocal.dev zone going live — see apps/local-landing/README.md.
const REDIRECTS: Record<string, string> = {
"/docs/local-mode": "https://maplelocal.dev/docs/getting-started/quickstart",
"/docs/local-mode/cli-reference": "https://maplelocal.dev/docs/reference/cli",
}

export default {
async fetch(request: Request, env: Env): Promise<Response> {
const url = new URL(request.url)

const redirect = REDIRECTS[url.pathname.replace(/\/$/, "")]
if (redirect) return Response.redirect(redirect, 301)

const assetResponse = await env.ASSETS.fetch(request)
if (assetResponse.status !== 404) return assetResponse

const url = new URL(request.url)
const notFound = await env.ASSETS.fetch(new Request(new URL("/404.html", url), request))
return new Response(notFound.body, {
status: 404,
Expand Down
26 changes: 26 additions & 0 deletions apps/local-landing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# build output
dist/
# generated from scripts/install.sh by the `sync:cli` script (served at /cli/install)
public/cli/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
32 changes: 32 additions & 0 deletions apps/local-landing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# @maple/local-landing

Standalone marketing + docs site for **Maple Local** — the single-binary local
OpenTelemetry tool built from `apps/cli`. Astro 5, same amber/Geist branding as
`apps/landing`, deployed as a Cloudflare Worker (static assets + tiny
`src/worker.ts` passthrough) via Alchemy.

```bash
bun run --cwd apps/local-landing dev:app # dev server on :3392 (or `bun dev` via portless)
bun run --cwd apps/local-landing build # static build into dist/
```

Docs live in `src/content/docs/` (groups: Getting Started, Sending Data,
Reference, Operations — ordering in `src/lib/docs-nav.ts`). The `build`/`dev`
scripts copy `scripts/install.sh` / `uninstall.sh` into `public/cli/` so the
site serves `/cli/install` like maple.dev does.

## Domain setup (manual, one-time)

The site targets the apex domain `maplelocal.dev`, which is **not** created by
the deploy — Alchemy can only attach a worker to a zone that already exists:

1. Buy `maplelocal.dev` and add it as a new zone in the same Cloudflare account.
2. Point the registrar's nameservers at Cloudflare and wait for the zone to go
active.
3. Uncomment the `localLanding` entries in
`packages/infra/src/cloudflare/stage.ts` (`PRD_DOMAINS` / `STG_DOMAINS`).
4. Recommended: add a `www` → apex redirect rule in the zone.

Until then the worker deploys on its workers.dev URL (same fallback as PR
previews). If a different apex is bought instead, update the two entries in
`stage.ts` and `site` in `astro.config.mjs`.
44 changes: 44 additions & 0 deletions apps/local-landing/alchemy.run.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { spawnSync } from "node:child_process"
import path from "node:path"
import { Assets, Worker } from "alchemy/cloudflare"
import {
CLOUDFLARE_WORKER_PLACEMENT,
resolveWorkerName,
type MapleDomains,
type MapleStage,
} from "@maple/infra/cloudflare"

export interface CreateLocalLandingWorkerOptions {
stage: MapleStage
domains: MapleDomains
}

export const createLocalLandingWorker = async ({ stage, domains }: CreateLocalLandingWorkerOptions) => {
const isDestroy = process.argv.some((arg) => arg === "destroy")
if (!isDestroy) {
const build = spawnSync("bun", ["run", "build"], {
stdio: "inherit",
cwd: import.meta.dirname,
env: process.env,
})
if (build.status !== 0) {
throw new Error(`local-landing build failed with exit code ${build.status ?? "unknown"}`)
}
}

const worker = await Worker("local-landing", {
name: resolveWorkerName("local-landing", stage),
cwd: import.meta.dirname,
entrypoint: path.join(import.meta.dirname, "src", "worker.ts"),
compatibility: "node",
placement: CLOUDFLARE_WORKER_PLACEMENT,
url: true,
adopt: true,
domains: domains.localLanding ? [{ domainName: domains.localLanding, adopt: true }] : undefined,
bindings: {
ASSETS: await Assets({ path: path.join(import.meta.dirname, "dist") }),
},
})

return worker
}
33 changes: 33 additions & 0 deletions apps/local-landing/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// @ts-check
import { defineConfig } from "astro/config"
import mdx from "@astrojs/mdx"
import react from "@astrojs/react"
import sitemap from "@astrojs/sitemap"
import tailwindcss from "@tailwindcss/vite"

// https://astro.build/config
export default defineConfig({
site: "https://maplelocal.dev",
trailingSlash: "ignore",
markdown: {
shikiConfig: {
theme: "vitesse-dark",
wrap: true,
},
},
integrations: [
mdx(),
react(),
sitemap({
// Stamp a build-time lastmod so the sitemap exposes a freshness signal.
serialize(item) {
item.lastmod = new Date().toISOString()
return item
},
}),
],
vite: {
plugins: [tailwindcss()],
envDir: "../../",
},
})
42 changes: 42 additions & 0 deletions apps/local-landing/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@maple/local-landing",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "portless",
"sync:cli": "mkdir -p public/cli && cp ../../scripts/install.sh public/cli/install && cp ../../scripts/uninstall.sh public/cli/uninstall",
"dev:app": "bun run sync:cli && astro dev --port ${PORT:-3392} --host ${HOST:-127.0.0.1}",
"build": "bun run sync:cli && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^5.0.3",
"@astrojs/react": "^4.4.2",
"@astrojs/sitemap": "^3.7.0",
"@fontsource-variable/geist": "^5.2.9",
"@fontsource-variable/geist-mono": "^5.2.8",
"@maple/infra": "workspace:*",
"@maple/ui": "workspace:*",
"@tailwindcss/vite": "catalog:tailwind",
"@types/react": "catalog:react",
"@types/react-dom": "catalog:react",
"alchemy": "^0.93.12",
"astro": "^5.17.1",
"fuse.js": "^7.4.2",
"motion": "^12.40.0",
"react": "catalog:react",
"react-dom": "catalog:react",
"recharts": "catalog:ui",
"tailwindcss": "catalog:tailwind",
"tw-animate-css": "catalog:tailwind"
},
"devDependencies": {
"@astrojs/check": "^0.9.9",
"typescript": "^6.0.3"
},
"portless": {
"name": "local-landing",
"script": "dev:app"
}
}
Binary file added apps/local-landing/public/favicon.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions apps/local-landing/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/local-landing/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/local-landing/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/local-landing/public/og-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions apps/local-landing/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# https://www.robotstxt.org/robotstxt.html

# Default: allow all crawlers full access.
User-agent: *
Disallow:

# Explicitly welcome AI search & answer engines.
# Citation by AI chatbots is impossible if these are blocked, so we opt in by name.
User-agent: GPTBot
Disallow:

User-agent: OAI-SearchBot
Disallow:

User-agent: ChatGPT-User
Disallow:

User-agent: ClaudeBot
Disallow:

User-agent: Claude-SearchBot
Disallow:

User-agent: Claude-User
Disallow:

User-agent: anthropic-ai
Disallow:

User-agent: PerplexityBot
Disallow:

User-agent: Perplexity-User
Disallow:

User-agent: Google-Extended
Disallow:

User-agent: Applebot-Extended
Disallow:

User-agent: CCBot
Disallow:

Sitemap: https://maplelocal.dev/sitemap-index.xml
Loading
Loading