Skip to content

schlotterer/flexline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building from Source

If you intend to clone the repository for custom development or contributions, please:

Then you can follow these instructions:

Prerequisites

  • 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

Build Instructions

  1. Clone the Repository:

    git clone https://github.com/schlotterer/flexline.git
    cd flexline
  2. 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.
  3. Install Node.js Dependencies:

    npm install
  4. Install PHP Dependencies:

    • Ensure Composer is installed on your system.
    composer install
  5. Development Build:

    • Compiles assets without minification for easier debugging.
    npm run dev
  6. Watch Mode:

    • Automatically rebuilds assets when files change, useful during active development.
    npm run watch
  7. Production Build:

    • Minifies assets for production use.
    npm run prod

Linting and Pre-commit Hooks

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

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.

Manually Running Linters

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.