mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-06 23:59:43 -04:00
d78517fd9a
# Description of Changes This PR does several small things: 1. It removes the explicit `h1` tags on every page, and either uses the side bar title directly, or puts it in the frontmatter 2. It merges what are currently called quickstarts into a single Chat App Tutorial 3. It creates new quickstarts which just use `spacetime dev --template` to get you up and running quickly 4. It adds a "The Zen of SpacetimeDB" page much like the Zen of Python which goes over the 5 key principles of SpacetimeDB 5. It reorders all Tabs groups so that the ordering is `TypeScript`, `C#`, `Rust`, `Unreal`, `C++`, `Blueprints` (order of decreasing popularity). 6. It improves the sidebar navigation by having categories act as overview pages, and also fixes the breadcrumbs 7. It fixes various small typos and issues 8. Closes #3610 and adds cursor rules files generally 9. It fixes general styling on the docs page by bring it inline with the UI design: Old: <img width="1678" height="958" alt="image" src="https://github.com/user-attachments/assets/f36efee6-b81a-4463-a179-da68b3a7152e" /> New: <img width="1678" height="957" alt="image" src="https://github.com/user-attachments/assets/f430f77d-0663-47f2-9727-45cbfe10e4c7" /> https://github.com/user-attachments/assets/adc5a78a-ada8-45b5-8078-a45cb81477a3 # API and ABI breaking changes This PR does NOT change any old links. It does add new pages though. # Expected complexity level and risk 3 - it's a large change. I manually tested the TypeScript Chat App Tutorial but I have not gone through the Rust and C# quickstarts. However, we have testing on the quickstarts and this is text only so can be carefully reviewed. # Testing <!-- Describe any testing you've done, and any testing you'd like your reviewers to do, so that you're confident that all the changes work as expected! --> - [x] Ran through each step of the Chat App TypeScript tutorial to ensure it is working - [x] Ran and tested the styles and the functionality of the side bar --------- Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com> Co-authored-by: spacetimedb-bot <spacetimedb-bot@users.noreply.github.com> Co-authored-by: clockworklabs-bot <clockworklabs-bot@users.noreply.github.com> Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com> Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
64 lines
1.5 KiB
JavaScript
Executable File
64 lines
1.5 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
import { createWriteStream, promises as fs } from 'node:fs';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { spawn } from 'node:child_process';
|
|
|
|
function getRepoRoot() {
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
return path.resolve(__dirname, '../..');
|
|
}
|
|
|
|
function runCargoAndAppend({ cwd, outFilePath }) {
|
|
return new Promise((resolve, reject) => {
|
|
const outStream = createWriteStream(outFilePath, { flags: 'a' });
|
|
|
|
const child = spawn(
|
|
'cargo',
|
|
['run', '--features', 'markdown-docs', '-p', 'spacetimedb-cli'],
|
|
{
|
|
cwd,
|
|
stdio: ['ignore', 'pipe', 'inherit'],
|
|
},
|
|
);
|
|
|
|
child.on('error', err => {
|
|
outStream.end();
|
|
reject(err);
|
|
});
|
|
|
|
child.stdout.pipe(outStream);
|
|
|
|
child.on('close', code => {
|
|
outStream.end();
|
|
if (code === 0) resolve();
|
|
else reject(new Error(`cargo exited with code ${code ?? 'unknown'}`));
|
|
});
|
|
});
|
|
}
|
|
|
|
async function main() {
|
|
const repoRoot = getRepoRoot();
|
|
|
|
const outFile = path.join(
|
|
repoRoot,
|
|
'docs',
|
|
'docs',
|
|
'00300-resources',
|
|
'00200-reference',
|
|
'00100-cli-reference',
|
|
'00100-cli-reference.md',
|
|
);
|
|
|
|
const header = `---\ntitle: CLI Reference\nslug: /cli-reference\n---\n\n`;
|
|
|
|
await fs.writeFile(outFile, header, 'utf8');
|
|
await runCargoAndAppend({ cwd: repoRoot, outFilePath: outFile });
|
|
}
|
|
|
|
main().catch(err => {
|
|
console.error(err?.stack ?? String(err));
|
|
process.exit(1);
|
|
});
|