Skip to content

Commit

Permalink
Swap TensorBoard local build from "tsd" to "typings".
Browse files Browse the repository at this point in the history
Reason: tsd is deprecated (DefinitelyTyped/tsd#269) and typings is the new standard. Also, tsd was behaving badly - running `tsd install` on a clean client was causing it to incorrectly depend on typing files from node_modules, which resulted in a broken build. This issue does not exist with typings.

For convenience, and since typings is really fast when all deps are up-to-date, I made it a part of the standard gulp task. `npm install` so you have all the deps, and running `gulp` will keep the typing files synchronized - there no longer is a separate step for downloading them.

The logical next step is to do the same for bower. I did wire that up, but I will not connect it to the gulp task until after the big bower dependency upgrade CL is through. If I add it right now, it will fail on unresolved dependency conflicts and make everyone sad.
Change: 115370585
  • Loading branch information
A. Unique TensorFlower authored and tensorflower-gardener committed Feb 23, 2016
1 parent 95c5401 commit cd0258a
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 55 deletions.
5 changes: 2 additions & 3 deletions README.md
Expand Up @@ -42,11 +42,11 @@ backend.

If you just want to use TensorBoard, there is no need to read any further.

### Install Node, npm, gulp, bower, and tsd in your machine
### Install Node, npm, gulp, and bower in your machine
Get nodejs and npm through whatever package distribution system is appropriate
for your machine. For example, on Ubuntu 14.04, run
`sudo apt-get install nodejs nodejs-legacy npm`. Then, run
`sudo npm install -g gulp bower tsd`.
`sudo npm install -g gulp bower`.

### Install project dependencies

Expand All @@ -55,7 +55,6 @@ run the following commands.

npm install
bower install
tsd install

### Run Gulp

Expand Down
2 changes: 0 additions & 2 deletions components/tf-categorizer/categorizer.ts
Expand Up @@ -13,8 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../typings/tsd.d.ts" />

module Categorizer {
/**
* This module contains methods that allow sorting tags into "categories".
Expand Down
1 change: 0 additions & 1 deletion components/tf-categorizer/test/categorizerTest.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../../typings/tsd.d.ts" />
/// <reference path="../categorizer.ts" />
var assert = chai.assert;

Expand Down
1 change: 0 additions & 1 deletion components/tf-dashboard-common/urlGenerator.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../typings/tsd.d.ts" />
/// <reference path="../plottable/plottable.d.ts" />

module TF {
Expand Down
1 change: 0 additions & 1 deletion components/tf-event-dashboard/dataCoordinator.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../typings/tsd.d.ts" />
/// <reference path="../plottable/plottable.d.ts" />

module TF {
Expand Down
1 change: 0 additions & 1 deletion components/tf-event-dashboard/dataset.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../typings/tsd.d.ts" />
/// <reference path="../plottable/plottable.d.ts" />

module TF {
Expand Down
1 change: 0 additions & 1 deletion components/tf-event-dashboard/tf-chart.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../typings/tsd.d.ts" />
/// <reference path="../plottable/plottable.d.ts" />

module TF {
Expand Down
2 changes: 0 additions & 2 deletions components/tf-graph-common/lib/common.ts
Expand Up @@ -13,8 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../../typings/tsd.d.ts" />

declare module graphlib {

interface GraphOptions {
Expand Down
1 change: 0 additions & 1 deletion components/tf-graph-common/lib/graph.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../../typings/tsd.d.ts" />
/// <reference path="common.ts" />
module tf.graph {

Expand Down
1 change: 0 additions & 1 deletion components/tf-graph-common/lib/parser.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../../typings/tsd.d.ts" />
/// <reference path="common.ts" />
module tf.graph.parser {

Expand Down
1 change: 0 additions & 1 deletion components/tf-graph-common/lib/scene/minimap.ts
Expand Up @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

/// <reference path="../../../../typings/tsd.d.ts" />
/// <reference path="../common.ts" />

module tf.scene {
Expand Down
23 changes: 17 additions & 6 deletions gulpfile.js
Expand Up @@ -31,6 +31,8 @@ var rename = require('gulp-rename');
var header = require('gulp-header');
var fs = require('fs');
var path = require('path');
var typings = require('gulp-typings');
var bower = require('gulp-bower');
var options = minimist(process.argv.slice(2), {
default: {
p: 8000, // port for gulp server
Expand Down Expand Up @@ -62,16 +64,25 @@ var TF_COMPONENTS_TYPESCRIPT_GLOB = 'components/' + TF_COMPONENTS_PREFIX +

var TF_LIB_TYPESCRIPT_GLOB = 'lib/js/**/*.ts';

gulp.task('compile.all', function() {
gulp.task('typings', function() {
// This task will create a typings directory at root level, with all typings
// installed in it.
return gulp.src('./typings.json')
.pipe(typings());
});

// TODO(danmane): Wire this up once bower.json specifies all resolutions
gulp.task('bower', function() {
return bower();
});

gulp.task('compile.all', ['typings'], function() {
hasError = false;
var isComponent = gulpFilter(['components/**/*.js']);
var isLib = gulpFilter(['lib/js/**/*.js']);
var isApp = gulpFilter(['app/**/*.js']);

var srcs = [TF_COMPONENTS_TYPESCRIPT_GLOB, 'components/**/*.d.ts',
'typings/**/*.d.ts', TF_LIB_TYPESCRIPT_GLOB];

var tsResult = gulp.src(srcs, {base: '.'})
var tsResult = tsProject.src()
.pipe(ts(tsProject))
.on('error', onError);
return merge([
Expand Down Expand Up @@ -187,4 +198,4 @@ gulp.task('vulcanize', ['compile.all', 'tslint-strict'], function() {
});

gulp.task('serve', ['server']); // alias
gulp.task('default', ['watch', 'serve']);
gulp.task('default', ['compile.all', 'watch', 'serve']);
1 change: 0 additions & 1 deletion lib/js/backend/backend.ts
Expand Up @@ -184,7 +184,6 @@ module TF.Backend {
};
};


// The following interfaces (TupleData, HistogramTuple, CompressedHistogramTuple,
// and ImageMetadata) describe how the data is sent over from the backend, and thus
// wall_time, step, value
Expand Down
1 change: 0 additions & 1 deletion lib/js/node-radar/test/nodeRadarTest.ts
Expand Up @@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
/// <reference path="../../../../typings/tsd.d.ts" />

module TF {
let assert = chai.assert;
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -28,6 +28,8 @@
"vulcanize": "^1.14.0",
"web-component-tester": "~3.4.2",
"gulp-header": "~1.7.1",
"gulp-rename": "~1.2.2"
"gulp-rename": "~1.2.2",
"gulp-typings": "~1.1.0",
"gulp-bower": "0.0.13"
}
}
7 changes: 6 additions & 1 deletion tsconfig.json
Expand Up @@ -4,5 +4,10 @@
"noEmitOnError": true,
"target": "ES5"
},
"compileOnSave": false
"compileOnSave": false,
"exclude": [
"node_modules",
"typings/main.d.ts",
"typings/main"
]
}
30 changes: 0 additions & 30 deletions tsd.json

This file was deleted.

12 changes: 12 additions & 0 deletions typings.json
@@ -0,0 +1,12 @@
{
"name": "tensorflow-vis",
"ambientDependencies": {
"chai-3.2.0": "github:DefinitelyTyped/DefinitelyTyped/chai/chai-3.2.0.d.ts#9c25433c84251bfe72bf0030a95edbbb2c81c9d5",
"d3": "github:DefinitelyTyped/DefinitelyTyped/d3/d3.d.ts#eb59a40d3c2f3257e34ec2ede181046230814a41",
"mocha": "github:DefinitelyTyped/DefinitelyTyped/mocha/mocha.d.ts#484544d14d400190b20f270341c97b16adc0f1ef",
"webcomponents.js": "github:DefinitelyTyped/DefinitelyTyped/webcomponents.js/webcomponents.js.d.ts#e9be3cecf8a326d3e220c52b42d218169a7bb9f2",
"lodash": "github:DefinitelyTyped/DefinitelyTyped/lodash/lodash.d.ts#eb835aa72f45eee4246b1de8beeffe2010c689e6",
"polymer": "github:DefinitelyTyped/DefinitelyTyped/polymer/polymer.d.ts#e9be3cecf8a326d3e220c52b42d218169a7bb9f2",
"es6-promise": "github:DefinitelyTyped/DefinitelyTyped/es6-promise/es6-promise.d.ts#e9be3cecf8a326d3e220c52b42d218169a7bb9f2"
}
}

0 comments on commit cd0258a

Please sign in to comment.