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

forge-vuex-parser

v1.1.5

Published

Javascript source code parser with the goal of parsing vuex

Downloads

170

Readme

Forge Parser

Forge Parser is a tool that automates the generation of extensibility SDKs from Vuex / Redux stores, enabling seamless integration between platform applications and plugins via iframe-based messaging.

Overview

The tool analyzes your Vuex or Redux store, generates an SDK client-side JavaScript file, and creates a server-side component to manage communications. It facilitates plugin extensibility through well-defined extension points and interaction with store getters, actions, and mutations, without requiring manual SDK wiring.

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 Vuex stores and produces client SDKs and server components.
  • Bidirectional Messaging: Allows plugins to send and receive messages using postMessage.
  • Extensibility API: Supports plugin registration at predefined extension points (e.g., sidebars, toolbars).
  • State Access: Provides direct access to Vuex store actions, getters, and mutations from plugins.
  • Role-Based Permissioning: Manage different SDKs 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 the forge-vuex-parser into your Vuex project:

yarn add forge-vuex-parser

Usage

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: Client SDK file.
  • SdkServer.vue: Server component for iframe communication.
  • vulcan.json: Settings and configuration file.

To generate SDK from a pre-configured JSON file:

yarn forgify --json config.json

Role-Based Permission Management

yarn forgify --map config_folder/

This generates separate SDKs and configurations for roles like internal, partner, and public, each with their own set of allowed actions and extension points.

Comment-Based Parameter Documentation

To ensure proper documentation of your SDK methods, use the following format in your Vuex store:

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

The generated output will include param type documentation, ensuring your SDK is properly documented.

Build & Publish

Build the project using TypeScript:

npx tsc

Publish your package to NPM:

npm publish

License

MIT