Skip to content

Commit

Permalink
Additional sprint staging work - fast forward (#93)
Browse files Browse the repository at this point in the history
* Use double semi-colon for filter value delimiter

* Find collection view by view class starts with

* Minor refactor, single entry, single exit

* Wait for directory view before processing search box template

* Fix duplicate directory filters and cleanup

* Update angular

* Upgrade nguniversal

* Upgrade ngrx

* Upgrade dependencies

* Remove deprecated modules

* Upgrade scholars-embed-utilities

* Import TransferHttpCacheModule and cleanup non functioning state transfer

* Use PreloadAllModules preloading strategy

* Update yarn.lock

* Exclude store dev tools from production build

https://ngrx.io/guide/store-devtools/recipes/exclude

* Update package.json and yarn.lock

* Update GitHub workflow to use matrix

* Add network timeout of 1 hour to yarn install

* Increment minor version

* Switch to MIT license

* Upgrade docker image to Node.js 18

* Add .gitattibutes and fix a few line endings

https://rehansaeed.com/gitattributes-best-practices/

* Update karma browser timeout and flags

* Update .editorconfig to set eol lf

* Correct Dockerfile comment
  • Loading branch information
William Welling committed Jan 2, 2023
1 parent 75f165d commit 0f34ef0
Show file tree
Hide file tree
Showing 21 changed files with 387 additions and 390 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
Expand Down
44 changes: 44 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
###############################
# Git Line Endings #
###############################

# Set default behaviour to automatically normalize line endings.
* text=auto

# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf

# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf

###############################
# Git Large File System (LFS) #
###############################

# Archives
*.7z filter=lfs diff=lfs merge=lfs -text
*.br filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text

# Documents
*.pdf filter=lfs diff=lfs merge=lfs -text

# Images
*.gif filter=lfs diff=lfs merge=lfs -text
*.ico filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text

# Fonts
*.woff2 filter=lfs diff=lfs merge=lfs -text

# Other
*.exe filter=lfs diff=lfs merge=lfs -text
16 changes: 11 additions & 5 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@ on: [push, pull_request, workflow_dispatch]

jobs:
build:
strategy:
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
node-version: [14, 16, 18]

runs-on: ubuntu-18.04
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v3

- name: Setup Node.js 14
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn install
run: yarn install --network-timeout 3600000

- name: Test CI
run: xvfb-run --auto-servernum yarn test:ci
uses: GabrielBB/xvfb-action@v1
with:
run: yarn test:ci

- name: Coveralls coverage report
uses: coverallsapp/github-action@master
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-alpine as node
FROM node:18-alpine as node

# copy project to build excluding node_modules and dist via .dockerignore
COPY . /scholars-angular
Expand All @@ -13,12 +13,12 @@ RUN yarn install
RUN yarn build:ssr

# final base image
FROM keymetrics/pm2:14-alpine
FROM keymetrics/pm2:18-alpine

# set deployment directory
WORKDIR /

# copy over the built artifact from the maven image
# copy over the built artifact from the node image
COPY --from=node /scholars-angular/dist /dist

# deploy scholars-angular using pm2 when running container
Expand Down
31 changes: 5 additions & 26 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
BSD 3-Clause License
The MIT License (MIT)
Copyright © 2023 Texas A&M University Libraries

Copyright (c) 2019, VIVO Community Projects
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
},
{
"replace": "src/app/build-specifics/index.ts",
"with": "src/app/build-specifics/index.prod.ts"
}
],
"optimization": true,
Expand Down
95 changes: 50 additions & 45 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/scholars-angular'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'lcovonly' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
singleRun: true,
restartOnFileChange: true
});
};
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/scholars-angular'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'lcovonly' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
singleRun: true,
restartOnFileChange: true,
browserNoActivityTimeout: 30000,
flags: [
'--disable-gpu',
'--no-sandbox'
]
});
};
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{
"name": "scholars-angular",
"version": "1.3.0",
"version": "1.4.0",
"description": "Angular Universal client for Scholars Discovery",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/vivo-community/scholars-angular.git"
},
"private": false,
"contributors": [
"William Welling <wwelling@library.tamu.edu>"
],
"engines": {
"node": "^14.20.0 || ^16.13.0 || >=18.10.0",
"yarn": ">=1.22.4 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
"repository": {
"type": "git",
"url": "git@github.com:TAMULib/scholars-angular.git"
},
"bugs": "https://github.com/TAMULib/scholars-angular/issues",
"scripts": {
"ng": "ng",
"gzipper": "gzipper",
Expand All @@ -25,7 +32,6 @@
"test:coverage": "ng test --no-watch --code-coverage",
"test:ci": "yarn lint && yarn build:ssr && yarn test:coverage"
},
"private": false,
"dependencies": {
"@angular/animations": "15.0.4",
"@angular/common": "15.0.4",
Expand All @@ -50,7 +56,7 @@
"express-static-gzip": "2.1.7",
"font-awesome": "4.7.0",
"rxjs": "7.8.0",
"scholars-embed-utilities": "0.3.2",
"scholars-embed-utilities": "0.3.3",
"tslib": "2.4.1",
"zone.js": "0.12.0"
},
Expand Down
Loading

0 comments on commit 0f34ef0

Please sign in to comment.