Skip to content

Commit eb4a131

Browse files
author
Fabian Stoehr
committed
chore: resolve mr conflicts
2 parents 1ec5dfc + 05194d8 commit eb4a131

466 files changed

Lines changed: 8826 additions & 10669 deletions

File tree

Some content is hidden

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

.codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
codecov:
2+
coverage:
3+
precision: 1
4+
round: up
5+

.eslintrc

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,59 @@
11
{
2-
"env": {
3-
"jest/globals": true
2+
"parserOptions": {
3+
"ecmaVersion": 2022,
4+
"sourceType": "module",
5+
"ecmaFeatures": {
6+
"jsx": true
7+
}
48
},
5-
"extends": ["airbnb","react-app", "plugin:jest-dom/recommended", "plugin:testing-library/react"],
9+
"extends": [
10+
"airbnb",
11+
"plugin:react/recommended",
12+
"plugin:react-hooks/recommended",
13+
"plugin:testing-library/react"
14+
],
615
"globals": {
716
"page": true,
8-
"document": true
17+
"document": true,
18+
"vi": true
919
},
10-
"plugins": ["jest", "jest-dom", "react", "react-hooks", "testing-library"],
20+
"plugins": [
21+
"react",
22+
"react-hooks",
23+
"testing-library"
24+
],
1125
"rules": {
1226
"import/no-unresolved": [
1327
2, { "ignore": ["test-utils"] }
1428
],
1529
"import/prefer-default-export": "off",
1630
"no-console": "off",
31+
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }],
32+
"no-unused-vars": "off",
33+
"no-undef": "off",
34+
"no-restricted-syntax": ["warn", "WithStatement"],
35+
"no-restricted-globals": ["error"],
36+
"eqeqeq": ["warn", "smart"],
37+
"no-use-before-define": [
38+
"warn",
39+
{
40+
"functions": false,
41+
"classes": false,
42+
"variables": false
43+
},
44+
],
45+
"no-mixed-operators": [
46+
"warn",
47+
{
48+
"groups": [
49+
["&", "|", "^", "~", "<<", ">>", ">>>"],
50+
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
51+
["&&", "||"],
52+
["in", "instanceof"],
53+
],
54+
"allowSamePrecedence": false,
55+
},
56+
],
1757
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
1858
"require-jsdoc": ["error", {
1959
"require": {
@@ -35,6 +75,7 @@
3575
"default-param-last": "off",
3676
"arrow-parens": "off",
3777
"import/no-anonymous-default-export": "off",
78+
"import/no-extraneous-dependencies": "off",
3879
"max-len": ["error", {
3980
"code": 120,
4081
"ignoreComments": true,
@@ -44,6 +85,9 @@
4485
}],
4586
"react/jsx-uses-react": "off",
4687
"react/react-in-jsx-scope": "off",
88+
"react/require-default-props": [2, {
89+
"functions": "defaultArguments"
90+
}],
4791
"react-hooks/exhaustive-deps": "error",
4892
"testing-library/render-result-naming-convention": "off",
4993
"testing-library/no-render-in-lifecycle": [

.github/workflows/node.js.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ on:
77
push:
88
branches: [ master ]
99
pull_request:
10-
branches: [ master, mui5 ]
10+
branches: [ master ]
1111

1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
node-version: [18.x, 20.x]
17+
node-version: [18.x, 20.x, 22.x]
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525
- run: npm install
2626
- run: npm test
2727
- name: Upload coverage to Codecov
28-
uses: codecov/codecov-action@v3
28+
uses: codecov/codecov-action@v5
29+
env:
30+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
⚠️ This project is for Mirador 3, the latest version of Mirador. For Mirador 2, please see [ProjectMirador/mirador2](https://github.com/projectmirador/mirador2) or legacy documentation on the [Mirador 2 wiki](https://github.com/ProjectMirador/mirador-2-wiki/wiki). Please note that the community's focus is on Mirador 3, and are unlikely to accept pull requests or provide support for Mirador 2.
21
# Mirador
32
![Node.js CI](https://github.com/ProjectMirador/mirador/workflows/Node.js%20CI/badge.svg) [![codecov](https://codecov.io/gh/ProjectMirador/mirador/branch/master/graph/badge.svg)](https://codecov.io/gh/ProjectMirador/mirador)
43

@@ -75,15 +74,21 @@ store.getState()
7574
```
7675

7776
## Running the tests
77+
We use Vitest to run our test suite.
7878

7979
```sh
80-
$ npm test # For headless CI=true npm test
80+
$ npm test
8181
```
8282

83-
or to continually watch the source files
83+
You can see the helpful Vitest UI in your browser by running Vitest with the `--ui` flag. To pass the flag through to npm run the following:
8484

8585
```sh
86-
$ npm run test:watch
86+
$ npm test -- --ui
87+
```
88+
89+
You can run Vitest without the additional linting and size checks in our `npm test` command. You can also test a single file:
90+
```sh
91+
$ npx vitest __tests__/integration/mirador/tests/sequence-switching.test.js --ui
8792
```
8893

8994
## Linting the project
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
<html>
2-
<title>Error</title>
3-
<body>
4-
<p>Something went wrong</p>
5-
</body>
6-
</html>
1+
{
2+
"test": "Broken"
3+
}

__tests__/integration/mirador/annotations.test.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

__tests__/integration/mirador/auth.html

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,10 @@
99
</head>
1010
<body>
1111
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
12-
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
13-
<script type="text/javascript">
14-
var miradorInstance = Mirador.viewer({
15-
id: 'mirador',
16-
windows: [
17-
{
18-
manifestId: 'https://purl.stanford.edu/ds199xg9454/iiif/manifest',
19-
},
20-
{
21-
manifestId: 'https://edsilv.github.io/test-manifests/auth1-degraded.json'
22-
},
23-
{
24-
manifestId: 'https://edsilv.github.io/test-manifests/auth1-standard.json'
25-
}
26-
],
27-
});
12+
<script type="module">
13+
import Mirador from '../../../src';
14+
import config from './mirador-configs/auth.js';
15+
Mirador.viewer(config);
2816
</script>
2917
</body>
3018
</html>

__tests__/integration/mirador/basic.test.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

__tests__/integration/mirador/blank.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99
</head>
1010
<body>
1111
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
12-
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
13-
<script type="text/javascript">
14-
var miradorInstance = Mirador.viewer({
15-
id: 'mirador',
16-
windows: [],
17-
theme: {
18-
transitions: window.location.port === '4488' ? { create: () => 'none' } : {},
19-
},
20-
});
12+
<script type="module">
13+
import Mirador from '../../../src';
14+
import config from './mirador-configs/blank.js';
15+
Mirador.viewer(config);
2116
</script>
2217
</body>
2318
</html>

__tests__/integration/mirador/collections.html

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,10 @@
99
</head>
1010
<body>
1111
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
12-
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
13-
<script type="text/javascript">
14-
var miradorInstance = Mirador.viewer({
15-
id: 'mirador',
16-
windows: [
17-
{
18-
collectionPath: [
19-
"https://www.e-codices.unifr.ch/metadata/iiif/collection.json",
20-
"https://www.e-codices.unifr.ch/metadata/iiif/collection/stabs.json"
21-
],
22-
manifestId: "https://www.e-codices.unifr.ch/metadata/iiif/stabs-StAlban-DD1-1580/manifest.json"
23-
},
24-
{
25-
manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/collection.json'
26-
}
27-
],
28-
catalog: [
29-
{ manifestId: "https://www.e-codices.unifr.ch/metadata/iiif/collection.json" },
30-
]
31-
});
12+
<script type="module">
13+
import Mirador from '../../../src';
14+
import config from './mirador-configs/collections.js';
15+
Mirador.viewer(config);
3216
</script>
3317
</body>
3418
</html>

0 commit comments

Comments
 (0)