# @capsulajs/capsulahub-service-renderer

> Service extension, that renders all the web-components, that are registered in Workspace

Latest version **0.0.3** (published 2019-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @capsulajs/capsulahub-service-renderer
pnpm add @capsulajs/capsulahub-service-renderer
yarn add @capsulajs/capsulahub-service-renderer
bun add @capsulajs/capsulahub-service-renderer
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-12-04 |
| First published | 2019-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 393.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | CapsulaJS |
| Maintainers | 95kach, capsulajsbot, capsulajsci, idanilt, mikesquall |

## Links

- npm: https://www.npmjs.com/package/@capsulajs/capsulahub-service-renderer
- npm.io page: https://npm.io/package/@capsulajs/capsulahub-service-renderer

## Dependencies (3)

- [react](https://npm.io/package/react.md) 16.8.6
- [react-dom](https://npm.io/package/react-dom.md) 16.8.6
- [@capsulajs/capsulahub-workspace](https://npm.io/package/@capsulajs/capsulahub-workspace.md) ^0.0.3

## Recent versions

- 0.0.3 (latest) — 2019-12-04
- 0.0.2-next.35 (next) — 2019-12-05
- 0.0.2-alpha.1575380902.32 (snapshot) — 2019-12-03
- 0.0.2-next.32 — 2019-12-03
- 0.0.2-next.14 — 2019-09-02
- 0.0.2-alpha.1567414963.14 — 2019-09-02
- 0.0.2-alpha.1567341061.14 — 2019-09-01
- 0.0.2-alpha.1567335839.14 — 2019-09-01
- 0.0.2-alpha.1567332840.14 — 2019-09-01
- 0.0.2-alpha.1567330424.14 — 2019-09-01
- 0.0.2-alpha.1567322639.14 — 2019-09-01
- 0.0.2-alpha.1567240793.14 — 2019-08-31
- 0.0.2-alpha.1567239233.14 — 2019-08-31
- 0.0.2-alpha.1567234320.14 — 2019-08-31
- 0.0.2-alpha.1567172799.14 — 2019-08-30
- … 70 more at https://npm.io/package/@capsulajs/capsulahub-service-renderer/versions

## README

# Service Renderer

Service extension, that renders all the web-components, that are registered in Workspace.

## Install

### NPM

To install the package from NPM registry you should run

    yarn add @capsulajs/capsulahub-service-renderer

or

    npm install @capsulajs/capsulahub-service-renderer

### CDN

You can get the default export from the link

    https://capsulajs.s3.amazonaws.com/develop/capsulahub-service-renderer/index.js

## WorkspaceConfiguration example

```json
{
  "services": [
    {
      "serviceName": "RendererService",
      "path": "https://capsulajs.s3.amazonaws.com/develop/capsulahub-service-renderer/index.js",
      "definition": {
        "serviceName": "RendererService",
        "methods": {
          "renderLayouts": { "asyncModel": "requestResponse" },
          "renderItems": { "asyncModel": "requestResponse" },
          "renderItem": { "asyncModel": "requestResponse" }
        }
      },
      "config": {}
    }
  ]
}
```

## Exports

### Default

Bootstrap function of the extension.

### Named (API)

The public API of the extension.

## API

### CDN

[The documentation about public API.](https://capsulajs.s3.amazonaws.com/develop/capsulahub-service-renderer/doc/index.html)

### Local

Run 

```bash
yarn doc
```

And open [doc/index.html](./doc/index.html) in browser.

## Example

All of the manual debugging should be provided only in _**test:debug**_ mode. Example folder is required only for Cypress needs.

## Tests

### Run

1) `yarn test`
2) `yarn test:debug`

### Recommendations for testing

**_getServiceRef()_** checks that the service has been bootstrapped correctly and returns the instance of the service.

In order to create a **_stub_** or **_spy_** of any util a file with utils has to export an object, in which these utils
are implemented. Then in the implementation of a test you can do:

```typescript
import utils from '../../src/utils';
const getConfigStub = cy.stub(utils, getConfig);
getConfigStub.resolves({ name: 'configuration name' });

// run some code from functionality
expect(getConfigStub).to.be.called;
```

Expectations for stubs and spies:

<https://docs.cypress.io/guides/references/assertions.html#Sinon-Chai>

## Licence

[CapsulaHub](https://github.com/capsulajs/capsulahub) and related services are released under MIT Licence.

## [Back to the Main Page](../../README.md)

---
_Source: https://npm.io/package/@capsulajs/capsulahub-service-renderer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
