Code Monkey home page Code Monkey logo

phaser3-plugin-project-starter's Introduction

agogpixel/phaser3-plugin-project-starter

Another opinionated Phaser 3 plugin project starter with TypeScript, webpack, Sass, & jest.

Code style/formatting with ESLint & Prettier; pre-commit hook via Husky & lint-staged.

Getting Started

Create a new repository from this template - see Creating a repository from a template for more information.

Alternatively:

git clone https://github.com/agogpixel/phaser3-plugin-project-starter.git <repo>
cd <repo>
rm -rf .git
git init
git branch -M <branch-name>
git add .
git commit -m "Initial commit."
git remote add origin https://github.com/<account>/<repo>.git
git push -u origin <branch-name>

Once the project template has been setup locally, install dependencies:

npm install

Usage

See the following for information on how plugins work in Phaser 3:

File Structure

phaser3-plugin-project-starter/
 |
 ├──.github/                                   * GitHub configurations.
 |   |
 |   ├──workflows/                             * GitHub Actions configurations.
 |   |   └──test.yml                           * Example CI configuration (on push, all branches).
 |   |
 |   └──CODEOWNERS                             * Define who is responsible for code in the repository.
 │
 ├──.vscode/                                   * VSCode configurations.
 |   └──settings.json                          * Example configuration with auto-formatting on save.
 │
 ├──src/                                       * Source files.
 |   |
 |   ├──lib/                                   * Library files.
 |   |   |
 |   |   ├──gameobjects/                       * Phaser game objects.
 |   |   |   ├──example-gameobject.spec.ts     * Example game object unit tests.
 |   |   |   └──example-gameobject.ts          * Example game object.
 |   |   |
 |   |   ├──plugins/                           * Phaser plugins.
 |   |   |   ├──example-global-plugin.spec.ts  * Example global plugin unit tests.
 |   |   |   ├──example-global-plugin.ts       * Example global plugin.
 |   |   |   ├──example-scene-plugin.spec.ts   * Example scene plugin unit tests.
 |   |   |   └──example-scene-plugin.ts        * Example scene plugin.
 |   |   |
 |   |   └──index.ts                           * Library public API.
 |   |
 |   └──index.ts                               * Export the library.
 |
 ├──test/                                      * Testing resources.
 |   |
 |   ├──mocks/                                 * Testing mock files.
 |   |   ├──file-mock.js                       * Mock module import of most binary resources.
 |   |   └──style-mock.js                      * Mock module import of styles.
 |   |
 |   └──test-setup.ts                          * Setup the test environment.
 |
 ├──.editorconfig                              * EditorConfig configurations.
 ├──.eslintrc                                  * ESLint configurations.
 ├──.eslintignore                              * ESLint ignore file.
 ├──.gitignore                                 * Git ignore file.
 ├──.npmrc                                     * NPM configuration.
 ├──.prettierignore                            * Prettier ignore configuration.
 ├──.prettierrc                                * Prettier configuration.
 ├──jest.config.js                             * Jest test framework configuration.
 ├──LICENSE                                    * Project license.
 ├──package-lock.json                          * Auto-generated NPM project configuration.
 ├──package.json                               * NPM project configuration.
 ├──README.md                                  * Project README.
 ├──tsconfig.build.json                        * TypeScript configuration (builds).
 ├──tsconfig.json                              * TypeScript configuration (IDE & tests).
 └──webpack.config.js                          * Webpack configuration.

Develop

Live development with jest --watch

npm start

Lint

Errors & warnings output to stdout via eslint:

npm run lint

Automatically fix fomatting issues (careful):

npm run lint:fix

Unit Test

Unit tests with coverage reporting output to coverage/ via jest:

npm test

Build

Build output to dist/ via webpack:

npm run build

Contributing

Discuss the change you wish to make via issue or email.

License

Licensed under the MIT License.

phaser3-plugin-project-starter's People

Contributors

kidthales avatar

Stargazers

 avatar

Watchers

 avatar

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.