1 line
6.9 KiB
JavaScript
1 line
6.9 KiB
JavaScript
import{_ as e,c as t,o,a}from"./app.ab34650d.js";var r="/assets/actionsbutton.f1ba9d8e.png",n="/assets/gh-pages.a24cefcf.png";const y=JSON.parse('{"title":"Setting Up","description":"","frontmatter":{},"headers":[{"level":2,"title":"Local Development","slug":"local-development"},{"level":3,"title":"Deploying","slug":"deploying"},{"level":3,"title":"Visual Studio Code Setup","slug":"visual-studio-code-setup"},{"level":2,"title":"Replit","slug":"replit"},{"level":2,"title":"Glitch","slug":"glitch"}],"relativePath":"guide/getting-started/setup.md","lastUpdated":1658112388000}'),i={name:"guide/getting-started/setup.md"},l=a('<h1 id="setting-up" tabindex="-1">Setting Up <a class="header-anchor" href="#setting-up" aria-hidden="true">#</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-hidden="true">#</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="noopener noreferrer">git</a></li><li><a href="https://nodejs.org/en/download/" target="_blank" rel="noopener noreferrer">node</a></li></ul><p>Create a new project from the <a href="https://github.com/profectus-engine/Profectus" target="_blank" rel="noopener noreferrer">Profectus repository</a> via the "Use this template" 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.html">updating Profectus</a> <em>before</em> you start developing, to avoid the issue with unrelated histories.</p></div><p>It'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'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' 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.html">update Profectus</a> before you start working, as it'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-hidden="true">#</a></h3><p>If you'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'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'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="'+n+'" alt="github pages"></p><p>Once the action completes, your project should be available at <code>https://<YOUR_GITHUB_USERNAME>.github.io/<YOUR_REPO_NAME>/</code>. For example, the TMT Demo project hosted at <a href="https://github.com/profectus-engine/TMT-Demo" target="_blank" rel="noopener noreferrer">https://github.com/profectus-engine/TMT-Demo</a> is available at <a href="https://profectus-engine.github.io/TMT-Demo/" target="_blank" rel="noopener 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-hidden="true">#</a></h3><p>If you don't already have a preferred IDE, Profectus is currently developed in <a href="https://code.visualstudio.com" target="_blank" rel="noopener 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="noopener 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&ssr=false#qna" target="_blank" rel="noopener 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-hidden="true">#</a></h2><p>As an alternative to local development, you may use <a href="https://replit.com" target="_blank" rel="noopener 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="noopener 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 "Run" 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-hidden="true">#</a></h2><p><a href="https://glitch.com" target="_blank" rel="noopener noreferrer">Glitch</a> is a site similar to replit, with much the same pros and cons. To create a projectus project on glitch, select "New Project", "Import from GitHub", 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 p(c,u,h,d,g,m){return o(),t("div",null,s)}var b=e(i,[["render",p]]);export{y as __pageData,b as default};
|