Skip to content

Commit

Permalink
Fix build steps. For some reason there was an extra browserify task b…
Browse files Browse the repository at this point in the history
…uilding into dist still. Also, the ui test task didn't take account for tsx
  • Loading branch information
jacobwindsor committed Mar 2, 2017
1 parent 70367ad commit 713072a
Show file tree
Hide file tree
Showing 13 changed files with 1,018 additions and 19 deletions.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
],
"scripts": {
"build": "npm-run-all -p build:*",
"build:es5": "npm run compile:es5 && browserify ./main.js -o ./dist/bridgedb.js -d -t brfs -t deglobalify",
"build:es5": "npm run compile:es5",
"build-broken:esnext": "npm run compile:esnext && browserify ./esnext/main.js -o ./dist/bridgedb.esnext.js -d -t brfs -t deglobalify",
"build:demo": "npm run compile:es5:ui && browserify ./test/e2e/ui-components-local.test.js -o ./demo/ui-combo.bundle.js -d -t brfs -t deglobalify",
"build:demo": "npm run compile:es5:ui && npm run compile:es5:ui:test && browserify ./test/e2e/ui-components-local.test.js -o ./demo/ui-combo.bundle.js -d -t brfs -t deglobalify",
"clean": "npm-run-all clean:*",
"clean:es5": "rm -rf main.js main.d.ts ui",
"clean:esnext": "rm -rf esnext",
"compile": "npm-run-all -p compile:*",
"compile:es5": "npm run clean:es5 && tsc --project tsconfig.json && echo ok || echo not ok",
"compile:esnext": "npm run clean:esnext && tsc --project tsconfig.esnext.json && echo ok || echo not ok",
"compile:es5:ui": "tsc src/ui/react-demo.tsx --jsx react --sourceMap --lib dom,es5,scripthost --module commonjs --outDir ui/ && echo ok || echo not ok",
"compile:es5:ui:test": "tsc --project tsconfig.demo.json && echo ok || echo not ok",
"dev": "npm run build:es5",
"start": "npm-run-all -p start:mockserver start:ui",
"start:mockserver": "./node_modules/mockserver/bin/mockserver.js -p 4522 -m './test/input-data'",
Expand Down Expand Up @@ -89,10 +90,13 @@
"@types/node": "^6.0.58",
"@types/react": "^0.14.43",
"@types/react-dom": "^0.14.18",
"@types/rx": "^4.1.1",
"@types/urijs": "^1.15.27",
"JSONStream": "^1.0.3",
"brfs": "^1.4.3",
"browserfs": "^1.1.0",
"csv-streamify": "^1.0.0",
"deglobalify": "^0.2.0",
"insert-css": "^0.2.0",
"json-loader": "^0.5.4",
"levenshtein": "^1.0.5",
Expand Down Expand Up @@ -151,7 +155,7 @@
"mkdirp": "~0.5.1",
"mocha": "^2.5.3",
"mockserver": "^1.5.1",
"npm-run-all": "^2.1.1",
"npm-run-all": "^2.3.0",
"npm-watch": "^0.1.6",
"pretty-data": "~0.40.0",
"pretty-hrtime": "~0.2.2",
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if (!global.hasOwnProperty('XMLHttpRequest')) {

import {camelCase, defaultsDeep, fill, isArray, isNaN, isNull, isUndefined, isEmpty, isString, omitBy, zip} from 'lodash';


import { Observable } from 'rxjs/Observable';

// TODO should I need to import the interface type definition like this?
Expand Down
13 changes: 4 additions & 9 deletions src/ui/XrefsAnnotationPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// TODO when we add the editor back, make sure this does what it's supposed to when the editor is open
// TODO what happens when the user selects another node without closing the panel?

import * as concat from 'lodash/concat';
import * as compact from 'lodash/compact';
import * as groupBy from 'lodash/groupBy';
import * as pick from 'lodash/pick';
import * as remove from 'lodash/remove';
import * as toPairs from 'lodash/toPairs';
import {concat, compact, groupBy, pick, remove, toPairs} from 'lodash';
import Bridgedb from '../main';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
Expand All @@ -15,9 +10,9 @@ import * as Rx from 'rxjs';
// TODO we don't need everything from these files,
// so remove the unused parts. I'm just using the
// files in their entirety now to save time.
require('./kaavio.css');
require('./stripped-bootstrap.css');
require('./annotation-panel.css');
import './kaavio.css';
import './stripped-bootstrap.css';
import './annotation-panel.css';

let bridgedb = new Bridgedb();

Expand Down
2 changes: 1 addition & 1 deletion src/ui/react-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../index.d.ts" />
/// <reference path="../../typings/index.d.ts" />

import * as React from 'react';
import * as ReactDOM from 'react-dom';
Expand Down
89 changes: 89 additions & 0 deletions test/e2e/ui-components-local.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/// <reference types="react" />
declare module "src/main" {
global {
namespace NodeJS {
interface Global {
XMLHttpRequest: XMLHttpRequest;
}
}
}
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/dom/ajax';
import 'rxjs/add/observable/empty';
import 'rxjs/add/observable/forkJoin';
import 'rxjs/add/observable/from';
import 'rxjs/add/observable/zip';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/find';
import 'rxjs/add/operator/mergeAll';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/multicast';
import 'rxjs/add/operator/reduce';
import 'rxjs/add/operator/publishReplay';
import 'rxjs/add/operator/timeout';
import 'rxjs/add/operator/toArray';
import 'rxjs/add/operator/windowWhen';
import 'rx-extra/add/operator/throughNodeStream';
export const CONFIG_DEFAULT: {
baseIri: string;
context: string;
dataSourcesHeadersIri: string;
dataSourcesMetadataIri: string;
http: {
timeout: number;
retryLimit: number;
retryDelay: number;
};
};
export default class BridgeDb {
config: any;
dataSourceMappings$: any;
getTSV: any;
private xrefsRequestQueue;
private xrefsResponseQueue;
constructor(config?: Partial<typeof CONFIG_DEFAULT>);
attributes(organism: organism, conventionalName: string, identifier: string): any;
attributeSearch(organism: organism, query: string, attrName?: string): Observable<Xref>;
attributeSet(organism: organism): Observable<string[]>;
dataSourceProperties: (input: string) => Observable<DataSource>;
isFreeSearchSupported(organism: organism): Observable<boolean>;
isMappingSupported(organism: organism, sourceConventionalName: string, targetConventionalName: string): Observable<boolean>;
organismProperties(organism: organism): Observable<{}>;
organisms(): Observable<{}>;
private parseXrefRow;
search(organism: organism, query: string): Observable<Xref>;
sourceDataSources(organism: organism): Observable<DataSource>;
targetDataSources(organism: organism): Observable<DataSource>;
xrefExists(organism: organism, conventionalName: string, identifier: string): Observable<boolean>;
xrefs(organism: organism, conventionalName: string, identifier: string, dataSourceFilter?: string): Observable<Xref>;
xrefsBatch: (organism: organism, conventionalNameOrNames: string | string[], identifiers: string[], dataSourceFilter?: string) => Observable<{
organism: string;
inputIdentifier: string;
inputDataSource: string;
xrefs: Xref[];
dataSourceFilter?: string;
}>;
}
}
declare module "src/ui/XrefsAnnotationPanel" {
import * as React from 'react';
import * as Rx from 'rxjs';
import './kaavio.css';
import './stripped-bootstrap.css';
import './annotation-panel.css';
class XrefsAnnotationPanel extends React.Component<any, any> {
xrefsRequest: Rx.Observable<any>;
constructor(props: any);
updateXrefs(): void;
componentDidMount(): void;
componentDidUpdate(prevProps: any, prevState: any): void;
componentWillUnmount(): void;
render(): JSX.Element;
}
export default XrefsAnnotationPanel;
}
declare module "test/e2e/ui-components-local.test" {
}
Loading

0 comments on commit 713072a

Please sign in to comment.