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
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.
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.
If you don't have a GitHub account, start here.
Fork the project
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.
Clone the fork
Now you'll make a local copy of the repository. From the command line:
# Open command line terminal
# Navigate to your desired working directory
cd <your-desired-working-directory>
git clone https://github.com/<your-username>/Silex.git
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 Silex
git remote add upstream https://github.com/silexlabs/Silex.git
Create a new branch (Recommended)
Though you can work directly in the default dev branch, it is best practice to keep that branch synced with Silex and create a new working branch for your changes. Name the new branch whatever you'd like.
git checkout -b <new-branch-name>
You'll need to set the upstream branch so git knows where to point your new branch's pull and push commands. Below you set your local dev branch as the upstream branch to your new branch.
git branch --set-upstream-to=dev <new-branch-name>
Install the dependencies
Be sure to have Node version >= 18.
npm install
This will install all the dependencies needed to run Silex.
Build the project
Before running Silex, you might need to build the project.
npm run build
Run the project
npm run dev
This will start the Silex server, Silex will be available on http://localhost:6805
.
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"
Note on commiting: If you have multiple commits or wish to change your commit message, you can use interactive rebase to clean up and consolidate your commits before making your pull request.
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 <branch-name>
Create a pull request
Create your request, making sure the title is as clear and descriptive as possible.