Skip to content

Conversation

@rajsite
Copy link
Member

@rajsite rajsite commented Dec 10, 2025

Pull Request

🀨 Rationale

Moves UnitFormat to a standalone npm library and modifies it to be usable from both browser and node applications.

πŸ‘©β€πŸ’» Implementation

  • Added @ni/unit-format using node esm compliant import paths
  • Breaking: Renamed types to align with folder layout and with nimble components naming conventions, see discussion.
    • Did regex searches for \w+unitformat and \w+unitscale which are the primary uses of the public api for missed renames

πŸ§ͺ Testing

  • Added jasmine node and karma browser tests
  • Draft SystemLinkShared PR, looks like usage was well-encapsulated so trivial change

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed. Added README and Contributing for library.

@rajsite rajsite mentioned this pull request Dec 31, 2025
10 tasks
@rajsite rajsite marked this pull request as ready for review December 31, 2025 07:50
@rajsite rajsite requested a review from jattasNI December 31, 2025 07:51
@rajsite
Copy link
Member Author

rajsite commented Jan 2, 2026

@jattasNI ready for review, won't bypass since it's a breaking change and to review the public api export names (i.e. biggest thing to focus on is the nimble-components and nimble-angular imports of @ni/unit-format)

Copy link
Contributor

@jattasNI jattasNI left a comment

Choose a reason for hiding this comment

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

What an absolute unit of a PR!

{
"name": "@ni/unit-format",
"version": "0.0.1",
"description": "Utilities to write parameterized jasmine tests",
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy-pasted description could use an update

"version": "0.0.1",
"description": "Utilities to write parameterized jasmine tests",
"keywords": [

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could populate keywords (some suggestions: units, formatting, nimble, engineering, metric, si, volts, degrees, bytes) or just delete the empty array.

@@ -0,0 +1,20 @@
// Note: This file should be kept in sync with other copies of global-type-extensions.d.ts in the monorepo

// This file has modifications to global types used for nimble-components builds:
Copy link
Contributor

Choose a reason for hiding this comment

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

Double checking: it's intentional that this is a new copy of the file and not a rename of the one in nimble-components?

Also, it looks like this might have been fixed so maybe we can delete these soon. I didn't track down whether we've uptaken that version yet. If you don't feel like it either, could you at least file a tech debt issue?

https://github.com/microsoft/TypeScript/pull/56902/files#diff-8cd7de35e3e99beffd3c7f2e8e537e6073b41bc1c10caff2e41be7c97a3c3595R20

https://github.com/search?q=repo%3Amicrosoft%2FTypeScript%20roundingpriority&type=code

{
"type": "major",
"comment": "First release of `@ni/unit-format` πŸŽ‰",
"packageName": "@ni/unit-format",
Copy link
Contributor

Choose a reason for hiding this comment

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

If any Skyline packages end up depending on this directly, reminder to add it to the npm Renovate config. I'm guessing they won't though, since nimble-angular should be re-exporting everything they need.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants