Skip to content

Commit f44f59b

Browse files
author
Fabian Stoehr
committed
chore: resolve mr conflicts
2 parents 143452b + 05194d8 commit f44f59b

File tree

508 files changed

+11581
-13630
lines changed

Some content is hidden

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

508 files changed

+11581
-13630
lines changed

.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: 50 additions & 6 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,9 +85,12 @@
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",
49-
"testing-library/no-render-in-setup": [
93+
"testing-library/no-render-in-lifecycle": [
5094
"error",
5195
{
5296
"allowTestingFrameworkSetupHook": "beforeEach"

.github/workflows/node.js.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
node-version: [16.x, 18.x, 19.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 }}

CONTRIBUTING.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1-
This document serves as a reference for the Mirador community and others interested in the project. It aims to outline agreed upon practices that are used in the development and maintenance of the Mirador software.
1+
This document serves as a reference for the Mirador community and others interested in the project. It aims to outline agreed-upon practices that are used in the development and maintenance of the Mirador software.
2+
23

34
## Contributing to Mirador
4-
Contributions to Mirador are always welcome, however, it will always be helpful to begin any large change by submitting an issue or engaging with the Mirador community. For more on this, see [plugin architecture](#plugin-architecture). Mirador 3.0 and beyond adheres to [semantic versioning](https://semver.org/) so that adopters and contributors can better understand what changes can be expected in released versions of the software.
55

6-
All contributions should be submitted as a [GitHub pull request](https://help.github.com/articles/about-pull-requests/) to the `master` branch. Pull requests must be reviewed and accepted by another Mirador maintainer and pass all continuous integration checks. Contributions should have tests for the feature or bug fix, documentation and should conform to the Mirador agreed upon coding style. Contributions should not include a “built” version of Mirador, this will help in reducing merge conflicts.
6+
Contributions to Mirador are always welcome!
7+
8+
It is always helpful to begin any large change by submitting an issue or engaging with the Mirador community. Mirador 3.0 and beyond adheres to [semantic versioning](https://semver.org/) so that adopters and contributors can better understand what changes can be expected in released versions of the software.
9+
10+
All contributions should be submitted as a [GitHub pull request](https://help.github.com/articles/about-pull-requests/) to the master branch. Pull requests must be reviewed and accepted by another Mirador maintainer and pass all continuous integration checks. Contributions should have tests for the feature or bug fix, documentation, should maintain high code coverage, and should conform to the Mirador agreed-upon coding style. Contributions should not include a “built” version of Mirador—this will help to reduce merge conflicts.
11+
12+
### Code of Conduct
13+
Everyone interacting in this community is expected to follow the [Mirador Code of Conduct](https://github.com/ProjectMirador/mirador/blob/master/CODE_OF_CONDUCT.md).
14+
15+
### Accessibility
16+
Mirador 3 aims to comply with the [Web Content Accessibility Guidelines (WCAG) 2.1 AA](https://www.w3.org/WAI/standards-guidelines/wcag/). These guidelines, authored by the W3C and legally adopted [internationally](https://www.w3.org/WAI/policies/?q=wcag-20), are comprehensive and provide the success criteria designers and developers need to build accessible web applications.
17+
18+
Mirador’s documentation wiki offers [additional information, tools, and resources](https://github.com/ProjectMirador/mirador/wiki/M3-Accessibility-Guidelines-for-Contributors) for testing your contributions against accessibility criteria before submitting pull requests.
719

820
### Adding dependencies
9-
Careful consideration should be given when adding software dependencies to Mirador. During the code review process, new dependencies may be evaluated on the following considerations:
10-
- added size of the dependency
11-
- whether or not that dependency is maintained and tested
12-
- how the dependency may interact with Mirador embedded in other environments
21+
Careful consideration should be given when adding software dependencies to Mirador. During the code review process, new dependencies may be evaluated on the following considerations:
1322

14-
As a general rule, any dependencies added should not be committed directly, but should use a package manager to require the dependency.
23+
- added size of the dependency
24+
- whether or not that dependency is maintained and tested
25+
- how the dependency may interact with Mirador embedded in other environments
26+
27+
As a general rule, dependencies added should not be committed directly, but should instead use a package manager to require the dependency.
1528

1629
Dependencies should also be scoped (both for style and script) so that they do not interact with a containing application.
1730

1831
### Coding style
19-
Mirador has adopted the [AirBnb JavaScript Style Guide](https://github.com/airbnb/javascript) as its agreed upon coding style for all contributions. This helps us ensure a consistent codebase with higher readability.
32+
Mirador has adopted the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) as its agreed-upon coding style for all contributions. This helps us ensure a consistent codebase with higher readability.
33+
2034
### Testing
21-
Mirador should be well tested at several different levels. A component or class should be tested individually (unit tests) and the interaction of that component or class with other parts should also be tested (integration tests).
35+
Mirador should be well-tested at several different levels. A component or class should be tested individually (unit tests) and the interaction of that component or class with other parts should also be tested (integration tests).
36+
2237
### Documentation
2338
Added or modified code should be appropriately documented using JSDoc comments and established project conventions.
2439

40+
### Plugin architecture
41+
Mirador 3 shifted to a plugin architecture to better support the wide array of uses of Mirador. This allows for the design to accommodate plugins in a more focused way. It also allows the community to maintain the core components while giving developers the freedom to develop new and innovative plugins. Your contribution might fit nicely as a Mirador plugin. For more on plugins, please see [Mirador 3 Plugins](https://github.com/ProjectMirador/mirador/wiki/Mirador-3-plugins) and [Creating a Mirador 3 Plugin](https://github.com/ProjectMirador/mirador/wiki/M3---Creating-a-Mirador-plugin) in the wiki.
42+
43+
### Support
44+
If you have questions, please check the [wiki](https://github.com/ProjectMirador/mirador/wiki), add a [discussion](https://github.com/ProjectMirador/mirador/discussions) question, post on the #mirador channel of the [IIIF Slack workspace](http://iiif.slack.com/), or join a Mirador community call (see #mirador for call details). Slack and community calls are also both great places to meet users and maintainers.
45+
2546
### Plugin architecture
2647
Mirador 3 shifted to a plugin architecture to better support the wide array of uses of Mirador. This allows for the design to accommodate plugins in more focused way. It also allows the community to maintain the core components while giving developers the freedom to develop new and innovative plugins. Your contribution might fit nicely as a Mirador plugin.

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>

0 commit comments

Comments
 (0)