Skip to content

Commit

Permalink
Install ngl from npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Oct 6, 2024
1 parent f87d4f4 commit 36294b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
11 changes: 6 additions & 5 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const STATIC_PLUGIN_BUILD_IDS = [
"ts_visjs",
"venn",
];
const INSTALL_PLUGIN_BUILD_IDS = ["msa"]; // todo: derive from XML
const INSTALL_PLUGIN_BUILD_IDS = ["ngl", "msa"]; // todo: derive from XML
const DIST_PLUGIN_BUILD_IDS = ["new_user"];
const PLUGIN_BUILD_IDS = Array.prototype.concat(DIST_PLUGIN_BUILD_IDS, STATIC_PLUGIN_BUILD_IDS);

Expand Down Expand Up @@ -245,10 +245,11 @@ async function installDependenciesFromXML(xmlPath, pluginDir) {
);

if (installResult.status === 0) {
await fs.copy(
path.join(pluginDir, "node_modules", pkgName, "static"),
path.join(pluginDir, "static")
);
const packagePath = path.join(pluginDir, "node_modules", pkgName);
const defaultPath = path.join(packagePath, "static");
const alternatePath = path.join(packagePath, "dist/static");
const sourcePath = fs.existsSync(defaultPath) ? defaultPath : alternatePath;
await fs.copy(sourcePath, path.join(pluginDir, "static"));
console.log(`Installed package ${pkgName}@${version} in ${pluginDir}`);
} else {
console.error(`Error installing package ${pkgName}@${version} in ${pluginDir}`);
Expand Down
10 changes: 5 additions & 5 deletions config/plugins/visualizations/example/config/example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<type>setting_type</type>
</input>
</settings>
<groups>
<tracks>
<input>
<name>group_input</name>
<help>group help</help>
<type>group_type</type>
<name>track_input</name>
<help>track help</help>
<type>track_type</type>
</input>
</groups>
</tracks>
<specs>
<spec_name>spec_value</spec_name>
</specs>
Expand Down
8 changes: 4 additions & 4 deletions config/plugins/visualizations/ngl/config/ngl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<params>
<param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
</params>
<entry_point
entry_point_type="script"
src="https://cdn.jsdelivr.net/gh/guerler/galaxy-visualizations@add_ngl/packages/ngl/dist/static/assets/index.js"
css="https://cdn.jsdelivr.net/gh/guerler/galaxy-visualizations@add_ngl/packages/ngl/dist/static/assets/index.css" />
<requirements>
<requirement type="npm" version="0.0.4" package="galaxy-visualization-ngl"/>
</requirements>
<entry_point entry_point_type="script" src="assets/index.js" css="assets/index.css" />
<settings>
<input>
<label>Quality</label>
Expand Down

0 comments on commit 36294b0

Please sign in to comment.