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

@cloudquery/plugin-config-ui-lib

v2.2.2

Published

Plugin configuration UI library for CloudQuery Cloud App

Downloads

12,025

Readme

@cloudquery/plugin-config-ui-lib

Plugin Config UI library for CloudQuery Plugin Config UI

Description

@cloudquery/plugin-config-ui-lib is a library that provides various utilities that can be used in CloudQuery Plugin Config UI.

Installation

To install the library, you can use npm:

npm install @cloudquery/plugin-config-ui-lib

Documentation

Hooks

useApiCall

This hook is used to make API calls that require Authentication header from CloudQuery Cloud App.

const { callApi } = useApiCall(pluginUiMessageHandler);

callApi('https://api.cloudquery.io', 'POST', { name: 'my-source' });

useFormActions

This hook is used export data and functions that can be used in the footer for plugin UI.

const formActions = useFormActions({
  pluginUiMessageHandler,
  teamName: 'my-team',
  pluginTeamName: 'cloudquery',
  pluginName: 'postgresql',
  pluginKind: 'source',
  getValues;
  pluginVersion: '1.0.0',
  isUpdating: false,
});

return <FormFooter {...formActions} />;

useFormCurrentValues

This hook is used to respond to request for current values from CloudQuery Cloud App.

useFormCurrentValues({
  pluginUiMessageHandler,
  getCurrentValues,
});

useFormHeightChange

This hook is used to automatically detect the changes of the height of the form container and notify CloudQuery Cloud App about those. The hooks returns the React Ref object that should reference the HTML element that represents the form container.

useFormHeightChange(pluginUiMessageHandler);

useFormInit

This hook is used get the initial values for the form from the CloudQuery Cloud App. The initial values can be undefined, therefore the hook also returns information whether it was initialized.

const { initialized, initialValues } = useFormInit(pluginUiMessageHandler, false);

if (!initialized) {
  return null;
}

return (
  <div>
    <form>
      <input type="text" value={initialValues.name} />
    </form>
  </div>
);

useFormSubmit

This hook is used to handle the submit event for the form from the CloudQuery Cloud App. It requires the function that should validate the data and return an object either with errors or values depending on the validation result. The function can also return a Promise of the same type.

const [name, setName] = useState('');
const handleValidate = () => {
  if (!name.trim()) {
    return { errors: { name: 'Name is required' } };
  }

  return { values: { name } };
};

useFormSubmit(handleValidate);

return <input type="text" value={name} onChange={(event) => setName(event.target.value)} />;

Development

Building the Library

To build the library, run:

npm run build

Running Tests

To run the test suite, execute:

npm test

Contributing

If you encounter any issues or have feature requests, please feel free to open an issue on the GitHub repository.

License

This project is licensed under the Mozilla Public License..