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

@equinor/fusion-framework-dev-server

v2.1.1

Published

Package for running a development server for fusion-framework

Readme

@equinor/fusion-framework-dev-server

Development server primitives for Fusion Framework applications. The package combines Vite, React Fast Refresh, SPA environment injection, Fusion service discovery, and local API proxying.

[!TIP] Most application developers should start with ffc app dev. Use this package directly when you are building framework tooling, a custom development command, or a Vite integration that needs control over server creation.

Choose your entry point

| Goal | Start here | | --- | --- | | Run a Fusion application locally | ffc app dev from @equinor/fusion-framework-cli | | Create and start a configured Vite server | createDevServer(options, overrides?) | | Generate Vite configuration without starting a server | createDevServerConfig(options, overrides?) | | Customize service discovery proxy routes | processServices(data, args) | | Develop against local OpenAPI mocks | @equinor/fusion-framework-cli-plugin-mock-server |

Quick start

pnpm add -D @equinor/fusion-framework-dev-server vite
import { createDevServer } from '@equinor/fusion-framework-dev-server';

const server = await createDevServer({
  spa: {
    templateEnv: {
      portal: { id: 'my-portal' },
      title: 'My application',
      serviceDiscovery: {
        url: 'https://service-discovery.example.com',
        scopes: ['api://example.com/user_impersonation'],
      },
      msal: {
        clientId: 'client-id',
        tenantId: 'tenant-id',
        redirectUri: '/authentication/login-callback',
        requiresAuth: 'true',
      },
    },
  },
  api: { serviceDiscoveryUrl: 'https://service-discovery.example.com' },
});

await server.listen();
server.printUrls();

The browser receives spa.templateEnv. The Node development server uses api.serviceDiscoveryUrl to fetch service definitions and create same-origin proxy routes. These two URLs often point to the same endpoint, but they serve different consumers.

Continue with Getting started for the complete mental model.

Mock APIs locally

Install the optional mock-server plugin when a backend is unavailable, unstable, or needs deterministic responses:

pnpm add -D @equinor/fusion-framework-cli-plugin-mock-server
ffc mock-server ./mocks --port 4010

[!IMPORTANT] ffc mock-server is a standalone foreground process. Installing the plugin does not start it with ffc app dev; the developer or test runner owns its lifecycle.

The plugin adds typed mockServer settings to DevServerOptions only when its types are imported, keeping this base package independent of optional mocking tools.

See Develop with mock services for normal development overlays, isolated --mock mode, direct-only services, and executable <name>.mock.ts modules.

Learn in order

  1. Getting started explains the server lifecycle and smallest useful setup.
  2. Configure the dev server covers SPA environment, API proxying, and logging.
  3. Develop with mock services shows the recommended optional mocking workflow.
  4. Advanced usage covers service processing, routes, Vite overrides, and extension interfaces.
  5. Troubleshooting maps common symptoms to the responsible configuration.

Public API

  • createDevServer creates a configured ViteDevServer. Call listen() yourself.
  • createDevServerConfig returns a Vite UserConfig for another tool to consume.
  • processServices rewrites discovered service URIs through the local proxy and returns routes.
  • DevServerOptions<TEnv> configures SPA injection, API discovery, and logging. It is an interface so optional plugins can augment it.
  • FusionService describes a backend using key, uri, name, and optional OAuth scopes.

Requirements and boundaries

  • Vite 7 or 8 is required as a peer dependency.
  • api.serviceDiscoveryUrl is required by the low-level API.
  • The package configures development; it does not build or publish applications.
  • Mock-server installation and process lifecycle are optional and external to this package.

License

ISC