Contributing guide
August 11, 2025 ยท View on GitHub
This page explains how to start contributing to this project.
This project uses Angular as the framework for the site.
Let us assign the issue to you
Before you start working on an issue, please comment in the issue to let us know you're going to work on it. This way we avoid duplicate work.
Local development
If you want to develop on your own machine, follow these steps:
- Install NodeJS
18.12.1LTS (or newer). - Install VSCode
v1.74(or newer). - Clone the repository with the Git CLI, or with a Git UI like GitHub Desktop, Sourcetree, GitKraken etc.
- Open the cloned folder with VSCode.
- Install the recommended extensions when prompted by VSCode.
- Run
npm run ito install the dependencies. - Start the development server for the app with
npm run start.
Hidden files in VSCode
This project has configured VSCode to hide some files.
The adrianwilczynski.toggle-hidden extension adds a toggle to show or hide, the hidden files.
The list of hidden files is in the files.exclude section of our VS Code settings.json file.
Storybook
Reference any components in the Storybook instance by:
- Running Storybook with the
npm run storybookcommand. - Browsing the list of components.
Read the Storybook docs to learn how to use the components.
Where to find stuff
This project uses Angular.
Source code
All source code is in the src folder.
The code you'll need most is in the src/app/ folder.
You'll often work in the internal folders, like cheat sheet components, to create or edit code.
The app.component.ts file is the main entry point for the Angular app, along with other app.xxx.ts files.
The rest of the src folder holds the main index.html where all the Angular code gets generated to, and is what is hosted.
The src folder also has basic resources like favicons and metadata for SEO.
Assets and stylesheets
The assets folder holds the images and icons.
The styles folder holds the CSS stylesheets.
Config files for linting, formatting, testing
Many files and folders in the top level of the repository are config files for our linting, formatting or testing tools.
Writing code
When creating new components, services, utilities, and so on:
- Install, and use, the Angular Files Generator Extension for VSCode. This extension is already enabled if you installed the recommended extensions.
- The extension can generate new files matching our project's style. Depending on the type you select the extension generates starter TypeScript, HTML, Storybook and Jest test files. This helps you develop well-documented and tested code.
Strongly type all TypeScript code
Make sure all the TypeScript code is strongly typed. This makes your code more robust and documents the code. This lets us know the data types used in any given place. Angular Files Generator Extension can help here too with models, enums etc...
Tips
Making a new cheat sheet
Look at the cs-common-ratios example first. Then follow these steps:
-
In the cheat-sheets folder look for the category you want to add to/modify.
-
Use the Angular Files Generator Extension to generate a new
Standalone Componentin one of those categories -
Add the newly generated component module to the matching category's module (e.g. game-base.module.ts)
importsarray. -
In the
.componentfile add the following (if not already generated):export const YOUR_NEW_SHEET_NAV: NavData = newNavData( 'Your Title', FactorioIcons.Icons_RepairPack ); ... public readonly cheatSheetTitle: string = YOUR_NEW_SHEET_NAV.title; public readonly cheatSheetIconId: FactorioIcons = YOUR_NEW_SHEET_NAV.sheetIconId; -
In the
.htmlfile add the<app-cheat-sheet-template [iconId]="cheatSheetIconId" [title]="cheatSheetTitle">Your Content Here</app-cheat-sheet-template>. -
In the
nav.data.tsadd to the nav array such asNAV_BASE:export const NAV_BASE: NavData[] = [ ... YOUR_NEW_SHEET_NAV, ... ] -
In the module
component.html(e.g.game.base.component.html) add in the component tag (e.g.<app-cs-common-ratios></app-cs-common-ratios>).
Making a new cheat sheet category (mods, expansions, etc)
Follow these steps:
- In the
cheat-sheetsfolder use thedeniszholob.angular-files-generatorextension to generate a newModule Component. - Follow the other category examples to create new routes, update the HTML and so on.
- Update the
cheat-sheets.module.tsfile. - Update the
nav.data.tsfile. - Add new route to the
sitemap.xmlfile. - Add cheat sheets, if needed, by following the steps listed in the Making a new cheat sheet section above.
Before opening a Pull Request
When your work is done, please:
- If you're making visual changes to the cheatsheets: run the preview server with
npm run startand make screenshots of your changes. - Run
npm run build. - After a successful build, commit and then push your changes to your fork. If you're fixing an Issue on GitHub: link to that issue in your Git commit message, for example:
Closes #issueNumberThatGetsFixed. - Create a new Pull Request, and follow the steps in the Pull Request template.
Debug
If you get an error with precommit hooks on Mac/Linux, see this discussion on Stack Overflow.
Generating a PDF
- Use Firefox, to "print" the page to PDF.
- Remove the margins, headers and footers.
- But keep the backgrounds.
- Scale to
90%. - Remove the last page if it's empty.