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

forgify

v1.2.0

Published

Javascript source code parser with the goal of parsing vuex

Downloads

9

Readme

Forgify

Forgify is a powerful tool that streamlines the creation of extensibility SDKs, automating the integration between platform applications and plugins using iframe-based messaging. By generating SDK files for both client and server from popular state management solutions like Redux, Vuex, and Pinia, Forgify simplifies adding plugins to your platform.

Overview

Forgify inspects your state management setup (e.g., Redux, Vuex, or Pinia), generating an SDK that includes a client-side JavaScript file and a server-side component to facilitate communication. The SDK allows plugins to interact with your application's state (getters, actions, mutations) through well-defined extension points, eliminating the need for manual SDK setup.

This SDK generation simplifies adding custom plugins or modules to your platform by providing a standardized interface for communication and state management.

Key Features

  • Automated SDK Generation: Scans client stores and produces client SDKs and server components.
  • Bidirectional Messaging: Allows plugins to send and receive messages using postMessage() protocol.
  • Extensibility API: Supports plugin registration at predefined extension points (e.g., sidebars, toolbars).
  • State Access: Provides direct access to store actions, getters, and mutations from plugins.
  • Role-Based Permissioning: Manage different SDK variants based on user roles.
  • TypeScript Support: Full TypeScript support for SDK generation and client-server interactions.
  • Comment-Based Documentation: Automatically extracts and documents param types from store comments.

Installation

Install Forgify in your project:

yarn add forgify

Usage

In this example, we’ll demonstrate using Forgify with a platform named Vulcan, a plugin publisher.

Generate SDK

Run the SDK generation tool and provide inputs like namespace and extension points. This will generate the SDK files in the directory matching the given namespace.

yarn forgify

Example: Input: namespace: vulcan, register points: left-sidebar, right-sidebar Output:

  • vulcan.client.js: The client SDK file, will be shared publicly to developers.
  • SdkServer.vue: Server component to manage iframe communication, will be kept private in your client side code.
  • vulcan.json: Configuration file containing SDK settings.

Use a pre-configured JSON file:

You can also use a JSON configuration file to specify SDK parameters.

yarn forgify --json config.json

TODO: Sample config

Comment-Based Parameter Documentation

For better documentation, include structured comments within your store code to describe SDK methods:

/**
 * Sets the loading state.
 * @param {boolean} loading - Whether the app is loading.
 */

Forgify will incorporate this documentation in the generated SDK output, providing clear, consistent parameter documentation.

Role-Based Permission Management

Generate SDKs with role-specific configurations, such as internal, partner, and public, each containing allowed actions and extension points for that role.

yarn forgify --map config_folder/

TODO: Sample config

Build & Publish

Build: Compile TypeScript files.

npx tsc

Publish: Publish your SDK package to NPM.

npm publish

License

MIT