Skip to content
Draft
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
5 changes: 4 additions & 1 deletion packages/workbench/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
"customWebpackConfig": {
"path": "extra-webpack.config.js",
"libraryName": "workbench",
"libraryTarget": "module"
"libraryTarget": "module",
"mergeStrategies": {
"module.rules": "replace"
}
}
},
"configurations": {
Expand Down
28 changes: 22 additions & 6 deletions packages/workbench/extra-webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
const {resolve} = require('node:path');
const singleSpaAngularWebpack = require('single-spa-angular/lib/webpack').default;

function patchSassLoader(rules) {
if (!Array.isArray(rules)) return;
rules.forEach(rule => {
patchSassLoader(rule.rules);
patchSassLoader(rule.oneOf);
(rule.use || []).forEach(use => {
if (typeof use === 'object' && use.loader && use.loader.includes('sass-loader')) {
use.options = {
...use.options,
sassOptions: {
silenceDeprecations: ['color-functions', 'global-builtin', 'import', 'if-function'],
loadPaths: [resolve(__dirname)]
}
};
}
});
});
}

module.exports = (config, options) => {
const singleSpaWebpackConfig = singleSpaAngularWebpack(config, options);

// Ensure Zone.js is included
// singleSpaWebpackConfig.externals = singleSpaWebpackConfig.externals || {};
// delete singleSpaWebpackConfig.externals['zone.js'];
// Feel free to modify this webpack config however you'd like to

singleSpaWebpackConfig.externals = [...singleSpaWebpackConfig.externals, "@ontotext/workbench-api"];
singleSpaWebpackConfig.experiments.outputModule = true;
if (singleSpaWebpackConfig.output) {
Expand All @@ -30,6 +45,7 @@ module.exports = (config, options) => {
// singleSpaWebpackConfig.devServer.client.overlay = false;
// singleSpaWebpackConfig.devServer.liveReload = false;

// console.log('=============', JSON.stringify(singleSpaWebpackConfig, null, 2));
patchSassLoader(singleSpaWebpackConfig.module.rules);

return singleSpaWebpackConfig;
};
31 changes: 31 additions & 0 deletions packages/workbench/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@jsverse/transloco": "^8.3.0",
"@jsverse/transloco-messageformat": "^8.3.0",
"@primeuix/themes": "^2.0.3",
"bootstrap": "^5.3.8",
"file-saver": "^2.0.5",
"ontotext-yasgui-web-component": "^1.6.4",
"primeng": "^21.1.8",
Expand Down
19 changes: 19 additions & 0 deletions packages/workbench/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
/* You can add global styles to this file, and also import other style files */
@use "styles/primeng-overrides";

app-root {
@import "../node_modules/bootstrap/scss/functions";
Comment thread
svilenvelikov marked this conversation as resolved.
// Required Bootstrap imports
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/variables-dark";
@import "../node_modules/bootstrap/scss/maps";
@import "../node_modules/bootstrap/scss/mixins";
// Probably not needed and leaking properties to :root
//@import "../node_modules/bootstrap/scss/root";

Check warning on line 12 in packages/workbench/src/styles.scss

View check run for this annotation

SonarQubeCloud / [Shared-components] SonarCloud Code Analysis

Remove this commented out code.

See more on https://sonarcloud.io/project/issues?id=Ontotext-AD_WB_migration_workbench&issues=AZ6D2qOsbnpqgwExiAC-&open=AZ6D2qOsbnpqgwExiAC-&pullRequest=2986
// Optional components
@import "../node_modules/bootstrap/scss/utilities";
// Probably not needed as well
//@import "../node_modules/bootstrap/scss/reboot";

Check warning on line 16 in packages/workbench/src/styles.scss

View check run for this annotation

SonarQubeCloud / [Shared-components] SonarCloud Code Analysis

Remove this commented out code.

See more on https://sonarcloud.io/project/issues?id=Ontotext-AD_WB_migration_workbench&issues=AZ6D2qOsbnpqgwExiAC_&open=AZ6D2qOsbnpqgwExiAC_&pullRequest=2986
Comment thread
svilenvelikov marked this conversation as resolved.
@import "../node_modules/bootstrap/scss/containers";
@import "../node_modules/bootstrap/scss/grid";
@import "../node_modules/bootstrap/scss/helpers";
@import "../node_modules/bootstrap/scss/utilities/api";
Comment thread
svilenvelikov marked this conversation as resolved.
}