cumulocity-smart-apps-webpack

3.1.1 • Public • Published

cumulocity-smart-apps-webpack

version downloads MIT License

A boilerplate to conveniently start creating Cumulocity Smart Apps instance and to improve development experience with webpack 3.x.

Screenshot

ATTENTION: Cumulocity Smart Apps Toolkit is currently in legacy mode as it is based on the old release of UI core JS API (6.3.x). That said, you may still use it and it's up to you to decide whether it works and still well-suited for your particular app. cumulocity-clients-javascript a.k.a. Cumulocity Smart Apps Toolkit a.k.a. Cumulocity Web SDK for AngularJS seems to be brought back to life (8.x). It's kinda form of necromancy but I'd still recommend you to develop plugins as it offers more out-of-the-box features and more convenient for newbs.

Why?

I would like to enhance the current boilerplate for creating a Cumulocity Smart Apps instance in order to be able to:

  • have a cleaner development boilerplate which highly respects some awesome style guides (John Papa's Angular 1 Style Guide, Airbnb JavaScript Style Guide).
  • leverage package managing and bundling process by getting rid of Bower* and Grunt in favour of npm and webpack.
  • showcase the usage of ES6+ in my code in conjunction with AngularJS.
  • use npm (scripts) as a build tool.
  • improve developer experience with webpack-dev-server 3.x (Code Splitting, Caching, HMR, Tree Shaking, Scope Hoisting, etc.).
  • stop repeating the hustle of creating a fiddle of CSA instance when I'm doing support for the guys who are still using the toolkit (yes, you! 😋).

*Unfortunately there are some package dependencies which are only available in Bower, including the toolkit itself. So, I cannot migrate 'em all completely to npm. 😞

Usage

  • Install Node.js and npm from its website, or even better: use nvm.

  • Install yarn.

  • Checkout the repo, cd to project directory, and setup dependencies:

$ yarn install:clean
  • For development, start webpack development server with hot reloading capability:
$ yarn start

You'll find the CSA instansce running on https://localhost:8080.

  • For production, build frontend static assets:
$ yarn build

Simply drop all files under assets directory to your production server.

Deploying to a Cumulocity tenant

  • Build the assets: yarn build.
  • Zip all files under assets directory (⚠️ not the directory itself!) and name the ZIP file as "smartapps" or whatever you want to call the app.
  • Go to Administration → Own applications → Add application → Upload ZIP file, then drop the app ZIP file from the previous step.

Author

Glenn Dwiyatcita (@dwiyatci)

License

MIT.

See LICENSE.txt.

Package Sidebar

Install

npm i cumulocity-smart-apps-webpack

Weekly Downloads

1

Version

3.1.1

License

MIT

Unpacked Size

7.09 MB

Total Files

47

Last publish

Collaborators

  • dwiyatci