Skip to content

Esm modules fix#1677

Open
Roaders wants to merge 9 commits intomainfrom
esm-modules-fix
Open

Esm modules fix#1677
Roaders wants to merge 9 commits intomainfrom
esm-modules-fix

Conversation

@Roaders
Copy link
Contributor

@Roaders Roaders commented Sep 25, 2025

Describe your change

This is an initial attempt to fis the module formats of the libraries published from this repo. I think that the current issues with the published packages are:

  • despite using ESM2022 module format the tpye of the package is not marked as module - this means that node does not know that it should treat the files as mjs rather than cjs
  • module resolution is not set to NodeNext which means that we do not specify extensions on our imports and esm consuming apps will not be able to consume the files (unless bundler magic deals with this which I think webpack and angular build systems do)

To fix these issues this PR:

  • marks published libraries as "type": "module"
  • sets module resolution to "NodeNext"
  • adds extensions to imports

Related Issue

fixes #1609

Contributor License Agreement

  • I acknowledge that a contributor license agreement is required and that I have one in place or will seek to put one in place ASAP.

Review Checklist

  • Issue: If a change was made to the FDC3 Standard, was an issue linked above?
  • CHANGELOG: Is a CHANGELOG.md entry included?
  • API changes: Does this PR include changes to any of the FDC3 APIs (DesktopAgent, Channel, PrivateChannel, Listener, Bridging)?
    • Docs & Sources: If yes, were both documentation (/docs) and sources updated?

      JSDoc comments on interfaces and types should be matched to the main documentation in /docs
    • Conformance tests: If yes, are conformance test definitions (/toolbox/fdc3-conformance) still correct and complete?

      Conformance test definitions should cover all required aspects of an FDC3 Desktop Agent implementation, which are usually marked with a MUST keyword, and optional features (SHOULD or MAY) where the format of those features is defined
    • Schemas: If yes, were changes applied to the Bridging and FDC3 for Web protocol schemas?

      The Web Connection protocol and Desktop Agent Communication Protocol schemas must be able to support all necessary aspects of the Desktop Agent API, while Bridging must support those aspects necessary for Desktop Agents to communicate with each other
      • If yes, was code generation (npm run build) run and the results checked in?

        Generated code will be found at /src/api/BrowserTypes.ts and/or /src/bridging/BridgingTypes.ts
  • Context types: Were new Context type schemas created or modified in this PR?
    • Were the field type conventions adhered to?
    • Was the BaseContext schema applied via allOf (as it is in existing types)?
    • Was a title and description provided for all properties defined in the schema?
    • Was at least one example provided?
    • Was code generation (npm run build) run and the results checked in?

      Generated code will be found at /src/context/ContextTypes.ts
  • Intents: Were new Intents created in this PR?

THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE FINOS CORPORATE CONTRIBUTOR LICENSE AGREEMENT.

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

@Roaders Roaders requested a review from a team as a code owner September 25, 2025 16:43
@netlify
Copy link

netlify bot commented Sep 25, 2025

Deploy Preview for fdc3 ready!

Name Link
🔨 Latest commit 9410d8c
🔍 Latest deploy log https://app.netlify.com/projects/fdc3/deploys/699484d24378ab000754fefc
😎 Deploy Preview https://deploy-preview-1677.preview-fdc3.finos.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Roaders Roaders marked this pull request as draft September 25, 2025 16:43
@Roaders
Copy link
Contributor Author

Roaders commented Sep 25, 2025

Currently this PR successfully builds all packages but it does not run the demo app when npm run dev is executed. There are issues with the demo web server.

The testing and fdc3-conformance packages are not converted to ESM as there were issues there with some imports (AJV seems to be used in a non standard way that ESM was not happy with) not working and other issues. As these are not publiushed I think this is OK.

I still need to get the demo server working correctly but I ran out of time today.

@Roaders
Copy link
Contributor Author

Roaders commented Sep 25, 2025

I imagine this PR will be a merge nightmare as it has touched so many files.... I don't know what the best way to deal with that will be.

@kriswest
Copy link
Contributor

kriswest commented Oct 9, 2025

@Roaders

I imagine this PR will be a merge nightmare as it has touched so many files.... I don't know what the best way to deal with that will be.

I don't think it will be that bad as most of the changes are in the imports into files. It would pick up conflicts with new additions, but won't with many other PRs. Regardless, we should try and get this done and merged ASAP.

@hughtroeger has offered to try and get this tested as a solution for @enewsome's issue #1609

However, the tests / cucumber see quite unhappy with the change and need further work. The SAST scan failing is down to the rename of a script file that needs to be in .semgrepignore here:

FDC3/.semgrepignore

Lines 4 to 5 in 16100f5

s2tQuicktypeUtil.js
t2sQuicktypeUtil.js
(.js extension changes to .cjs)

@Roaders
Copy link
Contributor Author

Roaders commented Oct 9, 2025

yes I think that the tests will be an issue. Converting to ESM is usually fairly painless other than things liks jest / karma / webpack / ts-node. I have already replaced ts-node with tsx as it's much happier with esm but have no idea how hard it will be to convince the testing framework to work - especially as I have no experience with this test runner.

@Roaders
Copy link
Contributor Author

Roaders commented Oct 14, 2025

I've spent a bit more time on this today and it's not good news I am afraid....
Apparently everything now builds correctly with no errors.... but unfortunately when I try to run the demo app I get runtime errors about not being able to find certain imports so more work is obviously required there.
The other issue that could take much longer to fix is the tests as @kriswest mentioned before. Cucumber does apparently support esm but I don't know if nyc does (I have never come across nyc before and have not done anything with cucumber for a very long time).
After a quick google it seems that nyc is supposed to support ESM through node's own esm loader. I have not had much luck with that which is why I have replaces ts-node with tsx.

This could end up being a much bigger job that we first thought.

@Roaders
Copy link
Contributor Author

Roaders commented Nov 4, 2025

I have confirmed that the fixes that I have put into this PR so far have fixed my issues when trying to run vitest in my local app. This is the case where my lib depends on @morgan-stanley/fdc3-web which depends on @finos/fdc3 and fails due to there being no file extensions on any of the imports.

The fix is good.... we "just" need to get the rest of the tooling in the mono repo working in an esm environment.

@kriswest
Copy link
Contributor

kriswest commented Nov 4, 2025

The fix is good.... we "just" need to get the rest of the tooling in the mono repo working in an esm environment.

Many thanks for your work on this issue @Roaders! @hughtroeger and @enewsome it would be worth confirming if this branch resolves some of your issues...

@Roaders which tooling most needs looking at?

  • You mentioned nyc,
  • semgrep needs its ignore file updating (s2tQuicktypeUtil.cjs change extension so is not being ignored),
  • CVE scanning with audit.js is broken on main (@robmoffat can we get FINOS' help with that - could be an account issue: https://github.com/finos/FDC3/actions/runs/19058409074/job/54433286532)
  • Lots seems broken in the tests - so I assume this is the area most in need of looking at...

@hughtroeger
Copy link
Contributor

Also want to express thanks for working on this @Roaders. We will test the changes in this PR and get back to you shortly.

@Roaders
Copy link
Contributor Author

Roaders commented Nov 6, 2025

I'm afraid that to test it you're going to have to check it out locally and build it locally then install each of the built packages one by one in your app. This worked for me. It's the tests that are not working in the PR.

@hughtroeger
Copy link
Contributor

@Roaders understood, I have built this branch and npm packed each of the individual packages and handed them over to @enewsome for testing. Thanks!

@Roaders Roaders force-pushed the esm-modules-fix branch 3 times, most recently from e9f62f0 to 6ae93bb Compare January 15, 2026 12:40
@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Jan 15, 2026

Coverage Report

Commit: 9410d8c
Base: main@f8c4493

Type Base This PR
Total Statements Coverage  96.57%  95.54% (-1.03%)
Total Branches Coverage  85.75%  90.52% (+4.77%)
Total Functions Coverage  95.32%  96.86% (+1.54%)
Total Lines Coverage  96.65%  95.54% (-1.11%)
Details (changed files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/Messaging.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/index.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts 86.45% 77.77% 100% 86.45%
packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts 80% 100% 75% 80%
packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts 98.35% 94.64% 100% 98.35%
packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts 98.93% 82.35% 100% 98.93%
packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts 97.18% 62.5% 100% 97.18%
packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts 100% 87.5% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DesktopAgentEventListener.ts 89.85% 87.5% 100% 89.85%
packages/fdc3-agent-proxy/src/listeners/EventListener.ts 3.44% 0% 0% 3.44%
packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts 95.89% 83.33% 100% 95.89%
packages/fdc3-agent-proxy/src/listeners/RegisterableListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/UserChannelContextListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts 95% 100% 75% 95%
packages/fdc3-agent-proxy/src/util/Logger.ts 57.14% 50% 50% 57.14%
packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/index.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/message-port.ts 98.27% 81.81% 100% 98.27%
packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts 96.87% 88.23% 100% 96.87%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 80.95% 100% 100%
packages/fdc3-get-agent/src/strategies/FailoverHandler.ts 100% 81.81% 100% 100%
packages/fdc3-get-agent/src/strategies/HelloHandler.ts 87.27% 83.33% 100% 87.27%
packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts 89.58% 73.33% 100% 89.58%
packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts 98.3% 88% 100% 98.3%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts 91.04% 91.66% 100% 91.04%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts 100% 88.88% 100% 100%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts 100% 90% 100% 100%
packages/fdc3-standard/src/index.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/AppIntent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/AppMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Channel.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/ContextMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/DesktopAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/GetAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/ImplementationMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/IntentMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/IntentResolution.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Methods.ts 94.2% 85.18% 100% 94.2%
packages/fdc3-standard/src/api/PrivateChannel.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/RecommendedChannels.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Types.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/contextConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/intentConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/ChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/IntentResolver.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/FDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/index.ts 0% 0% 0% 0%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts 98.64% 90% 100% 98.64%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/DirectoryInterface.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts 98.13% 89.91% 100% 98.13%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts 92.59% 87.87% 87.5% 92.59%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts 96.88% 95.48% 100% 96.88%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts 98.29% 92.3% 100% 98.29%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts 100% 100% 100% 100%
Details (all files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/Messaging.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/index.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/apps/AppSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts 86.45% 77.77% 100% 86.45%
packages/fdc3-agent-proxy/src/channels/ChannelSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts 80% 100% 75% 80%
packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts 98.35% 94.64% 100% 98.35%
packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts 98.93% 82.35% 100% 98.93%
packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/heartbeat/HeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/IntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts 97.18% 62.5% 100% 97.18%
packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts 100% 87.5% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DesktopAgentEventListener.ts 89.85% 87.5% 100% 89.85%
packages/fdc3-agent-proxy/src/listeners/EventListener.ts 3.44% 0% 0% 3.44%
packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts 95.89% 83.33% 100% 95.89%
packages/fdc3-agent-proxy/src/listeners/RegisterableListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/UserChannelContextListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts 95% 100% 75% 95%
packages/fdc3-agent-proxy/src/util/AbstractFDC3Logger.ts 83.56% 69.23% 91.66% 83.56%
packages/fdc3-agent-proxy/src/util/Logger.ts 57.14% 50% 50% 57.14%
packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/Fdc3Version.ts 0% 0% 0% 0%
packages/fdc3-get-agent/src/index.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/apps/NoopAppSupport.ts 0% 100% 100% 0%
packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/message-port.ts 98.27% 81.81% 100% 98.27%
packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts 96.87% 88.23% 100% 96.87%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 80.95% 100% 100%
packages/fdc3-get-agent/src/strategies/FailoverHandler.ts 100% 81.81% 100% 100%
packages/fdc3-get-agent/src/strategies/HelloHandler.ts 87.27% 83.33% 100% 87.27%
packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts 89.58% 73.33% 100% 89.58%
packages/fdc3-get-agent/src/strategies/Loader.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts 98.3% 88% 100% 98.3%
packages/fdc3-get-agent/src/strategies/Timeouts.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts 91.04% 91.66% 100% 91.04%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts 100% 88.88% 100% 100%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts 100% 90% 100% 100%
packages/fdc3-get-agent/src/ui/NullChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/NullIntentResolver.ts 100% 100% 66.66% 100%
packages/fdc3-get-agent/src/util/Logger.ts 62.5% 100% 50% 62.5%
packages/fdc3-get-agent/src/util/Uuid.ts 100% 100% 100% 100%
packages/fdc3-standard/src/index.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/AppIdentifier.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/AppIntent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/AppMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Channel.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/ContextMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/DesktopAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/DesktopAgentIdentifier.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/DisplayMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Errors.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Events.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/GetAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Icon.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Image.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/ImplementationMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/IntentMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/IntentResolution.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Listener.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Methods.ts 94.2% 85.18% 100% 94.2%
packages/fdc3-standard/src/api/PrivateChannel.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/RecommendedChannels.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Types.ts 100% 100% 100% 100%
packages/fdc3-standard/src/context/ContextType.ts 100% 100% 100% 100%
packages/fdc3-standard/src/intents/Intents.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/contextConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/intentConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/typeHelpers.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/ChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/Connectable.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/IntentResolver.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/FDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/index.ts 0% 0% 0% 0%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts 98.64% 90% 100% 98.64%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/DirectoryInterface.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts 98.13% 89.91% 100% 98.13%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts 92.59% 87.87% 87.5% 92.59%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts 96.88% 95.48% 100% 96.88%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts 98.29% 92.3% 100% 98.29%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts 100% 100% 100% 100%

@Roaders
Copy link
Contributor Author

Roaders commented Jan 15, 2026

this pr now switches all of the testing over to vitest. It seems much faster to me, is a much more "standard" testing setup and works with esm. jest has been completely removed and nyc has been removed from most places. It is still used in the root package.json to generate a report. I guess we could probably do that another way but I'm not sure what it's doing so I didn't want to touch that.

@Roaders Roaders marked this pull request as ready for review January 15, 2026 12:49
@Roaders Roaders force-pushed the esm-modules-fix branch 3 times, most recently from e0cec0b to 010e6df Compare February 5, 2026 11:06
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

@Roaders
Copy link
Contributor Author

Roaders commented Feb 6, 2026

woohoo! build passing! 😄

I don't know why the static code analysis if failing or how to fix it...

Rebasing this was a pain - took more than an entire morning. It would be good if we could merge this into main in the not too distant future to avoid any more merges or rebasing. I know this is a fairly major change though so it's going to need agreement from everyone.

@Roaders
Copy link
Contributor Author

Roaders commented Feb 6, 2026

still no coverage being reported..... 😞

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

618 passed

@Roaders
Copy link
Contributor Author

Roaders commented Feb 6, 2026

looks like coverage is now fixed 😄

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

618 passed

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

618 passed

@Roaders
Copy link
Contributor Author

Roaders commented Feb 6, 2026

fixed the static code analysis by ignoring a testing step. I assume that we're ok with this? Feel free to revert.

julianna-ciq
julianna-ciq previously approved these changes Feb 17, 2026
Copy link
Contributor

@julianna-ciq julianna-ciq left a comment

Choose a reason for hiding this comment

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

Note that I have not tested this code, just reviewed it. I have a couple of sanity check questions for @Roaders , but as long as:

  • The tests still pass
  • ESM consumers can still use the built files

Then it lgtm

"@finos/fdc3-standard": "2.2.2-beta.1"
},
"devDependencies": {
"@cucumber/cucumber": "10.3.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Just confirming - was this left in intentionally? I see that the other @cucumber dependencies were removed, as was the cucumber.yml file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, this was unintentional. I will remove. Thanks for spotting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correction: no we are still using a type from @cucumber in some of the steps. Datatable. I had a very quick look to see if we could easily remove it and it doesn't seem so. It's a shame to have a hangover dependency because of one type but I think we'll have to live with this for now.

"test": "tsc && vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"clean": "rimraf dist cucumber-report.html coverage node_modules test-results.xml",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does vitest generate a cucumber-report.html file? Just want to make sure that if we're cleaning the file, it's being created somewhere. I only saw test-results.xml be created, maybe there's a report step somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am pretty sure that this can be removed as well. I'll double check.

Copy link
Contributor Author

@Roaders Roaders Feb 17, 2026

Choose a reason for hiding this comment

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

tests re-ran and no cucumber-report generated. removed reference

@Roaders
Copy link
Contributor Author

Roaders commented Feb 17, 2026

Note that I have not tested this code, just reviewed it. I have a couple of sanity check questions for @Roaders , but as long as:

  • The tests still pass
  • ESM consumers can still use the built files

Then it lgtm

many thanks for the review @julianna-ciq . Yes the tests still pass (and reported in this pr) and the esm consumers can now consume the files - they were unable to before.

@github-actions
Copy link

618 passed

@github-actions
Copy link

618 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CJS build changes breaking Node consumers

5 participants