Skip to content

Commit d8ee3a3

Browse files
authored
WEBDEV-7371: Update ia-activity-indicator, histogram, and search-service (#419)
* Update ia-activity-indicator and histogram * Update import * Update CI * Move eslint-plugin-lit to devDeps * Update search-service * Bump to 2.7.7-alpha.2 * Update search-service to 2.0.0 final * Update node version * Fix modal manager in tests * Fix modal manager in tests * Fix test * 2.7.12-wedev-7371.0 * Bump dependencies * Update dependencies
1 parent 6710c4f commit d8ee3a3

File tree

88 files changed

+4442
-3397
lines changed

Some content is hidden

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

88 files changed

+4442
-3397
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v3
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 16.x
17+
node-version: latest
1818

1919
- name: Install dependencies
2020
run: yarn install
@@ -24,4 +24,4 @@ jobs:
2424

2525
- uses: codecov/codecov-action@v4
2626
with:
27-
token: ${{ secrets.CODECOV_TOKEN }}
27+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/gh-pages-main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
with:
1818
persist-credentials: false
1919

20-
- uses: actions/setup-node@v3
20+
- uses: actions/setup-node@v4
2121
with:
22-
node-version: 16.x
22+
node-version: latest
2323

2424
- name: Install dependencies
2525
run: yarn install

.github/workflows/pr-preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323

24-
- uses: actions/setup-node@v3
24+
- uses: actions/setup-node@v4
2525
with:
26-
node-version: 16.x
26+
node-version: latest
2727

2828
- name: Install and Build
2929
run: |

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage

eslint.config.mjs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
2+
import html from 'eslint-plugin-html';
3+
import tsParser from '@typescript-eslint/parser';
4+
import path from 'node:path';
5+
import { fileURLToPath } from 'node:url';
6+
import js from '@eslint/js';
7+
import { FlatCompat } from '@eslint/eslintrc';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all,
15+
});
16+
17+
export default [
18+
...compat.extends('plugin:@typescript-eslint/recommended'),
19+
{
20+
plugins: {
21+
'@typescript-eslint': typescriptEslint,
22+
html,
23+
},
24+
25+
languageOptions: {
26+
parser: tsParser,
27+
},
28+
29+
settings: {
30+
'import/resolver': {
31+
node: {
32+
extensions: ['.ts', '.tsx'],
33+
moduleDirectory: ['node_modules', 'src', 'demo'],
34+
},
35+
},
36+
},
37+
38+
rules: {
39+
'@typescript-eslint/no-unsafe-function-type': 'warn',
40+
'@typescript-eslint/no-unused-vars': 'warn',
41+
'@typescript-eslint/no-explicit-any': 'warn',
42+
},
43+
},
44+
{
45+
ignores: ['**/*.js', '**/*.mjs', '**/*.d.ts'],
46+
},
47+
{
48+
files: ['**/*.test.ts'],
49+
rules: {
50+
'@typescript-eslint/no-unused-expressions': 'off',
51+
},
52+
},
53+
];

index.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
}
1717
</style>
1818

19-
<script
20-
src="https://polyfill.archive.org/v3/polyfill.min.js?features=scrollIntoView%2CElement.prototype.scrollIntoView"></script>
21-
2219
</head>
2320
<body>
2421
<app-root></app-root>

package.json

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"start": "yarn run prepare && tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
1111
"prepare:ghpages": "rimraf ghpages && yarn run prepare && vite build",
1212
"prepare": "rimraf dist && tsc && husky install",
13-
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
14-
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
13+
"lint": "eslint . && prettier \"**/*.ts\" --check",
14+
"format": "eslint . --fix && prettier \"**/*.ts\" --write",
1515
"circular": "madge --circular --extensions ts .",
1616
"test": "tsc && yarn run lint && yarn run circular && wtr --coverage",
1717
"test:fast": "tsc && wtr --coverage",
@@ -23,48 +23,50 @@
2323
},
2424
"types": "dist/index.d.ts",
2525
"dependencies": {
26-
"@internetarchive/analytics-manager": "^0.1.2",
26+
"@internetarchive/analytics-manager": "^0.1.4",
2727
"@internetarchive/feature-feedback": "^0.1.4",
2828
"@internetarchive/field-parsers": "^0.1.4",
29-
"@internetarchive/histogram-date-range": "1.2.0",
30-
"@internetarchive/ia-activity-indicator": "^0.0.4",
31-
"@internetarchive/ia-dropdown": "1.3.8",
32-
"@internetarchive/infinite-scroller": "1.0.1",
33-
"@internetarchive/modal-manager": "^0.2.8",
34-
"@internetarchive/search-service": "^1.4.2",
29+
"@internetarchive/histogram-date-range": "^1.2.1",
30+
"@internetarchive/ia-activity-indicator": "^0.0.6",
31+
"@internetarchive/ia-dropdown": "^1.3.10",
32+
"@internetarchive/iaux-item-metadata": "^1.0.4",
33+
"@internetarchive/infinite-scroller": "^1.0.1",
34+
"@internetarchive/modal-manager": "^2.0.1",
35+
"@internetarchive/search-service": "^2.0.0",
3536
"@internetarchive/shared-resize-observer": "^0.2.0",
36-
"@lit/localize": "^0.11.2",
37-
"dompurify": "^3.1.7",
38-
"eslint-plugin-lit": "^1.6.1",
39-
"lit": "^2.2.2",
40-
"typescript-cookie": "^1.0.3"
37+
"@lit/localize": "^0.12.2",
38+
"dompurify": "^3.2.4",
39+
"lit": "^2.8.0",
40+
"typescript-cookie": "^1.0.6"
4141
},
4242
"devDependencies": {
4343
"@internetarchive/result-type": "^0.0.1",
44-
"@open-wc/eslint-config": "^8.0.2",
45-
"@open-wc/testing": "^3.0.3",
46-
"@types/dompurify": "^3.0.5",
47-
"@typescript-eslint/eslint-plugin": "^5.3.1",
48-
"@typescript-eslint/parser": "^5.3.1",
49-
"@web/dev-server": "^0.1.28",
50-
"@web/test-runner": "^0.13.22",
51-
"concurrently": "^6.3.0",
52-
"eslint": "^8.2.0",
53-
"eslint-config-prettier": "^8.3.0",
54-
"eslint-plugin-html": "^7.1.0",
55-
"eslint-plugin-import": "^2.25.3",
56-
"eslint-plugin-lit-a11y": "^2.2.0",
57-
"eslint-plugin-no-only-tests": "^3.0.0",
58-
"eslint-plugin-wc": "^1.3.2",
59-
"gh-pages": "^4.0.0",
60-
"husky": "^7.0.0",
61-
"madge": "^7.0.0",
62-
"prettier": "^2.4.1",
63-
"rimraf": "^3.0.2",
64-
"sinon": "^12.0.1",
65-
"tslib": "^2.3.1",
66-
"typescript": "^4.4.4",
67-
"vite": "^2.9.9"
44+
"@open-wc/eslint-config": "^12.0.3",
45+
"@open-wc/testing": "^4.0.0",
46+
"@types/dompurify": "^3.2.0",
47+
"@types/mocha": "^10.0.10",
48+
"@typescript-eslint/eslint-plugin": "^8.27.0",
49+
"@typescript-eslint/parser": "^8.27.0",
50+
"@web/dev-server": "^0.4.6",
51+
"@web/test-runner": "^0.20.0",
52+
"concurrently": "^9.1.2",
53+
"eslint": "^9.22.0",
54+
"eslint-config-prettier": "^10.1.1",
55+
"eslint-plugin-html": "^8.1.2",
56+
"eslint-plugin-import": "^2.31.0",
57+
"eslint-plugin-lit": "^2.0.0",
58+
"eslint-plugin-lit-a11y": "^4.1.4",
59+
"eslint-plugin-no-only-tests": "^3.3.0",
60+
"eslint-plugin-wc": "^3.0.0",
61+
"gh-pages": "^6.3.0",
62+
"husky": "^9.1.7",
63+
"madge": "^8.0.0",
64+
"prettier": "^3.5.3",
65+
"rimraf": "^6.0.1",
66+
"sinon": "^19.0.4",
67+
"tslib": "^2.8.1",
68+
"typescript": "^5.8.2",
69+
"vite": "^6.2.2"
6870
},
6971
"publishConfig": {
7072
"access": "public"

src/app-root.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import {
32
AnalyticsEvent,
43
AnalyticsManager,
@@ -7,7 +6,6 @@ import {
76
SearchService,
87
SearchServiceInterface,
98
SearchType,
10-
StringField,
119
} from '@internetarchive/search-service';
1210
import { html, css, LitElement, PropertyValues, nothing } from 'lit';
1311
import { customElement, property, query, state } from 'lit/decorators.js';
@@ -18,6 +16,7 @@ import type { AnalyticsManagerInterface } from '@internetarchive/analytics-manag
1816
import type { CollectionBrowser } from '../src/collection-browser';
1917

2018
import '../src/collection-browser';
19+
import { StringField } from '@internetarchive/iaux-item-metadata';
2120

2221
@customElement('app-root')
2322
export class AppRoot extends LitElement {
@@ -83,7 +82,7 @@ export class AppRoot extends LitElement {
8382
includeCredentials: false,
8483
baseUrl: params.get('search_base_url') ?? undefined,
8584
servicePath: params.get('search_service_path') ?? undefined,
86-
debuggingEnabled: !!params.get('debugging') ?? undefined,
85+
debuggingEnabled: !!params.get('debugging'),
8786
});
8887
}
8988

@@ -210,7 +209,7 @@ export class AppRoot extends LitElement {
210209
<button
211210
@click=${() => {
212211
const details = this.shadowRoot?.getElementById(
213-
'latest-event-details'
212+
'latest-event-details',
214213
);
215214
details?.classList.toggle('hidden');
216215
}}
@@ -504,7 +503,7 @@ export class AppRoot extends LitElement {
504503
`;
505504
}
506505

507-
private async setPlaceholderType(type: String) {
506+
private async setPlaceholderType(type: string) {
508507
switch (type) {
509508
case 'loading-placeholder':
510509
this.collectionBrowser.baseQuery = '';
@@ -548,11 +547,11 @@ export class AppRoot extends LitElement {
548547
if (target.checked) {
549548
this.collectionBrowser.style.setProperty(
550549
'--infiniteScrollerCellOutline',
551-
'1px solid #33D1FF'
550+
'1px solid #33D1FF',
552551
);
553552
} else {
554553
this.collectionBrowser.style.removeProperty(
555-
'--infiniteScrollerCellOutline'
554+
'--infiniteScrollerCellOutline',
556555
);
557556
}
558557
}
@@ -575,7 +574,7 @@ export class AppRoot extends LitElement {
575574
path: pageUrl.toString(),
576575
},
577576
'',
578-
pageUrl.toString()
577+
pageUrl.toString(),
579578
);
580579
}
581580
}
@@ -600,7 +599,7 @@ export class AppRoot extends LitElement {
600599
async search(params, searchType) {
601600
const searchResponse = await SearchService.default.search(
602601
params,
603-
searchType
602+
searchType,
604603
);
605604
searchResponse.success?.response.results.forEach(result => {
606605
Object.defineProperty(result, 'highlight', {
@@ -638,7 +637,7 @@ export class AppRoot extends LitElement {
638637
async search(params, searchType) {
639638
const searchResponse = await SearchService.default.search(
640639
params,
641-
searchType
640+
searchType,
642641
);
643642
searchResponse.success?.response.results.forEach((result, i) => {
644643
Object.defineProperty(result, 'review', {
@@ -700,7 +699,7 @@ export class AppRoot extends LitElement {
700699
*/
701700
private manageModeChanged(e: CustomEvent<boolean>): void {
702701
const manageCheckbox = this.shadowRoot?.querySelector(
703-
'#enable-management'
702+
'#enable-management',
704703
) as HTMLInputElement;
705704
if (manageCheckbox) manageCheckbox.checked = e.detail;
706705
}
@@ -780,7 +779,7 @@ export class AppRoot extends LitElement {
780779
this.collectionBrowser.appendChild(p);
781780
} else {
782781
this.collectionBrowser.removeChild(
783-
this.collectionBrowser.lastElementChild as Element
782+
this.collectionBrowser.lastElementChild as Element,
784783
);
785784
}
786785
}
@@ -804,7 +803,7 @@ export class AppRoot extends LitElement {
804803
this.collectionBrowser.appendChild(div);
805804
} else {
806805
this.collectionBrowser.removeChild(
807-
this.collectionBrowser.lastElementChild as Element
806+
this.collectionBrowser.lastElementChild as Element,
808807
);
809808
}
810809
}
@@ -826,7 +825,7 @@ export class AppRoot extends LitElement {
826825
this.collectionBrowser.appendChild(p);
827826
} else {
828827
this.collectionBrowser.removeChild(
829-
this.collectionBrowser.lastElementChild as Element
828+
this.collectionBrowser.lastElementChild as Element,
830829
);
831830
}
832831
}
@@ -848,7 +847,7 @@ export class AppRoot extends LitElement {
848847
this.collectionBrowser.appendChild(div);
849848
} else {
850849
const slottedEl = this.collectionBrowser.querySelector(
851-
'[slot="sort-options-left"]'
850+
'[slot="sort-options-left"]',
852851
);
853852
if (slottedEl) this.collectionBrowser.removeChild(slottedEl);
854853
}
@@ -871,7 +870,7 @@ export class AppRoot extends LitElement {
871870
this.collectionBrowser.appendChild(div);
872871
} else {
873872
const slottedEl = this.collectionBrowser.querySelector(
874-
'[slot="sort-options-right"]'
873+
'[slot="sort-options-right"]',
875874
);
876875
if (slottedEl) this.collectionBrowser.removeChild(slottedEl);
877876
}
@@ -882,7 +881,7 @@ export class AppRoot extends LitElement {
882881
this.rowGap = parseFloat(input.value);
883882
this.collectionBrowser.style.setProperty(
884883
'--collectionBrowserRowGap',
885-
`${input.value}rem`
884+
`${input.value}rem`,
886885
);
887886
}
888887

@@ -891,7 +890,7 @@ export class AppRoot extends LitElement {
891890
this.colGap = parseFloat(input.value);
892891
this.collectionBrowser.style.setProperty(
893892
'--collectionBrowserColGap',
894-
`${input.value}rem`
893+
`${input.value}rem`,
895894
);
896895
}
897896

@@ -900,7 +899,7 @@ export class AppRoot extends LitElement {
900899
this.cellWidth = parseFloat(input.value);
901900
this.collectionBrowser.style.setProperty(
902901
'--collectionBrowserCellMinWidth',
903-
`${input.value}rem`
902+
`${input.value}rem`,
904903
);
905904
}
906905

@@ -909,11 +908,11 @@ export class AppRoot extends LitElement {
909908
this.cellHeight = parseFloat(input.value);
910909
this.collectionBrowser.style.setProperty(
911910
'--collectionBrowserCellMinHeight',
912-
`${input.value}rem`
911+
`${input.value}rem`,
913912
);
914913
this.collectionBrowser.style.setProperty(
915914
'--collectionBrowserCellMaxHeight',
916-
`${input.value}rem`
915+
`${input.value}rem`,
917916
);
918917
}
919918

@@ -940,7 +939,7 @@ export class AppRoot extends LitElement {
940939
this.collectionBrowser.enableSortOptionsSlot = true;
941940
} else {
942941
const slottedEl = this.collectionBrowser.querySelector(
943-
'[slot="sort-options"]'
942+
'[slot="sort-options"]',
944943
);
945944
if (slottedEl) this.collectionBrowser.removeChild(slottedEl);
946945
this.collectionBrowser.enableSortOptionsSlot = false;

0 commit comments

Comments
 (0)