Skip to content

Commit

Permalink
Merge remote-tracking branch 'vufind-org/dev' into pull-request-add-t…
Browse files Browse the repository at this point in the history
…ranslations-for-service-type
  • Loading branch information
elsenhans committed Jan 11, 2024
2 parents 07bb6f7 + e2de268 commit 1c08355
Show file tree
Hide file tree
Showing 658 changed files with 49,435 additions and 6,237 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
plugins: ["no-jquery"],
ignorePatterns: ["themes/**/vendor/**"],
ignorePatterns: [
"themes/**/vendor/**",
"themes/**/node_modules/**"
],
extends: ["eslint:recommended", "plugin:no-jquery/deprecated"],
env: {
"browser": true,
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local
strategy:
matrix:
php-version: ['8.0', '8.1', '8.2']
# We run most tests on all platforms, but we only run Javascript-related tests in 8.1.
# Since the results should be the same on all platforms, we don't need to repeat them.
php-version: ['8.1', '8.2', '8.3']
# We run PHP-based tests on all platforms (qa-php), but we only include PHP AND
# Javascript-related tests (qa-console) once. Since the JS results should be the
# same on all platforms, we don't need to repeat them.
include:
- php-version: 8.0
phing_tasks: "qa-php"
- php-version: 8.1
phing_tasks: "qa-console"
phing_tasks: "qa-php"
- php-version: 8.2
phing_tasks: "qa-console"
- php-version: 8.3
phing_tasks: "qa-php"

steps:
Expand Down
26 changes: 16 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = function(grunt) {
const fs = require("fs");

// Load dart-sass
grunt.loadNpmTasks('grunt-dart-sass');

// Local custom tasks
if (fs.existsSync("./Gruntfile.local.js")) {
require("./Gruntfile.local.js")(grunt);
Expand All @@ -16,6 +19,7 @@ module.exports = function(grunt) {
// initialize search path with directory containing LESS file
var retVal = [];
retVal.push(parts.join('/'));
retVal.push(parts.join('/') + '/vendor/');

// Iterate through theme.config.php files collecting parent themes in search path:
while (config = fs.readFileSync("themes/" + parts[1] + "/theme.config.php", "UTF-8")) {
Expand All @@ -39,6 +43,7 @@ module.exports = function(grunt) {

parts[1] = matches[1];
retVal.push(parts.join('/') + '/');
retVal.push(parts.join('/') + '/vendor/');
}
return retVal;
}
Expand Down Expand Up @@ -72,15 +77,16 @@ module.exports = function(grunt) {
}
},
// SASS compilation
scss: {
sass: {
'scss': {
'dart-sass': {
options: {
outputStyle: 'compressed',
quietDeps: true
}
}
},
'check:scss': {
sass: {
'dart-sass': {
}
},

Expand Down Expand Up @@ -207,13 +213,13 @@ module.exports = function(grunt) {
});

grunt.registerMultiTask('scss', function sassScan() {
grunt.config.set('sass', getSassConfig(this.data.options, false));
grunt.task.run('sass');
grunt.config.set('dart-sass', getSassConfig(this.data.options, false));
grunt.task.run('dart-sass');
});

grunt.registerMultiTask('check:scss', function sassCheck() {
grunt.config.set('sass', getSassConfig(this.data.options, true));
grunt.task.run('sass');
grunt.config.set('dart-sass', getSassConfig(this.data.options, true));
grunt.task.run('dart-sass');
});

grunt.registerTask('default', function help() {
Expand All @@ -240,9 +246,7 @@ module.exports = function(grunt) {
for (var i in themeList) {
if (Object.prototype.hasOwnProperty.call(themeList, i)) {
var config = {
options: {
implementation: require("node-sass"),
},
options: {},
files: [{
expand: true,
cwd: path.join('themes', themeList[i], 'scss'),
Expand All @@ -257,6 +261,8 @@ module.exports = function(grunt) {
}
}
config.options.includePaths = getLoadPaths('themes/' + themeList[i] + '/scss/compiled.scss');
// This allows loading of styles from composer dependencies:
config.options.includePaths.push('vendor/');

sassConfig[themeList[i]] = config;
}
Expand Down
57 changes: 27 additions & 30 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<property name="vufinddbpass" value="vufindtestpass" />
<property name="dbtype" value="mysql" /><!-- use pgsql for PostgreSQL -->
<property name="mysqlhost" value="localhost" />
<property name="mysqlport" value="3306" />
<property name="mysqlrootuser" value="root" />
<property name="mysqlrootpass" value="password" />
<property name="pgsqlhost" value="localhost" />
Expand Down Expand Up @@ -181,10 +182,10 @@

<!-- JSHint -->
<target name="jshint">
<exec command="npx jshint --config=${srcdir}/tests/jshint.json --exclude=themes/*/js/vendor ${srcdir}/themes" checkreturn="true" passthru="true" />
<exec command="npx jshint --config=${srcdir}/tests/jshint.json --exclude=themes/*/js/vendor,themes/*/node_modules ${srcdir}/themes" checkreturn="true" passthru="true" />
</target>
<target name="jshint-report">
<exec command="npx jshint --config=${srcdir}/tests/jshint.json --exclude=themes/*/js/vendor --reporter=checkstyle ${srcdir}/themes &gt; ${builddir}/reports/jshint-checkstyle.xml" />
<exec command="npx jshint --config=${srcdir}/tests/jshint.json --exclude=themes/*/js/vendor,themes/*/node_modules --reporter=checkstyle ${srcdir}/themes &gt; ${builddir}/reports/jshint-checkstyle.xml" />
</target>

<!-- Run Sass build, error if it fails -->
Expand Down Expand Up @@ -371,22 +372,6 @@
<exec command="php ${srcdir}/composer.phar install ${composer_extra_params}" passthru="true" checkreturn="true" />
</target>

<!-- Copy files from node modules to themes -->
<target name="copynodemodules">
<!-- autocomplete.js -->
<copy file="${srcdir}/node_modules/autocomplete.js/autocomplete.js" todir="${srcdir}/themes/bootstrap3/js/vendor" overwrite="true" />
<!-- jstree -->
<copy todir="${srcdir}/themes/bootstrap3/js/vendor/jsTree" overwrite="true">
<fileset dir="${srcdir}/node_modules/jstree/dist/" >
<include name="**/**" />
<exclude name="jstree.js" />
<exclude name="themes/default-dark/" />
</fileset>
</copy>
<!-- vanilla-cookieconsent -->
<copy file="${srcdir}/node_modules/vanilla-cookieconsent/dist/cookieconsent.umd.js" todir="${srcdir}/themes/bootstrap3/js/vendor" overwrite="true" />
</target>

<!-- Install and Activate VuFind -->
<target name="startup" description="install and activate demo">
<property name="solr_pid_file" value="${localdir}/solr-${solr_port}.pid" />
Expand Down Expand Up @@ -494,7 +479,7 @@
<property name="db_connection_string" value="pgsql://${vufinddbuser}:${vufinddbpass}@${pgsqlhost}/${vufinddb}" />
</then>
<else>
<property name="db_connection_string" value="mysql://${vufinddbuser}:${vufinddbpass}@${mysqlhost}/${vufinddb}" />
<property name="db_connection_string" value="mysql://${vufinddbuser}:${vufinddbpass}@${mysqlhost}:${mysqlport}/${vufinddb}" />
</else>
</if>

Expand Down Expand Up @@ -531,7 +516,7 @@
</then>
</if>

<!-- Add a local translation for tests -->
<!-- Add local translations for tests -->
<if>
<not>
<available file="${localdir}/languages" type="dir" />
Expand All @@ -540,7 +525,19 @@
<mkdir dir="${localdir}/languages" />
</then>
</if>
<if>
<not>
<available file="${localdir}/languages/Facets" type="dir" />
</not>
<then>
<mkdir dir="${localdir}/languages/Facets" />
</then>
</if>
<append destFile="${localdir}/languages/en.ini" text="location_main = Main Library${line.separator}" />
<append destFile="${localdir}/languages/Facets/en.ini" text="0/level1a/ = Top Level, Sorted Last${line.separator}" />
<append destFile="${localdir}/languages/Facets/en.ini" text="0/level1z/ = Top Level, Sorted First${line.separator}" />
<append destFile="${localdir}/languages/Facets/en.ini" text="1/level1z/level2y/ = Second Level, Sorted Last${line.separator}" />
<append destFile="${localdir}/languages/Facets/en.ini" text="1/level1z/level2z/ = Second Level, Sorted First${line.separator}" />
</target>

<target name="setup_database" description="setup demo database">
Expand All @@ -558,13 +555,13 @@
</then>
<else>
<!-- build database -->
<exec command="mysqladmin -f -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} drop ${vufinddb}" />
<exec command="mysqladmin -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} create ${vufinddb}" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;DROP USER '${vufinddbuser}'@'${mysqlhost}'&quot;" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;CREATE USER '${vufinddbuser}'@'${mysqlhost}' IDENTIFIED BY '${vufinddbpass}'&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;GRANT SELECT,INSERT,UPDATE,DELETE ON ${vufinddb}.* TO '${vufinddbuser}'@'${mysqlhost}' WITH GRANT OPTION&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;FLUSH PRIVILEGES&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -D ${vufinddb} &lt; ${srcdir}/module/VuFind/sql/mysql.sql" checkreturn="true" />
<exec command="mysqladmin -f -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} drop ${vufinddb}" />
<exec command="mysqladmin -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} create ${vufinddb}" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;DROP USER '${vufinddbuser}'@'%'&quot;" />
<exec command="mysql -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;CREATE USER '${vufinddbuser}'@'%' IDENTIFIED BY '${vufinddbpass}'&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;GRANT SELECT,INSERT,UPDATE,DELETE ON ${vufinddb}.* TO '${vufinddbuser}'@'%' WITH GRANT OPTION&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;FLUSH PRIVILEGES&quot;" checkreturn="true" />
<exec command="mysql -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -D ${vufinddb} &lt; ${srcdir}/module/VuFind/sql/mysql.sql" checkreturn="true" />
</else>
</if>
</target>
Expand Down Expand Up @@ -650,8 +647,8 @@ ${git_status}
<exec command="sudo su -c &quot;psql -c \&quot;DROP USER ${vufinddbuser};\&quot;&quot; ${pgsqlrootuser}" checkreturn="true" />
</then>
<else>
<exec command="mysql -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;DROP USER '${vufinddbuser}'@'${mysqlhost}'&quot;" />
<exec command="mysqladmin -f -h ${mysqlhost} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} drop ${vufinddb}" />
<exec command="mysql -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} -e &quot;DROP USER '${vufinddbuser}'@'%'&quot;" />
<exec command="mysqladmin -f -h ${mysqlhost} -P ${mysqlport} -u ${mysqlrootuser} ${mysqlpwswitch}${mysqlrootpass} drop ${vufinddb}" />
</else>
</if>

Expand Down Expand Up @@ -763,7 +760,7 @@ ${git_status}
</delete>
<delete>
<fileset dir="${localdir}/languages">
<include name="*" />
<include name="**/*" />
</fileset>
</delete>
<delete file="${srcdir}/env.bat" />
Expand Down
17 changes: 10 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "GPL-2.0",
"config": {
"platform": {
"php": "8.0"
"php": "8.1"
},
"process-timeout": 0,
"allow-plugins": {
Expand All @@ -25,14 +25,15 @@
"ext-sodium": "*"
},
"require": {
"php": ">=8.0",
"php": ">=8.1",
"ahand/mobileesp": "dev-master",
"apereo/phpcas": "1.6.1",
"cap60552/php-sip2": "1.0.0",
"colinmollenhour/credis": "1.15.0",
"composer/package-versions-deprecated": "1.11.99.5",
"composer/semver": "3.4.0",
"endroid/qr-code": "4.8.2",
"friendsofphp/proxy-manager-lts": "1.0.16",
"laminas/laminas-cache": "3.10.1",
"laminas/laminas-cache-storage-adapter-blackhole": "^2.0",
"laminas/laminas-cache-storage-adapter-filesystem": "^2.0",
Expand Down Expand Up @@ -74,7 +75,6 @@
"league/oauth2-server": "8.5.4",
"lm-commons/lmc-rbac-mvc": "3.3.2",
"matthiasmullie/minify": "1.3.71",
"ocramius/proxy-manager": "2.14.1",
"pear/archive_tar": "^1.4",
"pear/http_request2": "2.5.1",
"phing/phing": "2.17.4",
Expand All @@ -91,7 +91,7 @@
"vufind-org/vufinddate": "1.2.0",
"vufind-org/vufindharvest": "5.2.0",
"vufind-org/vufindhttp": "3.2.0",
"vufind-org/vufind-marc": "1.0.2",
"vufind-org/vufind-marc": "1.1.0",
"webfontkit/open-sans": "^1.0",
"wikimedia/composer-merge-plugin": "2.1.0",
"yajra/laravel-pdo-via-oci8": "3.4.0"
Expand All @@ -101,12 +101,13 @@
"behat/mink-selenium2-driver": "1.6.0",
"dmore/chrome-mink-driver": "2.9.2",
"firebase/php-jwt": "6.8.1",
"friendsofphp/php-cs-fixer": "3.26.1",
"friendsofphp/php-cs-fixer": "3.46.0",
"phpmd/phpmd": "2.13.0",
"phpstan/phpstan": "1.10.34",
"phpunit/php-code-coverage": "9.2.28",
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "9.6.12",
"pietercolpaert/hardf": "0.3.1",
"squizlabs/php_codesniffer": "3.7.2"
},
"extra": {
Expand All @@ -128,7 +129,9 @@
"post-install-cmd": "@phing-install-dependencies",
"post-update-cmd": "@phing-install-dependencies",
"qa": "phing qa-console -Ddefaultconfigs=true",
"install-npm-dependencies": "npm install && phing copynodemodules",
"update-npm-dependencies": "npm update && phing copynodemodules"
"update-npm-dependencies": [
"npm update",
"cd themes/bootstrap3 && npm run updateDeps"
]
}
}
Loading

0 comments on commit 1c08355

Please sign in to comment.