@mainframe/bot-ui
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "@mainframe/bot-ui", | ||
"version": "0.1.0", | ||
"main": "lib/index.js", | ||
"repository": "git@github.com:thusfresh/bot-ui-js.git", | ||
"author": "Paul Le Cam <paul@mainframe.com>", | ||
"license": "MIT", | ||
"scripts": { | ||
"build:clean": "del lib", | ||
"build:compile": "babel src --out-dir lib --ignore test.js", | ||
"build": "npm run build:clean && npm run build:compile", | ||
"lint": "eslint ./src", | ||
"test": "npm run lint", | ||
"start": "npm test && npm run build", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"dependencies": { | ||
"react": "^15.6.1", | ||
"react-json-renderer": "^0.5.1" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-plugin-syntax-export-extensions": "^6.13.0", | ||
"babel-plugin-syntax-object-rest-spread": "^6.13.0", | ||
"babel-plugin-transform-export-extensions": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-env": "^1.6.0", | ||
"babel-preset-react": "^6.24.1", | ||
"del-cli": "^1.0.0", | ||
"eslint": "^4.6.1", | ||
"eslint-config-prettier": "^2.4.0", | ||
"eslint-plugin-prettier": "^2.2.0", | ||
"prettier": "^1.6.1" | ||
} | ||
"version": "0.2.0" | ||
} |
@@ -1,44 +0,1 @@ | ||
# Mainframe JavaScript UI framework for bots | ||
This documentation only covers the JavaScript UI framework, see the [Mainframe bots documentation](http://developer.mainframe.com/) for more information about creating Mainframe bots, and the [bots SDK repository](https://github.com/thusfresh/bot-sdk-js) to get started implementing a bot in JavaScript. | ||
## Installation | ||
```sh | ||
npm install @mainframe/bot-ui # npm | ||
yarn add @mainframe/bot-ui # Yarn | ||
``` | ||
## Example | ||
```js | ||
const React = require('react') | ||
const { render, Text } = require('@mainframe/bot-ui') | ||
const ui = render(<Text>Hello bot!</Text>) | ||
``` | ||
## Usage | ||
This UI framework is meant as a complement to the [JavaScript bot SDK](https://github.com/thusfresh/bot-sdk-js), exposing the [components supported by the client UI](http://developer.mainframe.com/#components) and a `render()` function converting a JSX tree to an [UIComponent](http://developer.mainframe.com/#ui-types) tree expected by the Mainframe server. | ||
The `render()` function expects a `React.Element`, the provided JSX must therefore be transpiled, for example using [Babel's React JSX transform plugin](https://babeljs.io/docs/plugins/transform-react-jsx/). | ||
## API | ||
### React | ||
Alias to [React](https://facebook.github.io/react/) library. It needs to be imported in scope when using [Babel's React JSX transform plugin](https://babeljs.io/docs/plugins/transform-react-jsx/) so that JSX can be converted to `React.createElement()` calls. | ||
### render | ||
Alias to [React JSON renderer convertToObject](https://github.com/thusfresh/react-json-renderer#converttoobject) function. Converts the JSX tree into a JS Object supported by the Mainframe platform. | ||
## Components | ||
All the [documented components](http://developer.mainframe.com/#components) are exposed by this UI framework so they can be used to create the JSX tree. | ||
## License | ||
MIT | ||
See [LICENSE](LICENSE) file | ||
This package has been deprecated |
Sorry, the diff of this file is not supported yet
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
0
0
1228
4
0
3
2
2
- Removedreact@^15.6.1
- Removedreact-json-renderer@^0.5.1
- Removedasap@2.0.6(transitive)
- Removedcore-js@1.2.7(transitive)
- Removedcreate-react-class@15.7.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removedfbjs@0.8.18(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpromise@7.3.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@15.7.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedreact-json-renderer@0.5.4(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedua-parser-js@0.7.40(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)