Files
supabase/apps/docs/internals/generate-gz-archive.ts
Jeremias Menichelli 575ac8c645 [DOCS-979] feat(Docs): Generate new markdown files for reference pages (#46727)
In this PR:
- The `llms.ts` script is removed from the pipeline. It was just
iterating over the sections of the SDK JSON files to generate _dummy_
text files for LLMS to consume. But with a lot of inconsistencies and
mistakes.
- There's a new script that builds markdown files from the SDK
definition files.
- The Management API now has a definition file too, it was missing
before.
- On the www project now there are redirects for the reference text
files to the new markdown files in the docs project.
- NPM scripts have received better names so that prebuild ones are
smaller and all are easier to differentiate.
2026-06-09 10:39:55 +02:00

17 lines
589 B
TypeScript

import { globby } from 'globby'
import { create as createTar } from 'tar'
async function generate() {
// Create a tar.gz archive of the generated docs, served at /docs/docs.tar.gz.
// Sorted entries, portable headers, and a fixed mtime keep the output deterministic.
const archivePath = 'public/docs.tar.gz'
const entries = (await globby(['**'], { cwd: 'public/markdown' })).sort()
await createTar(
{ gzip: true, file: archivePath, cwd: 'public/markdown', portable: true, mtime: new Date() },
entries
)
console.log(`Created archive at ${archivePath}`)
}
generate()