Skip to content

Commit b1af7a3

Browse files
authored
Merge branch 'dev' into configs-in-examples
2 parents acd6a49 + fad6547 commit b1af7a3

410 files changed

Lines changed: 20564 additions & 18187 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.

.github/workflows/build-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: NPM build + test
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:
@@ -25,3 +25,6 @@ jobs:
2525

2626
- run: npm ci
2727
- run: npm run build
28+
# Disable AppArmor namespace behavior that breaks tests:
29+
- run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
30+
- run: npm test

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint code
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Setup Node
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: '18'
15+
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install npm dependencies
20+
run: npm install
21+
22+
- name: Lint code
23+
run: npm run lint
24+
25+
- name: Auto-commit fixes
26+
uses: EndBug/add-and-commit@v9
27+
with:
28+
default_author: github_actions
29+
add: "['src/']"

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
4646

4747
- run: npm ci
48+
- run: npm run prepublishOnly
4849

4950
- uses: JS-DevTools/npm-publish@v3
5051
with:

.github/workflows/update-docs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Update Documentation
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Setup Node
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: '18'
15+
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install npm dependencies
20+
run: npm install
21+
22+
- name: Build documentation
23+
run: npm run docs
24+
25+
- name: Auto-commit fixes
26+
uses: EndBug/add-and-commit@v9
27+
with:
28+
default_author: github_actions
29+
add: "['docs/']"

COMMUNITY_TEAM.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
# UV Community Team
22

3-
UV community team members help shepherd the community. They are here to help mentor newcomers, review pull requests, and facilitate issue discussions.
3+
The Universal Viewer [Governance Document](https://github.com/UniversalViewer/universalviewer/blob/dev/GOVERNANCE.md) explains how the project's open source community operates.
44

5-
## Primary Role Descriptions
6-
7-
### Supporting Success of the Project & Its Contributors
5+
The [Contribution Guide](https://github.com/UniversalViewer/universalviewer/blob/dev/CONTRIBUTING.md) explains some of the more technical aspects of participating in the project.
86

9-
- Responding to newcomer questions in [Slack](http://universalviewer.io/#contact) and on GitHub.
10-
- Helping select tasks for newcomers or other community members who are unsure of where to start.
11-
- Reviewing pull requests, with a goal of three (3) reviews per PR.
12-
- Where possible, helping bring a PR to a final acceptable state, based on engineering review.
13-
- Providing useful feedback in issues.
7+
All community members are expected to adhere to the project's [Code of Conduct](https://github.com/UniversalViewer/universalviewer/blob/dev/CODE_OF_CONDUCT.md).
148

15-
### Building a Healthy and Inclusive Community
9+
This page expands upon some specific roles that members of the community may wish to take on.
1610

17-
- Leading by example, through adherence to [Mozilla's Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/) ("CPG").
18-
- [Looking for and reporting any violations of the Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/reporting/).
19-
- Ensuring opportunities for all levels of contribution, confidence, and background.
11+
## Primary Role Descriptions
2012

2113
### Active Community Team Members
2214

2315
Active Community Members are visibly active in our Slack and/or GitHub channels. We identify active members as being those whom contributors and staff can most count on for a response within 2-3 days.
2416

17+
These individuals are willing and able to help with some or all of the following tasks:
18+
19+
- Responding to newcomer questions in [Slack](http://universalviewer.io/#contact) and on GitHub.
20+
- Helping select tasks for newcomers or other community members who are unsure of where to start.
21+
- Reviewing pull requests.
22+
- Where possible, helping bring a PR to a final acceptable state, based on engineering review.
23+
- Providing useful feedback in issues.
24+
2525
| | (Ordered alphabetically, by first name) |
2626
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
27-
| ![Demian](https://avatars.githubusercontent.com/demiankatz?s=460&v=4) | **[Demian](https://github.com/demiankatz)** is Director of Library Technologies and has been at Falvey Memorial Library in some capacity since 2009, living in Philadelphia US. Ask Demian about: <ul><li>Universal Viewer</li><li>TypeScript</li><li>IIIF</li></ul> |
27+
| ![Demian](https://avatars.githubusercontent.com/demiankatz?s=460&v=4) | **[Demian](https://github.com/demiankatz)** is Director of Library Technologies and has been at Villanova University's Falvey Library in some capacity since 2009, living near Philadelphia in the US. Ask Demian about: <ul><li>Universal Viewer</li><li>TypeScript</li><li>IIIF</li></ul> |
2828
| ![Edward](https://avatars.githubusercontent.com/edsilv?s=460&v=4) | **[Edward](https://github.com/edsilv)** is an applications developer at [mnemoscene](https://mnscene.io), living in Brighton UK. Ask Edward about: <ul><li>React</li><li>three.js</li><li>Universal Viewer</li><li>TypeScript</li><li>IIIF</li></ul> |
2929

30-
### Joining the Team
30+
### Translation Team
31+
32+
The Universal Viewer's interface has been translated into several languages. If you have language skills and would like to assist in adding support for a new language or helping to maintain an existing one, please join the #translations channel in the project's Slack.
33+
34+
## Joining the Team
3135

3236
We welcome active contributors to join the UV team. Specifically, we are looking for contributors with:
3337

@@ -37,8 +41,6 @@ We welcome active contributors to join the UV team. Specifically, we are looking
3741

3842
To apply, simply contact one of our staff or community team members via Slack or email, and we'll get right back to you.
3943

40-
We embrace diversity, and invite people from any and all backgrounds to get involved in the UV project. We don't discriminate based on family status, gender, gender-identity, marital status, sexual orientation, sex, age, ability, race and/or ethnicity, national origin, socioeconomic status, religion, geographic location, or any other dimension of diversity.
41-
4244
### Review Periods
4345

44-
Once per year, we'll check in with our team members (both _active_ and _on break_) to ensure they are feeling supported, and to check if they will remain active on our team for the coming months. If we do not hear back from members at check-in time, they will be transitioned to an alumni role.
46+
Once per year, we'll check in with our team members (both _active_ and _on break_) to ensure they are feeling supported, and to check if they will remain active on our team for the coming months. If we do not hear back from members at check-in time, they will be transitioned to an alumni role. Alumni will be acknowledged here as thanks for their past service and are still welcome to participate in the community, but they are no longer expected to respond quickly to inquiries or meet other specific standards of community service. Alumni can have their names entirely removed from the list by request.

CONTRIBUTING.md

Lines changed: 61 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
# Contribution guide
22

3-
### Installing dependencies
3+
## Installing dependencies
44

55
Before you can build the UV, we assume the following list of software is already installed in your system
66

77
- Git
88
- Node 18 or higher
99
- Npm 8.1.1 or higher
1010

11-
### Fork repository
11+
## Forking the repository
1212

13-
In order to contribute to the UV, you must have a github account so you can push code and create a new Pull Request (PR).
13+
In order to contribute to the UV, you must have a GitHub account so you can push code and create a new Pull Request (PR).
1414

15-
Once you are all setup, following the Github's guide of how to fork a repository: https://guides.github.com/activities/forking/
15+
Once you are all setup, following the GitHub's guide of how to fork a repository: https://guides.github.com/activities/forking/
1616

17-
1. Clone the `universalviewer` repository:
17+
1. Clone the `universalviewer` repository (or your fork):
1818

1919
`git clone https://github.com/UniversalViewer/universalviewer.git`
2020

21-
1. On the command line, go in to the `universalviewer` folder
21+
1. On the command line, navigate to the `universalviewer` folder:
2222

23-
`cd universalviewer`
23+
`cd universalviewer`
2424

25-
1. Run
25+
1. To install dependencies, run:
2626

2727
`npm install`
2828

@@ -34,35 +34,53 @@ To build the debug version of the viewer, just run (on the command line, in the
3434

3535
This will compile the project using webpack and serve the examples on `localhost:8080`
3636

37-
## Distribution Builds
37+
## Building for distribution
3838

3939
To build the distribution version of the UV, just run (on the command line, in the `universalviewer` folder):
4040

4141
npm run build
4242

43-
#### 2. Open `universalviewer` folder in your IDE
43+
When this process completes, your build can be found in the `dist` folder under your `universalviewer` folder.
44+
45+
## Code Architecture
4446

4547
UV source code lives inside the `/src/` folder.
4648

4749
Here is a [diagram](https://docs.google.com/drawings/d/1i484Jd32FoLwtE5uvkBA6l5LV-DioSOZDIWD0WfhWl8/edit?usp=sharing) showing the overall architecture of the project.
4850

49-
#### 3. Run test suite
51+
## Running the test suite
5052

5153
Before commiting your changes make sure tests are passing:
5254

5355
```
5456
npm test
5557
```
5658

57-
> Note: the development server must be running (`npm start`)
59+
> Note: the test suite runs its own server on port 4444 for browser-based testing; be sure that you have built the latest code (e.g. using `npm run build`) before running tests to ensure that you are testing the right changes.
5860
5961
> Tests are written using [Jest](https://jestjs.io/)
6062
61-
#### 4. Create a branch and commit
63+
## Project branch strategy
64+
65+
This project's branch strategy is based on the [Gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). To summarize:
66+
67+
- Every feature should be developed in its own branch.
68+
- Completed features should be merged into the `dev` branch, which represents the bleeding edge of stable development.
69+
- While a release is in testing, a short-lived `release-X.Y.Z` branch is created to isolate fixes from new feature development.
70+
- When a release is completed, the `release-X.Y.Z` branch is merged into `dev` and the corresponding `release-X.Y` branch, then the `dev` branch is merged into the `main` branch, which represents the most recent stable release of the project.
71+
- Long-lived `release-X.Y` branches are retained to allow backporting of fixes.
72+
73+
See the release process below for more details.
74+
75+
Please target the `dev` branch when opening pull requests against the project, except when contributing a bug fix to an active `release-X.Y.Z` branch.
76+
77+
### Creating a branch and committing
78+
79+
After making your changes to the code in the dev branch, you can...
6280

6381
```bash
6482
# Create a git branch
65-
git checkout -b my-improvement
83+
git checkout -b feature/my-improvement
6684

6785
# Add changes
6886
git add .
@@ -71,29 +89,40 @@ git add .
7189
git commit -m "fix(component): message"
7290
```
7391

74-
#### 5. Create a release
92+
After pushing your new branch to your fork, you can create a PR; see: https://guides.github.com/activities/forking/
7593

76-
<!-- ```bash
77-
git commit -m "Release v1.2.3"
78-
git tag v1.2.3
79-
git push origin main v1.2.3
80-
``` -->
94+
## Creating a release
8195

82-
Checkout the `main` branch, and ensure it is up-to-date.
96+
### Pre-Release Planning
8397

84-
Run `npm version [major | minor | patch]` for example:
98+
Before a release can be made, some planning is required:
8599

86-
```bash
87-
npm version patch
88-
```
100+
1. The [Universal Viewer Steering Group](https://github.com/UniversalViewer/universalviewer/wiki/Steering-Group) is responsible for determining when a new release is needed (for example, because a sprint has completed, or because a major fix or feature has been contributed) and for identifying a Release Manager (any Steering Group member with rights to bypass GitHub branch protection rules) to manage the technical parts of the process. The community is welcome to reach out to members of the Steering Group to propose/request a release at any time.
101+
2. Once a release is decided upon, its version number must be determined. The project uses [semantic versioning](https://semver.org/), so given version X.Y.Z, we will increment Z for fixes (patch release), Y for new features (minor release), or X for backward-incompatible changes (major release).
102+
3. If outstanding work must be completed to ensure a stable release, a milestone for the new version will be created in GitHub and all relevant outstanding issues/PRs assigned to it, so that estimation can be performed to set a realistic release date (this could be done at steering group and/or community call meetings). If work is already complete, the release candidate process can begin immediately.
89103

90-
This will update the `package.json` version and create a git tag. Then push both the main/tag.
104+
### Release Candidate Process
91105

92-
```bash
93-
git push origin main v0.0.8
94-
```
106+
A series of Release Candidates should be created and tested to ensure that the final release is stable. Note that the examples in the steps below assume that Git is set up with an `upstream` remote pointing at the main Universal Viewer repository and an `origin` remote pointing at the Release Manager's fork. Replace X.Y.Z in all steps with the version determined in step 2 of Pre-Release Planning.
107+
108+
1. When it's time to begin the release process, the Release Manager will create a `release-X.Y.Z` branch off of `dev`: `git checkout dev ; git checkout -b release-X.Y.Z ; git push --set-upstream upstream release-X.Y.Z`
109+
2. The Release Manager should next create a pull request against the new branch containing the result of using NPM to bump the version: `git checkout -b release-X.Y.Z-rc1 ; npm version X.Y.Z-rc1 ; git push --set-upstream origin release-X.Y.Z-rc1`. When creating the PR on GitHub, be sure that you target the appropriate release branch, not `dev`. This PR can be merged immediately; its purpose is to create an easily accessible public preview and a public forum for discussion of the RC. The description of this pull request should highlight major changes and areas where testing is needed; you can use the GitHub compare tool to review commits -- e.g. `https://github.com/UniversalViewer/universalviewer/compare/main...release-X.Y.Z` will show all commits added between the last stable release and the new release-in-progress.
110+
3. The release tag created during step 2 should be pushed to the main GitHub repository to trigger publishing of the release candidate to NPM: `git push upstream vX.Y.Z-rc1`
111+
4. Next, the Steering Group will announce the release candidate and offer an appropriate testing window (usually 1-2 weeks, depending on scope/complexity of changes) for community feedback. During this window, community members are encouraged to build the new version, try it out in their environments, and raise issues/pull requests if they encounter problems.
112+
5. If problems were found during the testing window, they will be evaluated by the Steering Group, and as soon as any critical bugs are fixed, steps 1-4 will be repeated with an incremented "rc" number (e.g. X.Y.Z-rc2) to ensure that no problems remain.
113+
6. Once the release candidate is deemed stable by the Steering Group, it will be promoted to the formal release. After the RC pull request is merged, the full release can be published.
114+
115+
### Making a Normal Release
116+
117+
Once a stable release is ready to be published, these steps can be followed by the Release Manager:
118+
119+
1. On the `release-X.Y.Z` branch, run `npm version X.Y.Z` (replacing "X.Y.Z" with the actual number of the new version) to appropriately update `package.json` and create a Git tag.
120+
2. Merge the `release-X.Y.Z` branch into both `dev` and the matching `release-X.Y` branch. Create the `release-X.Y` branch if it does not already exist. The `release-X.Y` branch will be long-lived, used to create backported patch releases as needed; the `release-X.Y.Z` branch will be deleted as part of the release process, as it is no longer needed.
121+
3. Merge the `release-X.Y` branch into the `main` branch, so that `main` continues to point to the most recent stable release.
122+
4. All changed/deleted branches and newly-created release tags must be pushed to GitHub; e.g. `git push origin main dev v4.1.0 release-4.1 :release-4.1.0`. (Note the colon on `:release-4.1.0` -- this deletes the short-lived release branch while updating all of the long-lived branches).
123+
5. At this point, a GitHub action will recognize the new version tag and publish the package to NPM.
124+
6. Don't forget to create a release with appropriate release notes through the GitHub web interface to make the new version more visible.
95125

96-
Then the GitHub action will pick up the tag and publish it to NPM.
126+
### Backporting a Bug Fix
97127

98-
Create a PR:
99-
https://guides.github.com/activities/forking/
128+
If there is a need to fix a bug in an older version of the code, bug fix pull requests should be created against the appropriate `release-X.Y` branch(es). After these are merged and tested, releases can be published from the appropriate release branch(es) by running `npm version patch` and then pushing the updated files and new release tag to GitHub. There should be no need to merge from `release-X.Y` branches forward to the `dev` branch when fixes are backported.

0 commit comments

Comments
 (0)