# rc-pluggable-widgets-tools

> Mendix Pluggable Widgets Tools

Latest version **8.18.3** (published 2021-05-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install rc-pluggable-widgets-tools
pnpm add rc-pluggable-widgets-tools
yarn add rc-pluggable-widgets-tools
bun add rc-pluggable-widgets-tools
```

Provides the command `rc-pluggable-widgets-tools`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 8.18.3 |
| Published | 2021-05-18 |
| First published | 2021-05-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 74 |
| Unpacked size | 233.7 KB |
| Known vulnerabilities | 0 (+8 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 53 |
| Maintainers | canoe |
| Keywords | typings, typescript, build, automation, test, jest, mendix |

## Links

- npm: https://www.npmjs.com/package/rc-pluggable-widgets-tools
- Repository: https://github.com/mendix/widgets-resources
- Homepage: https://github.com/mendix/widgets-resources/tree/master/packages/tools/pluggable-widgets-tools
- Issues: https://github.com/mendix/widgets-resources/issues
- npm.io page: https://npm.io/package/rc-pluggable-widgets-tools

## Dependencies (74)

- [del](https://npm.io/package/del.md) ^4.1.1
- [gulp](https://npm.io/package/gulp.md) ^4.0.2
- [jest](https://npm.io/package/jest.md) ^26.1.0
- [sass](https://npm.io/package/sass.md) ^1.26.10
- [react](https://npm.io/package/react.md) ~16.9.0
- [big.js](https://npm.io/package/big.js.md) ^5.2.2
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [enzyme](https://npm.io/package/enzyme.md) ^3.10.0
- [eslint](https://npm.io/package/eslint.md) ^6.8.0
- [mendix](https://npm.io/package/mendix.md) ^8.14.0
- [semver](https://npm.io/package/semver.md) ^7.3.2
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.23
- [core-js](https://npm.io/package/core-js.md) ^3.6.4
- [jasmine](https://npm.io/package/jasmine.md) ^3.4.0
- [ts-jest](https://npm.io/package/ts-jest.md) ^26.1.4
- [ts-node](https://npm.io/package/ts-node.md) ^8.10.2
- [webpack](https://npm.io/package/webpack.md) ^4.41.6
- [gulp-zip](https://npm.io/package/gulp-zip.md) ^5.0.0
- [prettier](https://npm.io/package/prettier.md) ^1.19.1
- [@wdio/cli](https://npm.io/package/@wdio/cli.md) ^5.11.13
- [react-dom](https://npm.io/package/react-dom.md) ~16.9.0
- [ts-loader](https://npm.io/package/ts-loader.md) ^6.2.1
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.6.0
- [@wdio/sync](https://npm.io/package/@wdio/sync.md) ^5.11.13
- [babel-jest](https://npm.io/package/babel-jest.md) ^26.1.0
- [css-loader](https://npm.io/package/css-loader.md) ^3.1.0
- [jest-junit](https://npm.io/package/jest-junit.md) ^11.1.0
- [map-stream](https://npm.io/package/map-stream.md) ^0.0.7
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0
- [raw-loader](https://npm.io/package/raw-loader.md) ^3.1.0
- [typescript](https://npm.io/package/typescript.md) ^3.8.3
- [url-loader](https://npm.io/package/url-loader.md) ^1.1.2
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.6.0
- [file-loader](https://npm.io/package/file-loader.md) ^4.0.0
- [json-loader](https://npm.io/package/json-loader.md) ^0.5.7
- [sass-loader](https://npm.io/package/sass-loader.md) ^9.0.2
- [webdriverio](https://npm.io/package/webdriverio.md) ^5.18.6
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^3.3.11
- [babel-eslint](https://npm.io/package/babel-eslint.md) ^10.0.2
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.0.6
- [concurrently](https://npm.io/package/concurrently.md) ^5.0.1
- [jasmine-core](https://npm.io/package/jasmine-core.md) ^3.4.0
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1
- [react-native](https://npm.io/package/react-native.md) 0.61.5
- [style-loader](https://npm.io/package/style-loader.md) ^0.23.1
- [webpack-merge](https://npm.io/package/webpack-merge.md) ^4.2.2
- [enzyme-to-json](https://npm.io/package/enzyme-to-json.md) ^3.3.5
- [find-free-port](https://npm.io/package/find-free-port.md) ^2.0.0
- [json-source-map](https://npm.io/package/json-source-map.md) ^0.6.1
- [react-hot-loader](https://npm.io/package/react-hot-loader.md) ^4.12.19
- [to-string-loader](https://npm.io/package/to-string-loader.md) ^1.1.6
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.5.5
- [source-map-loader](https://npm.io/package/source-map-loader.md) ^0.2.4
- [@wdio/dot-reporter](https://npm.io/package/@wdio/dot-reporter.md) ^5.11.7
- [@wdio/local-runner](https://npm.io/package/@wdio/local-runner.md) ^5.11.13
- [eslint-plugin-jest](https://npm.io/package/eslint-plugin-jest.md) ^23.19.0
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^3.10.3
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.0.0
- [@wdio/spec-reporter](https://npm.io/package/@wdio/spec-reporter.md) ^5.11.7
- [copy-webpack-plugin](https://npm.io/package/copy-webpack-plugin.md) ^6.0.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.18.3
- [react-test-renderer](https://npm.io/package/react-test-renderer.md) ~16.9.0
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^4.2.1
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^6.10.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^3.1.2
- [@wdio/jasmine-framework](https://npm.io/package/@wdio/jasmine-framework.md) ^5.11.0
- [enzyme-adapter-react-16](https://npm.io/package/enzyme-adapter-react-16.md) ^1.14.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^2.19.2
- [extract-text-webpack-plugin](https://npm.io/package/extract-text-webpack-plugin.md) ^4.0.0-beta.0
- [metro-react-native-babel-preset](https://npm.io/package/metro-react-native-babel-preset.md) ~0.61.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^2.19.2
- [@wdio/selenium-standalone-service](https://npm.io/package/@wdio/selenium-standalone-service.md) ^5.11.2
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.4.4

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 8.18.3 (latest) — 2021-05-18
- 8.18.2 — 2021-05-18
- 8.18.1 — 2021-05-17

## README

# Pluggable Widgets Tools

![npm version](https://badge.fury.io/js/%40mendix%2Fpluggable-widgets-tools.svg)
![Mendix 8](https://img.shields.io/badge/mendix-8.0.0-brightgreen.svg)
![Build Status](https://travis-ci.org/mendix/widgets-resources.svg?branch=master)
![npm](https://img.shields.io/npm/dm/rc-pluggable-widgets-tools)
![GitHub release](https://img.shields.io/github/release/mendix/widgets-resources)
![GitHub issues](https://img.shields.io/github/issues/mendix/widgets-resources)

## About

A toolset to build, test, format, run, release and lint your [Pluggable Widgets](https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets)

## How to install

Install via NPM using `npm install rc-pluggable-widgets-tools` (use [node.js](https://nodejs.org/) version >= 12). When installing via NPM v7.x.x, use `npm install rc-pluggable-widgets-tools --legacy-peer-deps`.
Even better is creating your widget using [Pluggable Widgets Generator](https://www.npmjs.com/package/@mendix/generator-widget) which scaffolds the correct project setup.

## How to use

In your `package.json` scripts, use the following command with the desired task: `pluggable-widgets-tools task`

### Available tasks

-   `start:web` Build and watch the changes of your Web widget
-   `start:server` Build and watch the changes of your Web widget. Start a web server, that reloads the widget code without the need to re-run the Mendix project. Accepts option `--open` to automatically open your browser.
-   `start:native` Build and watch the changes of your Native widget
-   `build:web` Build your Web widget
-   `build:native` Build your Native widget
-   `release:web` Create a release build of your Web widget
-   `release:native` Create a release build of your Native widget
-   `lint` Lint your project using ESLint and Prettier
-   `lint:fix` Fix lint problems/warning of ESLint and Prettier
-   `format` Format your code using Prettier
-   `test:unit:web` Run unit tests for your Web widget. Accepts option `--u` to update snapshots, `--no-cache` to remove existing caches, `--ci` assumes use of a CI environment, `--coverage` to support coverage test.
-   `test:unit:native` Run unit tests for your Native widget. Accepts option `--u` to update snapshots, `--no-cache` to remove existing caches, `--ci` assumes use of a CI environment, `--coverage` to support coverage test.
-   `test:e2e` Execute end-to-end tests in your Web widget

#### Example

```json
  "name": "MyWidget",
  "widgetName": "com.company.widgets.MyWidget",
  "version": "1.0.0",
  "config": {
    "projectPath": "../MxTestProject/",
    "mendixHost": "http://localhost:8080",
    "developmentPort": "3000"
  },
  "scripts": {
    "build": "pluggable-widgets-tools build:web",
    "lint": "pluggable-widgets-tools lint",
    "lint:fix": "pluggable-widgets-tools lint:fix",
    "test:unit": "pluggable-widgets-tools test:unit --coverage"
  }
```

## Project layout

-   `src/`
    -   `MyWidget.xml` - widget [definition](https://docs.mendix.com/apidocs-mxsdk/apidocs/property-types-pluggable-widgets)
    -   `MyWidget.[tj]sx` - widget [client componet](https://docs.mendix.com/apidocs-mxsdk/apidocs/client-apis-for-pluggable-widgets)
    -   `MyWidget.editorPreview.[tj]sx` - (optional) widget [preview](https://docs.mendix.com/apidocs-mxsdk/apidocs/studio-apis-for-pluggable-widgets)
    -   `MyWidget.editorConfig.[tj]s` - (optional) widget editor configuration
    -   `comopnents/`
        -   `MyComponent.[tj]s` - code of widget's components
        -   `__tests__/`
            -   `MyComponent.spec.[tj]s` - tests for widget's components
    -   `.eslint.js` - configuration for ESLint. We recoommend to just re-export `rc-pluggable-widgets-tools/configs/eslint.ts.base.json`
    -   `prettier.config.js` - configuration for Prettier. We recommend to just re-export `rc-pluggable-widgets-tools/configs/prettier.base.json`
    -   `tsconfig.json` - configuration for TypeScript. We recommend to just extend `rc-pluggable-widgets-tools/configs/tsconfig.base.json`
    -   `webpack.config.dev.js` - (optional) custom configurations for webpack bundler (both for client and preview components) when running in development mode. The standard confiugration can be imported from `rc-pluggable-widgets-tools/configs/webpack.config.dev.js` for web and from `rc-pluggable-widgets-tools/configs/webpack.native.config.js` for native apps.
    -   `webpack.config.prod.js` - (optional) custom configuration for webpack bundler in release mode.
    -   `package.json` - widget package definitions, inluding its dependencies, scripts, and basic configuration (`widgetName` and `config.projectPath` in particular)

## Migrating from 8.9 to 8.10

React-hot-loader is not anymore needed to provide auto refresh functionality. That is, you can remove its usage from the code: your main entry point can simply be `export default MyWidget;` instead of `export default hot(MyWidget);`.

**If you do not change your widget, hot will be replaced with a noop function that has no effect.**

---
_Source: https://npm.io/package/rc-pluggable-widgets-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
