Skip to content

Commit

Permalink
LTSVIEWER-315 Upgrading packages to secure versions. (#10)
Browse files Browse the repository at this point in the history
* LTSVIEWER-315 Upgrading packages to secure versions.

* LTSVIEWER-315 updating version to 1.0.2.
  • Loading branch information
phil-plencner-hl authored Jan 27, 2025
1 parent bc30eea commit e3a27d1
Show file tree
Hide file tree
Showing 18 changed files with 10,088 additions and 11,787 deletions.
Binary file removed .DS_Store
Binary file not shown.
39 changes: 39 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to npmjs on release
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
token: ${{ secrets.ACCESS_TOKEN }}

- run: |
git config user.name "Github Action"
git config user.email actions@github.com
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci

- name: Create new version
run: |
TAG_NAME="${GITHUB_REF##*/}"
npm version "$TAG_NAME"
git push origin HEAD:${{ github.event.release.target_commitish }}
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/coverage
/demo/dist
/es
/lib
/node_modules
/umd
dist
es
node_modules
npm-debug.log*

.idea/
.DS_Store
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/hydrogen
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: false

language: node_js
node_js:
- 10
- 18

before_install:
- npm install codecov.io coveralls
Expand All @@ -12,5 +12,4 @@ after_success:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

branches:
only:
- master
only:
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,42 @@
# mirador-hide-nav-plugin
A Mirador 3 plugin that hides viewer navigation manifest-defined single images.

## Requirements

- [NVM](https://github.com/nvm-sh/nvm)

## Setup

1. Run `nvm use` to ensure your version of matches that in the `.nvmrc` file
2. Run `npm i` to install dependencies
3. Use one of the [NPM scripts](#npm-scripts) to perform the actions described below.

## NPM scripts

The following are some useful scripts can be ran using `npm run <script>`. A full list can be seen in [package.json](./package.json)

| Script | Description |
| ------- | -------------------------------------------------------------------------------------------------------------------------- |
| `clean` | Removes the `dist` directories |
| `build` | Builds the source files into the `./dist` directory |
| `serve` | Runs a local web server where the plugin can be viewed in a vanilla Mirador instance (helpful for testing and development) |
| `test` | Runs the automated test suites

## Installing in Mirador

The `mirador-hide-nav-plugin` requires an instance of Mirador 3. Visit the [Mirador wiki](https://github.com/ProjectMirador/mirador/wiki) to learn how to [install an existing plugin](https://github.com/ProjectMirador/mirador/wiki/Mirador-3-plugins#installing-an-existing-plugin) and for additional information about plugins.

Package you will need to install:

```bash
npm i @harvard-lts/mirador-hide-nav-plugin
```

## Contribute
Mirador's development, design, and maintenance is driven by community needs and ongoing feedback and discussion. Join us at our regularly scheduled community calls, on [IIIF slack #mirador](http://bit.ly/iiif-slack), or the [mirador-tech](https://groups.google.com/forum/#!forum/mirador-tech) and [iiif-discuss](https://groups.google.com/forum/#!forum/iiif-discuss) mailing lists. To suggest features, report bugs, and clarify usage, please submit a GitHub issue.

[build-badge]: https://img.shields.io/travis/projectmirador/mirador-share-plugin/master.png?style=flat-square
[build]: https://travis-ci.org/projectmirador/mirador-share-plugin

[npm-badge]: https://img.shields.io/npm/v/mirador-share-plugin.png?style=flat-square
[npm]: https://www.npmjs.org/package/mirador-share-plugin
12 changes: 12 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": "auto"
}
],
["@babel/preset-react", { "runtime": "automatic" }]
]
}

17 changes: 17 additions & 0 deletions demo/demoEntry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Mirador from "mirador/dist/es/src/index";
import Plugin from "../src/index";

document.addEventListener("DOMContentLoaded", () => {
const config = {
id: "mirador",
windows: [
{
manifestId: "https://iiif.lib.harvard.edu/manifests/ids:10274486",
},
]
};

const plugins = [...Plugin];

Mirador.viewer(config, plugins);
});
23 changes: 23 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test</title>
<style>
body {
margin: 0;
padding: 0;
}
#mirador {
height: 100vh;
width: 100vw;
}
</style>
<script src="demo.js"></script>
</head>
<body>
<div id="mirador"></div>
</script>
</body>
</html>
13 changes: 0 additions & 13 deletions demo/src/index.js

This file was deleted.

21 changes: 21 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @type {import('jest').Config} */
module.exports = {
testEnvironment: "jsdom",
transformIgnorePatterns: ["node_modules/(?!mirador)/", "node_modules/pdiiif"],
setupFilesAfterEnv: ["@testing-library/jest-dom", "./setupTests"],
// collectCoverage: true,
// coverageDirectory: "coverage",
// verbose: true,
// testRegex: "(/tests/.*|\\.(test|spec))\\.jsx?$",
// moduleFileExtensions: ["js", "json", "jsx", "node"],
// coverageThreshold: {
// global: {
// branches: 30,
// functions: 90,
// lines: 90,
// statements: 90,
// },
// },
// // setupFiles: ["./setupTests"],
};

Loading

0 comments on commit e3a27d1

Please sign in to comment.