UNPKG

@robotlegsjs/phaser

Version:

RobotlegsJS integration with Phaser Scene Manager

116 lines 8.9 kB
{ "name": "@robotlegsjs/phaser", "version": "4.1.0", "description": "RobotlegsJS integration with Phaser Scene Manager", "main": "lib/index.js", "typings": "lib/index.d.ts", "repository": { "url": "https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser" }, "publishConfig": { "registry": "https://registry.npmjs.org" }, "keywords": [ "TypeScript", "Robotlegs", "IoC", "Phaser" ], "author": "RobotlegsJS", "contributors": [ "Endel Dreyer <endel.dreyer@gmail.com>", "Gnun Ulikhanyan <gnun.ulikhanyan@gmail.com>", "Sargis Sargsyan <sargsyan.sargis.89@gmail.com>", "Tiago Schenkel <tiago.schenkel@gmail.com>" ], "license": "MIT", "bugs": { "url": "https://github.com/RobotlegsJS/RobotlegsJS-Framework/issues" }, "homepage": "https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser#readme", "files": [ "definitions", "lib" ], "directories": { "lib": "./lib" }, "dependencies": { "@robotlegsjs/core": "^3.1.0", "tslib": "^2.3.0" }, "peerDependencies": { "phaser": "^3.22.0", "reflect-metadata": "^0.1.13" }, "devDependencies": { "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@mcler/webpack-concat-plugin": "^4.1.3", "@rushstack/eslint-config": "^2.3.4", "@types/bluebird": "^3.5.36", "@types/chai": "^4.2.21", "@types/mocha": "^8.2.3", "@types/sinon": "^10.0.2", "@types/webpack-env": "^1.16.2", "bluebird": "^3.7.2", "chai": "^4.3.4", "clean-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^9.0.1", "es6-map": "^0.1.5", "es6-symbol": "^3.1.3", "eslint": "^7.30.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jsdoc": "^35.4.3", "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-react": "^7.24.0", "eslint-plugin-unicorn": "^34.0.1", "html-webpack-plugin": "^5.3.2", "karma": "^6.3.4", "karma-chrome-launcher": "^3.1.0", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", "karma-sinon-chai": "^2.0.2", "karma-sourcemap-loader": "^0.3.8", "karma-sourcemap-writer": "^0.1.2", "karma-webpack": "^5.0.0", "mocha": "^9.0.2", "phaser": "^3.22.0", "prettier": "^2.6.2", "puppeteer": "^10.1.0", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", "sinon": "^11.1.1", "sinon-chai": "^3.7.0", "terser-webpack-plugin": "^5.1.4", "ts-loader": "^9.2.3", "ts-node": "^10.1.0", "typescript": "~4.2.4", "webpack": "^5.44.0", "webpack-cli": "^4.7.2", "webpack-dev-server": "^3.11.2" }, "scripts": { "start": "webpack serve --config ./webpack.example.config.js", "test": "karma start --single-run", "autoformat": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --write --list-different .", "lint-fix:src": "eslint -c .eslintrc.js --ext .ts ./src --fix", "lint-fix:test": "eslint -c .eslintrc.js --ext .ts ./test --fix", "lint-fix:example": "eslint -c .eslintrc.js --ext .ts ./example --fix", "lint-fix": "npm run lint-fix:src && npm run lint-fix:test && npm run lint-fix:example", "lint:src": "eslint -c .eslintrc.js --ext .ts ./src", "lint:test": "eslint -c .eslintrc.js --ext .ts ./test", "lint:example": "eslint -c .eslintrc.js --ext .ts ./example", "lint": "npm run lint:src && npm run lint:test && npm run lint:example", "cleanup": "rimraf .nyc_output && rimraf coverage && rimraf lib && rimraf lib-test && rimraf lib-example && rimraf dist && rimraf dist-test", "compile:src": "tsc", "compile:test": "tsc -p tsconfig.test.json", "compile:example": "tsc -p tsconfig.example.json", "dist:dev": "webpack", "dist:production": "webpack --env production", "build:example": "webpack --config ./webpack.example.config.js --env.production", "deploy:example": "./deploy-example.sh", "build": "npm run cleanup && npm run compile:src" }, "readme": "# RobotlegsJS Phaser Extension\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser/blob/master/LICENSE)\n[![Gitter chat](https://badges.gitter.im/RobotlegsJS/RobotlegsJS.svg)](https://gitter.im/RobotlegsJS/RobotlegsJS)\n[![npm version](https://badge.fury.io/js/%40robotlegsjs%2Fphaser.svg)](https://badge.fury.io/js/%40robotlegsjs%2Fphaser)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nIntegrate [RobotlegsJS](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/core)\nframework with [Phaser](https://github.com/photonstorm/phaser).\n\n## Installation\n\nYou can get the latest release and the type definitions using [NPM](https://www.npmjs.com/):\n\n```bash\nnpm install @robotlegsjs/phaser --save-prod\n```\n\nOr using [Yarn](https://yarnpkg.com/en/):\n\n```bash\nyarn add @robotlegsjs/phaser\n```\n\nFrom version `0.2.0` of this package, the [Phaser](https://github.com/photonstorm/phaser) dependency was moved to **peerDependencies**,\nallowing the final user to choose the desired version of the `phaser` library on each project.\n\nThe `@robotlegsjs/phaser` package version `>=3.0.0` is compatible with versions between the `>=3.22.0 <4` version range of `phaser` library.\n\nAs example, when you would like to use the version `3.22.0` of `phaser` library, you can run:\n\n```bash\nnpm install phaser@3.22.0 reflect-metadata --save-prod\n```\n\nor\n\n```bash\nyarn add phaser@3.22.0 reflect-metadata\n```\n\nThen follow the [installation instructions](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/core#installation) of **RobotlegsJS** library to complete the setup of your project.\n\n**Dependencies**\n\n+ [RobotlegsJS](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/core)\n+ [tslib](https://github.com/Microsoft/tslib)\n\n**Peer Dependencies**\n\n+ [Phaser](https://github.com/photonstorm/phaser)\n+ [reflect-metadata](https://github.com/rbuckton/reflect-metadata)\n\n## Usage\n\n```ts\n/// <reference path=\"../node_modules/phaser/types/phaser.d.ts\" />\n\nimport \"reflect-metadata\";\n\nimport { Context, IContext, MVCSBundle } from \"@robotlegsjs/core\";\n\nimport { ContextSceneManager, PhaserBundle } from \"@robotlegsjs/phaser\";\n\nimport { GameConfig } from \"./config/GameConfig\";\nimport { SceneMediatorConfig } from \"./config/SceneMediatorConfig\";\n\nimport { SceneKey } from \"./constants/SceneKey\";\n\nimport { Boot } from \"./scenes/Boot\";\nimport { Main } from \"./scenes/Main\";\nimport { Preload } from \"./scenes/Preload\";\n\nexport class Game extends Phaser.Game {\n private _context: IContext;\n\n constructor() {\n super({\n type: Phaser.CANVAS,\n width: 800,\n height: 600,\n backgroundColor: \"#010101\",\n parent: \"phaser-example\"\n });\n\n this._context = new Context();\n this._context\n .install(MVCSBundle, PhaserBundle)\n .configure(new ContextSceneManager(this.scene))\n .configure(SceneMediatorConfig)\n .configure(GameConfig)\n .initialize();\n\n this.scene.add(SceneKey.BOOT, new Boot());\n this.scene.add(SceneKey.PRELOAD, new Preload());\n this.scene.add(SceneKey.MAIN, new Main());\n\n this.scene.start(SceneKey.BOOT);\n }\n}\n```\n\n[See example](example)\n\n## Running the example\n\nRun the following commands to run the example:\n\n```bash\nnpm install\nnpm start\n```\n\nor:\n\n```bash\nyarn install\nyarn start\n```\n\n## RobotlegsJS integration with Phaser CE (Community Edition)\n\nThe `@robotlegsjs/phaser` package was updated to support [Phaser v3](https://www.npmjs.com/package/phaser) plugin.\n\nIf you are looking for integration with [Phaser CE](https://github.com/photonstorm/phaser-ce) you can use the [RobotlegsJS-Phaser-CE](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser-ce) plugin.\n\n## RobotlegsJS Phaser for enterprise\n\nAvailable as part of the Tidelift Subscription\n\nThe maintainers of [@robotlegsjs/phaser](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser) and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-robotlegsjs-phaser?utm_source=npm-robotlegsjs-phaser&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n## License\n\n[MIT](LICENSE)\n" }