npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-phaser-h5

v4.2.6

Published

A Yeoman generator to generate h5 games with phaser.js or not, based on Gulp!

Downloads

147

Readme

generator-phaser-h5

Translations: 简体中文

generator-phaser-h5 is a Yeoman plugin that makes starting up Phaser h5 projects simple, quick and easy.

h5 ≠ <h5></h5> , h5 ≠ html5, h5 ≠ car haval5.

h5 = Web page or Web app etc.

How do you think of some Chinese call HTML5 'H5'

Not only for Phaser, Add Dependencies you want.

ECMAScript version ES5

Also Support ECMAScript version ES6

~~Bower manages the things — frameworks, libraries, assets, and utilities.~~

Note:...psst! While Bower is maintained, we recommend yarn and webpack for new front-end projects!

Installation

Note: Install Node.js, Gulp, ~~Bower~~ First

  • Get Yeoman and generator-phaser-h5 via npm.

    npm install --global yo                    # Install Yeoman if you don't have it yet.
    npm install --global generator-phaser-h5   # Install generator-phaser-h5

Usage

  1. Create a directory to keep your project contents and go into it.

    mkdir myproject
    cd myproject
  2. Create your new game project.

    yo phaser-h5
  3. Launch it!

    gulp          # Launches the server and opens the page for live development.
    gulp build    # Prepare the h5 release for distribution.

The result in dist/

Plugins

~~Bower manages plugins~~

npm manages plugins.

devDependencies are for the development-related scripts, e.g. unit testing, packaging scripts, documentation generation, etc.

dependencies are required for production use, and assumed required for dev as well.

Note: Please do not put test harnesses, transpilers or latest "Matches latest version", * "Matches any version" in your dependencies object!

Recommend: version "Specifying version", ^version "Compatible with version"

Frontend environments evolve rapidly nowadays, modern browsers have already implemented a great deal of DOM/BOM APIs which are good enough. So You-Dont-Need-jQuery

devDependencies:

Note: npm install <packages> --save-dev

dependencies:

Note: npm install <packages>

others:

Note: Read Documentation For a Getting started guide, Usage , API docs, etc. check out or docs!

Use the following ways Sometime:

  • Cdn jsDelivr, cdnjs, bootcdn :

    <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser-ce/2.10.5/phaser.js"></script>
  • browserify Make file available from outside the bundle with require(file) (Also with import(file) because of babelify)

  • browserify-shim Make CommonJS-Incompatible Files Browserifyable

  • Local In gulpfile.js Write Libs paths and Run gulp concatlibs task:

    <script src="/assets/js/lib/libs.js"></script>

Directory Structure

In development, run gulp:

    .
    ├── dist
    ├── src
    │   └── assets
    │       ├── img
    │       ├── media         # video audio resources
    │       ├── css
    │       │   ├── css.css
    │       │   └── sass.scss
    │       └── js
    │           ├── entities
    │           ├── states    # phaser state
    │           │
    │           └── main.js    
    │
    ├── node_modules
    ├── README.md
    ├── LICENSE
    ├── index.html
    ├── package.json
    ├── gulpfile.js
    └── .jshintrc   

In production, run gulp build:

   dist
    ├── assets
    │   ├── img
    │   ├── media
    │   ├── css
    │   │   ├── libs
    │   │   │	 └── *.css 	   # libs css e.g. animate.min.css, swiper.min.css, etc.
    │   │   └── css.min.css
    │   └── js
    │       ├── libs
    │       │    └── libs.js
    │       └── main.min.js
    │
    └── index.html

Versions

1.x.x

Only for Phaser

2.x.x

Not only for Phaser , Add Dependencies you want , Without Bower

3.x.x

Rebuild Directory Structure

4.x.x

Refactor Generator , Fix tests

Reference

Yeoman Generator API

generator-phaser-plus

创建 Yeoman Generator 简单教程

开发自己的 yeoman 脚手架(generator-reactpackage)

前端模块及依赖管理的新选择:Browserify

gulp-rev:项目部署缓存解决方案

License

MIT License