Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull stellar-cli docs from latest released version. #1068

Merged
merged 2 commits into from
Nov 12, 2024
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ yarn-error.log*

*.info.mdx

.tool-versions

fnando marked this conversation as resolved.
Show resolved Hide resolved
# non-production openrpc.json files
/openrpc/*openrpc.json

Expand Down
5 changes: 1 addition & 4 deletions docs/data/horizon/api-reference/structure/consistency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ title: Consistency
sidebar_position: 70
---

For endpoints which serve data which can change from ledger to ledger (for example an account balance), Horizon includes a `Latest-Ledger` HTTP header in its response.
The value of the `Latest-Ledger` HTTP header is the sequence number of the latest ledger known to Horizon at the time the request was processed.
Horizon will guarantee that all the data included in the response is consistent with that ledger. This mechanism prevents race conditions where
a request is processed at the boundary of two ledgers and ensures that the response is consistent with the ledger included in the `Latest-Ledger` HTTP header.
For endpoints which serve data which can change from ledger to ledger (for example an account balance), Horizon includes a `Latest-Ledger` HTTP header in its response. The value of the `Latest-Ledger` HTTP header is the sequence number of the latest ledger known to Horizon at the time the request was processed. Horizon will guarantee that all the data included in the response is consistent with that ledger. This mechanism prevents race conditions where a request is processed at the boundary of two ledgers and ensures that the response is consistent with the ledger included in the `Latest-Ledger` HTTP header.
fnando marked this conversation as resolved.
Show resolved Hide resolved
38 changes: 21 additions & 17 deletions scripts/stellar_cli.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import fs from "fs-extra";
import path from 'path';
fnando marked this conversation as resolved.
Show resolved Hide resolved
import { execSync } from 'child_process';
import path from "path";
import { execSync } from "child_process";

const repoUrl = 'https://github.com/stellar/stellar-cli.git';
const localRepoPath = './stellar-cli-repo';
const repoUrl = "https://github.com/stellar/stellar-cli.git";
const localRepoPath = "./stellar-cli-repo";

// Remove the existing repo if it exists
if (fs.existsSync(localRepoPath)) {
console.log('Removing existing repository...');
console.log("Removing existing repository...");
fs.removeSync(localRepoPath);
}

// Perform a shallow clone of the repository
console.log('Cloning repository...');
execSync(`git clone --depth 1 ${repoUrl} ${localRepoPath}`);
console.log("Cloning repository...");
execSync(`git clone ${repoUrl} ${localRepoPath}`);
execSync(
`cd ${localRepoPath} && git checkout --quiet $(git tag | grep -v -E 'rc|preview' | tail -n1)`,
);
fnando marked this conversation as resolved.
Show resolved Hide resolved

// Copy FULL_HELP_DOCS.md
const fullHelpDocsPath = path.join(localRepoPath, 'FULL_HELP_DOCS.md');
const fullHelpDocsContent = fs.readFileSync(fullHelpDocsPath, 'utf8');
const fullHelpDocsPath = path.join(localRepoPath, "FULL_HELP_DOCS.md");
const fullHelpDocsContent = fs.readFileSync(fullHelpDocsPath, "utf8");

const modifiedContent = `---
sidebar_position: 30
Expand All @@ -27,14 +30,15 @@ description: This document contains the help content for the stellar command-lin
${fullHelpDocsContent}
`;

fs.writeFileSync("docs/tools/developer-tools/cli/stellar-cli.mdx", modifiedContent);

fs.cpSync(
path.join(localRepoPath, 'cookbook'),
'docs/build/guides/cli',
{ recursive: true },
fs.writeFileSync(
"docs/tools/developer-tools/cli/stellar-cli.mdx",
modifiedContent,
);

execSync('yarn format:mdx');
fs.cpSync(path.join(localRepoPath, "cookbook"), "docs/build/guides/cli", {
recursive: true,
});

execSync("yarn format:mdx");

console.log('All files processed successfully.');
console.log("All files processed successfully.");