If you intend to clone the repository for custom development or contributions, please:
Then you can follow these instructions:
- Node.js (LTS version recommended)
- npm (Node Package Manager)
- nvm (Node Version Manager) – recommended for managing multiple Node.js versions
- Composer – required for managing PHP dependencies
-
Clone the Repository:
git clone https://github.com/schlotterer/flexline.git cd flexline
-
Switch to the Recommended Node.js Version:
- Ensure you are using the correct version of Node.js as specified in the
.nvmrc
file.
nvm use
- If the required version is not installed, nvm will prompt you to install it.
- Ensure you are using the correct version of Node.js as specified in the
-
Install Node.js Dependencies:
npm install
-
Install PHP Dependencies:
- Ensure Composer is installed on your system.
composer install
-
Development Build:
- Compiles assets without minification for easier debugging.
npm run dev
-
Watch Mode:
- Automatically rebuilds assets when files change, useful during active development.
npm run watch
-
Production Build:
- Minifies assets for production use.
npm run prod
To maintain code quality and ensure consistency across contributions, our project utilizes linting tools for PHP, JavaScript, and SCSS, and enforces these standards through pre-commit hooks managed by Husky.
Pre-commit hooks are set up to run automatically on every commit to ensure that changes adhere to our coding standards. When you attempt to commit changes, the following linting processes are triggered:
- PHP files are automatically fixed and checked with PHP_CodeSniffer.
- JavaScript files are linted and automatically fixed with ESLint.
- SCSS files are linted and automatically fixed with Stylelint.
If there are any linting errors that cannot be automatically fixed, the commit will be aborted, and you will need to manually resolve these issues.
If you wish to manually lint your files prior to committing, you can use the following commands:
-
Lint PHP files:
npm run lint-php
-
Automatically fix PHP files:
npm run fix-php
-
Lint JavaScript files:
npm run lint-js
-
Lint SCSS files:
npm run lint-style
These commands provide a way to proactively check and fix your code, helping you avoid surprises during the commit process.