Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into component-confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
crhallberg committed Mar 1, 2024
2 parents fa3c83b + 4f80a1b commit f2c5bae
Show file tree
Hide file tree
Showing 1,023 changed files with 66,540 additions and 11,589 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
22 changes: 15 additions & 7 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 All @@ -41,7 +42,7 @@ jobs:
if: ${{ matrix.phing_tasks == 'qa-console' }}
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'

- name: Cache NPM dependencies
if: ${{ matrix.phing_tasks == 'qa-console' }}
Expand Down Expand Up @@ -89,6 +90,13 @@ jobs:
key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-phpstan-"

- name: Cache PHP_CodeSniffer data
uses: actions/cache@v3
with:
path: tests/phpcs.cache.json
key: "php-${{ matrix.php-version }}-phpcs-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-phpcs-"

- name: Install composer dependencies
run: composer install

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ env.bat
env.sh
import/solrmarc.log*
lessphp_*.list
module/VuFind/tests/.phpunit.result.cache
module/VuFind/tests/.phpunit*
node_modules
package-lock.json
public/swagger-ui
tests/phpcs.cache.json
local/DirLocations.ini
local/config/vufind/*.ini
local/config/vufind/*.json
Expand Down
29 changes: 19 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,19 @@ module.exports = function(grunt) {
}
},
// SASS compilation
scss: {
sass: {
'scss': {
'dart-sass': {
options: {
outputStyle: 'compressed',
quietDeps: true
}
}
},
'check:scss': {
sass: {
'dart-sass': {
options: {
quietDeps: true
}
}
},

Expand Down Expand Up @@ -207,13 +216,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 +249,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 +264,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
Loading

0 comments on commit f2c5bae

Please sign in to comment.