mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-03-20 09:01:05 +08:00
# Description of Changes Closes: #3895 - Added third tier expanding folder - Merged most into intro + core concepts - Collapsed modules + database into one - Moved several documents to how-to to streamline the core concepts - Added warning to RLS to use views - refactored all links - Moved How To and References into Developer Resources - Fixed TypeScript View code Sample: (Getting Started will start expanded due to being the initial page) <img width="293" height="746" alt="image" src="https://github.com/user-attachments/assets/6abc3a0d-1ae2-4886-bda7-11f5565afecf" /> # API and ABI breaking changes N/A # Expected complexity level and risk 1 # Testing - [X] Updated the quickstarts.py and generate-cli tooling --------- Signed-off-by: Jason Larabie <jason@clockworklabs.io> Co-authored-by: Tyler Cloutier <cloutiertyler@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',
|
|
'01000-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);
|
|
});
|