This page is about contributing code, for other types of contribution (non technical) see this page. If you want to get involved we can also chat!
Silex is free and open source since 2009, it is up to us to keep it alive and competitive. Contribute to Silex today, give it exposure, help test the beast, add features or fix bugs. Get help from the team on the forums and community chat
Useful links:
To contribute code (features, bug fixes, design changes, etc.) to the Silex code base, you'll need to complete a few steps to get a local working copy of our repository. Below are the steps you'll need to fork, clone, branch, and create a pull request.
Please be sure to conform to the coding standards used throughout our project and bear in mind that, by contributing to this project, you agree to our Code of Conduct.
By contributing to Silex or any related project, you accept that your contribution is licenced with the same licence as the project you contribute to.
You'll find the main Silex repo in Silex meta repository. That holds the main client and server side code for Silex. It has important plugins too, that are not activated by default, unless you use silex-platform
repository which enables all the plugins and features you find on v3.sile.me instance.
The client-side is primarily handled by the files in the src/ts/client
directory. The main entry point is defined in index.ts
, which initializes the Silex application. The config.ts
file contains the SilexConfig
class that holds the configuration for the client-side application, including the GrapesJS editor configuration and the client config URL. The grapesjs
directory contains the GrapesJS editor configuration and plugins. The utils.ts
file contains utility functions.
The server-side is primarily handled by the files in the src/ts/server
directory. The main entry point is defined in index.ts
, which initializes the server-side application. The config.ts
file contains the ServerConfig
class that holds the configuration for the server-side application. The express.ts
file sets up the Express.js application and starts the server. The cli.ts
file handles the command-line interface for the server, parsing command-line arguments and setting environment variables accordingly. The events.ts
file defines events for the startup process.
Fork the meta repo
This repo holds all Silex code, including the plugins and optional libraries we maintain.
Open the Silex meta repository in GitHub. Click Fork
in the upper right corner of the window. This adds a copy of the Silex repository to your GitHub account.
Clone the fork of the meta repo
Now you'll make a local copy of the repository. Check the instructions in the README file, in the "installation" section.
Fork the project you need to modify
Let's say you want to change some code in the Silex
repo
Open the Silex Project in GitHub. Click Fork
in the upper right corner of the window. This adds a copy of the Silex repository to your GitHub account.
Set the upstream repository
Assign Silex as the upstream repository. Setting the upstream repository tells Git where to pull from when you use the pull command (which you'll do in the next step).
cd packages/Silex
git remote add upstream https://github.com/<your-github-id>/Silex.git
Run the project
Before running Silex, you might need to build the project.
npm run build
npm start
This will build and start the Silex server, Silex will be available on http://localhost:6805
.
Or better, use npm run watch
instead of npm run build
to keep rebuilding the project when you edit a file.
For other projects, there my be different npm scripts, just run npm run
to see what script to use to build and start the project.
Make your changes
Once changes are complete, use one of the following commands to stage the changes to be committed.
git add <file-name>
Once your changes are ready and all files you wish to commit have been added (step #5), you'll create your commit.
git commit -m "This is a short message about the change made in this commit"
Rebase the upstream branch into your local branch(es)
Do this from time to time to keep your local repository up to date with the latest changes in the upstream repository. This is especially important before you start making changes.
This assumes that your local folder is "clean", that all your work is committed.
git pull --rebase upstream dev
Push your local branch up to your fork
git push origin dev
Create a pull request
Head here to submit your code for review: https://github.com/silexlabs/<your-github-id>/compare
or check this doc on how to create your pull request, making sure the title is as clear and descriptive as possible.