Skip to content

Commit 412acc5

Browse files
authored
Dependency Updates for December 2024 (#2485)
# Pull Request ## 🤨 Rationale Updates dependencies manually to address build issues revealed by #2482 #2481 #2480. Found that just updating dependencies by rebuilding the lock fails the build which means the [repo is in a bad state](#1479 (comment)) and that should be addressed quickly. ## 👩‍💻 Implementation - Update major deps and rebuild lock - Found that the now [deprecated tiptap link validate](https://tiptap.dev/docs/editor/extensions/marks/link#validate-deprecated) function is expected to still function with [backwards compat](ueberdosis/tiptap#5812) however there seems to be a regression as it [fails our build by allowing autolinking of unexpected protocols](https://github.com/ni/nimble/actions/runs/12110590706/job/33761233944#step:17:613). - Switched from tiptap link validate to [shouldAutoLink](https://tiptap.dev/docs/editor/extensions/marks/link#shouldautolink) as described by docs. That seems to not fail the build. - Pushed the min semver range version up for all the tiptap / prosemirror packages as otherwise it seems to[ fail build when type checking libraries](ueberdosis/tiptap#5867). **NOTE**: It seems to be transitive dependency type issues that will fail builds, I think it's possible that minimal upgrades done by renovate may hit issues in app updates. If an app adopting latest these changes fails to build it may need to rebuild the lock files in a clean workspace to align transitive deps on latest versions and avoid library type check issues. - Updates to [prettier 3.4](https://prettier.io/blog/2024/11/26/3.4.0.html) resulting in lots of changes. ## 🧪 Testing Rely on CI. ## ✅ Checklist - [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
1 parent d3bff75 commit 412acc5

File tree

89 files changed

+2990
-2755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2990
-2755
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Update rich text dependencies",
4+
"packageName": "@ni/nimble-components",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Updates from lint changes",
4+
"packageName": "@ni/spright-components",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

package-lock.json

+914-711
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/nimble-components/CONTRIBUTING.md

+44-44
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ Before building a new component, 3 specification documents need to be created:
8181

8282
If a component is not ready for general use, it should be marked as "incubating" to indicate that status to clients. A component could be in this state if any of the following are true:
8383

84-
- It is still in development.
85-
- It is missing important features like interaction design, visual design, or accessibility.
84+
- It is still in development.
85+
- It is missing important features like interaction design, visual design, or accessibility.
8686

8787
Incubating contributions may compromise on the above capabilities but they still must abide by other repository requirements. For example:
8888

89-
- Start development with a spec describing the high level plan and what's in or out of scope
90-
- Coding conventions (element naming, linting, code quality)
91-
- Unit and Chromatic test coverage
92-
- Storybook documentation
89+
- Start development with a spec describing the high level plan and what's in or out of scope
90+
- Coding conventions (element naming, linting, code quality)
91+
- Unit and Chromatic test coverage
92+
- Storybook documentation
9393

9494
To mark a component as incubating:
9595

@@ -187,17 +187,17 @@ Component CSS should follow the patterns described in [CSS Guidelines](/packages
187187

188188
It is common in web development to represent variations of control states using css classes. While it is possible to apply custom styles to web components based on user-added CSS classes, i.e. `:host(.my-class)`, it is not allowed in nimble for the following reasons:
189189

190-
- The `class` attribute is a user-configured attribute. For native HTML elements it would be surprising if setting a class, i.e. `<div class="my-class">`, caused the element to have a new style that the user did not define in their stylesheet. However, other attributes are expected to have element defined behavior, i.e. `<div hidden>`.
191-
- Classes set in the `class` attribute are not as well-typed across frameworks. Users have to contort a bit to use exported enums for CSS class strings while attributes and attribute values are well-typed in wrappers.
192-
- Binding to updates in the `class` attribute is more difficult / not an expected pattern. This makes it difficult to forward configured properties to inner elements. Alternatively, binding to attributes and forwarding bound attribute values in templates is a well supported pattern.
190+
- The `class` attribute is a user-configured attribute. For native HTML elements it would be surprising if setting a class, i.e. `<div class="my-class">`, caused the element to have a new style that the user did not define in their stylesheet. However, other attributes are expected to have element defined behavior, i.e. `<div hidden>`.
191+
- Classes set in the `class` attribute are not as well-typed across frameworks. Users have to contort a bit to use exported enums for CSS class strings while attributes and attribute values are well-typed in wrappers.
192+
- Binding to updates in the `class` attribute is more difficult / not an expected pattern. This makes it difficult to forward configured properties to inner elements. Alternatively, binding to attributes and forwarding bound attribute values in templates is a well supported pattern.
193193

194194
##### Attribute naming convention
195195

196-
- Do not use attribute names that conflict with native attribute names:
197-
- Avoid any names in the [MDN HTML attribute reference list](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#attribute_list) (unless the attribute is trying to match that behavior exactly).
198-
- Do a best effort search in relevant working groups for new attributes that may be coming to avoid, i.e. https://github.com/openui and https://github.com/whatwg.
199-
- Avoid any names that are [reserved words](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_words) in JavaScript.
200-
- Use lower-kebab-case for attributes and enum values that are part of a component's public API.
196+
- Do not use attribute names that conflict with native attribute names:
197+
- Avoid any names in the [MDN HTML attribute reference list](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#attribute_list) (unless the attribute is trying to match that behavior exactly).
198+
- Do a best effort search in relevant working groups for new attributes that may be coming to avoid, i.e. https://github.com/openui and https://github.com/whatwg.
199+
- Avoid any names that are [reserved words](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_words) in JavaScript.
200+
- Use lower-kebab-case for attributes and enum values that are part of a component's public API.
201201

202202
```ts
203203
@attr({ attribute: 'error-text' })
@@ -206,19 +206,19 @@ It is common in web development to represent variations of control states using
206206

207207
##### Attribute common name patterns
208208

209-
- For attributes that control the visibility of a part, use either the boolean attribute `<part>-visible` or `<part>-hidden`, i.e. `icon-visible` or `icon-hidden`.
209+
- For attributes that control the visibility of a part, use either the boolean attribute `<part>-visible` or `<part>-hidden`, i.e. `icon-visible` or `icon-hidden`.
210210

211211
The default configuration should be the most common configuration and the boolean attribute should be added for the less common alternate configuration that differs from the default. An element should NOT implement both `-visible` and `-hidden` attributes for a given `<part>`, only one or the other.
212212

213-
- Use the `appearance` attribute to represent mutually exclusive visual modes of a component that represent large style changes. Likely implemented with an attribute behavior.
213+
- Use the `appearance` attribute to represent mutually exclusive visual modes of a component that represent large style changes. Likely implemented with an attribute behavior.
214214

215215
An `appearance-variant` attribute may also be used to represent smaller mutually exclusive variations of an appearance. Likely implemented with CSS attribute selectors.
216216

217217
##### Attribute common value patterns
218218

219-
- When applicable, the default value for an attribute that is allowed to be unconfigured should be first in the enum object, have a descriptive enum name, such as `default`, `none`, etc, based on the context, and be the enum value `undefined`.
220-
- Boolean attributes must always default to `false`. Otherwise, the configuration in HTML becomes meaningless, as both `<element></element>` and `<element bool-attr></element>` result in `bool-attr` being set to `true`.
221-
- States representing the following ideas should use those names: `success`, `error`, `warning`, `information`.
219+
- When applicable, the default value for an attribute that is allowed to be unconfigured should be first in the enum object, have a descriptive enum name, such as `default`, `none`, etc, based on the context, and be the enum value `undefined`.
220+
- Boolean attributes must always default to `false`. Otherwise, the configuration in HTML becomes meaningless, as both `<element></element>` and `<element bool-attr></element>` result in `bool-attr` being set to `true`.
221+
- States representing the following ideas should use those names: `success`, `error`, `warning`, `information`.
222222

223223
Avoid shorthands, i.e. `warn`, `info` and avoid alternatives, i.e. `pass`, `fail`, `invalid`.
224224

@@ -270,8 +270,8 @@ Components can also consider exposing an API that checks the validity of the com
270270

271271
It is acceptable to throw exceptions in production code in other situations. For example:
272272

273-
- when a case gets hit that should be impossible, like an invalid enum value.
274-
- from a component method when it shouldn't be called in the component's current state, like `show()` on a dialog that is already open.
273+
- when a case gets hit that should be impossible, like an invalid enum value.
274+
- from a component method when it shouldn't be called in the component's current state, like `show()` on a dialog that is already open.
275275

276276
#### Comments
277277

@@ -281,8 +281,8 @@ At a minimum all classes should have a block comment and ultimately all parts of
281281

282282
Accessibility is a requirement for all new components. For the Nimble design system, this means
283283

284-
- Focus states are defined for every element and work on all browsers.
285-
- Colors have sufficient contrast across all themes.
284+
- Focus states are defined for every element and work on all browsers.
285+
- Colors have sufficient contrast across all themes.
286286

287287
This is a collaborative effort between development and design. Designers will do their due diligence to make sure that designs promote accessiblity, and developers must ensure that each design is implemented and tested across browsers and themes.
288288

@@ -359,11 +359,11 @@ Consider whether or not the `delegatesFocus` shadow DOM option should be set to
359359

360360
Some guidelines to follow when deciding whether or not to set `delegatesFocus`:
361361

362-
- For a component built on top of a fast-foundation component, check the fast-foundation component's README.md to see if the component was built with the expectation that focus will be delegated.
363-
- Non-interactive elements should keep `delegatesFocus` with the default `false` value.
364-
- Interactive controls that contain no focusable components in the shadow root should keep `delegatesFocus` with the default `false` value.
365-
- Interactive controls that contain focusable components in the shadow root should set `delegatesFocus` to `true`.
366-
- Refer to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#parameters) or [this table](https://github.com/TakayoshiKochi/tabindex-focus-navigation-explainer/blob/master/TabindexFocusNavigationExplainer.md#proposed-solution) for more information.
362+
- For a component built on top of a fast-foundation component, check the fast-foundation component's README.md to see if the component was built with the expectation that focus will be delegated.
363+
- Non-interactive elements should keep `delegatesFocus` with the default `false` value.
364+
- Interactive controls that contain no focusable components in the shadow root should keep `delegatesFocus` with the default `false` value.
365+
- Interactive controls that contain focusable components in the shadow root should set `delegatesFocus` to `true`.
366+
- Refer to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#parameters) or [this table](https://github.com/TakayoshiKochi/tabindex-focus-navigation-explainer/blob/master/TabindexFocusNavigationExplainer.md#proposed-solution) for more information.
367367

368368
If it is determined that the component should delegate focus, it can be configured as shown below:
369369

@@ -423,26 +423,26 @@ The following commands can be run from the `nimble` directory:
423423

424424
### Development commands
425425

426-
- `npm run tdd:watch -w @ni/nimble-components`: Starts a process for building the components and running the test suite on file changes.
426+
- `npm run tdd:watch -w @ni/nimble-components`: Starts a process for building the components and running the test suite on file changes.
427427

428428
This command runs headlessly. See [Debugging commands](#debugging-commands) if you need to see the browser or set breakpoints while running.
429429

430-
- `npm run tdd -w @ni/nimble-components`: Similar to the corresponding `tdd:watch` command but only runs once. Useful for infrastructure changes which do not trigger the watch command.
430+
- `npm run tdd -w @ni/nimble-components`: Similar to the corresponding `tdd:watch` command but only runs once. Useful for infrastructure changes which do not trigger the watch command.
431431

432432
### Debugging commands
433433

434-
- `npm run test-chrome:debugger -w @ni/nimble-components`: When run opens a Chrome window that can be used for interactive debugging. Using dev tools set breakpoints in tests and refresh the page, etc.
434+
- `npm run test-chrome:debugger -w @ni/nimble-components`: When run opens a Chrome window that can be used for interactive debugging. Using dev tools set breakpoints in tests and refresh the page, etc.
435435

436436
You can also take the page url and open it in a different browser to test interactively.
437437

438-
- `npm run test-webkit:debugger -w @ni/nimble-components`: Similar to `test-chrome:debugger` but for WebKit. Can be run on Windows.
438+
- `npm run test-webkit:debugger -w @ni/nimble-components`: Similar to `test-chrome:debugger` but for WebKit. Can be run on Windows.
439439

440440
### Test utilities
441441

442442
Test utilities located in [`/src/testing`](/packages/nimble-components/src/testing) may be used for testing:
443443

444-
- performed inside the `@ni/nimble-components` package or
445-
- by other packages in the monorepo or users consuming the built package
444+
- performed inside the `@ni/nimble-components` package or
445+
- by other packages in the monorepo or users consuming the built package
446446

447447
Test utilties located in [`/src/utilities/tests`](/packages/nimble-components/src/utilities/tests) are just for tests in the `@ni/nimble-components` package and are not shared externally.
448448

@@ -471,22 +471,22 @@ Most user-visible strings displayed by Nimble components are provided by the cli
471471

472472
The current label providers:
473473

474-
- `nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
475-
- `nimble-label-provider-rich-text`: Used for labels for the rich text components
476-
- `nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
474+
- `nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
475+
- `nimble-label-provider-rich-text`: Used for labels for the rich text components
476+
- `nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
477477

478478
The expected format for label token names is:
479479

480-
- element/type(s) to which the token applies, e.g. `number-field` or `table`
481-
- This may not be an exact element name, if this label applies to multiple elements or will be used in multiple contexts
482-
- component part/category (optional), e.g. `column-header`
483-
- specific functionality or sub-part, e.g. `decrement`
484-
- the suffix `label` (will be omitted from the label-provider properties/attributes)
480+
- element/type(s) to which the token applies, e.g. `number-field` or `table`
481+
- This may not be an exact element name, if this label applies to multiple elements or will be used in multiple contexts
482+
- component part/category (optional), e.g. `column-header`
483+
- specific functionality or sub-part, e.g. `decrement`
484+
- the suffix `label` (will be omitted from the label-provider properties/attributes)
485485

486486
Components using localized labels should document them in Storybook. To add a "Localizable Labels" section:
487487

488-
- Their story `Args` should extend `LabelUserArgs`
489-
- Call `addLabelUseMetadata()` and pass their declared metadata object, the applicable label provider tag, and the label tokens that they're using
488+
- Their story `Args` should extend `LabelUserArgs`
489+
- Call `addLabelUseMetadata()` and pass their declared metadata object, the applicable label provider tag, and the label tokens that they're using
490490

491491
## Component naming
492492

packages/nimble-components/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ Most user-visible strings displayed by Nimble components are provided by the cli
110110

111111
The current label providers:
112112

113-
- `nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
114-
- `nimble-label-provider-rich-text`: Used for labels for the rich text components
115-
- `nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
113+
- `nimble-label-provider-core`: Used for labels for all components without a dedicated label provider
114+
- `nimble-label-provider-rich-text`: Used for labels for the rich text components
115+
- `nimble-label-provider-table`: Used for labels for the table (and table sub-components / column types)
116116

117117
If a client is localized, it should:
118118

119-
- Add the `label-provider` element(s) as children of their root theme provider:
119+
- Add the `label-provider` element(s) as children of their root theme provider:
120120
```html
121121
<body>
122122
<nimble-theme-provider theme="light">
@@ -127,14 +127,14 @@ If a client is localized, it should:
127127
</nimble-theme-provider>
128128
</body>
129129
```
130-
- For each label token on the label provider API, localize the English string, and set the corresponding HTML attribute or JS property on the label provider to the localized values. A list of all label tokens for each label provider (and their corresponding attribute/property names and English strings) can be found in the [Tokens/Label Providers section of Storybook](http://nimble.ni.dev/storybook/?path=/docs/tokens-label-providers--docs).
130+
- For each label token on the label provider API, localize the English string, and set the corresponding HTML attribute or JS property on the label provider to the localized values. A list of all label tokens for each label provider (and their corresponding attribute/property names and English strings) can be found in the [Tokens/Label Providers section of Storybook](http://nimble.ni.dev/storybook/?path=/docs/tokens-label-providers--docs).
131131

132132
## Content Security Policy
133133

134134
When using Nimble in an environment with a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) enabled, the following are known required settings beyond "common" settings (such as the [OWASP Basic non-Strict CSP Policy](https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html#basic-non-strict-csp-policy)) for using Nimble:
135135

136-
- `style-src 'unsafe-inline'` is [needed to support style patterns in the FAST library](https://github.com/microsoft/fast/issues/4510) leveraged by Nimble.
137-
- `worker-src blob:` is needed to support controls that leverage Web Workers (for example the Wafer Map).
136+
- `style-src 'unsafe-inline'` is [needed to support style patterns in the FAST library](https://github.com/microsoft/fast/issues/4510) leveraged by Nimble.
137+
- `worker-src blob:` is needed to support controls that leverage Web Workers (for example the Wafer Map).
138138

139139
## Accessibility
140140

packages/nimble-components/build/generate-icons/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Behavior
44

5-
- Depends on the build output of `nimble-tokens` to generate icon components.
6-
- Generates an icon component file for each icon, and an all-icons.ts file which exports all icon components.
5+
- Depends on the build output of `nimble-tokens` to generate icon components.
6+
- Generates an icon component file for each icon, and an all-icons.ts file which exports all icon components.
77

88
## How to run
99

packages/nimble-components/build/generate-scss/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Behavior
44

5-
- Depends on the build output of the `npm run build-components` command to generate design token names.
6-
- Generates SCSS files in the nimble component dist with the design token names formatted as SCSS properties.
7-
- Generates an SCSS file for fonts that imports from Nimble Tokens.
5+
- Depends on the build output of the `npm run build-components` command to generate design token names.
6+
- Generates SCSS files in the nimble component dist with the design token names formatted as SCSS properties.
7+
- Generates an SCSS file for fonts that imports from Nimble Tokens.
88

99
## How to run
1010

0 commit comments

Comments
 (0)