fauna-gql-upload
Version:
Manage your FaunaDB resources in within your project and upload them using a single command
256 lines (194 loc) • 9.64 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>💡 Contributing - Fauna GQL Upload</title>
<link rel="preconnect" href="https://cdnjs.cloudflare.com" />
<link rel="preconnect" href="https://arc.io" />
<link rel="preconnect" href="https://viewm.moonicorn.network" />
<link rel="preconnect" href="https://plausible.io" />
<link rel="stylesheet" href="../css/main.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/themes/prism-okaidia.css" integrity="sha512-lTmd0bFMM2Ttm/S8V5dywYNiJaSyF5PILZosvAIzW4EJ7JLEYflk9ImyYIxw5KlFz7e9ZCJN53rnvPnefD240w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/prism.min.js" integrity="sha512-YBk7HhgDZvBxmtOfUdvX0z8IH2d10Hp3aEygaMNhtF8fSOvBZ16D/1bXZTJV6ndk/L/DlXxYStP8jrF77v2MIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script async src="https://arc.io/widget.min.js#3ua6mscf"></script>
<script async defer data-domain="fgu-docs.com" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
<header>
<button class="icon-button hamburger">
<img src="../img/hamburger.svg" />
</button>
<h1 class="title">Fauna GQL Upload</h1>
<div class="social">
<a href="https://github.com/Plazide/fauna-gql-upload">
<img alt="Github" src="../img/github.png" />
</a>
<a href="https://twitter.com/chj_web">
<img alt="Twitter" src="../img/twitter.png" />
</a>
</div>
</header>
<nav class="nav">
<header>
<button onclick="toggleNavigation()" class="icon-button backburger">
<img src="../img/backburger.svg" />
</button>
<h1 class="title">Fauna GQL Upload</h1>
</header>
<ul class="list">
<li >
<a href="..">✨ Introduction</a>
</li>
<li >
<a href="../getting-started/">🏹 Getting started</a>
</li>
<li class="dropdown">
<button class="dropdown-button">
⌨️ Configuration
<img class="chevron" alt="chevron" src="../img/chevron.svg" />
</button>
<ul class="closed list">
<li >
<a href="../configuration/config-file/">Config file</a>
</li>
<li >
<a href="../configuration/command-line-options/">Command-line options</a>
</li>
<li >
<a href="../configuration/local-development/">Local development</a>
</li>
</ul>
</li>
<li class="dropdown">
<button class="dropdown-button">
🤹 Usage
<img class="chevron" alt="chevron" src="../img/chevron.svg" />
</button>
<ul class="closed list">
<li >
<a href="../usage/upload-schema/">Upload schema</a>
</li>
<li >
<a href="../usage/upload-functions/">Upload functions</a>
</li>
<li >
<a href="../usage/upload-indexes/">Upload indexes</a>
</li>
<li >
<a href="../usage/upload-roles/">Upload roles</a>
</li>
<li >
<a href="../usage/upload-data/">Upload data</a>
</li>
<li >
<a href="../usage/upload-access-providers/">Upload access providers</a>
</li>
<li >
<a href="../usage/graphql-code-generator/">GraphQL code generator</a>
</li>
<li >
<a href="../usage/with-typescript/">With typescript</a>
</li>
</ul>
</li>
<li class="active">
<a href="./">💡 Contributing</a>
</li>
<li >
<a href="../problems-or-issues/">❌ Problems or issues?</a>
</li>
</ul>
<footer>
<a href="https://github.com/Plazide/fauna-gql-upload">
<img alt="Github" src="../img/github.png" />
</a>
<a href="https://twitter.com/chj_web">
<img alt="Twitter" src="../img/twitter.png" />
</a>
</footer>
</nav>
<main class="main"><h1 id="contributing">💡 Contributing</h1>
<p>If you want to make changes to Fauna GQL Upload, this is the place to be. You'll find guides for local development and testing below. While these aren't extensive, they should give you an idea of how to get started.</p>
<h2 id="areas-where-help-is-needed">Areas where help is needed</h2>
<p>There are a few areas where your help would be extra appreciated. These are listed below:</p>
<ul>
<li>Testing. The current test suite is lacking and needs to be improved.</li>
<li>Documentation. The current documentation works, but there is room for improvement. This includes:<ul>
<li>Creating a better design</li>
<li>Implementing search</li>
<li>Implementing versioning</li>
<li>Improving overall quality of content</li>
</ul>
</li>
<li>Examples. There should be simple example projects inside the repo.</li>
</ul>
<p>If you want to help out with any of these areas, <a href="mailto:carl@chjweb.se">send me an email</a>, send me a DM on <a href="https://twitter.com/chj_web">Twitter</a>, or open an issue to start a discussion.</p>
<h2 id="local-development">Local development</h2>
<p>First thing to do is to <code>git clone</code> the repo. Like this:</p>
<pre><code class="language-sh">git clone https://github.com/Plazide/fauna-gql-upload
</code></pre>
<p>You should then move into the created directory and create a new branch where your changes will live.</p>
<pre><code class="language-sh">git checkout -b <new-feature>
</code></pre>
<p>Now install the dependencies:</p>
<pre><code class="language-sh">yarn install
</code></pre>
<p>Since Fauna GQL Upload is written in Typescript, we need to build the code before it'll run. During development, we can use the following command to build new changes as they happen:</p>
<pre><code class="language-sh">yarn watch
</code></pre>
<p>You are now ready to start developing.</p>
<h2 id="manual-testing">Manual testing</h2>
<p>To actually test your changes, you need to create a new directory and link your local version of Fauna GQL Upload to it. To do this, first run the following command in your local Fauna GQL Upload project:</p>
<pre><code class="language-sh">yarn link
</code></pre>
<p>Then run the following command in the project you use for testing:</p>
<pre><code class="language-sh">yarn link fauna-gql-upload
</code></pre>
<p>You can now create resources and start testing your changes.</p>
<blockquote>
<p><strong>NOTE</strong>: To get up and running quickly with your testing project, you can run the commands above and then run <code>yarn fgu init</code> to create placeholder resources.</p>
</blockquote>
<h3 id="other-notes">Other notes</h3>
<h4 id="using-local-version-of-faunadb">Using local version of FaunaDB</h4>
<p>To test things properly, you need a FaunaDB instance to test against. The simplest way to use FaunaDB is by using the cloud instances. If you are running a lot of tests with large amounts resources, it is possible that you could incur charges. To avoid this, it is possible to install a development version of FaunaDB locally using Docker.</p>
<p>Read about how to <a href="https://blog.chjweb.se/set-up-fauna-gql-upload-with-fauna-dev">set up Fauna GQL Upload with Fauna Dev</a>.</p>
<h4 id="other-means-of-installation">Other means of installation</h4>
<p>It is possible that the linking method doesn't work for some features. When you notice that the test project starts throwing errors that it shouldn't, try installing Fauna GQL Upload like you normally would but with the path to your local project. Like this:</p>
<pre><code class="language-sh">yarn add -D /path/to/your/local/project
</code></pre>
<p>Unfortunately, when doing this, you will need to re-install the package after every change you make to the code.</p>
<h2 id="automatic-tests">Automatic tests</h2>
<p>The test suite for Fauna GQL Upload is very limited right now (we only have 3 tests). Regardless, it is still a good idea to run these tests before committing. To run tests, you need to first copy the contents of <code>.env.test-example</code> to <code>.env.test</code>, like so:</p>
<pre><code class="language-sh">cp .env.test-example .env.test
</code></pre>
<p>Replace the placeholder values with your own.</p>
<p>You can then run the tests using:</p>
<pre><code class="language-sh">yarn test
</code></pre>
<p>Please consider adding tests for any features that you might add.</p>
<h2 id="documentation">Documentation</h2>
<p>It is sometimes necessary to add or edit the documentation after making changes to the code. You can do this by going into the <code>/docs</code> folder.</p>
<p>It is not necessary, but once you've made your changes, you can run <code>yarn mkdocs</code> to build and inspect the documentation. This requires <a href="https://www.python.org/">Python</a> and the <a href="https://www.mkdocs.org/getting-started/">mkdocs CLI</a>.</p></main>
<iframe
src="https://viewm.moonicorn.network/#%7B%22options%22%3A%7B%22publisherAddr%22%3A%220x60C1D3c8E5FE51bEE5546F6240E18230be4C7Ab2%22%2C%22whitelistedTokens%22%3A%5B%220x6B175474E89094C44Da98b954EedeAC495271d0F%22%5D%2C%22whitelistedType%22%3A%22legacy_160x600%22%2C%22randomize%22%3Atrue%2C%22targeting%22%3A%5B%5D%2C%22width%22%3A%22160%22%2C%22height%22%3A%22600%22%2C%22minPerImpression%22%3A%220%22%2C%22fallbackUnit%22%3Anull%2C%22marketSlot%22%3A%22QmREYH6teaTWQF7uD7TfKuVvqRY3P5WauxDeHoQoJJJ4aA%22%7D%7D"
width="160"
height="600"
scrolling="no"
frameborder="0"
style="border: 0;"
class="ad-frame"
onload="window.addEventListener('message', function(ev) {
if (ev.data.hasOwnProperty('adexHeight') && ('https://viewm.moonicorn.network' === ev.origin)) {
for (let f of document.getElementsByTagName('iframe')) {
if (f.contentWindow === ev.source) {
f.height = ev.data.adexHeight;
}
}
}
}, false)"
></iframe>
<script src="../js/main.js"></script>
</body>
</html>