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

@ibm-wch/cli-create-layout-react

v1.0.8

Published

Command line interface for the generation of WCH layout.jsons, layout-mapping.jsons, and template .jsx files in react.

Downloads

4

Readme

Watson Content Hub CLI create layout command for react

Simplified Layout Generation

Generates a single react layout, layout mapping and React.Component (.jsx) template for a given type.
Also updates the registration.jsx file to include registerComponent() calls as well as the src/index.js file to include exporting the newly created react component.

Usage

ibm-wch-sdk-cli create layout --data <DATA> --type <TYPE> [--scss] --react --src <SRC>

With

  • DATA: wchtools data folder
  • TYPE: name of the type to construct the layout for. This needs to be the full type name, not a regular expression. The name is case sensitive.
  • SRC: root dir of where to generate the layout (.jsx) and style (.scss) files. The layout files will be generated in SRC/src/layouts and the style files will be generated in SRC/styles/layouts.

Layout Generation

  • Generates layouts and layout-mapping json files (currently same as angular) based on type information.
  • The layout json file goes into a subfolder layouts/ from the dir supplied into --data
  • The layout-mapping json file goes into a subfolder layout-mappings/ from the dir supplied into --data
  • The React.Component template goes into a subfolder src/layouts/ from where the command is called
  • An updated registration.jsx will go into src/ from where the command is called
  • An updated index.js will go into src/layouts from where the command is called

Naming Scheme

The react template file (.jsx) name is derived from the type name as follows:

  • convert the type name to camel case
  • if the result ends with Type remove that suffix
  • DOES NOT add a Layout suffix (unlike angular, which does)
  • the React.Component class name inside the template file will be the same name but upper camel case

The layout selector (.json file name and parameter passed into registerComponent()) is derived from the react component file name as follows:

  • convert the component/class name to kebab case
  • if the result DOES NOT end with list, then add layout
  • e.g. coolImage -> cool-image-layout, coolList -> cool-list

The layout mapping name (.json file name) is derived from the layout name as follows:

  • add -mapping to the layout selector

Important Notes

Currently does not support the "multipe" option for elements.