profectus-docs/assets/guide_getting-started_setup.md.cfc023b0.js

1 line
6.7 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as e,c as t,o,N as a}from"./chunks/framework.0799945b.js";const r="/assets/actionsbutton.f1ba9d8e.png",i="/assets/gh-pages.a24cefcf.png",y=JSON.parse('{"title":"Setting Up","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started/setup.md","lastUpdated":1680966801000}'),n={name:"guide/getting-started/setup.md"},l=a('<h1 id="setting-up" tabindex="-1">Setting Up <a class="header-anchor" href="#setting-up" aria-label="Permalink to &quot;Setting Up&quot;"></a></h1><p>Profectus requires a node development environment in order to work on a project. If you are comfortable with the command line, it is recommended to use a local development environment.</p><h2 id="local-development" tabindex="-1">Local Development <a class="header-anchor" href="#local-development" aria-label="Permalink to &quot;Local Development&quot;"></a></h2><p>You will require the following tools for local development:</p><ul><li><a href="https://git-scm.com/downloads" target="_blank" rel="noreferrer">git</a></li><li><a href="https://nodejs.org/en/download/" target="_blank" rel="noreferrer">node</a></li></ul><p>Create a new project from the <a href="https://github.com/profectus-engine/Profectus" target="_blank" rel="noreferrer">Profectus repository</a> via the &quot;Use this template&quot; button. You can then copy the link for the repository to clone it locally.</p><div class="info custom-block"><p class="custom-block-title">INFO</p><p>Since the repository is a template repository, you can easily create multiple projects from one repository. However, it does make updating an existing project to a newer version of Profectus more difficult. Consider <a href="./updating">updating Profectus</a> <em>before</em> you start developing, to avoid the issue with unrelated histories.</p></div><p>It&#39;s recommended to create a new git branch for development, so you can push your changes without it affecting the live build. This allows you to continue working with smaller commits, and only release new versions when you&#39;re actually ready to. The github workflow will automatically rebuild the page whenever you push to the <code>main</code> branch.</p><p>The next step is to install Profectus&#39; dependencies. This is as simple as running <code>npm install</code>.</p><p>You can now run <code>npm run serve</code> to start a local server that will host your project so you can work on it. As you change files the site will automatically reload them.</p><p>Also, you might consider following the steps to <a href="./updating">update Profectus</a> before you start working, as it&#39;ll make updating in the future easier without needing to worry about unrelated histories.</p><h3 id="deploying" tabindex="-1">Deploying <a class="header-anchor" href="#deploying" aria-label="Permalink to &quot;Deploying&quot;"></a></h3><p>If you&#39;re using git, deploying is as easy as pushing your changes to the <code>main</code> branch. In a couple minutes the site will be updated fully automatically. If you&#39;d like to see progress on it, or look at any errors that happened, you can do so from the actions tab on your repository.</p><p><img src="'+r+'" alt="actions button"></p><p>Before github knows to actually host the generated site, you&#39;ll have to enable github pages in the repo settings. This just means selecting the branch to use - <code>gh-pages</code>. You will only need to perform this step once. This will automatically start another github action to deploy the website.</p><p><img src="'+i+'" alt="github pages"></p><p>Once the action completes, your project should be available at <code>https://&lt;YOUR_GITHUB_USERNAME&gt;.github.io/&lt;YOUR_REPO_NAME&gt;/</code>. For example, the TMT Demo project hosted at <a href="https://github.com/profectus-engine/TMT-Demo" target="_blank" rel="noreferrer">https://github.com/profectus-engine/TMT-Demo</a> is available at <a href="https://profectus-engine.github.io/TMT-Demo/" target="_blank" rel="noreferrer">https://profectus-engine.github.io/TMT-Demo/</a>.</p><h3 id="visual-studio-code-setup" tabindex="-1">Visual Studio Code Setup <a class="header-anchor" href="#visual-studio-code-setup" aria-label="Permalink to &quot;Visual Studio Code Setup&quot;"></a></h3><p>If you don&#39;t already have a preferred IDE, Profectus is currently developed in <a href="https://code.visualstudio.com" target="_blank" rel="noreferrer">Visual Studio Code</a> and is known to work well with that IDE in particular.</p><p>Recommendations:</p><ul><li>Use <a href="https://github.com/johnsoncodehk/volar/discussions/471" target="_blank" rel="noreferrer">Take Over Mode</a> for proper type analysis</li><li>Turn off <code>.value</code> autocomplete by running the <code>Preferences: Open Settings</code> command and setting <code>volar.autoCompleteRefs</code> to <code>false</code></li><li>Install the <a href="https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorer&amp;ssr=false#qna" target="_blank" rel="noreferrer">Vitest VS Code extension</a> for running and debugging unit tests (if you plan on working on the engine itself)</li></ul><h2 id="replit" tabindex="-1">Replit <a class="header-anchor" href="#replit" aria-label="Permalink to &quot;Replit&quot;"></a></h2><p>As an alternative to local development, you may use <a href="https://replit.com" target="_blank" rel="noreferrer">replit</a>, which will automatically set up your development environment for you and also host your project itself.</p><p>However, on the free plan you will be limited by the amount of resources you can use, and the program will need to start up occasionally.</p><p>To create a Profectus project on replit, all you have to do is click this button:</p><p><a href="https://repl.it/github/profectus-engine/Profectus" target="_blank" rel="noreferrer"><img src="https://repl.it/badge/github/profectus-engine/Profectus" alt="Run on Repl.it"></a></p><p>You can then start the developing by clicking the &quot;Run&quot; button at the top of the screen. This will also make the project run publicly, so you could consider it as automatically deployed. This does mean you cannot have a separate development environment from your production environment, however.</p><h2 id="glitch" tabindex="-1">Glitch <a class="header-anchor" href="#glitch" aria-label="Permalink to &quot;Glitch&quot;"></a></h2><p><a href="https://glitch.com" target="_blank" rel="noreferrer">Glitch</a> is a site similar to replit, with much the same pros and cons. To create a projectus project on glitch, select &quot;New Project&quot;, &quot;Import from GitHub&quot;, and then type in <code>profectus-engine/Profectus</code>. The new project will be created and should be automatically configured and ready to go.</p>',29),s=[l];function c(u,p,h,d,m,g){return o(),t("div",null,s)}const b=e(n,[["render",c]]);export{y as __pageData,b as default};