Skip to content

Conversation

@odinr
Copy link
Collaborator

@odinr odinr commented May 27, 2025

Why

This PR introduces a collection of updates, enhancements, and fixes across the Fusion Framework monorepo. It includes refactors, dependency upgrades, bug fixes, documentation updates, and feature releases for multiple packages.

The current behavior includes outdated dependencies, limited functionality in some modules, and missing documentation for certain integrations.

@equinor/fusion-framework-cli

  • The Fusion Framework CLI has been completely rewritten to use the Fusion Framework internally, reducing dependencies and improving performance. This rewrite makes the CLI a first-class citizen in the Fusion Framework ecosystem, providing a more consistent and integrated experience.

  • The Dev Portal has been modularized and moved to a separate package, @equinor/fusion-framework-dev-server, enabling a modular architecture and independent updates. The Dev Portal now supports live previews and API mocking, configurable via dev-server.config.js.

  • The CLI's command structure has been reorganized into three main groups: bin (executable functions), commands (CLI commands), and lib (for consumers, config, and utilities). This improves organization and modularity.

  • The --service flag has been removed, and the CLI now uses service discovery via Fusion environment variables. Additionally, all app -build-??? commands have been deprecated and will be removed in the next major version.

  • Vite configuration and dev server functionality have been abstracted into the @equinor/fusion-framework-dev-server package. The CLI now provides a higher-level API that handles Vite configuration internally, while still allowing for customization through configuration options.

  • New utility functions have been added to the CLI, including modules for resolving CI/CD metadata (e.g., GitHub Actions, Azure DevOps), git commit and remote info, and package metadata. These utilities support advanced scripting and automation scenarios.

  • Support for portal configuration has been improved with new helpers for loading and resolving portal configuration files. The portal manifest has been refactored to use name and templateEntry for consistency with app manifests, and type safety and schema validation have been enhanced.

  • The CLI has been modernized for ESM compatibility, including the use of deepmerge instead of lodash.mergewith, explicit .js extensions in imports, and updated package.json and tsconfig.json configurations.

  • The dev server configuration has been refactored to improve merging logic, add a RecursivePartial type, and implement a custom array merge strategy. Documentation for configuration has also been improved.

  • A Node.js version check has been added to the CLI entrypoint, recommending the use of the LTS version. Build configuration now injects version info via environment variables.

  • The maintainability, type safety, and developer experience of the CLI and dev server packages have been significantly improved.

  • For further details, see the CLI's README and the docs folder.

@equinor/fusion-framework-dev-portal

This PR introduces a new package, @equinor/fusion-framework-dev-portal, as part of a refactor of the @equinor/fusion-framework-cli.

Features

  • Development portal for the Fusion framework
  • Support for MSAL authentication
  • Integration with service discovery
  • Environment variable configuration

This package is a small part of the refactoring of the @equinor/fusion-framework-cli and while it can be used standalone, it is recommended to use the @equinor/fusion-framework-dev-server package for a more complete development experience.

Read More

For more detailed information, usage examples, and advanced configuration, please refer to the GitHub README for this package.

@equinor/fusion-framework-dev-server

Introduced a new package, @equinor/fusion-framework-dev-server, designed to provide a development server tailored for Fusion Framework applications. Built on top of Vite, it seamlessly integrates Vite and Fusion Framework configurations.

For more details, visit the GitHub repository.

Features

  • createDevServer Function: Simplifies the creation of a development server using a configuration object.
  • createDevServerConfig Function: Generates a Vite-compatible configuration for the development server.
  • SPA Support: Includes spa.templateEnv for defining environment variables specific to Single Page Applications.
  • API Service Discovery: Enables proxying and route mapping for API services via api.serviceDiscoveryUrl.
  • Dynamic Proxy Routes: Introduced the processServices function to remap Fusion services' URIs and dynamically generate proxy routes.
  • Logging: Integrated @equinor/fusion-log for customizable logging, with dedicated sub-loggers for SPA and API services.

Dependencies

The following dependencies were added to support the new package:

  • @equinor/fusion-framework-vite-plugin-api-service
  • @equinor/fusion-framework-vite-plugin-spa

@equinor/fusion-framework-module-http

  • The HTTP module now uses the correct method acquireAccessToken from the auth provider to retrieve the access token for requests with scopes.
  • This fixes compatibility with the new MSAL node module interface, which no longer exposes acquireToken but instead provides acquireAccessToken for token retrieval.
  • Ensures the Authorization header is set correctly for authenticated HTTP requests.

@equinor/fusion-framework-module-msal-node

This release makes @equinor/fusion-framework-module-msal-node an explicit ESM package.

@equinor/fusion-framework-module-module

This release makes @equinor/fusion-framework-module an explicit ESM package.

@equinor/fusion-framework-react-components-people-provider

update @equinor/fusion-wc-person dependency to version 3.1.8

@equinor/fusion-framework-vite-plugin-api-service

Introducing a new Vite plugin for Fusion Framework applications that simplifies API development workflows through service discovery integration and API mocking.

Key capabilities:

  • Proxy requests to backend services with automatic route generation
  • Mock API responses for testing and development
  • Intercept and transform API requests and responses
  • Configure custom routes with middleware support

For complete documentation and examples, see the API Service Plugin README.

@equinor/fusion-framework-vite-plugin-spa

Introducing a powerful new Vite plugin for building Single Page Applications (SPAs) with the Fusion Framework and Vite. This plugin significantly streamlines the development workflow by automating HTML template generation, bootstrapping authentication and service discovery, and enabling seamless portal loading and API proxying.

Purpose:

This plugin represents a strategic modularization of the Fusion Framework CLI codebase. By extracting the SPA functionality into its own dedicated package, we've simplified the CLI's architecture while enabling greater flexibility. This modular design allows the SPA component to be replaced or reused by third-party developers independently of the CLI. The primary goal is to maintain a cleaner, more maintainable codebase through proper separation of concerns, with the CLI using this plugin rather than containing this functionality directly.

Key Features:

  • Fusion Framework Bootstrap: Automatically initializes core modules and renders configured portals
  • Service Discovery: Enables dynamic service routing and eliminates hardcoded service endpoints
  • MSAL Authentication: Provides seamless Azure AD integration with configurable authentication flows
  • Service Worker: Intercepts network requests to add authentication tokens and rewrite URLs for proxying
  • Portal Integration: Loads and renders any portal by ID from local packages or the Fusion Portal Service
  • Environment Configuration: Supports flexible configuration through code or .env files with proper naming conventions
  • Custom Templates: Allows full control over HTML document structure while maintaining environment variable injection
  • Custom Bootstrap: Supports advanced customization of the application initialization process
  • API Service Integration: Works with @equinor/fusion-framework-vite-plugin-api-service for enhanced development capabilities

This plugin is designed for seamless integration with the Fusion Framework CLI and provides flexible configuration for both standard and advanced SPA scenarios.

@equinor/fusion-imports

Updated the files field in package.json to include both dist and src directories.

Bookmark

Refactored the Bookmark type to be an intersection of BookmarkWithoutData and an optional payload property, improving type safety and flexibility. Updated useBookmarkNavigate to use proper TypeScript typing for bookmark events.

Module Bookmark Changes:

  • Refactored Bookmark type in packages/modules/bookmark/src/types.ts
  • Added export for BookmarkProviderEvents type in packages/modules/bookmark/src/index.ts
  • Updated JSDoc comment from @note to @remarks in packages/modules/bookmark/src/BookmarkClient.ts
  • Reordered tsconfig references (event before services)

React Changes:

  • Updated packages/react/modules/bookmark/src/portal/useBookmarkNavigate.ts to use proper TypeScript typing for bookmark provider events
  • Removed React paths configuration from packages/react/app/tsconfig.json

Dependency Updates

  • Vite: Upgraded to version 6.3.5 for improved performance and compatibility.
  • Zod: Upgraded to the latest version to leverage new features and fixes.

Breaking changes

@equinor/fusion-framework-cli

  • The --service flag has been removed. The CLI now uses service discovery via Fusion environment variables. All app -build-??? commands are deprecated and will be removed in the next major version. Migration Guide: v10 to v11

EsmNext to NodeNext

@equinor/fusion-framework-module and "@equinor/fusion-framework-module-msal-node is now built for module and moduleResolutionto NodeNext. This should not really effect any consumers, but all CJS will fail.

closes: #AB64518


Check off the following:

  • Confirm that I checked changes to branch which I am merging into.

    • I have validated included files
    • My code does not generate new linting warnings
    • My PR is not a duplicate, check existing pr`s
  • Confirm that the I have completed the self-review checklist.

  • Confirm that my changes meet our code of conduct.

odinr and others added 4 commits May 27, 2025 13:59
* fix(package): update @equinor/fusion-wc-person dependency to version 3.1.8

* feat(dev-server): add initial implementation of Fusion Framework Dev Server

* feat(api-service): Add plugin for API services

Add a new Vite plugin to handle API services. This includes:
- Proxy handler creation
- Response interception
- Route matching and validation
- Utility functions for processing routes

Also includes tests and configuration updates for the new plugin.

* feat(api-service): enhance logging and improve request handling in proxy server

* test(api-service-plugin): remove obsolete test file for API service plugin

* feat(spa-plugin): add initial implementation of Fusion Framework Vite SPA Plugin (#2939)

* feat(spa-plugin): add initial implementation of Fusion Framework Vite SPA Plugin

* style: update line endings

* feat(api-service): enhance proxy logging and improve error handling

* feat(spa-plugin): update portal service client and enhance portal manifest handling

* feat(api-service): refactor proxy response handling and enhance data processing arguments

* feat(api-service): add README documentation for Fusion Vite API Plugin

* Add Development Server Package for Fusion Framework Applications (#2961)

* feat(spa-plugin): update portal service client and enhance portal manifest handling

* feat(api-service): refactor proxy response handling and enhance data processing arguments

* feat(api-service): add README documentation for Fusion Vite API Plugin

* feat(dev-server): introduce Fusion Framework development server package

- Added `@equinor/fusion-framework-dev-server` package for creating a development server tailored for Fusion Framework applications.
- Implemented `createDevServer` and `createDevServerConfig` functions for simplified server setup.
- Added support for SPA configuration, API service discovery, and dynamic proxy routes.
- Integrated logging with `@equinor/fusion-log`.
- Updated dependencies and TypeScript configuration for the new package.
- Provided detailed examples and documentation in the README.

* chore: update lock

* Empty-Commit

* style: fix linting

* feat(dev-server): allow providing vite overrides when creating dev server

* feat(api-service): update vite dependency and improve request parameter typing

* feat(dev-server): allow custom server port configuration in dev server setup

* fix(spa): allow empty string for rewrite

* refactor: remove @equinor/fusion-framework-react-widget package and its dependencies

- Deleted the @equinor/fusion-framework-react-widget package and its associated files, including components, hooks, and utility functions.
- Removed references to the widget module in package.json and tsconfig.json files.
- Updated useCurrentBookmark hook to return the correct type.
- Cleaned up package.json dependencies in the main app to reflect the removal of the widget module.

* feat(spa): update portalId to portal object in template environment configuration

* fix: update changeset

* Introduce `@equinor/fusion-framework-dev-portal` package (#2981)

* feat: initial package dev-portal

* Update packages/dev-portal/src/Header.tsx

Co-authored-by: Copilot <[email protected]>

* Update .changeset/tasty-cities-relate.md

Co-authored-by: Copilot <[email protected]>

* Update packages/dev-portal/src/PersonSideSheet/sheets/Styled.tsx

Co-authored-by: Copilot <[email protected]>

* Update packages/dev-portal/src/PersonSideSheet/index.tsx

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

* chore: remove console.log from dev-server and add vite dependency

* fix: change log level from info to debug for plugin environment logging

* feat: replace esbuild with rollup for build process and add rollup configuration

* fix: update plugin to use lodash.mergewith for environment merging

* feat(dev-server): add initial implementation of Fusion Framework Dev Server

* feat(api-service): Add plugin for API services

Add a new Vite plugin to handle API services. This includes:
- Proxy handler creation
- Response interception
- Route matching and validation
- Utility functions for processing routes

Also includes tests and configuration updates for the new plugin.

* feat(api-service): enhance logging and improve request handling in proxy server

* test(api-service-plugin): remove obsolete test file for API service plugin

* feat(spa-plugin): add initial implementation of Fusion Framework Vite SPA Plugin (#2939)

* feat(spa-plugin): add initial implementation of Fusion Framework Vite SPA Plugin

* style: update line endings

* feat(api-service): enhance proxy logging and improve error handling

* feat(api-service): refactor proxy response handling and enhance data processing arguments

* Add Development Server Package for Fusion Framework Applications (#2961)

* feat(spa-plugin): update portal service client and enhance portal manifest handling

* feat(api-service): refactor proxy response handling and enhance data processing arguments

* feat(api-service): add README documentation for Fusion Vite API Plugin

* feat(dev-server): introduce Fusion Framework development server package

- Added `@equinor/fusion-framework-dev-server` package for creating a development server tailored for Fusion Framework applications.
- Implemented `createDevServer` and `createDevServerConfig` functions for simplified server setup.
- Added support for SPA configuration, API service discovery, and dynamic proxy routes.
- Integrated logging with `@equinor/fusion-log`.
- Updated dependencies and TypeScript configuration for the new package.
- Provided detailed examples and documentation in the README.

* chore: update lock

* Empty-Commit

* style: fix linting

* feat(api-service): update vite dependency and improve request parameter typing

* fix(http): update token retrieval method to acquireAccessToken

* feat(spa): fetch and pass portal config to render function in bootstrap

* fix(biome): update linter rule for noConfusingVoidType to info level

* Implement Fusion Framework Dev Server and API Service Plugin (#3069)

* feat(cli)!: rewrite CLI to use Fusion Framework, separate dev portal, and improve modularity

- Rewrite CLI to use Fusion Framework internally for better performance and maintainability
- Move dev portal to `@equinor/fusion-framework-dev-server` for modular architecture
- Add support for `dev-server.config.js` for dev portal configuration
- Enable live preview and API mocking in dev portal (future documentation planned)
- Default dev portal to `@equinor/fusion-framework-dev-portal` but allow custom portals
- Add `fusion-framework-cli auth login` command for improved authentication
- Refactor CLI into `bin`, `commands`, and `lib` namespaces for better organization
- BREAKING CHANGE: remove `--service` flag, deprecate `app -build-???` commands in favor of new structure

* feat(dev-server): export UserConfig interface from vite

* chore: update vite to 6.3.5

* chore: add build output directory to .gitignore

* feat(cli): update TODO.md and improve return handling in legacy functions

* fix: update package.json main entry to point to dist for multiple cookbooks

* refactor: rename resolveAppPackage to resolveProjectPackage for consistency

* feat: refactor Dockerfile and add libsecret installation instructions to enhance secure credential storage

* feat: enhance app manifest handling and improve error management in git utilities

* doc: implement lazy loading of MSAL cache to optimize libsec loading

* style: format img tag for better readability and maintainability

* fix: correct package name in fetch portal config changeset

* Empty-Commit

* removed pre.json file

---------

Co-authored-by: Copilot <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented May 27, 2025

🦋 Changeset detected

Latest commit: a86b21a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 👨🏻‍🍳 cookbooks 💾 CLI fusion framework CLI 📚 documentation Improvements or additions to documentation 🚧 chore maintaines work, (update deps, workflos ...) 🛠️ utils packages related to utils 🧨 breaking changes 🧬 Modules labels May 27, 2025
@odinr odinr requested a review from Copilot August 15, 2025 19:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR performs a comprehensive modernization and refactoring of the Fusion Framework codebase, transitioning to ESM modules, updating dependencies, improving documentation, and adding new development tooling.

  • Migration to ES modules with "type": "module" and .js extensions in imports
  • Updated dependencies including Zod version bumps and TypeScript configuration improvements
  • Enhanced documentation with comprehensive JSDoc comments and improved README files
  • Introduction of new development server and portal packages for better development experience

Reviewed Changes

Copilot reviewed 224 out of 384 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/modules/module/src/BaseConfigBuilder.ts Updated imports to use .js extensions and improved JSDoc documentation
packages/modules/module/package.json Added "type": "module" and version bump to support ESM
packages/modules/http/src/module.ts Updated authentication method call from acquireToken to acquireAccessToken
packages/modules/http/package.json Updated Zod dependency to version 3.25.76
packages/modules/event/src/event.ts Replaced @note with @remarks in JSDoc comments
packages/modules/context/src/* Extensive documentation improvements and type safety enhancements
packages/dev-server/src/* New development server package with comprehensive configuration options
packages/dev-portal/src/* New development portal package for local development
packages/cli/src/* Major refactoring with improved utilities and type definitions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@odinr odinr merged commit 8fffbfb into main Aug 27, 2025
12 checks passed
@odinr odinr deleted the next branch August 27, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧨 breaking changes 🐞 bug Something isn't working 🚧 chore maintaines work, (update deps, workflos ...) 💾 CLI fusion framework CLI 👨🏻‍🍳 cookbooks 📚 documentation Improvements or additions to documentation 🚀 feature New feature or request 🧬 Modules 👾 React 🛠️ utils packages related to utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants