npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-laxarjs2

v2.3.0

Published

Yeoman generator for LaxarJS 2 applications and artifacts

Downloads

18

Readme

LaxarJS 2 Yeoman Generator

The convenient way to scaffold a new LaxarJS 2.x application, widget or control.

Note: This generator produces code that works with LaxarJS version 2.x. If you need to create widgets or controls for an application running LaxarJS in version 1.x, you'll have to use generator-laxarjs instead.

Installation

Install the generator package (and optionally yeoman) globally via npm:

npm install -g yo generator-laxarjs2

Generators

The Yeoman generator laxarjs2 comes up with the main generator for scaffolding an application and three sub-generators for widgets, activities and controls.

Available generators:

  • laxarjs2
  • laxarjs2:widget
  • laxarjs2:activity
  • laxarjs2:control

Application

To scaffold a new LaxarJS application, create a directory and run the generator:

mkdir my-application
cd my-application
yo laxarjs2

After answering several questions, the generator creates the bare-bones application scaffolding for you. Alternatively you can choose to let the generator create a set of very simple example widgets in the application. When choosing this option, a widget is created for every selected integration technology. Additionally, a widget written in plain JavaScript is added, since the corresponding technology adapter is always part of LaxarJS.

Next, all dependencies can be installed by running npm install (or yarn), and after that is finished, the development web server can be started by running npm start.

Command Line Options

--banner <banner-file.txt>

By using this option, a text file containing a custom header for source files can be configured. When the generator creates a new source file (.js, .ts, .jsx or .vue), this will be added as header just before the actual code starts.

This option will be saved in the Yeoman configuration file and will be used by sub-generators.

Widget, Activity and Control

The scaffolding for a widget can be generated by running the following in the root directory of the application:

yo laxarjs2:widget

The widget will be created in <application-root>/application/widgets/<widget-name>. If the generator is not run in the application root directory but some other sub-directory, the widget will be created directly in that directory.

Keep in mind that the sub-generators expect to find a Yeoman configuration file (.yo-rc.json) in the root directory of your application. Having used the generator for the application first, the necessary configuration file will already be in your project. In case you add widgets, activities or controls to an application that was created without Yeoman, simply create the file with an empty object as content:

echo "{}" > .yo-rc.json

To create an activity or a control, use the appropriate sub-generator:

# create an activity
yo laxarjs2:activity
# create a control
yo laxarjs2:control

By default, activities will be created in the same folder as widgets, while controls will be created in <application-root>/application/controls/<control-name>. Note that LaxarJS will not automatically find artifacts outside of the default folders (<application-root>/application). You can change the defaults using the file laxar.config.js, or add additional resolutions to the loader configuration (webpack.config.js).

Also, for widgets and controls the previously selected integration technology will be pre-selected the next time one of these artifact types is generated. However, for activities the pre-selected technology will always be plain. This is because an activity isn't rendered in the DOM, and any view rendering technology would thus only add bloat. A valid exception could be an activity that uses an AngularJS service, for instance.

Command Line Options

  • <artifact-name>

    When asked for the artifact name, this will be prompted as default instead of the current directory.

  • --banner <banner-file.txt>

    This is the same as explained above for the application generator.

  • --directory <artifacts-directory>

The generator will create the widget, activity or control in a sub-directory of this directory. The name of the artifact will be used as a sub-directory within this directory.

Example:

my-app $ yo laxarjs2:widget hello-world-widget --directory stuff/my-widgets

This will create the widget in my-app/stuff/my-widgets/hello-world-widget.