Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions common/config/rush/pnpm-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
},

/**
Expand Down
41 changes: 25 additions & 16 deletions common/scripts/sass-quiet.js
Original file line number Diff line number Diff line change
@@ -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;
9 changes: 7 additions & 2 deletions desktop/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions dev/prod/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
Loading