UNPKG

@robotlegsjs/core

Version:

An architecture-based IoC framework for JavaScript/TypeScript

127 lines 10.7 kB
{ "name": "@robotlegsjs/core", "version": "3.1.0", "description": "An architecture-based IoC framework for JavaScript/TypeScript", "main": "lib/index.js", "typings": "lib/index.d.ts", "nyc": { "extends": "@istanbuljs/nyc-config-typescript", "include": [ "src/**/*.ts" ], "exclude": [ "test" ], "extension": [ ".ts" ], "require": [ "jsdom-global/register", "ts-node/register", "source-map-support/register" ], "reporter": [ "text-summary", "lcov" ], "check-coverage": true, "sourceMap": true, "instrument": true }, "repository": { "url": "https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/core" }, "publishConfig": { "registry": "https://registry.npmjs.org" }, "keywords": [ "TypeScript", "Robotlegs", "IoC" ], "author": "RobotlegsJS", "contributors": [ "Endel Dreyer <endel.dreyer@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/core#readme", "files": [ "lib" ], "directories": { "lib": "./lib" }, "dependencies": { "inversify": "^5.1.1", "tslib": "^2.3.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@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", "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", "jsdom": "^16.6.0", "jsdom-global": "^3.0.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", "nyc": "^15.1.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", "source-map-support": "^0.5.19", "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": { "test": "nyc mocha", "karma": "node --max-old-space-size=2048 ./node_modules/karma/bin/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": "npm run lint-fix:src && npm run lint-fix:test", "lint:src": "eslint -c .eslintrc.js --ext .ts ./src", "lint:test": "eslint -c .eslintrc.js --ext .ts ./test", "lint": "npm run lint:src && npm run lint:test", "cleanup": "rimraf .nyc_output && rimraf coverage && rimraf lib && rimraf lib-test && rimraf dist-test", "compile:src": "tsc", "compile:test": "tsc -p tsconfig.test.json", "dist:dev": "webpack", "dist:production": "webpack --env production", "build": "npm run cleanup && npm run compile:src" }, "readme": "# RobotlegsJS <img src=\"https://raw.githubusercontent.com/RobotlegsJS/RobotlegsJS-Framework/master/packages/core/media/robotlegs.png\" width=\"30\" height=\"30\" />\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/core/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%2Fcore.svg)](https://badge.fury.io/js/%40robotlegsjs%2Fcore)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nRobotlegsJS is a architecture-based IoC framework for JavaScript/TypeScript. This\nversion is a direct port from the [ActionScript 3.0 codebase](https://github.com/robotlegs/robotlegs-framework).\nSee the [motivation](#motivation) behind it.\n\nRight now, this framework has extensions for [pixi.js v5](https://github.com/pixijs/pixi.js), [easeljs](https://github.com/CreateJS/EaselJS),\n[openfl](https://github.com/openfl/openfl), [phaser-ce v2](https://github.com/photonstorm/phaser-ce) and [phaser v3](https://github.com/photonstorm/phaser).\n\n**Features**\n\n- Dependency injection (through [InversifyJS](https://github.com/inversify/InversifyJS))\n\n- Command management\n\n- View management\n\n**Extensions**\n\n- [RobotlegsJS-Macrobot](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/macrobot): extends commands, adding support to async and macro commands.\n\n- [RobotlegsJS-SignalCommandMap](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/signalcommandmap): maps [SignalsJS](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/signals) to commands.\n\n- [RobotlegsJS-EventEmitter3](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/eventemitter3): integrate RobotlegsJS with [EventEmitter3](https://github.com/primus/eventemitter3).\n\n- [RobotlegsJS-Pixi](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/pixi): integrate RobotlegsJS with [PixiJS](https://github.com/pixijs/pixi.js).\n\n- [RobotlegsJS-Pixi-Palidor](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/pixi-palidor): a view manager extension for [RobotlegsJS-Pixi](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/pixi).\n\n- [RobotlegsJS-Pixi-SignalMediator](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/pixi-signalmediator): a port of [Robotlegs SignalMediator Extension](https://github.com/MrDodson/robotlegs-extensions-SignalMediator) to TypeScript.\n\n- [RobotlegsJS-CreateJS](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/createjs): integrate RobotlegsJS with [EaselJS](https://github.com/CreateJS/EaselJS).\n\n- [RobotlegsJS-OpenFL](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/openfl): integrate RobotlegsJS with [OpenFL](https://github.com/openfl/openfl).\n\n- [RobotlegsJS-Phaser-CE](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser-ce): integrate RobotlegsJS with [Phaser-CE](https://github.com/photonstorm/phaser-ce).\n\n- [RobotlegsJS-Phaser-CE-SignalCommandMap](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser-ce-signalcommandmap): maps [Phaser.Signal](https://photonstorm.github.io/phaser-ce/Phaser.Signal.html) to commands.\n\n- [RobotlegsJS-Phaser](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/phaser): integrate RobotlegsJS 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/core reflect-metadata --save\n```\n\nOr using [Yarn](https://yarnpkg.com/en/):\n\n```bash\nyarn add @robotlegsjs/core reflect-metadata\n````\n\n> :warning: **Important!** RobotlegsJS requires TypeScript >= 2.0 and the `experimentalDecorators`, `emitDecoratorMetadata`, `types` and `lib`\ncompilation options in your `tsconfig.json` file.\n\n```js\n{\n \"compilerOptions\": {\n \"target\": \"es5\",\n \"lib\": [\"es6\", \"dom\"],\n \"types\": [\"reflect-metadata\"],\n \"module\": \"commonjs\",\n \"moduleResolution\": \"node\",\n \"experimentalDecorators\": true,\n \"emitDecoratorMetadata\": true\n }\n}\n```\n\nRobotlegsJS requires a modern JavaScript engine with support for:\n\n- [Reflect metadata](https://rbuckton.github.io/reflect-metadata/)\n- [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)\n\nIf your environment doesn't support one of these you will need to import a shim or polyfill.\n\n> :warning: **The `reflect-metadata` polyfill should be imported only once in your entire application** because the Reflect object is meant to be a global singleton. More details about this can be found [here](https://github.com/inversify/InversifyJS/issues/262#issuecomment-227593844).\n\nCheck out the [Environment support and polyfills](https://github.com/inversify/InversifyJS/blob/master/wiki/environment.md)\npage in the [InversifyJS](https://github.com/inversify/InversifyJS) wiki and their [Basic example](https://github.com/inversify/inversify-basic-example) to learn more.\n\nTo learn more about the basic usage and APIs provided by [InversifyJS](https://github.com/inversify/InversifyJS), follow [The Basics](https://github.com/inversify/InversifyJS/blob/master/README.md#the-basics) and [The InversifyJS Features and API](https://github.com/inversify/InversifyJS#the-inversifyjs-features-and-api).\n\n## Motivation\n\nThere are many frameworks and patterns out there that helps you to write\nDOM-based applications. There is no scalable solution yet to architecture a\ncanvas-based application though.\n\n[Robotlegs](https://github.com/robotlegs/robotlegs-framework) has proven itself of being a mature solution from the ActionScript\ncommunity for interactive experiences.\n\n## RobotlegsJS for enterprise\n\nAvailable as part of the Tidelift Subscription\n\nThe maintainers of [@robotlegsjs/core](https://github.com/RobotlegsJS/RobotlegsJS-Framework/tree/master/packages/core) 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-core?utm_source=npm-robotlegsjs-core&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n## License\n\n[MIT](LICENSE)\n" }