Skip to content

Commit 4832b29

Browse files
authored
chore: update dependencies (#2475)
* chore: update dependencies * chore: update ts config for v5 * chore: update deps * chore: update deps * chore: replace ttypescript with ts-patch beta * fix: appease typescript * fix: align typescript versions * style: workaround chai-semantic-dom-diff lint error * test: fix test runner tsconfig settings * feat(tools): allUpdates test helper * test: use allUpdates helper
1 parent 52b336a commit 4832b29

File tree

24 files changed

+9491
-5532
lines changed

24 files changed

+9491
-5532
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@patternfly/pfe-tools": minor
3+
---
4+
**Test Helpers**: Added `allUpdates` test helper, which waits until an element
5+
completely finishes updating.
6+
7+
```js
8+
const element = await fixture(html`<my-el></my-el>`);
9+
await allUpdates(element);
10+
```

.github/workflows/commitlint.yml

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
with:
3131
fetch-depth: 0
3232

33+
# https://github.com/wagoid/commitlint-github-action/issues/560#issuecomment-1277659864
34+
- run: rm tsconfig.json
35+
3336
- uses: wagoid/commitlint-github-action@v5
3437
id: commitlint
3538
continue-on-error: true
@@ -58,48 +61,8 @@ jobs:
5861
script: |
5962
const results = ${{ steps.commitlint.outputs.results }};
6063
const titleGood = ${{ steps.prTitle.outputs.success }};
61-
62-
const totalErrors = results.reduce((a, r) => a + r.errors.length, 0);
63-
const totalWarnings = results.reduce((a, r) => a + r.warnings.length, 0);
64-
65-
const header = `
66-
## 👕 Commitlint Problems for this PR: ${!titleGood ? '' : `
67-
68-
**The PR title conforms to conventional commit style**
69-
70-
👉 **Make sure the PR is squashed into a single commit using the PR title** 👈`}
71-
72-
🔎 found ${totalErrors} errors, ${totalWarnings} warnings
73-
ℹ️ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
74-
`;
75-
76-
const comment = results.reduce((acc, result) => {
77-
if (!result.errors.length && !result.warnings.length) {
78-
return acc;
79-
}
80-
81-
const [firstLine, ...rest] = result.message.split('\n');
82-
83-
const body = rest.join('\n').trim();
84-
const icon = result.errors.length ? '❌' : '⚠️';
85-
const hash = result.hash.substring(0, 8);
86-
87-
return `${acc} ${!body.length ? '\n\n' : `
88-
89-
<details><summary>`}
90-
${hash} - ${firstLine} ${!body.length ? '\n\n' : `\
91-
</summary>
92-
93-
${body}
94-
95-
</details>
96-
97-
`}${result.errors.map(error => `
98-
- ❌ ${error}`).join('')} ${result.warnings.map(warn => `
99-
- ⚠️ ${warn}`).join('')}`;
100-
}, header);
101-
102-
core.setOutput('comment', comment);
64+
const { format } = await import('${{ github.workspace }}/scripts/format-commitlint-messages.js');
65+
return format({ core, results, titleGood });
10366
10467
- name: Notify PR
10568
if: ${{ steps.commitlint.outcome == 'failure' && steps.prTitle.outputs.success == 'false' }}
@@ -109,7 +72,7 @@ jobs:
10972
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11073
header: commitlint
11174
message: |
112-
${{ steps.format.outputs.comment }}
75+
${{ steps.format.outputs.result }}
11376
11477
- name: Fail Job on Error
11578
if: ${{ steps.commitlint.outcome == 'failure' && steps.prTitle.outputs.success == 'false' }}

.github/workflows/tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ jobs:
7979
strategy:
8080
matrix:
8181
node:
82-
- 18
83-
- 19
82+
- '18'
83+
- '19'
84+
# https://github.com/TypeStrong/ts-node/issues/1997
85+
# - '20'
8486
if: |
8587
github.event_name == 'workflow_dispatch'
8688
|| github.event_name == 'push'

core/pfe-core/controllers/floating-dom-controller.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import type { ReactiveController, ReactiveElement } from 'lit';
33
import type { StyleInfo } from 'lit/directives/style-map.js';
44
import type { Options as Offset } from '@floating-ui/core/src/middleware/offset';
55

6-
7-
export { Placement };
6+
export type { Placement };
87

98
import {
109
autoUpdate,

core/pfe-core/controllers/internals-controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class InternalsController implements ReactiveController, ARIAMixin {
1212
declare ariaChecked: ARIAMixin['ariaChecked'];
1313
declare ariaColCount: ARIAMixin['ariaColCount'];
1414
declare ariaColIndex: ARIAMixin['ariaColIndex'];
15-
declare ariaColIndexText: ARIAMixin['ariaColIndexText'];
15+
declare ariaColIndexText: string | null;
1616
declare ariaColSpan: ARIAMixin['ariaColSpan'];
1717
declare ariaCurrent: ARIAMixin['ariaCurrent'];
1818
declare ariaDisabled: ARIAMixin['ariaDisabled'];
@@ -36,7 +36,7 @@ export class InternalsController implements ReactiveController, ARIAMixin {
3636
declare ariaRoleDescription: ARIAMixin['ariaRoleDescription'];
3737
declare ariaRowCount: ARIAMixin['ariaRowCount'];
3838
declare ariaRowIndex: ARIAMixin['ariaRowIndex'];
39-
declare ariaRowIndexText: ARIAMixin['ariaRowIndexText'];
39+
declare ariaRowIndexText: string | null;
4040
declare ariaRowSpan: ARIAMixin['ariaRowSpan'];
4141
declare ariaSelected: ARIAMixin['ariaSelected'];
4242
declare ariaSetSize: ARIAMixin['ariaSetSize'];

core/pfe-core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"test": "wtr --files './test/*.spec.ts' --config ../../web-test-runner.config.js"
5151
},
5252
"dependencies": {
53-
"@floating-ui/dom": "^1.2.3",
54-
"lit": "2.6.1"
53+
"@floating-ui/dom": "^1.2.6",
54+
"lit": "^2.7.2"
5555
},
5656
"repository": {
5757
"type": "git",

elements/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
"wireit": {
7070
"build": {
71-
"command": "ttsc -b . --pretty",
71+
"command": "tspc -b . --pretty",
7272
"dependencies": [
7373
"analyze"
7474
]

elements/pf-accordion/test/pf-accordion.spec.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,7 @@ import { PfAccordion, PfAccordionPanel, PfAccordionHeader } from '@patternfly/el
1010
import { Logger } from '@patternfly/pfe-core/controllers/logger.js';
1111

1212
import '@patternfly/pfe-tools/test/stub-logger.js';
13-
14-
async function allUpdates(element: ReactiveElement) {
15-
let count = 0;
16-
do {
17-
if (count > 100) {
18-
throw new Error('Too Many Updates');
19-
}
20-
await element.updateComplete;
21-
count++;
22-
} while (!await element.updateComplete);
23-
}
13+
import { allUpdates } from '@patternfly/pfe-tools/test/utils.js';
2414

2515
describe('<pf-accordion>', function() {
2616
let element: PfAccordion;
@@ -1019,7 +1009,7 @@ describe('<pf-accordion>', function() {
10191009
<pf-accordion-panel id="panel-2-2" data-index="1-1"></pf-accordion-panel>
10201010
</pf-accordion>
10211011
</pf-accordion-panel>
1022-
1012+
10231013
<pf-accordion-header id="header-3" data-index="2"></pf-accordion-header>
10241014
<pf-accordion-panel id="panel-3" data-index="2"></pf-accordion-panel>
10251015
</pf-accordion>

elements/pf-card/test/pf-card.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('<pf-card>', function() {
137137

138138
describe('accessible', function() {
139139
it('should be accessible in both the light and shadow dom', async function() {
140-
expect(element).to.be.accessible();
140+
await expect(element).to.be.accessible();
141141
});
142142
// TODO: this has been flaky. revisit later
143143
// it('should have an article element wrapper in the shadow dom', async function() {

elements/pf-jump-links/test/pf-jump-links.spec.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,12 @@ import { expect, html, nextFrame } from '@open-wc/testing';
33
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
44
import { sendKeys } from '@web/test-runner-commands';
55

6-
import { PfJumpLinks } from '@patternfly/elements/pf-jump-links/pf-jump-links.js';
6+
import { PfJumpLinks } from '../pf-jump-links.js';
77
import { PfJumpLinksItem } from '../pf-jump-links-item.js';
88
import { PfJumpLinksList } from '../pf-jump-links-list.js';
99

1010
import '@patternfly/pfe-tools/test/stub-logger.js';
11-
12-
async function allUpdates(element: ReactiveElement) {
13-
let count = 0;
14-
do {
15-
if (count > 100) {
16-
throw new Error('Too Many Updates');
17-
}
18-
await element.updateComplete;
19-
count++;
20-
} while (!await element.updateComplete);
21-
}
11+
import { allUpdates } from '@patternfly/pfe-tools/test/utils.js';
2212

2313
describe('<pf-jump-links>', function() {
2414
let element: PfJumpLinks;

0 commit comments

Comments
 (0)