This package has been deprecated

Author message:

No longer in use nor maintained

generator-np-lumen

1.0.3 • Public • Published

NoProtocol Lumen Generator

The NoProtocol Lumen Generator creates a project scaffolding for a Lumen project based on NoProtocol's best practices. This includes such features as:

  • Complete Gulp build file (based on our own) gulp-noprotocol library
  • Automatic robots.txt based on environment setting
  • Pre-defined SASS & JS structure

See the features list to see them all.

Installation

If you don't already have it installed, install Yeoman

npm install -g yo

Install the generator

npm install -g generator-np-lumen

Using the generator

Make a new directory, and cd into it:

mkdir my-new-project && cd $_

Run yo np-lumen or simply yo and select the Np Lumen generator.

Options:

  • --quick Skip interaction and install app with defaults* and setup the database, create Git repository and install all Composer/NPM/Bower dependencies
  • --skipdbsetup Skip the database setup
  • --skipdependencies Skip installation of all the Composer/NPM/Bower dependencies
  • --force Force installation even if the directory isn't empty

* Defaults are as follows:

  • Projectname: dirname
  • Project version: 1.0.0
  • Lumen version: 5.1.4
  • Setup database: yes
  • Database credentials: root/root
  • Database name: projectname_ddb
  • Setup git repository: yes

You can also see these options by running yo np-lumen --help.

When the generator is finished, run gulp and you're done.

Features:

Lumen

One of the various Lumen releases, or the master branch. See Laravel Lumen for the various versions.

Gulp

Build the app using Gulp and our own gulp-noprotocol (which takes care of bundling files, running sass etc).

Place all the app JS files outside the webroot in resources/js. The gulp process will bundle them into app.min.js in the public/build/js folder. If needed, extra JS libs can be placed anywhere and added to the gulp bundle-libs task. These will be bundled into libs.min.js

Place all the Sass files outside the webroot in resources/sass. The gulp process will bundle them into app.js in the public/build/js folder.

The gulp watch task also activates Livereload which is set to reload on changes to .js and .css files.

Robots.txt

Due to repeated incidents in which staging server still allowed crawlers to access everything, the generator comes with RobotsController.php. On any Lumen environment other the production the output will be Disallow: *.

.htaccess

The .htaccess file has been augmented with several settings taken from the HTML5 boilerplate such as media types, security settings, gzip etc. The option to force HTTPS for one or more domains has also been added. See the file for more info.

CORS/Preflight

Comes pre-installed with Barryvdh's laravel-cors package for easy preflight and CORS settings. To enable it, see the documenation on the package page.

Hashids

Comes pre-installed with Hashids package to easily create unique short id's based on the Hashids library. To enable it, see the documenation on the package page.

Splash page

A NoProtocol splash page on the index :)

Package Sidebar

Install

npm i generator-np-lumen

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • verschuur