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

@formbird/schematics

v0.0.15

Published

A schematic for generating a React component that can be run in formbird

Downloads

36

Readme

Formbird Component Schematics

This repository is a collection of schematics for creating components to run in formbird. Formbird components are custom elements, which is part of the web components standard, and they can be developed using different component frameworks as long as the component is wrapped in a custom element. This schematic collection generates components that are ready to load in a formbird form.

Prerequisites

  1. Make sure you've got Node.js 12 and npm installed.

  2. Install @angular-devkit/schematics with:

    npm install @angular-devkit/schematics-cli -g

  3. Install the formbird schematics with:

    npm install @formbird/schematics -g

React

To generate a React component:

  1. Run the schematic with:

    npx schematics @formbird/schematics:react-component

  2. You will be prompted for the component name. Enter a hyphenated component name that is all lower-case, with the first section of the name being a prefix for your set of components. Formbird uses "sc" as a prefix for standard components, but third-parties can use a prefix for their company or project name to identify their own set of components. An example is:

    re-chips

After entering the component name, a series of files are generated:

/Volumes/Projects/react/schematic-test npx schematics @formbird/schematics:react-component
? Enter the component name? re-chips
CREATE re-chips/package.json (503 bytes)
CREATE re-chips/tsconfig.json (262 bytes)
CREATE re-chips/webpack.config.js (529 bytes)
CREATE re-chips/json/re-chips.component.json (1011 bytes)
CREATE re-chips/json/re-chips.template.json (414 bytes)
CREATE re-chips/src/index.ts (37 bytes)
CREATE re-chips/src/components/ReChips.tsx (703 bytes)
CREATE re-chips/src/utils/CustomElementWrapper.tsx (1877 bytes)
  1. Upload the following generated files through the formbird template editor:

    a) json/re-chips.component.json - the component document for the component b) json/re-chips.template.json - a simple test template that can be used to load the component in formbird

  2. Navigate to the folder for the component and run yarn to install the node modules:

    npm install

or

npx yarn

Yarn is faster than npm and is the preferred way to install modules for formbird. Whichever one you use, you should use the same one every time because they both generate a lock file to ensure that the same versions of dependencies are always installed.

  1. Then build the component with:

    npm run build

or to build the component automatically when you change the code, you can build in watch mode with:

npm run watch

Watch mode is useful when working on the component so you don't have to keep running the build command on every change.

  1. Load the component in formbird by reading the documentId from the template file that was uploaded in step 3a:

    "documentId": "c6385ead-7b5c-458f-8421-ca017465bb1e",

The url will be https:///form/c6385ead-7b5c-458f-8421-ca017465bb1e . Eg. https://re.formbird.com/form/c6385ead-7b5c-458f-8421-ca017465bb1e

  1. You should see a simple component with the following text:

    re-chips works. Please edit src/components/ReChipsComponent.tsx to make changes