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

@clark-inc/clark-forms

v3.3.2

Published

Clark React Redux Forms library.

Downloads

31

Readme

Clark Forms

📝 Clark React Redux Forms library

This library is a React project with Redux, Redux Forms, Styled-Components, and Jest/Enzyme. It includes particulars in the build pipeline including Airbnb ESlint, Prettier, hot-reloading, and SVG optimizations.

This application was initially scaffolded using Create React App and then ejected, reference those docs for additional information. Below you will find some information on how this project is structured.

Project structure:

The src directory contains both lib and demo folders. Demo serves as a sandbox to test, build, and see updates to the form components locally. The lib folder is where all the library production code goes.

|-- src
|   |-- demo
|   |-- lib

Getting Started

  • You will need to install Yarn for dependency management, if you do not have it already installed.

  • Run the yarn command to install node_modules

  • To build the demo project locally run yarn start

Testing library integration locally

To test the Clark Forms library locally follow the instructions here.

** Make sure build/ directory exists (yarn build) ** Any subsequent changes made to Clark Forms library while symlinked require running yarn build again.

Testing

The testing suite uses Jest as the test runner and Enzyme as a utility to make testing React components easier. These functions are all made available globally in every test file in the setupTests.js.

  • Run yarn run lint to run the linter
  • Run yarn test to start the test runner

Updating

For convience sake, we use the cut-release project to easily publish to npm and follow SEMVER.

If for some reason you rather do this manually, the process is as follows:

  1. Merge changes into master

  2. git checkout master

  3. Run yarn build

  4. Run npm version specifying the subsequent version based on SEMVER and supply a commit message using the -m flag. ex. npm version patch -m "Upgrade to %s for reasons"

  5. git push origin master

  6. git push origin master --tags

  7. yarn publish

** In order to publish to the org @clark-inc, you must be logged-in. NPM CLI will provide a prompt to login. At that point contact either @micheal or @ian on slack in #dev channel for assistance. Before doing so please download keybase.

Once you have cut a release remember to bump the version in your project.

Usage

To use the library run yarn add @clark-inc/clark-forms

You can then import the library in your component like so: import Fieldset from '@clark-inc/clark-forms';

The Fieldset component must be wrapped in a <form> element and the form component must be connected to redux-forms.

Ex.

const Demo = ({ handleSubmit }) => (
  <div>
    <form onSubmit={handleSubmit(handleClick)}>
      <Fieldset data={FIELD_SETS} />
      <button>Submit</button>
    </form>
  </div>
);

export default reduxForm({
  form: 'demo',
})(Demo);

The Fieldset component takes one prop called data which is a json structure. These FIELD_SETS must have a type, name, and label.

Types include: input, radioButton, checkbox, dropdown, textarea, datepicker.

Ex.

const FIELD_SETS = [
  {
    fieldSet: [
      {
        columns: { small: 1, large: 2 },
        fields: [
          {
            type: 'input',
            name: 'accountNumber',
            label: 'Account Number',
            validate: [isRequired, minLength(6)],
            normalize: normalizeNumbers(16),
          },
          {
            type: 'input',
            name: 'routingNumber',
            label: 'Routing number',
            validate: [isRequired, minLength(9)],
            normalize: normalizeNumbers(9),
          },
        ],
      },
    ],
  },
];