feat: add versions to links to quick start scripts#2248
Conversation
Summary of ChangesHello @jcstein, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the documentation by implementing dynamic versioning for quick start script links. By introducing a new Vue component and integrating it into the relevant guide, the PR ensures that users always access the correct script versions for different networks, thereby improving the accuracy and maintainability of the documentation. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new Vue component NetworkScriptLinks to display versioned links for quick start scripts, replacing a hardcoded list in the consensus node guide. This is a good improvement for maintainability. My review includes a suggestion to refactor the new component to reduce code duplication and improve its structure, and a comment to remove now-unused imports from the markdown file.
| <template> | ||
| <div> | ||
| <ul> | ||
| <li>Local devnet: <a href="https://github.com/celestiaorg/celestia-app/blob/main/scripts/single-node.sh" target="_blank" rel="noopener noreferrer">https://github.com/celestiaorg/celestia-app/blob/main/scripts/single-node.sh</a></li> | ||
| <li>Arabica: <a :href="`https://github.com/celestiaorg/celestia-app/blob/${arabicaVersions['app-latest-tag']}/scripts/arabica.sh`" target="_blank" rel="noopener noreferrer">{{ `https://github.com/celestiaorg/celestia-app/blob/${arabicaVersions['app-latest-tag']}/scripts/arabica.sh` }}</a></li> | ||
| <li>Mocha: <a :href="`https://github.com/celestiaorg/celestia-app/blob/${mochaVersions['app-latest-tag']}/scripts/mocha.sh`" target="_blank" rel="noopener noreferrer">{{ `https://github.com/celestiaorg/celestia-app/blob/${mochaVersions['app-latest-tag']}/scripts/mocha.sh` }}</a></li> | ||
| <li>Mainnet Beta: <a :href="`https://github.com/celestiaorg/celestia-app/blob/${mainnetVersions['app-latest-tag']}/scripts/mainnet.sh`" target="_blank" rel="noopener noreferrer">{{ `https://github.com/celestiaorg/celestia-app/blob/${mainnetVersions['app-latest-tag']}/scripts/mainnet.sh` }}</a></li> | ||
| </ul> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import arabicaVersions from "/.vitepress/constants/arabica_versions.js"; | ||
| import mochaVersions from "/.vitepress/constants/mocha_versions.js"; | ||
| import mainnetVersions from "/.vitepress/constants/mainnet_versions.js"; | ||
|
|
||
| export default { | ||
| name: 'NetworkScriptLinks', | ||
| data() { | ||
| return { | ||
| arabicaVersions, | ||
| mochaVersions, | ||
| mainnetVersions | ||
| }; | ||
| } | ||
| } | ||
| </script> No newline at end of file |
There was a problem hiding this comment.
The current implementation has a lot of repetition in the template for constructing the URLs. This can be improved for maintainability by using a v-for loop in the template and a computed property in the script. This makes the component cleaner, easier to read, and simplifies adding or modifying network links in the future.
<template>
<div>
<ul>
<li>Local devnet: <a href="https://github.com/celestiaorg/celestia-app/blob/main/scripts/single-node.sh" target="_blank" rel="noopener noreferrer">https://github.com/celestiaorg/celestia-app/blob/main/scripts/single-node.sh</a></li>
<li v-for="network in networks" :key="network.name">
{{ network.name }}: <a :href="network.url" target="_blank" rel="noopener noreferrer">{{ network.url }}</a>
</li>
</ul>
</div>
</template>
<script>
import arabicaVersions from "/.vitepress/constants/arabica_versions.js";
import mochaVersions from "/.vitepress/constants/mocha_versions.js";
import mainnetVersions from "/.vitepress/constants/mainnet_versions.js";
const networkConfigs = [
{ name: 'Arabica', versions: arabicaVersions, scriptName: 'arabica.sh' },
{ name: 'Mocha', versions: mochaVersions, scriptName: 'mocha.sh' },
{ name: 'Mainnet Beta', versions: mainnetVersions, scriptName: 'mainnet.sh' },
];
export default {
name: 'NetworkScriptLinks',
computed: {
networks() {
const baseUrl = 'https://github.com/celestiaorg/celestia-app/blob/';
return networkConfigs.map(config => ({
name: config.name,
url: `${baseUrl}${config.versions['app-latest-tag']}/scripts/${config.scriptName}`
}));
}
}
}
</script>
| import arabicaVersions from '/.vitepress/constants/arabica_versions.js' | ||
| import mochaVersions from '/.vitepress/constants/mocha_versions.js' | ||
| import mainnetVersions from '/.vitepress/constants/mainnet_versions.js' |
|
Overview
Resolves #2246