mirror of
https://github.com/supabase/supabase.git
synced 2026-09-22 13:37:53 +08:00
232ce7e68c
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. Yes. ## What kind of change does this PR introduce? Documentation update and a small Studio copy correction. ## What is the current behavior? The Logs guide mixes unified filtering with retired SQL Explorer instructions, and the Markdown field reference loses query semantics. ## What is the new behavior? The Logs guide mixed filtering and event inspection with the retired SQL Logs Explorer workflow. It now documents the unified Logs view: default sources, filter semantics, event details, Live, sharing, bounded exports, and missing results. The log field reference uses one mapping for HTML and Markdown, preserving source IDs, query expressions, and source/query types. The Studio User-filter empty state and comments now match its Auth and API Gateway scope. ## Additional context Validation: shared-field mapping tests, guides Markdown generation, docs typecheck, targeted docs/Studio ESLint, formatting, and browser inspection of the field table. Exported Markdown includes the source IDs and usable ClickHouse expressions. Repository-wide MDX lint has existing failures; changed pages have no reported violations. Self-review: hosted Studio filtering and log ingestion were checked against the implementation, not exercised against a hosted project. The documentation assumes the unified Logs experience is the default. Stage 1 of 3. Review and merge from the bottom of the stack. Stack: #50073 → #50074 → #50075. Production docs build also passes at the stack tip after standard reference generation. Initial CI note: the spelling action failed while building its container because Debian package downloads returned 404, before checking content. The stack has no merge conflicts. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Expanded the log field reference with ClickHouse fields, nested-field query examples, types, schema references, and capture limits. * Reworked the Logs guide with clearer instructions for filtering, event inspection, live mode, sharing, exports, retention, and missing results. * Clarified service and Postgres log behavior and updated navigation and metadata. * **Bug Fixes** * Corrected user-filtering guidance and empty-state messaging to identify Auth and API Gateway logs as supported sources. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Steven Eubank <eubank.steven88@gmail.com> Co-authored-by: Steven Eubank <47563310+smeubank@users.noreply.github.com>
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import { createRequire } from 'node:module'
|
|
|
|
import { getLogFieldReference, resolveSharedDataPath } from '../../components/SharedData.utils'
|
|
|
|
// tsx's ESM loader can't pick up named exports from the `shared-data` package
|
|
// (CJS, no `"type": "module"`). Load via `createRequire` to use CJS interop —
|
|
// this file only runs in the build script, never in the Next.js bundle.
|
|
const { config, logConstants } = createRequire(import.meta.url)('shared-data')
|
|
|
|
const sharedData: Record<string, unknown> = { config, logConstants }
|
|
|
|
const renderLogConstants = (data: typeof logConstants): string =>
|
|
getLogFieldReference(data.schemas)
|
|
.map((schema) =>
|
|
[
|
|
`### ${schema.name}`,
|
|
'',
|
|
`Source: \`${schema.reference}\``,
|
|
'',
|
|
'| Schema path | ClickHouse query field | Source type | Query value type |',
|
|
'| --- | --- | --- | --- |',
|
|
...schema.fields.map(
|
|
(field) =>
|
|
`| \`${field.path}\` | \`${field.queryField}\` | \`${field.type}\` | \`${field.queryType}\` |`
|
|
),
|
|
].join('\n')
|
|
)
|
|
.join('\n\n')
|
|
|
|
export const SharedData = ({
|
|
props,
|
|
children,
|
|
}: {
|
|
props: Record<string, unknown>
|
|
children: string
|
|
}): string => {
|
|
const dataset = sharedData[String(props.data ?? '')]
|
|
if (!dataset) return children
|
|
|
|
// String-path pattern: `<SharedData data="config">a.b.c</SharedData>`.
|
|
const value = resolveSharedDataPath(dataset, children.trim())
|
|
if (value != null) return String(value)
|
|
|
|
// Render-function pattern: `<SharedData data="logConstants">{(d) => …}`.
|
|
// The schema walker strips the MDX expression children before this handler
|
|
// runs, and we can't evaluate the function statically anyway — hardcode the
|
|
// markdown for the only dataset that uses this form today.
|
|
if (props.data === 'logConstants') return renderLogConstants(dataset as typeof logConstants)
|
|
return ''
|
|
}
|