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

@gluestack-framework-v3/framework

v0.0.95

Published

This Plugin provides a Plugin Manager and a BasePlugin class for managing and installing plugins in a project. The Plugin consists of two main files:

Downloads

121

Readme

Framework Plugin

This Plugin provides a Plugin Manager and a BasePlugin class for managing and installing plugins in a project. The Plugin consists of two main files:

  1. BasePlugin.ts

    The BasePlugin class is an abstract class that serves as the base for both client and server plugins. It defines various methods for copying directories, merging dependencies, updating configuration files, and more. Subclasses must implement abstract methods such as install, update, and uninstall.

  2. PluginManager.ts

    The PluginManager class is responsible for managing the installation of plugins. It provides methods for loading plugin classes, installing dependencies, and copying plugin Plugins based on the generation type (template or example).

BasePlugin Class

Properties

  • pluginName: Name of the plugin.
  • sourcePath: Path to the source directory.
  • projectName: Name of the project.
  • generateFrom: Generation type, either 'template' or 'example'.

Methods

Common Methods (Used by both client and server plugins)

  • copyDirectories(): Copy multiple directories from source to destination.
  • copyDirectory(): Copy a single directory from source to destination.
  • mergeDependencies(): Merge dependencies, devDependencies, scripts, etc. from the plugin to the project's package.json.
  • mergeTSconfigPaths(): Merge tsconfig paths from the plugin to the project's tsconfig.json.
  • updatePluginJson(): Merge plugin-specific JSON to the project JSON.
  • updateProjectNameInPackageJson(): Update the project name in package.json.

client Plugin Methods

  • deleteDirectories(): Delete multiple directories from the destination.
  • mergeAppJson(): Merge app.json from the plugin to the project, with specific keys for iOS, Android, and web.
  • replaceMainLayout(): Replace the main layout from the plugin to the project.

server Plugin Methods

  • mergeAppModule(): Merge app Plugin from the plugin to the project.
  • copyDockerComposeForDB(): Copy docker-compose.yml from the plugin to the project.

Abstract Methods

  • install(): Abstract method to install the plugin.
  • update(): Abstract method to update the plugin.
  • uninstall(): Abstract method to uninstall the plugin.

PluginManager Class

Properties

  • baseDir: Base directory for the project.
  • projectName: Name of the project.
  • generateFrom: Generation type, either 'template' or 'example'.
  • generationType: Type of generation, either 'project' or 'example'.

Methods

  • updateGenerationFrom(generationFrom: 'template' | 'example'): PluginManager: Update the generation type of the PluginManager instance.

  • installPlugin(pluginName: string, pluginType: 'server' | 'client'): Promise<void>: Install a plugin by copying its Plugin, installing dependencies, and initializing the plugin class.

Usage

To use the Plugin Manager, create an instance of the PluginManager class, configure it, and then call the installPlugin method to install individual plugins.

// Example usage
const pluginManager = new PluginManager('/path/to/project', 'myProject', 'template', 'project');
await pluginManager.installPlugin('myPlugin', 'client');

Note: You can use these methods in various plugins and call in the install function of any plugin.

Logs

Please use logger instead of console.logging. Logs from logger doesn't show in production. If you want to manage logs in development env, you can set ENABLE_LOGGING=false/true in .env.