Skip to content

@xcons/cli - Overview

XCON Widget Management CLI Tool - Command line tool developed for creating, building and managing XCON widgets.

General Description

XCONS CLI is a command line tool designed for quick and easy development of XCON platform widgets. It automates widget project creation, build and deployment processes.

Key Features

  • Quick Widget Creation: Ready-to-use widget projects with a single command
  • Multi-Platform Support: Widget development for ThingsBoard and Web platforms
  • TypeScript & .NET: Support for both TypeScript and .NET based widgets
  • Automatic Build: Webpack-based optimized build system
  • IDE Integration: Ready configurations for VS Code, Visual Studio 2022 and IntelliJ IDEA
  • External Library Management: External library management support

XCONS Platform Integration

Build Workflow

  1. TypeScript Compilation - TypeScript compilation
  2. XCon Webpack Loader - Template and resource injection
  3. Webpack Bundling - Optimized bundle creation
  4. Platform Wrapper - Adding ThingsBoard or Web wrapper
  5. Minification - Final optimization with Terser

Platform Wrappers

ThingsBoard Wrapper:

  • Widget lifecycle methods (onInit, onDataUpdated, onResize, onDestroy)
  • ThingsBoard context integration
  • Widget activation with XConWidgets registry

Web Wrapper:

  • Standard web platform integration
  • Custom type parameters
  • Resource and configuration management

XCon Webpack Loader Functions

  • Template Processing: templateUrltemplate conversion and minify
  • Style Processing: styleUrlsstyles conversion and minify
  • Resource Injection: Automatic addition of XCONS libraries
  • Metadata Processing: Widget metadata processing