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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@memberjunction/ng-base-application

v5.3.1

Published

MemberJunction Explorer: BaseApplication class system for app-centric navigation

Readme

@memberjunction/ng-base-application

Base application class system for app-centric navigation in MemberJunction Explorer. Provides extensible application classes, workspace configuration types, tab management, and state persistence.

Overview

This package defines the foundational architecture for MemberJunction's multi-application workspace. Each "application" in MJ Explorer is an instance of BaseApplication (or a subclass) that provides its own navigation items, color theme, lifecycle hooks, and default dashboard. The ApplicationManager service handles loading, ordering, and switching between applications, while WorkspaceStateManager and GoldenLayoutManager handle tab state and layout persistence.

graph TD
    AM["ApplicationManager\n(Singleton Service)"] --> BA["BaseApplication\nInstances"]
    AM --> WSM["WorkspaceStateManager"]
    WSM --> GLM["GoldenLayoutManager"]
    WSM --> TS["TabService"]
    BA --> NI["NavItem[]"]
    BA --> TR["TabRequest"]
    BA --> DE["DashboardEngine\n(Default Tab)"]

    style AM fill:#7c5295,stroke:#563a6b,color:#fff
    style BA fill:#2d6a9f,stroke:#1a4971,color:#fff
    style WSM fill:#2d6a9f,stroke:#1a4971,color:#fff
    style GLM fill:#2d8659,stroke:#1a5c3a,color:#fff
    style TS fill:#2d8659,stroke:#1a5c3a,color:#fff
    style NI fill:#b8762f,stroke:#8a5722,color:#fff
    style TR fill:#b8762f,stroke:#8a5722,color:#fff
    style DE fill:#b8762f,stroke:#8a5722,color:#fff

Features

  • BaseApplication class: Extensible via @RegisterClass for custom app behavior
  • ApplicationManager: Loads user applications, manages active app state, handles UserApplication records
  • WorkspaceStateManager: Persists and restores tab state across sessions
  • GoldenLayoutManager: Manages the Golden Layout tab container
  • TabService: Programmatic tab creation, switching, and closing
  • Type-safe interfaces: NavItem, TabRequest, WorkspaceConfiguration
  • Dashboard integration: Auto-loads default dashboards for apps with no nav items
  • Lifecycle hooks: OnActivate() / OnDeactivate() for custom initialization and cleanup

Installation

npm install @memberjunction/ng-base-application

Key Dependencies

| Dependency | Purpose | |---|---| | @memberjunction/core | Metadata, entity access | | @memberjunction/core-entities | DashboardEngine, UserApplicationEntity | | @memberjunction/global | RegisterClass, ClassFactory | | golden-layout | Tab container layout engine | | rxjs | Observable state management |

Usage

Extending BaseApplication

import { RegisterClass } from '@memberjunction/global';
import { BaseApplication } from '@memberjunction/ng-base-application';

@RegisterClass(BaseApplication, 'CRMApplication')
export class CRMApplication extends BaseApplication {
  override GetNavItems(): NavItem[] {
    const items = super.GetNavItems();
    // Add dynamic items based on permissions
    return items;
  }

  override async OnActivate(): Promise<void> {
    // Custom initialization when app becomes active
  }
}

Using ApplicationManager

import { ApplicationManager } from '@memberjunction/ng-base-application';

@Component({ /* ... */ })
export class AppSwitcherComponent {
  constructor(private appManager: ApplicationManager) {}

  ngOnInit() {
    this.appManager.Applications.subscribe(apps => {
      this.apps = apps; // User's active applications
    });
  }

  switchApp(app: BaseApplication) {
    this.appManager.SetActiveApp(app);
  }
}

Exported API

| Export | Type | Description | |---|---|---| | BaseApplication | Class | Base class for application definitions | | ApplicationManager | Service | Manages application instances and active state | | WorkspaceStateManager | Service | Persists and restores workspace tab state | | GoldenLayoutManager | Service | Manages Golden Layout tab container | | TabService | Service | Programmatic tab management | | NavItem | Interface | Navigation item configuration | | TabRequest | Interface | Tab creation request | | WorkspaceConfiguration | Interface | Complete workspace state | | UserAppConfig | Interface | User application configuration |

Build

cd packages/Angular/Explorer/base-application && npm run build

License

ISC