Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp build improvements, update. #19405

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
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
23 changes: 14 additions & 9 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ const INSTALL_PLUGIN_BUILD_IDS = [
const DIST_PLUGIN_BUILD_IDS = ["new_user"];
const PLUGIN_BUILD_IDS = Array.prototype.concat(DIST_PLUGIN_BUILD_IDS, STATIC_PLUGIN_BUILD_IDS);

// Modify these lines to support the --limit option
const args = process.argv.slice(2);
const limitIndex = args.indexOf("--limit");
const pluginFilter = limitIndex !== -1 && args[limitIndex + 1] ? args[limitIndex + 1] : "";

const applyPluginFilter = (plugin) => {
return !pluginFilter || plugin.includes(pluginFilter);
};

const failOnError =
process.env.GALAXY_PLUGIN_BUILD_FAIL_ON_ERROR && process.env.GALAXY_PLUGIN_BUILD_FAIL_ON_ERROR !== "0"
? true
Expand Down Expand Up @@ -79,7 +88,9 @@ PATHS.pluginDirs = [
];

PATHS.pluginBuildModules = [
path.join(PATHS.pluginBaseDir, `{visualizations,welcome_page}/{${PLUGIN_BUILD_IDS.join(",")}}/package.json`),
...PLUGIN_BUILD_IDS.filter(applyPluginFilter).map((plugin) =>
path.join(PATHS.pluginBaseDir, `visualizations/${plugin}/package.json`)
),
];

function stageLibs(callback) {
Expand All @@ -99,12 +110,6 @@ function stageLibs(callback) {
return callback();
}

function fonts() {
return src(path.resolve(path.join(PATHS.nodeModules, "font-awesome/fonts/**/*"))).pipe(
dest("../static/images/fonts")
);
}

async function icons() {
await buildIcons("./src/assets/icons.json");
}
Expand Down Expand Up @@ -215,7 +220,7 @@ function buildPlugins(callback, forceRebuild) {

async function installPlugins(callback) {
// iterate through install_plugin_build_ids, identify xml files and install dependencies
for (const plugin_name of INSTALL_PLUGIN_BUILD_IDS) {
for (const plugin_name of INSTALL_PLUGIN_BUILD_IDS.filter(applyPluginFilter)) {
const pluginDir = path.join(PATHS.pluginBaseDir, `visualizations/${plugin_name}`);
const xmlPath = path.join(pluginDir, `config/${plugin_name}.xml`);
// Check if the file exists
Expand Down Expand Up @@ -279,7 +284,7 @@ function cleanPlugins() {
return del(["../static/plugins/{visualizations,welcome_page}/*"], { force: true });
}

const client = parallel(fonts, stageLibs, icons);
const client = parallel(stageLibs, icons);
const plugins = series(buildPlugins, installPlugins, cleanPlugins, stagePlugins);
const pluginsRebuild = series(forceBuildPlugins, installPlugins, cleanPlugins, stagePlugins);

Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"expose-loader": "^4.1.0",
"fake-indexeddb": "^6.0.0",
"fs-extra": "^11.2.0",
"gulp": "^4.0.2",
"gulp": "^5.0.0",
"ignore-loader": "^0.1.2",
"imports-loader": "^4.0.1",
"jest": "^29.7.0",
Expand Down
Loading
Loading