Bug 32978: Replace node-sass with dart-sass

'npm install' fails in ktd on aarch64, giving unsupported architecture error for node-sass.

This patch addresses this by replacing node-sass with dart-sass, updating our gulpfile
accordingly. Some corrections have been made to SCSS to fix warnings
raised during the build process.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Works like a charm. Great work oleonard! Tested on Apple M1, e.g. aarch64.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I removed some useless formatting changes in the gulpfile, and the
yarn.lock changes as well.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e5b28d9c40)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2023-02-15 17:36:57 +00:00 committed by Jacob O'Mara
parent c2916c36f1
commit e1e3ec1309
4 changed files with 14 additions and 19 deletions

View file

@ -9,8 +9,7 @@ const os = require('os');
const path = require('path');
const util = require('util');
const sass = require("gulp-sass");
const cssnano = require("gulp-cssnano");
const sass = require('gulp-sass')(require('sass'));
const rtlcss = require('gulp-rtlcss');
const sourcemaps = require('gulp-sourcemaps');
const autoprefixer = require('gulp-autoprefixer');
@ -36,8 +35,6 @@ if (args.view == "opac") {
}
var sassOptions = {
errLogToConsole: true,
precision: 3,
includePaths: [
__dirname + '/node_modules',
__dirname + '/../node_modules'
@ -67,15 +64,13 @@ function css() {
return stream;
}
// CSS processing for production
function build() {
function build(css_base) {
css_base = css_base || CSS_BASE;
sassOptions.outputStyle = "compressed";
var stream = src(css_base + "/src/**/*.scss")
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(cssnano({
zindex: false
}))
.pipe(dest(css_base));
if( args.view == "opac" ){

View file

@ -3,7 +3,7 @@ $slideTime: 400ms;
$daySize: 39px !default;
$padding: $daySize / 16;
$padding: calc( $daySize / 16 );
$dayMargin: 2px !default;
$daysWidth: $daySize * 7 + $dayMargin * 14 + $padding * 2 + 2;
$calendarWidth: $daysWidth;

View file

@ -1,9 +1,9 @@
$bezier: cubic-bezier( .23, 1, .32, 1 );
$slideTime: 400ms;
$daySize: 39px !default;
$padding: $daySize / 16;
$padding: calc( $daySize / 16 );
$dayMargin: 2px !default;
$daysWidth: $daySize * 7 + $dayMargin * 14 + $padding * 2 + 2;
$daysWidth: calc( $daySize * 7) + $dayMargin * 14 + $padding * 2 + 2;
$calendarWidth: $daysWidth;
$monthNavHeight: 34px !default;
$weekdaysHeight: 28px !default;

View file

@ -21,11 +21,10 @@
"gulp": "^4.0.2",
"gulp-autoprefixer": "^4.0.0",
"gulp-concat-po": "^1.0.0",
"gulp-cssnano": "^2.1.2",
"gulp-exec": "^4.0.0",
"gulp-rename": "^2.0.0",
"gulp-rtlcss": "^1.4.1",
"gulp-sass": "^3.1.0",
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^2.6.1",
"js-yaml": "^3.13.1",
"lodash": "^4.17.12",
@ -33,6 +32,7 @@
"minimist": "^1.2.5",
"mysql": "^2.18.1",
"pinia": "^2.0.13",
"sass": "^1.58.1",
"style-loader": "^3.3.1",
"vue": "^3.2.31",
"vue-flatpickr-component": "^9",
@ -60,11 +60,6 @@
"author": "",
"license": "GPL-3.0",
"devDependencies": {
"postcss-selector-parser": "^6.0.10",
"postcss": "^8.4.14",
"stylelint-config-standard-scss": "^5.0.0",
"stylelint-order": "^5.0.0",
"stylelint": "^14.9.1",
"@babel/core": "^7.17.5",
"@babel/preset-env": "^7.16.11",
"@vue/compiler-sfc": "^3.2.31",
@ -74,6 +69,11 @@
"clean-webpack-plugin": "^4.0.0",
"gulp-tap": "^1.0.1",
"html-webpack-plugin": "^5.5.0",
"postcss": "^8.4.14",
"postcss-selector-parser": "^6.0.10",
"stylelint": "^14.9.1",
"stylelint-config-standard-scss": "^5.0.0",
"stylelint-order": "^5.0.0",
"ts-loader": "^9.2.7",
"typescript": "^4.6.2",
"vinyl-source-stream": "^2.0.0",