Skip to content

Commit 51e5da5

Browse files
committed
jbrowse2 initial implementation
1 parent 2242b07 commit 51e5da5

File tree

16 files changed

+57881
-747
lines changed

16 files changed

+57881
-747
lines changed

jbrowse/.DS_Store

6 KB
Binary file not shown.

jbrowse/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set registry for @labkey scopes
2+
@labkey:registry=https://artifactory.labkey.com/artifactory/api/npm/libs-client/

jbrowse/build.gradle

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -18,87 +18,4 @@ dependencies {
1818
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:LabDevKitModules:LDK", depProjectConfig: "published", depExtension: "module")
1919
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:DiscvrLabKeyModules:SequenceAnalysis", depProjectConfig: "published", depExtension: "module")
2020
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: BuildUtils.getPlatformModuleProjectPath(project.gradle, "pipeline"), depProjectConfig: "published", depExtension: "module")
21-
}
22-
23-
ConfigurableFileTree copyDestination = fileTree("./resources/web/jbrowseApp/");
24-
project.task("copyJBrowse",
25-
type: Copy,
26-
group: "Build",
27-
description: "Copy jbrowse app into webapp directory",
28-
{ CopySpec copy ->
29-
copy.from fileTree("./node_modules/@gmod/jbrowse").exclude('css/main.css')
30-
copy.into copyDestination.getDir()
31-
}
32-
).doFirst({
33-
File f = project.file('./node_modules/@gmod/jbrowse');
34-
if (!f.exists()){
35-
throw new GradleException("Input source for copyJBrowse doesn't exist: " + f.getAbsolutePath())
36-
}
37-
}).onlyIf({
38-
//this is a very expensive step and the input should rarely change
39-
if (copyDestination.getDir().exists()) {
40-
List<File> copiedFiles = copyDestination.exclude("./resources/web/jbrowseApp/css/").sort {it.lastModified()};
41-
if (copiedFiles.isEmpty()) {
42-
return true;
43-
}
44-
45-
File firstModifiedCopiedFile = copiedFiles.first()
46-
File lastModifiedSourceFile = fileTree('./node_modules/@gmod/jbrowse').exclude('package.json').sort {it.lastModified()}.last()
47-
if (firstModifiedCopiedFile.lastModified() < lastModifiedSourceFile.lastModified()) {
48-
println("Source has been modified, need to copy again")
49-
println("Copy last copied: " + new Date(firstModifiedCopiedFile.lastModified()))
50-
println("First modified file: " + firstModifiedCopiedFile.getPath())
51-
52-
println("Source last modified: " + new Date(lastModifiedSourceFile.lastModified()))
53-
println("Last modified file: " + lastModifiedSourceFile.getPath())
54-
55-
return true;
56-
}
57-
else {
58-
println("Up to date, no need to copy")
59-
return false;
60-
}
61-
}
62-
63-
return true;
64-
})
65-
66-
project.task("copyJBrowseCss",
67-
type: Copy,
68-
group: "Build",
69-
description: "Copy jbrowse main.css into webapp directory",
70-
{ CopySpec copy ->
71-
copy.from new File("./webpack/main.css")
72-
copy.into new File("./resources/web/jbrowseApp/css/")
73-
}
74-
).doFirst({
75-
File f = project.file('./resources/web/jbrowseApp/index.html');
76-
if (!f.exists())
77-
{
78-
throw new GradleException("copyJBrowse was not successful. missing: " + f.getAbsolutePath())
79-
}
80-
81-
File f2 = project.file('./resources/web/jbrowseApp/src/dijit/themes/dijit.css');
82-
if (!f2.exists())
83-
{
84-
throw new GradleException("copyJBrowse was not successful. missing jbrowse dependencies: " + f2.getAbsolutePath())
85-
}
86-
87-
// NOTE: due to bug/inconsistency in how the jbrowse postinstall script is run, several modules may not be copied to /src. This is a check against this.
88-
// There's a jbrowse PR around this as well.
89-
File f3 = project.file('./resources/web/jbrowseApp/src/jszlib');
90-
if (!f3.exists())
91-
{
92-
throw new GradleException("copyJBrowse was not successful. missing jbrowse dependencies: " + f3.getAbsolutePath())
93-
}
94-
})
95-
96-
97-
project.tasks.copyJBrowse.dependsOn(project.tasks.npmInstall)
98-
99-
project.tasks.copyJBrowse.mustRunAfter("npmRunBuild")
100-
project.tasks.copyJBrowse.mustRunAfter("npmRunBuildProd")
101-
102-
project.tasks.copyJBrowseCss.dependsOn(project.tasks.copyJBrowse)
103-
project.tasks.processModuleResources.dependsOn(project.tasks.copyJBrowse)
104-
project.tasks.processModuleResources.dependsOn(project.tasks.copyJBrowseCss)
21+
}

jbrowse/dev.config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2019 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
// COPY THIS FILE TO node_modules/@labkey/build/webpack/dev.config.js
8+
const lkModule = process.env.LK_MODULE;
9+
const entryPoints = require('../../../../src/client/entryPoints');
10+
const constants = require('./constants');
11+
const webpack = require('webpack');
12+
13+
// set based on the lk module calling this config
14+
__dirname = lkModule;
15+
16+
module.exports = {
17+
context: constants.context(__dirname),
18+
19+
mode: 'development',
20+
21+
devtool: 'eval',
22+
23+
entry: constants.processEntries(entryPoints),
24+
25+
output: {
26+
path: constants.outputPath(__dirname),
27+
publicPath: './', // allows context path to resolve in both js/css
28+
filename: '[name].js'
29+
},
30+
31+
module: {
32+
rules: constants.loaders.TYPESCRIPT_LOADERS.concat(constants.loaders.STYLE_LOADERS)
33+
},
34+
35+
resolve: {
36+
extensions: constants.extensions.TYPESCRIPT
37+
},
38+
39+
plugins: [new webpack.ProvidePlugin({
40+
regeneratorRuntime: 'regenerator-runtime',
41+
})],
42+
43+
node: {
44+
fs: "empty"
45+
},
46+
};

0 commit comments

Comments
 (0)