Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Giulia Chiola
Giulia Chiola

Posted on • Originally published atgiuliachiola.dev

UIengine project setup

UIengine is an awesome tool I used few times to document design systems with living pattern libraries. Here it is my basic UIengine setup.

Prerequisites

Styles configuration from scratch is available in this post:📒 styleguide setup.

UIengine

Workbench for UI-driven development: A tool for developers and designers to build and document web sites and apps.

npminstall @uiengine/core--save-dev
Enter fullscreen modeExit fullscreen mode

UIengine supports lot oftemplate languages. After choosing one of them, for instanceEJS, we have to install the adapter for this language

npminstall @uiengine/adapter-ejs--save-dev
Enter fullscreen modeExit fullscreen mode

Create aliases of directories and register custom module paths in NodeJS like a boss!

npminstallmodule-alias--save-dev
Enter fullscreen modeExit fullscreen mode

module-alias comes in handy incomponent.config.js files, where we need to call JS functions contained in the root folder/scripts:

Requiremodule-alias

constmoduleAlias=require('module-alias')
Enter fullscreen modeExit fullscreen mode

Register the alias with the methodaddAlias

moduleAlias.addAlias('@scripts',process.cwd()+'/scripts')
Enter fullscreen modeExit fullscreen mode

Example: we want to populate component fileds with data contained inscripts/content.js. Usingmodule-alias we can use the shortcut@scripts to get the content file, from anywhere we made the call.

// Debug to run it in nodeJSconstmoduleAlias=require('module-alias')moduleAlias.addAlias('@scripts',process.cwd()+'/scripts')// Configconstcontent=require('@scripts/content.js')
Enter fullscreen modeExit fullscreen mode

Run parallel tasks

A CLI tool to run multiple npm-scripts in parallel or sequential.

npminstallnpm-run-all--save-dev
Enter fullscreen modeExit fullscreen mode

nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.

npminstallnodemon--save-dev
Enter fullscreen modeExit fullscreen mode

Dev scripts

  • nodemon checks if any file has changed
  • UIengine runs in--serve mode to hot-reload changes
  • npm-run-all runs in parallel UIengine build and styles build
"scripts":{"_____________________________Dev_______________________________":"","watcher":"nodemon -e scss -x\"npm run styles:dev\"","build:serve":"node ./scripts/uiengine build --watch --serve","dev":"npm-run-all -l clean:dev --parallel build:serve watcher"}
Enter fullscreen modeExit fullscreen mode

UIengine configuration

  • Add CSS file to customize UIengine layout
// uiengine.config.jscustomStylesFile:'/css/uiengine.css',
Enter fullscreen modeExit fullscreen mode

Now that my basic UIengine setup is done, I can start to develop my components! 💪🏻

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Front-end Developer. 👾Media engineer. ⚡Facing life one bug at a time. 🔥 Easily bribed with chocolate. 🍫 she/her.
  • Location
    Val di Susa, Italia
  • Education
    Media Engineer, Politecnico di Torino
  • Work
    Front-end web developer
  • Joined

More fromGiulia Chiola

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp