Giter Site home page Giter Site logo

bezoerb / generator-sf Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 3.0 2.33 MB

Yeoman generator that scaffolds out a Symfony PHP app including Browsersync, various CSS preprocessors, jspm, webpack, browserify and Service Worker

License: MIT License

JavaScript 69.36% PHP 1.40% HTML 16.01% CSS 13.22%
yeoman gulp grunt webpack hmr offline service-worker jspm symfony

generator-sf's Introduction

generator-sf

NPM version Build Status Dependency Status Download Coverage Status

This Yeoman generator scaffolds a symfony app with full featured frontend grunt/gulp tooling. Just scaffold your app and you are ready to go.

Installation

First, install Yeoman and generator-sf using npm (we assume you have pre-installed node.js).

Install dependencies

npm install -g yo grunt gulp

To install generator-sf from npm, run:

npm install -g generator-sf

Then generate your new project:

yo sf

Features

  • Symfony framework
  • Twig templating engine
  • Assetic removed
  • Browsersync dev/prod server with livereload
  • Choose the build tool which fits your needs
  • Choose the CSS preprocessor which fits your needs
  • Choose CSS Framework
  • Choose Javascript module loader
  • File revving
  • Image optimization
  • Critical (Extract & Inline Critical-path CSS)
  • uncss (Automatically strip off unused css)
  • Service Worker
  • Organized Gruntfile with load-grunt-config
  • Preconfigured testing Stack: Karma, Mocha & Chai
  • Phpunit

Things to come

  • Feel free to add feature requests ;)

Environments

The browsersync server uses it's own symfony environment to prevent asset loading conflicts with the environment loaded via apache2.

Directory structure

The directory structure is based on the Symfony Best Practices

Dev

  • Assets are located in app/Resources/public
  • Templates can be found in app/Resources/views

Production

  • All production assets are located in the web folder.
  • Run grunt build or gulp build to compile, optimize and rev your assets for production.

Changelog

See CHANGELOG.md

License

MIT

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

License

MIT © Ben Zörb

generator-sf's People

Contributors

bezoerb avatar greenkeeperio-bot avatar sturdy5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

generator-sf's Issues

Gulp build --env prod skips making production files

gulp build --env prod is not generating main.css or main.js and the php templates are the initial ones, not my modified ones.

Any ideas? I'm on node 6.10 on php 7

app_dev.php works fine, gulp serve works fine

P.S. I'm in a hackathon... I'm working around it by running a production mode php-middleware server.

THANKS!

404 on initial setup

? Would you like to use the Symfony "Standard Edition" distribution 4.1.4 (latest) Yes
? Would you like to enable Git for this project (includes post-merge hook)? No
info Fetching https://github.com/symfony/symfony-standard/archive/v4.1.4.zip ...
info This might take a few moments
events.js:183
throw er; // Unhandled 'error' event
^

HTTPError: Response code 404 (Not Found)
at EventEmitter.ee.on.res (C:\Users\Home\AppData\Roaming\npm\node_modules\generator-sf\node_modules\got\index.js:250:24)
at emitOne (events.js:116:13)
at EventEmitter.emit (events.js:211:7)
at Immediate.setImmediate [as _onImmediate] (C:\Users\Home\AppData\Roaming\npm\node_modules\generator-sf\node_modules\got\index.js:99:8)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)

Routing Issue with paths with extensions

I have a symfony route that would handle the following url http://localhost:8000/myaction/generated.txt

gulp's server won't handle it and returns
Cannot GET /myaction/generated.txt

Seems to be related to the same issue I had with generator-grunt-symfony Where it would route .json requests
bezoerb/generator-grunt-symfony#205 (comment)

I'm looking into it, not as familiar as I was with grunt... any pointers?

UPDATE:
Culprit is clearly

if (!/\.\w{2,}$/.test(obj.pathname) || /\.php/.test(obj.pathname)) {

The solution I had used was to give php-proxy-middleware everything but browsersync and then modify app_dev.php to route based on whether a real file existed, similar to a lot of mod_rewrite rules.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.