diff --git a/common/config/rush/pnpm-config.json b/common/config/rush/pnpm-config.json index 5711c21ebeb..3f312e748e2 100644 --- a/common/config/rush/pnpm-config.json +++ b/common/config/rush/pnpm-config.json @@ -199,10 +199,11 @@ * PNPM documentation: https://pnpm.io/package_json#pnpmoverrides */ "globalOverrides": { - // DEV: Uncomment the lines below to use local huly.core packages + // DEV: Uncomment the lines below to use local huly.core, huly.server, and huly.utils packages // Then "rush update --full" to update the dependencies. - // NOTE: It's configured to work if huly.core is placed adjacent to the platform. If you have it in a different location, you need to change the paths below. + // NOTE: It's configured to work if huly.core, huly.server, and huly.utils are placed adjacent to the platform. If you have them in a different location, you need to change the paths below. + // huly.core packages: // "@hcengineering/account-client": "file:../../../huly.core/packages/account-client", // "@hcengineering/analytics": "file:../../../huly.core/packages/analytics", // "@hcengineering/analytics-service": "file:../../../huly.core/packages/analytics-service", @@ -224,7 +225,30 @@ // "@hcengineering/text-html": "file:../../../huly.core/packages/text-html", // "@hcengineering/text-markdown": "file:../../../huly.core/packages/text-markdown", // "@hcengineering/text-ydoc": "file:../../../huly.core/packages/text-ydoc", - // "@hcengineering/token": "file:../../../huly.core/packages/token" + // "@hcengineering/token": "file:../../../huly.core/packages/token", + + // huly.server packages: + // "@hcengineering/collaboration": "file:../../../huly.server/packages/collaboration", + // "@hcengineering/datalake": "file:../../../huly.server/packages/datalake", + // "@hcengineering/elastic": "file:../../../huly.server/packages/elastic", + // "@hcengineering/hulylake": "file:../../../huly.server/packages/hulylake", + // "@hcengineering/kafka": "file:../../../huly.server/packages/kafka", + // "@hcengineering/middleware": "file:../../../huly.server/packages/middleware", + // "@hcengineering/minio": "file:../../../huly.server/packages/minio", + // "@hcengineering/mongo": "file:../../../huly.server/packages/mongo", + // "@hcengineering/postgres": "file:../../../huly.server/packages/postgres", + // "@hcengineering/s3": "file:../../../huly.server/packages/s3", + // "@hcengineering/server": "file:../../../huly.server/packages/server", + // "@hcengineering/server-client": "file:../../../huly.server/packages/client", + // "@hcengineering/server-core": "file:../../../huly.server/packages/core", + // "@hcengineering/server-storage": "file:../../../huly.server/packages/server-storage", + + // huly.utils packages: + // "@hcengineering/measurements": "file:../../../huly.utils/packages/measurements", + // "@hcengineering/measurements-otlp": "file:../../../huly.utils/packages/measurements-otlp", + // "@hcengineering/platform-rig": "file:../../../huly.utils/packages/platform-rig", + // "@hcengineering/postgres-base": "file:../../../huly.utils/packages/postgres-base", + // "@hcengineering/ui-test": "file:../../../huly.utils/packages/ui-test" }, /** diff --git a/common/scripts/sass-quiet.js b/common/scripts/sass-quiet.js index eaa515440d4..2df43760309 100644 --- a/common/scripts/sass-quiet.js +++ b/common/scripts/sass-quiet.js @@ -1,22 +1,31 @@ // Wrapper around sass to suppress legacy-js-api deprecation warnings // Should be removed when sass-preprocessor is upgraded to the version that works with modern sass api -const sass = require('sass'); - -// Capture original stderr.write -const originalStderrWrite = process.stderr.write.bind(process.stderr); -// Override stderr.write to filter out sass deprecation warnings -process.stderr.write = (chunk, encoding, callback) => { - if (typeof chunk === 'string' && chunk.includes('DEPRECATION WARNING [legacy-js-api]')) { - // Suppress the warning - if (typeof encoding === 'function') { - encoding(); - } else if (typeof callback === 'function') { - callback(); +// Install the stderr filter globally as early as possible +if (!process.stderr._originalWrite) { + process.stderr._originalWrite = process.stderr.write; + + process.stderr.write = function (chunk, encoding, callback) { + const chunkStr = typeof chunk === 'string' ? chunk : (chunk?.toString?.() || ''); + + // Filter out sass legacy API deprecation warnings + if (chunkStr.includes('Deprecation Warning [legacy-js-api]') || + chunkStr.includes('DEPRECATION WARNING [legacy-js-api]') || + chunkStr.includes('The legacy JS API is deprecated') || + chunkStr.includes('More info: https://sass-lang.com/d/legacy-js-api')) { + // Suppress the warning - just call the callback + if (typeof encoding === 'function') { + encoding(); + } else if (typeof callback === 'function') { + callback(); + } + return true; } - return true; - } - return originalStderrWrite(chunk, encoding, callback); -}; + + return process.stderr._originalWrite.call(this, chunk, encoding, callback); + }; +} + +const sass = require('sass'); module.exports = sass; diff --git a/desktop/webpack.config.js b/desktop/webpack.config.js index 364e75a2e13..1ac4436d49c 100644 --- a/desktop/webpack.config.js +++ b/desktop/webpack.config.js @@ -2,13 +2,15 @@ // Copyright © 2023 Hardcore Engineering Inc. // +// Load sass-quiet FIRST to install stderr filter +const sass = require('../common/scripts/sass-quiet.js') + const Dotenv = require('dotenv-webpack') const path = require('path') const CompressionPlugin = require('compression-webpack-plugin') const DefinePlugin = require('webpack').DefinePlugin const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyPlugin = require('copy-webpack-plugin') -const sass = require('../common/scripts/sass-quiet.js') const mode = process.env.NODE_ENV || 'development' const prod = mode === 'production' @@ -190,7 +192,10 @@ module.exports = [ hotReload: !prod, preprocess: require('svelte-preprocess')({ postcss: true, - sourceMap: true + sourceMap: true, + scss: { + implementation: sass + } }), hotOptions: { // Prevent preserving local component state diff --git a/dev/prod/webpack.config.js b/dev/prod/webpack.config.js index 7f77494131b..357a33294da 100644 --- a/dev/prod/webpack.config.js +++ b/dev/prod/webpack.config.js @@ -13,13 +13,15 @@ // limitations under the License. // +// Load sass-quiet FIRST to install stderr filter +const sass = require('../../common/scripts/sass-quiet.js') + const Dotenv = require('dotenv-webpack') const path = require('path') const CompressionPlugin = require('compression-webpack-plugin') const DefinePlugin = require('webpack').DefinePlugin const HtmlWebpackPlugin = require('html-webpack-plugin') const { Configuration } = require('webpack') -const sass = require('../../common/scripts/sass-quiet.js') const mode = process.env.NODE_ENV || 'development' const prod = mode === 'production' @@ -314,7 +316,10 @@ module.exports = [ hotReload: !prod, preprocess: require('svelte-preprocess')({ postcss: true, - sourceMap: true + sourceMap: true, + scss: { + implementation: sass + } }), hotOptions: { // Prevent preserving local component state