Skip to content

Commit

Permalink
Merge pull request #520 from GMOD/cra_rescripts
Browse files Browse the repository at this point in the history
Electron build of JBrowse desktop
  • Loading branch information
garrettjstevens authored Oct 30, 2019
2 parents 1babf91 + 8e64e7b commit 37e3512
Show file tree
Hide file tree
Showing 166 changed files with 9,396 additions and 6,674 deletions.
24 changes: 11 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ module.exports = {
},
rules: {
'class-methods-use-this': 'off',
'global-require': 'off',
'import/no-cycle': 'warn',
'import/prefer-default-export': 'off',
'max-classes-per-file': 'off',
'monorepo/no-internal-import': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'warn',
'no-param-reassign': 'off',
'no-restricted-syntax': 'off',
'global-require': 'off',
'no-underscore-dangle': 'warn',
'no-unused-vars': 'warn',
'no-use-before-define': 'off',
Expand All @@ -42,11 +43,13 @@ module.exports = {
'react/prefer-stateless-function': 'warn',
'react/prop-types': 'warn',
'react/require-default-props': 'warn',
'spaced-comment': ['error', 'always', { 'markers': ['/'] }],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/camelcase': 'warn',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
settings: {
'import/resolver': {
Expand All @@ -56,16 +59,12 @@ module.exports = {
},
},
overrides: [
{
files: ['packages/generator-jbrowse/**/*'],
env: { node: true },
rules: { '@typescript-eslint/no-var-requires': 'off' },
},
{
files: ['**/*.worker.js'],
globals: { self: true },
rules: { 'no-restricted-globals': 'off' },
},
// {
// "files": ["*.ts", "*.tsx"],
// "rules": {
// "@typescript-eslint/explicit-function-return-type": ["error"]
// }
// },
{
files: ['**/*.test.[t,j]s'],
env: { jest: true },
Expand All @@ -77,7 +76,6 @@ module.exports = {
},
rules: {
'import/no-extraneous-dependencies': 'off',
// 'no-restricted-globals': 'off',
},
},
],
Expand Down
57 changes: 20 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"build": "NODE_ENV=production lerna run build",
"lint": "eslint --report-unused-disable-directives --max-warnings 0 --ext .js,.ts,.jsx,.tsx .",
"typecheck": "tsc --noEmit",
"test-ci": "jest --ci --coverage",
"built-test-ci": "jest --ci packages/integration-tests",
"test": "jest"
Expand All @@ -24,98 +25,80 @@
"@gmod/jbrowse-plugin-linear-genome-view": "^2.0.0",
"@material-ui/core": "^4.0.0",
"@material-ui/styles": "^4.0.0",
"@rescripts/cli": "^0.0.12",
"@svgr/webpack": "^4.1.0",
"@testing-library/jest-dom": "^4.0.0",
"@testing-library/react": "^9.0.0",
"@types/base64-js": "^1.2.5",
"@types/get-value": "^3.0.1",
"@types/jest": "^24.0.9",
"@types/long": "^4.0.0",
"@types/node": "12.7.5",
"@types/pako": "^1.0.1",
"@types/react": "16.9.2",
"@types/react-dom": "^16.9.1",
"@types/set-value": "^2.0.0",
"@types/shortid": "^0.0.29",
"@types/string-template": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^1.7.0",
"@typescript-eslint/parser": "^1.7.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.7.1",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"babel-loader": "^8.0.4",
"babel-plugin-named-asset-import": "^0.3.0",
"babel-preset-mobx": "^2.0.0",
"babel-preset-react-app": "8.0.0-next.b0cbf2ca",
"babel-preset-typescript": "^7.0.0-alpha.19",
"bfj": "^6.1.1",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"chalk": "^2.4.1",
"concurrently": "^4.1.2",
"core-js": "^3.2.1",
"css-loader": "^2.1.0",
"documentation": "^9.3.1",
"dotenv": "^6.0.0",
"dotenv-expand": "^4.2.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-config-react-app": "^4.0.0",
"electron": "^6.0.0",
"eslint-config-airbnb": "^18.0.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-config-react-app": "^5.0.0",
"eslint-config-xo": "^0.26.0",
"eslint-loader": "^2.1.2",
"eslint-plugin-flowtype": "^3.6.1",
"eslint-loader": "^3.0.0",
"eslint-plugin-flowtype": "^4.0.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-monorepo": "^0.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.6.0",
"eslint-plugin-react-hooks": "^2.0.0",
"fetch-mock": "^7.3.3",
"file-loader": "^3.0.1",
"fs-extra": "^7.0.0",
"html-webpack-plugin": "4.0.0-alpha.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.8.0",
"jest-environment-jsdom-fourteen": "^0.1.0",
"jest-pnp-resolver": "^1.2.0",
"jest-resolve": "^24.3.0",
"lerna": "^3.4.1",
"mini-css-extract-plugin": "^0.5.0",
"mobx": "^5.0.0",
"mobx-react": "^6.0.0",
"mobx-state-tree": "3.14.1",
"node-sass": "^4.9.3",
"open-cli": "^5.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"pnp-webpack-plugin": "^1.1.0",
"postcss-flexbugs-fixes": "^4.1.0",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.5.0",
"postcss-safe-parser": "^4.0.1",
"prettier": "^1.18.2",
"prop-types": "^15.0.0",
"range-parser": "^1.2.1",
"react": "^16.8.0",
"react-app-polyfill": "^0.2.0",
"react-dev-utils": "<8.0.0",
"react-dom": "^16.8.0",
"resolve": "^1.8.1",
"react-scripts": "^3.2.0",
"rescript-worker-loader": "^1.0.3",
"rescripts-use-yarn-workspaces": "^1.1.0",
"rimraf": "^2.6.3",
"rxjs": "^6.0.0",
"sass-loader": "^7.1.0",
"standard-changelog": "^2.0.7",
"style-loader": "^0.23.0",
"terser-webpack-plugin": "^1.1.0",
"text-encoding-polyfill": "^0.6.7",
"thread-loader": "^2.1.1",
"ts-jest": "^24.0.2",
"typedoc": "^0.15.0",
"typedoc-plugin-markdown": "^1.1.27",
"typescript": "^3.3.4000",
"url-loader": "^1.1.1",
"webpack": "^4.19.1",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.1.14",
"webpack-manifest-plugin": "^2.0.4",
"wait-on": "^3.3.0",
"webpack-cli": "^3.3.9",
"whatwg-fetch": "^3.0.0",
"workbox-webpack-plugin": "^4.0.0",
"worker-loader": "^2.0.0",
"yeoman-test": "^1.9.1"
}
Expand Down
31 changes: 16 additions & 15 deletions packages/alignments/src/BamAdapter/BamAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ interface HeaderLine {
tag: string
value: string
}
interface SamHeader {
idToName?: string[]
nameToId?: Record<string, number>
}
export default class extends BaseAdapter {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private bam: any
private bam: BamFile

// eslint-disable-next-line @typescript-eslint/no-explicit-any
private samHeader: any
private samHeader?: SamHeader

public static capabilities = ['getFeatures', 'getRefNames']

Expand Down Expand Up @@ -48,9 +50,9 @@ export default class extends BaseAdapter {
this.bam = new BamFile(bamOpts)
}

async setup(): Promise<void> {
async setup(opts: BaseOptions = {}): Promise<void> {
if (!this.samHeader) {
const samHeader = await this.bam.getHeader()
const samHeader = await this.bam.getHeader(opts.signal)
this.samHeader = {}

// use the @SQ lines in the header to figure out the
Expand All @@ -68,16 +70,14 @@ export default class extends BaseAdapter {
}
})
})
if (idToName.length) {
this.samHeader.idToName = idToName
this.samHeader.nameToId = nameToId
}
this.samHeader.idToName = idToName
this.samHeader.nameToId = nameToId
}
}

async getRefNames(): Promise<string[]> {
await this.setup()
return this.samHeader.idToName
async getRefNames(opts: BaseOptions = {}): Promise<string[]> {
await this.setup(opts)
return (this.samHeader && this.samHeader.idToName) || []
}

/**
Expand All @@ -94,7 +94,7 @@ export default class extends BaseAdapter {
): Observable<Feature> {
return ObservableCreate(
async (observer: Observer<Feature>): Promise<void> => {
await this.setup()
await this.setup(opts)
const records = await this.bam.getRecordsForRange(
refName,
start,
Expand All @@ -116,6 +116,7 @@ export default class extends BaseAdapter {
* will not be needed for the forseeable future and can be purged
* from caches, etc
*/
// eslint-disable-next-line @typescript-eslint/no-empty-function
freeResources(/* { region } */): void {}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -126,7 +127,7 @@ export default class extends BaseAdapter {
refIdToName(refId: number): string | undefined {
// use info from the SAM header if possible, but fall back to using
// the ref name order from when the browser's ref names were loaded
if (this.samHeader.idToName) {
if (this.samHeader && this.samHeader.idToName) {
return this.samHeader.idToName[refId]
}
return undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export default class implements Feature {
return this.record._get('md')
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
set(): void {}

tags(): string[] {
Expand Down
1 change: 0 additions & 1 deletion packages/alignments/src/BamAdapter/declare.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/alignments/src/CramAdapter/CramAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export default class CramAdapter extends BaseAdapter {
* will not be needed for the forseeable future and can be purged
* from caches, etc
*/
// eslint-disable-next-line @typescript-eslint/no-empty-function
freeResources(/* { region } */): void {}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export default class CramSlightlyLazyFeature implements Feature {
return undefined
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
set(): void {}

pairedFeature() {
Expand Down
2 changes: 1 addition & 1 deletion packages/alignments/src/PileupRenderer/PileupRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class extends BoxRendererType {
config: any, // eslint-disable-line @typescript-eslint/no-explicit-any
bpPerPx: number,
region: IRegion,
horizontallyFlipped: boolean = false,
horizontallyFlipped = false,
): LayoutRecord | null {
const startPx = bpToPx(
feature.get('start'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import PrerenderedCanvas from '@gmod/jbrowse-core/components/PrerenderedCanvas'
import runner from 'mobx-run-in-reactive-context'
import useTimeout from 'use-timeout'

const useStyles = makeStyles(theme => ({
const useStyles = makeStyles({
hoverLabel: {
border: '1px solid black',
backgroundColor: '#fffa',
position: 'absolute',
pointerEvents: 'none',
zIndex: 10000,
},
}))
})

function Tooltip({ offsetX, offsetY, feature, timeout = 300 }) {
const classes = useStyles()
Expand Down
1 change: 1 addition & 0 deletions packages/bed/src/BigBedAdapter/BigBedAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default class extends BaseAdapter {
})
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
public freeResources(): void {}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export default ({ jbrequire }) => {
export default () => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
return function ChordTrack() {}
}
2 changes: 1 addition & 1 deletion packages/circular-view/src/ChordTrack/models/ChordTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default pluginManager => {
configuration: ConfigurationReference(configSchema),
bezierRadiusRatio: 0.1,
})
.volatile(self => ({
.volatile((/* self */) => ({
refNameMap: undefined,
}))
.views(self => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default ({ jbrequire }) => {
}

const Chord = observer(function Chord({
trackModel,
feature,
blocksForRefs,
radius,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default pluginManager => {
configuration: ConfigurationReference(configSchema),
}),
)
.volatile(self => ({
.volatile((/* self */) => ({
ReactComponent: mainReactComponent,

// NOTE: all this volatile stuff has to be filled in at once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default pluginManager => {

const model = types
.model('RefNameMap', {})
.volatile(self => ({
.volatile((/* self */) => ({
refNameMap: undefined,
}))
.actions(self => ({
Expand All @@ -35,6 +35,7 @@ export default pluginManager => {
)
},

// eslint-disable-next-line @typescript-eslint/no-empty-function
loadAssemblyRefNameMapStarted() {},
loadAssemblyRefNameMapSuccess(result) {
// console.log('loaded refname map', result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ export default ({ jbrequire }) => {
return data
}

async function renderReactionEffect(
props,
signal,
self,
allowRefetch = true,
) {
async function renderReactionEffect(props, signal, self) {
if (!props) {
throw new Error('cannot render with no props')
}
Expand Down
1 change: 1 addition & 0 deletions packages/circular-view/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class CircularViewPlugin {
)
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
configure() {}
}

Expand Down
Loading

0 comments on commit 37e3512

Please sign in to comment.