Skip to content

Commit

Permalink
Update circulation web for ThePalaceProject repo (#1)
Browse files Browse the repository at this point in the history
* Install a particular node version.
* Update package.json to use TPP repos.
* Update workflows
* Ignore github files
* Remove old travis config
* Update name
* Update node to version 12.
  • Loading branch information
jonathangreen authored May 11, 2021
1 parent d3bdb5a commit 415e85b
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 69 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy Documentation
on:
push:
# If we are pushing to a release branch (main or master), then we need
# to deploy the documentation to GitHub Pages.
branches:
- main
- master

jobs:
gh-pages:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Install Node.js 💻
uses: actions/setup-node@v2
with:
node-version: 12

- name: Install 🔧
run: npm ci

- name: Build docs 📃
run: npm run build-docs

- name: Deploy docs to GitHub pages 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
BRANCH: gh-pages
FOLDER: docs
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Release

on:
# The build will be triggered when we publish a release
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2

- name: Install Node.js 💻
uses: actions/setup-node@v2
with:
node-version: 12

- name: Install locked dependencies 🔧
run: npm ci

- name: Version ✅
run: npm version --no-git-tag-version ${{ github.event.release.tag_name }}

- name: Test 🧪
env:
TZ: America/New_York
run: npm test

- name: Publish 📚
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Test & Deploy Documentation
name: Test
on: [push, pull_request]

jobs:
build-test-and-deploy:
test:
runs-on: ubuntu-latest

# We want to run on external PRs, but not on our own internal PRs as they'll be run
Expand All @@ -14,28 +14,16 @@ jobs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Install Node.js 💻
uses: actions/setup-node@v2
with:
persist-credentials: false
node-version: 12

- name: Install locked dependencies 🔧
run: |
npm ci
npm run build --if-present
run: npm ci

- name: Test 🧪
env:
TZ: America/New_York
run: npm test

- name: Build docs 📃
run: npm run build-docs

# If we are merging to a release branch (main or master), then we need
# to deploy the documentation to GitHub Pages.
- name: Deploy docs to GitHub pages 🚀
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ docs

# prettier
build
coverage
coverage

# github
.github
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

25 changes: 6 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "simplified-circulation-web",
"version": "0.4.40",
"description": "Web Front-end for Library Simplified Circulation Manager Admin Interface",
"name": "@thepalaceproject/circulation-admin",
"description": "Admin Interface for The Palace Project Circulation Manager",
"repository": {
"type": "git",
"url": "https://github.com/NYPL-Simplified/circulation-web.git"
"url": "git://github.com/ThePalaceProject/circulation-admin.git"
},
"main": "dist/circulation-web.js",
"author": "NYPL",
"main": "dist/circulation-admin.js",
"author": "The Palace Project",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0",
"npm": ">=5.0.0"
"node": ">=12.0.0",
"npm": ">=7.0.0"
},
"scripts": {
"prepublish": "npm run prod",
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface ConfigurationSettings {

/** The main admin interface application. Create an instance of this class
to render the app and set up routing. */
class CirculationWeb {
class CirculationAdmin {
constructor(config: ConfigurationSettings) {
let div = document.createElement("div");
div.id = "opds-catalog";
Expand Down Expand Up @@ -93,4 +93,4 @@ class CirculationWeb {
}
}

export = CirculationWeb;
export = CirculationAdmin;
6 changes: 3 additions & 3 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module.exports = {
},
output: {
path: path.resolve(__dirname, "./dist"),
filename: "circulation-web.js",
library: "CirculationWeb",
filename: "circulation-admin.js",
library: "CirculationAdmin",
libraryTarget: "umd"
},
plugins: [
Expand All @@ -23,7 +23,7 @@ module.exports = {
// in the browser even if it is never used, so we ignore it:
new webpack.IgnorePlugin(/jsdom$/),
// Extract separate css file.
new MiniCssExtractPlugin({ filename: "circulation-web.css" }),
new MiniCssExtractPlugin({ filename: "circulation-admin.css" }),
// Set a local global variable in the app that will be used only
// for testing AXE in development mode.
new webpack.DefinePlugin({
Expand Down

0 comments on commit 415e85b

Please sign in to comment.