From 3f27cf779436cda1cfc8b7f227cbd3e967f97cd1 Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Sat, 30 Jan 2016 00:51:22 +0000 Subject: [PATCH 1/8] Switch to typings --- Makefile | 4 +- package.json | 2 +- tsd.json | 105 --------------------------------------------------- typings.json | 37 ++++++++++++++++++ 4 files changed, 40 insertions(+), 108 deletions(-) delete mode 100644 tsd.json create mode 100644 typings.json diff --git a/Makefile b/Makefile index ef8aaf6a..7a27bfd3 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,7 @@ setup: vendor vendor: npm install - rm -f typings/tsd.d.ts - tsd reinstall -so + typings install # Remove derived files clean: @@ -21,3 +20,4 @@ clean: rm -rf otter rm -rf zorilla rm -rf marten + rm -rf typings diff --git a/package.json b/package.json index 7388ca18..e4498434 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "livereload": "^0.3.7", "merge-stream": "^1.0.0", "sync-exec": "^0.6.2", - "tsd": "^0.6.5", "typescript": "~1.7.5", + "typings": "^0.6.3", "vinyl-buffer": "^1.0.0", "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0" diff --git a/tsd.json b/tsd.json deleted file mode 100644 index 7775427c..00000000 --- a/tsd.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "version": "v4", - "repo": "esperco/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "jquery/jquery.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "segment-analytics/segment-analytics.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "fullCalendar/fullCalendar.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "jqueryui/jqueryui.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "chrome/chrome.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "webrtc/MediaStream.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "es6-promise/es6-promise.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "cryptojs/cryptojs.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "moment/moment.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "moment/moment-node.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "jasmine/jasmine.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "lodash/lodash.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "moment-timezone/moment-timezone.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "react/react.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-global.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "eventemitter3/eventemitter3.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "page/page.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "bootstrap/bootstrap.d.ts": { - "commit": "f53108644c2f32b93de423d844650297fc415a8b" - }, - "bootstrap-daterangepicker/bootstrap-daterangepicker.d.ts": { - "commit": "95c9b8d2d4070c35f40295a45efef95af6913579" - }, - "typeahead/typeahead.d.ts": { - "commit": "7c749215797e4a18066f3a5e6fc99d82d7bf144e" - }, - "ravenjs/ravenjs.d.ts": { - "commit": "02bc2983507f9ae82fa67300848f070fd88fd11a" - }, - "quill/quill.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-dom.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-create-fragment.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-css-transition-group.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-transition-group.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-linked-state-mixin.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-perf.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-pure-render-mixin.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-test-utils.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "react/react-addons-update.d.ts": { - "commit": "b5000efa7905758a842aca9f3111d582cf030128" - }, - "highcharts/highcharts.d.ts": { - "commit": "7c749215797e4a18066f3a5e6fc99d82d7bf144e" - } - } -} diff --git a/typings.json b/typings.json new file mode 100644 index 00000000..ec2a270d --- /dev/null +++ b/typings.json @@ -0,0 +1,37 @@ +{ + "ambientDependencies": { + "MediaStream": "github:esperco/DefinitelyTyped/webrtc/MediaStream.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "bootstrap": "github:esperco/DefinitelyTyped/bootstrap/bootstrap.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "bootstrap-daterangepicker": "github:esperco/DefinitelyTyped/bootstrap-daterangepicker/bootstrap-daterangepicker.d.ts#95c9b8d2d4070c35f40295a45efef95af6913579", + "chrome": "github:esperco/DefinitelyTyped/chrome/chrome.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "cryptojs": "github:esperco/DefinitelyTyped/cryptojs/cryptojs.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "es6-promise": "github:esperco/DefinitelyTyped/es6-promise/es6-promise.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "eventemitter3": "github:esperco/DefinitelyTyped/eventemitter3/eventemitter3.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "fullCalendar": "github:esperco/DefinitelyTyped/fullCalendar/fullCalendar.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "highcharts": "github:esperco/DefinitelyTyped/highcharts/highcharts.d.ts#7c749215797e4a18066f3a5e6fc99d82d7bf144e", + "jasmine": "github:esperco/DefinitelyTyped/jasmine/jasmine.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "jquery": "github:esperco/DefinitelyTyped/jquery/jquery.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "jqueryui": "github:esperco/DefinitelyTyped/jqueryui/jqueryui.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "lodash": "github:esperco/DefinitelyTyped/lodash/lodash.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "moment-timezone": "github:esperco/DefinitelyTyped/moment-timezone/moment-timezone.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "page": "github:esperco/DefinitelyTyped/page/page.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "quill": "github:esperco/DefinitelyTyped/quill/quill.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "ravenjs": "github:esperco/DefinitelyTyped/ravenjs/ravenjs.d.ts#02bc2983507f9ae82fa67300848f070fd88fd11a", + "react": "github:esperco/DefinitelyTyped/react/react.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-create-fragment": "github:esperco/DefinitelyTyped/react/react-addons-create-fragment.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-css-transition-group": "github:esperco/DefinitelyTyped/react/react-addons-css-transition-group.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-linked-state-mixin": "github:esperco/DefinitelyTyped/react/react-addons-linked-state-mixin.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-perf": "github:esperco/DefinitelyTyped/react/react-addons-perf.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-pure-render-mixin": "github:esperco/DefinitelyTyped/react/react-addons-pure-render-mixin.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-test-utils": "github:esperco/DefinitelyTyped/react/react-addons-test-utils.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-transition-group": "github:esperco/DefinitelyTyped/react/react-addons-transition-group.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-addons-update": "github:esperco/DefinitelyTyped/react/react-addons-update.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-dom": "github:esperco/DefinitelyTyped/react/react-dom.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "react-global": "github:esperco/DefinitelyTyped/react/react-global.d.ts#b5000efa7905758a842aca9f3111d582cf030128", + "segment-analytics": "github:esperco/DefinitelyTyped/segment-analytics/segment-analytics.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "typeahead": "github:esperco/DefinitelyTyped/typeahead/typeahead.d.ts#7c749215797e4a18066f3a5e6fc99d82d7bf144e" + }, + "dependencies": { + "moment": "github:typings/typed-moment#a4075cd50e63efbedd850f654594f293ab81a385" + } +} From cf5a688f35a539860ef879f6bcb35c3f6b52123a Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Mon, 1 Feb 2016 17:57:06 +0000 Subject: [PATCH 2/8] Update esper.com references --- build-helpers/typescript.js | 2 +- esper.com/ts/chrome-ext.js/chrome-ext.js.ts | 1 + esper.com/ts/chrome-ext.js/tsconfig.json | 2 +- esper.com/ts/common/Analytics.Web.ts | 2 -- esper.com/ts/common/Layout.tsx | 1 - esper.com/ts/common/Login.ts | 1 - esper.com/ts/common/Route.ts | 1 - esper.com/ts/common/tsconfig.json | 8 ++++++++ esper.com/ts/common/typings.d.ts | 3 +++ esper.com/ts/login.js/Login.OAuth.ts | 1 - esper.com/ts/login.js/login.js.tsx | 1 + esper.com/ts/login.js/tsconfig.json | 2 +- esper.com/ts/settings.js/Esper.ts | 10 +--------- esper.com/ts/settings.js/tsconfig.json | 2 +- esper.com/ts/test.js/Integration.Login.ts | 1 - esper.com/ts/test.js/Integration.Time.ts | 1 - esper.com/ts/test.js/Integration.ts | 1 - esper.com/ts/test.js/test.js.ts | 2 +- esper.com/ts/test.js/tsconfig.json | 2 -- esper.com/ts/time.js/Calendars.Test.ts | 1 - esper.com/ts/time.js/Colors.ts | 2 -- .../ts/time.js/Components.IntervalRangeSelector.tsx | 1 - esper.com/ts/time.js/Components.Login.tsx | 1 - esper.com/ts/time.js/DailyStats.Test.ts | 1 - esper.com/ts/time.js/Esper.ts | 12 +----------- esper.com/ts/time.js/Partition.Test.ts | 1 - esper.com/ts/time.js/Route.Test.ts | 2 +- esper.com/ts/time.js/Teams.Test.ts | 1 - esper.com/ts/time.js/TestFixtures.ts | 1 - esper.com/ts/time.js/TimeStats.Test.ts | 1 - esper.com/ts/time.js/Views.CalendarLabeling.Test.tsx | 1 - esper.com/ts/time.js/Views.Charts.Test.tsx | 1 - esper.com/ts/time.js/tsconfig.json | 3 +-- esper.com/ts/typings | 2 +- 34 files changed, 23 insertions(+), 52 deletions(-) create mode 100644 esper.com/ts/common/tsconfig.json create mode 100644 esper.com/ts/common/typings.d.ts diff --git a/build-helpers/typescript.js b/build-helpers/typescript.js index 45f7ed39..3a6f6da8 100644 --- a/build-helpers/typescript.js +++ b/build-helpers/typescript.js @@ -62,7 +62,7 @@ var build = function(globs, tsConfigPath, outDir) { } // Get entry points from config files - var files = config.files || []; + var files = config.anyFiles || []; if (production.isSet()) { files = files.concat(config.prodFiles || []); } else { diff --git a/esper.com/ts/chrome-ext.js/chrome-ext.js.ts b/esper.com/ts/chrome-ext.js/chrome-ext.js.ts index 57945971..bb253ed4 100644 --- a/esper.com/ts/chrome-ext.js/chrome-ext.js.ts +++ b/esper.com/ts/chrome-ext.js/chrome-ext.js.ts @@ -3,6 +3,7 @@ Chrome extension */ +/// /// /// diff --git a/esper.com/ts/chrome-ext.js/tsconfig.json b/esper.com/ts/chrome-ext.js/tsconfig.json index 5ae45c72..73b8db02 100644 --- a/esper.com/ts/chrome-ext.js/tsconfig.json +++ b/esper.com/ts/chrome-ext.js/tsconfig.json @@ -4,7 +4,7 @@ "outFile": "chrome-ext.js" }, - "files": [ + "anyFiles": [ "chrome-ext.js.ts" ] } diff --git a/esper.com/ts/common/Analytics.Web.ts b/esper.com/ts/common/Analytics.Web.ts index b281a5b8..07ecb778 100644 --- a/esper.com/ts/common/Analytics.Web.ts +++ b/esper.com/ts/common/Analytics.Web.ts @@ -4,8 +4,6 @@ or global scope. */ -/// -/// /// /// /// diff --git a/esper.com/ts/common/Layout.tsx b/esper.com/ts/common/Layout.tsx index d41c2257..9ff6422a 100644 --- a/esper.com/ts/common/Layout.tsx +++ b/esper.com/ts/common/Layout.tsx @@ -2,7 +2,6 @@ Module for rendering things (mostly React components) into our HTML page */ -/// /// module Esper.Layout { diff --git a/esper.com/ts/common/Login.ts b/esper.com/ts/common/Login.ts index dca5c349..5ac8b9a9 100644 --- a/esper.com/ts/common/Login.ts +++ b/esper.com/ts/common/Login.ts @@ -2,7 +2,6 @@ Refactored login code for OAuth clients (Zorilla, Grison, Otter) */ -/// /// /// /// diff --git a/esper.com/ts/common/Route.ts b/esper.com/ts/common/Route.ts index b79f41e1..301b56db 100644 --- a/esper.com/ts/common/Route.ts +++ b/esper.com/ts/common/Route.ts @@ -1,6 +1,5 @@ // Helpers for client-side router -/// /// module Esper.Route { diff --git a/esper.com/ts/common/tsconfig.json b/esper.com/ts/common/tsconfig.json new file mode 100644 index 00000000..c3c1f07c --- /dev/null +++ b/esper.com/ts/common/tsconfig.json @@ -0,0 +1,8 @@ +{ + "description": "Placeholder tsconfig so editor plugins recognize definitions", + + "compilerOptions": { + "noImplicitAny": true, + "jsx": "react" + } +} diff --git a/esper.com/ts/common/typings.d.ts b/esper.com/ts/common/typings.d.ts new file mode 100644 index 00000000..054af6df --- /dev/null +++ b/esper.com/ts/common/typings.d.ts @@ -0,0 +1,3 @@ +/* Include all typings for now */ + +/// diff --git a/esper.com/ts/login.js/Login.OAuth.ts b/esper.com/ts/login.js/Login.OAuth.ts index d5f61750..751c0f85 100644 --- a/esper.com/ts/login.js/Login.OAuth.ts +++ b/esper.com/ts/login.js/Login.OAuth.ts @@ -2,7 +2,6 @@ Refactored login code for OAuth clients (Zorilla, Grison, Otter) */ -/// /// /// /// diff --git a/esper.com/ts/login.js/login.js.tsx b/esper.com/ts/login.js/login.js.tsx index 827aef87..2cabaa81 100644 --- a/esper.com/ts/login.js/login.js.tsx +++ b/esper.com/ts/login.js/login.js.tsx @@ -1,3 +1,4 @@ +/// /// /// /// diff --git a/esper.com/ts/login.js/tsconfig.json b/esper.com/ts/login.js/tsconfig.json index c558b071..8c193291 100644 --- a/esper.com/ts/login.js/tsconfig.json +++ b/esper.com/ts/login.js/tsconfig.json @@ -5,7 +5,7 @@ "outFile": "login.js" }, - "files": [ + "anyFiles": [ "login.js.tsx" ], diff --git a/esper.com/ts/settings.js/Esper.ts b/esper.com/ts/settings.js/Esper.ts index 773a6b89..f64fe43a 100644 --- a/esper.com/ts/settings.js/Esper.ts +++ b/esper.com/ts/settings.js/Esper.ts @@ -4,15 +4,7 @@ Esper module. */ -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// declare module Esper { export var _: _.LoDashStatic; diff --git a/esper.com/ts/settings.js/tsconfig.json b/esper.com/ts/settings.js/tsconfig.json index 6a8485d5..ea0dbc91 100644 --- a/esper.com/ts/settings.js/tsconfig.json +++ b/esper.com/ts/settings.js/tsconfig.json @@ -6,7 +6,7 @@ "oblivion": true, - "files": [ + "anyFiles": [ "Esper.ts", "List.ts", "Deferred.ts", diff --git a/esper.com/ts/test.js/Integration.Login.ts b/esper.com/ts/test.js/Integration.Login.ts index ec0d7cb1..4cc405e9 100644 --- a/esper.com/ts/test.js/Integration.Login.ts +++ b/esper.com/ts/test.js/Integration.Login.ts @@ -1,4 +1,3 @@ -/// /// /// /// diff --git a/esper.com/ts/test.js/Integration.Time.ts b/esper.com/ts/test.js/Integration.Time.ts index 4e72d2f2..1a29ac52 100644 --- a/esper.com/ts/test.js/Integration.Time.ts +++ b/esper.com/ts/test.js/Integration.Time.ts @@ -1,4 +1,3 @@ -/// /// /// /// diff --git a/esper.com/ts/test.js/Integration.ts b/esper.com/ts/test.js/Integration.ts index 8d2ddc48..adaf4571 100644 --- a/esper.com/ts/test.js/Integration.ts +++ b/esper.com/ts/test.js/Integration.ts @@ -1,6 +1,5 @@ // Integration test helpers -/// /// /// diff --git a/esper.com/ts/test.js/test.js.ts b/esper.com/ts/test.js/test.js.ts index 921b99b2..d9914a66 100644 --- a/esper.com/ts/test.js/test.js.ts +++ b/esper.com/ts/test.js/test.js.ts @@ -1,6 +1,6 @@ /* Define external libs used by test.js */ -/// +/// // React is a namespace, so we need a way to refer to its type type ReactStatic = typeof React; diff --git a/esper.com/ts/test.js/tsconfig.json b/esper.com/ts/test.js/tsconfig.json index a9d4016e..5a33e9b6 100644 --- a/esper.com/ts/test.js/tsconfig.json +++ b/esper.com/ts/test.js/tsconfig.json @@ -5,8 +5,6 @@ "outFile": "test.js" }, - "files": [], - "devFiles": [ "test.js.ts", "../lib/Test.ts", diff --git a/esper.com/ts/time.js/Calendars.Test.ts b/esper.com/ts/time.js/Calendars.Test.ts index 464f7f60..5452fe11 100644 --- a/esper.com/ts/time.js/Calendars.Test.ts +++ b/esper.com/ts/time.js/Calendars.Test.ts @@ -1,4 +1,3 @@ -/// /// module Esper.Calendars { describe("defaultSelection", function() { diff --git a/esper.com/ts/time.js/Colors.ts b/esper.com/ts/time.js/Colors.ts index 28d34e24..46b45d9a 100644 --- a/esper.com/ts/time.js/Colors.ts +++ b/esper.com/ts/time.js/Colors.ts @@ -2,8 +2,6 @@ A module for assigning colors to labels */ -/// - module Esper.Colors { // Preset list of calendars -- these look pretty close to Google Calendar diff --git a/esper.com/ts/time.js/Components.IntervalRangeSelector.tsx b/esper.com/ts/time.js/Components.IntervalRangeSelector.tsx index 30b50b22..52077f29 100644 --- a/esper.com/ts/time.js/Components.IntervalRangeSelector.tsx +++ b/esper.com/ts/time.js/Components.IntervalRangeSelector.tsx @@ -2,7 +2,6 @@ Interface for selecting date and time ranges */ -/// /// /// /// diff --git a/esper.com/ts/time.js/Components.Login.tsx b/esper.com/ts/time.js/Components.Login.tsx index 28516cf0..a3aa80ce 100644 --- a/esper.com/ts/time.js/Components.Login.tsx +++ b/esper.com/ts/time.js/Components.Login.tsx @@ -2,7 +2,6 @@ Displays login info or link to login via Otter */ -/// /// /// /// diff --git a/esper.com/ts/time.js/DailyStats.Test.ts b/esper.com/ts/time.js/DailyStats.Test.ts index 16fbacfb..487b0a69 100644 --- a/esper.com/ts/time.js/DailyStats.Test.ts +++ b/esper.com/ts/time.js/DailyStats.Test.ts @@ -1,4 +1,3 @@ -/// /// /// /// diff --git a/esper.com/ts/time.js/Esper.ts b/esper.com/ts/time.js/Esper.ts index fd3a3bed..e299038b 100644 --- a/esper.com/ts/time.js/Esper.ts +++ b/esper.com/ts/time.js/Esper.ts @@ -1,14 +1,4 @@ -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// // React is a namespace, so we need a way to refer to its type type ReactStatic = typeof React; diff --git a/esper.com/ts/time.js/Partition.Test.ts b/esper.com/ts/time.js/Partition.Test.ts index 7742ba20..634b69b0 100644 --- a/esper.com/ts/time.js/Partition.Test.ts +++ b/esper.com/ts/time.js/Partition.Test.ts @@ -1,4 +1,3 @@ -/// /// /// diff --git a/esper.com/ts/time.js/Route.Test.ts b/esper.com/ts/time.js/Route.Test.ts index cad84ae3..83827101 100644 --- a/esper.com/ts/time.js/Route.Test.ts +++ b/esper.com/ts/time.js/Route.Test.ts @@ -1,6 +1,6 @@ -/// /// /// +/// module Esper.Route { // Helper for testing Layout.render's arguments vs. React components diff --git a/esper.com/ts/time.js/Teams.Test.ts b/esper.com/ts/time.js/Teams.Test.ts index 46069167..69941e07 100644 --- a/esper.com/ts/time.js/Teams.Test.ts +++ b/esper.com/ts/time.js/Teams.Test.ts @@ -1,4 +1,3 @@ -/// /// /// /// diff --git a/esper.com/ts/time.js/TestFixtures.ts b/esper.com/ts/time.js/TestFixtures.ts index a5e915e4..88ee1468 100644 --- a/esper.com/ts/time.js/TestFixtures.ts +++ b/esper.com/ts/time.js/TestFixtures.ts @@ -2,7 +2,6 @@ Zorilla-specific test fixutres */ -/// /// /// /// diff --git a/esper.com/ts/time.js/TimeStats.Test.ts b/esper.com/ts/time.js/TimeStats.Test.ts index 60f54e2c..58970de8 100644 --- a/esper.com/ts/time.js/TimeStats.Test.ts +++ b/esper.com/ts/time.js/TimeStats.Test.ts @@ -1,4 +1,3 @@ -/// /// /// diff --git a/esper.com/ts/time.js/Views.CalendarLabeling.Test.tsx b/esper.com/ts/time.js/Views.CalendarLabeling.Test.tsx index 17bdaff9..1be89377 100644 --- a/esper.com/ts/time.js/Views.CalendarLabeling.Test.tsx +++ b/esper.com/ts/time.js/Views.CalendarLabeling.Test.tsx @@ -1,4 +1,3 @@ -/// /// /// /// diff --git a/esper.com/ts/time.js/Views.Charts.Test.tsx b/esper.com/ts/time.js/Views.Charts.Test.tsx index b25592db..64ccabae 100644 --- a/esper.com/ts/time.js/Views.Charts.Test.tsx +++ b/esper.com/ts/time.js/Views.Charts.Test.tsx @@ -1,4 +1,3 @@ -/// /// /// /// diff --git a/esper.com/ts/time.js/tsconfig.json b/esper.com/ts/time.js/tsconfig.json index 13ed09f4..b9ebf358 100644 --- a/esper.com/ts/time.js/tsconfig.json +++ b/esper.com/ts/time.js/tsconfig.json @@ -5,7 +5,7 @@ "outFile": "time.js" }, - "files": [ + "anyFiles": [ "Main.ts" ], @@ -14,7 +14,6 @@ "Calendars.Test.ts", "DailyStats.Test.ts", "Partition.Test.ts", - "Route.Test.ts", "Teams.Test.ts", "TimeStats.Test.ts", "Views.Charts.Test.tsx", diff --git a/esper.com/ts/typings b/esper.com/ts/typings index a019c6ec..4ef8b830 120000 --- a/esper.com/ts/typings +++ b/esper.com/ts/typings @@ -1 +1 @@ -../../typings \ No newline at end of file +../../typings/browser \ No newline at end of file From 034841bf320ebaa1e3750d94eff60b8a90c91f80 Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Mon, 1 Feb 2016 17:58:00 +0000 Subject: [PATCH 3/8] lib-ts reference updates --- lib-ts/Analytics.Iframe.ts | 2 -- lib-ts/Api.ts | 2 -- lib-ts/ApiC.Test.ts | 3 +-- lib-ts/ApiC.ts | 1 - lib-ts/Components.Modal.tsx | 1 - lib-ts/Emit.Test.ts | 1 - lib-ts/Emit.ts | 4 +--- lib-ts/JQStore.Test.ts | 3 +-- lib-ts/JQStore.ts | 4 +--- lib-ts/JsonHttp.ts | 2 -- lib-ts/LocalStore.Test.ts | 1 - lib-ts/Log.ts | 1 - lib-ts/Model.Batch.Test.ts | 3 +-- lib-ts/Model.StoreOne.Test.ts | 3 +-- lib-ts/Model.Test.ts | 1 - lib-ts/Model.ts | 1 - lib-ts/Queue.Test.ts | 1 - lib-ts/Queue.ts | 1 - lib-ts/ReactHelpers.Test.ts | 3 +-- lib-ts/ReactHelpers.ts | 1 - lib-ts/Test.ts | 4 ---- lib-ts/Util.Test.ts | 3 +-- lib-ts/Util.ts | 2 -- 23 files changed, 8 insertions(+), 40 deletions(-) diff --git a/lib-ts/Analytics.Iframe.ts b/lib-ts/Analytics.Iframe.ts index 2b7a4919..8ac0cd53 100644 --- a/lib-ts/Analytics.Iframe.ts +++ b/lib-ts/Analytics.Iframe.ts @@ -3,8 +3,6 @@ via a hidden iFrame. */ -/// -/// /// /// diff --git a/lib-ts/Api.ts b/lib-ts/Api.ts index 40161c4a..033f7990 100644 --- a/lib-ts/Api.ts +++ b/lib-ts/Api.ts @@ -3,8 +3,6 @@ in one module but less of a headache than keeping everything separate */ -/// -/// /// /// /// diff --git a/lib-ts/ApiC.Test.ts b/lib-ts/ApiC.Test.ts index d05a1a9f..645c913f 100644 --- a/lib-ts/ApiC.Test.ts +++ b/lib-ts/ApiC.Test.ts @@ -1,4 +1,3 @@ -/// /// module Esper.ApiC { var ApiTest = { @@ -198,4 +197,4 @@ module Esper.ApiC { }); }); }); -} \ No newline at end of file +} diff --git a/lib-ts/ApiC.ts b/lib-ts/ApiC.ts index 955220e3..c4878287 100644 --- a/lib-ts/ApiC.ts +++ b/lib-ts/ApiC.ts @@ -2,7 +2,6 @@ Caching for API calls */ -/// /// /// /// diff --git a/lib-ts/Components.Modal.tsx b/lib-ts/Components.Modal.tsx index 65f0ef12..9c3d0b5f 100644 --- a/lib-ts/Components.Modal.tsx +++ b/lib-ts/Components.Modal.tsx @@ -2,7 +2,6 @@ Generic Bootstrap modal wrapper */ -/// /// module Esper.Components { diff --git a/lib-ts/Emit.Test.ts b/lib-ts/Emit.Test.ts index 1c4f6470..d9dc2fc4 100644 --- a/lib-ts/Emit.Test.ts +++ b/lib-ts/Emit.Test.ts @@ -1,4 +1,3 @@ -/// /// module Esper.Emit { diff --git a/lib-ts/Emit.ts b/lib-ts/Emit.ts index d234c395..caa72fd1 100644 --- a/lib-ts/Emit.ts +++ b/lib-ts/Emit.ts @@ -3,8 +3,6 @@ changes. */ -/// -/// declare module Esper { export var EventEmitter: typeof EventEmitter3.EventEmitter; } @@ -125,4 +123,4 @@ module Esper.Emit { protected onChange = (): void => this.emitChange(); } -} \ No newline at end of file +} diff --git a/lib-ts/JQStore.Test.ts b/lib-ts/JQStore.Test.ts index 58288df6..cd4db789 100644 --- a/lib-ts/JQStore.Test.ts +++ b/lib-ts/JQStore.Test.ts @@ -1,6 +1,5 @@ // Tests for JQStore -/// /// module Esper { @@ -50,4 +49,4 @@ module Esper { expect(this.store.get()).toBeUndefined(); }); }); -} \ No newline at end of file +} diff --git a/lib-ts/JQStore.ts b/lib-ts/JQStore.ts index af09975b..311a8d93 100644 --- a/lib-ts/JQStore.ts +++ b/lib-ts/JQStore.ts @@ -4,8 +4,6 @@ memory leaks. */ -/// - module Esper { // http://stackoverflow.com/a/10172676 @@ -36,4 +34,4 @@ module Esper { delete this.elm; } } -} \ No newline at end of file +} diff --git a/lib-ts/JsonHttp.ts b/lib-ts/JsonHttp.ts index 2de4454f..26f256c4 100644 --- a/lib-ts/JsonHttp.ts +++ b/lib-ts/JsonHttp.ts @@ -5,8 +5,6 @@ Assumes CryptoJS */ -/// -/// /// /// diff --git a/lib-ts/LocalStore.Test.ts b/lib-ts/LocalStore.Test.ts index ca38cc1e..b5eea2b8 100644 --- a/lib-ts/LocalStore.Test.ts +++ b/lib-ts/LocalStore.Test.ts @@ -1,6 +1,5 @@ /* Test LocalStore */ -/// /// module Esper.LocalStore { diff --git a/lib-ts/Log.ts b/lib-ts/Log.ts index ad228a68..38e8e256 100644 --- a/lib-ts/Log.ts +++ b/lib-ts/Log.ts @@ -1,4 +1,3 @@ -/// /// declare module Esper { diff --git a/lib-ts/Model.Batch.Test.ts b/lib-ts/Model.Batch.Test.ts index 87c77f1d..b499b7b3 100644 --- a/lib-ts/Model.Batch.Test.ts +++ b/lib-ts/Model.Batch.Test.ts @@ -1,4 +1,3 @@ -/// /// module Esper.Model { @@ -169,4 +168,4 @@ module Esper.Model { }); }); }); -} \ No newline at end of file +} diff --git a/lib-ts/Model.StoreOne.Test.ts b/lib-ts/Model.StoreOne.Test.ts index f06e4f35..11ae51dc 100644 --- a/lib-ts/Model.StoreOne.Test.ts +++ b/lib-ts/Model.StoreOne.Test.ts @@ -1,6 +1,5 @@ /* Test StoreOne module */ -/// /// module Esper.Model { @@ -197,4 +196,4 @@ module Esper.Model { }); }); }); -} \ No newline at end of file +} diff --git a/lib-ts/Model.Test.ts b/lib-ts/Model.Test.ts index da0c6db4..1ece0f1a 100644 --- a/lib-ts/Model.Test.ts +++ b/lib-ts/Model.Test.ts @@ -1,6 +1,5 @@ /* Test Model.Store */ -/// /// module Esper.Model { diff --git a/lib-ts/Model.ts b/lib-ts/Model.ts index 372c17b6..c6e60bc3 100644 --- a/lib-ts/Model.ts +++ b/lib-ts/Model.ts @@ -8,7 +8,6 @@ the dispatcher so they're updated when Actions are dispatched. */ -/// /// /// diff --git a/lib-ts/Queue.Test.ts b/lib-ts/Queue.Test.ts index adb4396d..a3a1812e 100644 --- a/lib-ts/Queue.Test.ts +++ b/lib-ts/Queue.Test.ts @@ -1,4 +1,3 @@ -/// /// module Esper.Queue { describe("Queue.enqueue", function() { diff --git a/lib-ts/Queue.ts b/lib-ts/Queue.ts index d4f2c21b..bf4abfd8 100644 --- a/lib-ts/Queue.ts +++ b/lib-ts/Queue.ts @@ -3,7 +3,6 @@ order to avoid race conditions). */ -/// /// module Esper.Queue { diff --git a/lib-ts/ReactHelpers.Test.ts b/lib-ts/ReactHelpers.Test.ts index 43cc5be0..c7e8a007 100644 --- a/lib-ts/ReactHelpers.Test.ts +++ b/lib-ts/ReactHelpers.Test.ts @@ -3,7 +3,6 @@ being present. */ -/// /// /// /// @@ -303,4 +302,4 @@ module Esper.ReactHelpers { expect(this.component.render.calls.count()).toEqual(3); }); }); -} \ No newline at end of file +} diff --git a/lib-ts/ReactHelpers.ts b/lib-ts/ReactHelpers.ts index 25a553ed..cd54c415 100644 --- a/lib-ts/ReactHelpers.ts +++ b/lib-ts/ReactHelpers.ts @@ -3,7 +3,6 @@ being present. */ -/// /// /// /// diff --git a/lib-ts/Test.ts b/lib-ts/Test.ts index 99a0e3ce..690221af 100644 --- a/lib-ts/Test.ts +++ b/lib-ts/Test.ts @@ -3,10 +3,6 @@ and React. */ -/// -/// -/// -/// /// module Esper.Test { diff --git a/lib-ts/Util.Test.ts b/lib-ts/Util.Test.ts index ccd9deef..d666c069 100644 --- a/lib-ts/Util.Test.ts +++ b/lib-ts/Util.Test.ts @@ -1,4 +1,3 @@ -/// /// module Esper.Util { @@ -112,4 +111,4 @@ module Esper.Util { }); }); }); -} \ No newline at end of file +} diff --git a/lib-ts/Util.ts b/lib-ts/Util.ts index f05ac2c4..e101b1f3 100644 --- a/lib-ts/Util.ts +++ b/lib-ts/Util.ts @@ -1,5 +1,3 @@ -/// - module Esper.Util { // Return a random alphanumeric string export function randomString() { From 43a5a6c2a59cfd49fa5443271346290ecc2ac2df Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Mon, 1 Feb 2016 20:00:43 +0000 Subject: [PATCH 4/8] Update type references in Stoat --- stoat/common/Esper.ts | 15 +-------------- stoat/common/ExtensionOptions.Storage.ts | 2 -- stoat/common/Login.ts | 1 - stoat/common/Makefile | 6 +++--- stoat/common/Message.Chrome.ts | 1 - stoat/content-script/CalSidebar.Storage.ts | 3 +-- stoat/content-script/Main.ts | 7 +------ stoat/content-script/ThreadState.Storage.ts | 3 +-- stoat/event-page/Main.ts | 6 +----- stoat/event-page/Update.ts | 1 - stoat/gcal-is/CalSidebar.tsx | 1 - stoat/gcal-is/Main.ts | 6 +----- stoat/gmail-is/Main.ts | 1 + stoat/gulpfile.js | 11 ++++++++--- stoat/options-page/Main.ts | 6 +----- stoat/typings | 1 - 16 files changed, 19 insertions(+), 52 deletions(-) delete mode 120000 stoat/typings diff --git a/stoat/common/Esper.ts b/stoat/common/Esper.ts index 9021ae7c..25212a25 100644 --- a/stoat/common/Esper.ts +++ b/stoat/common/Esper.ts @@ -4,20 +4,7 @@ Esper module. */ -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// // React is a namespace, so we need a way to refer to its type type ReactStatic = typeof React; diff --git a/stoat/common/ExtensionOptions.Storage.ts b/stoat/common/ExtensionOptions.Storage.ts index 78c195a5..45fb3a1e 100644 --- a/stoat/common/ExtensionOptions.Storage.ts +++ b/stoat/common/ExtensionOptions.Storage.ts @@ -5,8 +5,6 @@ /// /// -/// -/// module Esper.ExtensionOptions { diff --git a/stoat/common/Login.ts b/stoat/common/Login.ts index e52d6445..22e9c553 100644 --- a/stoat/common/Login.ts +++ b/stoat/common/Login.ts @@ -1,4 +1,3 @@ -/// /// /// /// diff --git a/stoat/common/Makefile b/stoat/common/Makefile index 47cbc081..03bfd79a 100644 --- a/stoat/common/Makefile +++ b/stoat/common/Makefile @@ -1,14 +1,14 @@ -.PHONY: clean +.PHONY: clean DevConf.ts ProdConf.ts default: DevConf.ts # NB: Use NPM to build # Makefile just here to set up Conf files and clean up DevConf.ts: DevConf.ts.in ../VERSION - sed -e "s:@@VERSION@@:`cat ../VERSION`:g" DevConf.ts.in > $@ + sed -e "s:@@VERSION@@:`cat ../VERSION`:g" DevConf.ts.in > Conf.ts ProdConf.ts: ProdConf.ts.in ../VERSION - sed -e "s:@@VERSION@@:`cat ../VERSION`:g" ProdConf.ts.in > $@ + sed -e "s:@@VERSION@@:`cat ../VERSION`:g" ProdConf.ts.in > Conf.ts clean: rm -f *~ diff --git a/stoat/common/Message.Chrome.ts b/stoat/common/Message.Chrome.ts index aa6bc492..8a6617d4 100644 --- a/stoat/common/Message.Chrome.ts +++ b/stoat/common/Message.Chrome.ts @@ -4,7 +4,6 @@ */ /// -/// module Esper.Message { diff --git a/stoat/content-script/CalSidebar.Storage.ts b/stoat/content-script/CalSidebar.Storage.ts index 8fb689e6..4ae32f59 100644 --- a/stoat/content-script/CalSidebar.Storage.ts +++ b/stoat/content-script/CalSidebar.Storage.ts @@ -4,7 +4,6 @@ TODO: Refactor against ThreadState.Storage.ts. */ -/// /// /// /// @@ -78,4 +77,4 @@ module Esper.CalSidebar { initialized = true; } } -} \ No newline at end of file +} diff --git a/stoat/content-script/Main.ts b/stoat/content-script/Main.ts index f86b66db..c507beba 100644 --- a/stoat/content-script/Main.ts +++ b/stoat/content-script/Main.ts @@ -5,17 +5,12 @@ https://developer.chrome.com/extensions/content_scripts */ -/// -/// -/// -/// -/// - /// /// /// /// +/// /// /// /// diff --git a/stoat/content-script/ThreadState.Storage.ts b/stoat/content-script/ThreadState.Storage.ts index 6febff12..6da7075f 100644 --- a/stoat/content-script/ThreadState.Storage.ts +++ b/stoat/content-script/ThreadState.Storage.ts @@ -1,6 +1,5 @@ // Sync ThreadState with local Chrome profile data -/// /// /// /// @@ -91,4 +90,4 @@ module Esper.ThreadState { initialized = true; } } -} \ No newline at end of file +} diff --git a/stoat/event-page/Main.ts b/stoat/event-page/Main.ts index 7fcf417d..f5baa2f3 100644 --- a/stoat/event-page/Main.ts +++ b/stoat/event-page/Main.ts @@ -11,14 +11,10 @@ CSPs (which occasionally affect Content Scripts for some reason) */ -/// -/// -/// -/// - /// /// +/// /// /// /// diff --git a/stoat/event-page/Update.ts b/stoat/event-page/Update.ts index 72574438..85366b47 100644 --- a/stoat/event-page/Update.ts +++ b/stoat/event-page/Update.ts @@ -2,7 +2,6 @@ Manually request updates to latest Chrome E */ -/// /// module Esper.Update { diff --git a/stoat/gcal-is/CalSidebar.tsx b/stoat/gcal-is/CalSidebar.tsx index f10b1522..366a3c39 100644 --- a/stoat/gcal-is/CalSidebar.tsx +++ b/stoat/gcal-is/CalSidebar.tsx @@ -2,7 +2,6 @@ Calendar sidebar (differs a bit from Gmail sidebar) */ -/// /// /// /// diff --git a/stoat/gcal-is/Main.ts b/stoat/gcal-is/Main.ts index 5f6f2328..501f1522 100644 --- a/stoat/gcal-is/Main.ts +++ b/stoat/gcal-is/Main.ts @@ -4,11 +4,6 @@ as required by gmail.js. */ -/// -/// -/// -/// - /// /// /// @@ -16,6 +11,7 @@ /// /// +/// /// /// /// diff --git a/stoat/gmail-is/Main.ts b/stoat/gmail-is/Main.ts index 3d3379e0..559e4b79 100644 --- a/stoat/gmail-is/Main.ts +++ b/stoat/gmail-is/Main.ts @@ -11,6 +11,7 @@ /// /// +/// /// /// /// diff --git a/stoat/gulpfile.js b/stoat/gulpfile.js index 17610391..53b664f4 100644 --- a/stoat/gulpfile.js +++ b/stoat/gulpfile.js @@ -21,16 +21,21 @@ var config = { jsBundles: ["vendor.js"], jsOut: "pub/js", + // Used for watcher only -- typescript helper uses mix of tsConfig base dir + // plus tsCommonGlobs tsGlobs: [ "common/**/*.{ts,tsx}", "lib/**/*.{ts,tsx}", - "typings/**/*.d.ts", "content-script/**/*.{ts,tsx}", "event-page/**/*.{ts,tsx}", "gcal-is/**/*.{ts,tsx}", "gmail-is/**/*.{ts,tsx}", "options-page/**/*.{ts,tsx}" ], + tsCommonGlobs: [ + "common/**/*.{ts,tsx}", + "lib/**/*.{ts,tsx}" + ], tsProjects: [ "content-script/tsconfig.json", "event-page/tsconfig.json", @@ -56,8 +61,8 @@ gulp.task("build-less", function() { gulp.task("watch-less", watch(config.lessGlobs, "build-less")); gulp.task("build-ts", function() { - return helpers.typescript(config.tsGlobs, - config.tsProjects, + return helpers.typescript(config.tsProjects, + config.tsCommonGlobs, config.jsOut); }); diff --git a/stoat/options-page/Main.ts b/stoat/options-page/Main.ts index 839b3aa9..16b59284 100644 --- a/stoat/options-page/Main.ts +++ b/stoat/options-page/Main.ts @@ -2,12 +2,8 @@ Entry point for the options.js script */ -/// -/// -/// -/// - /// +/// /// /// diff --git a/stoat/typings b/stoat/typings deleted file mode 120000 index 4fe6a5e5..00000000 --- a/stoat/typings +++ /dev/null @@ -1 +0,0 @@ -../typings/ \ No newline at end of file From 2c7db8e16429cfb1851c8d82e974dcd1cbd8c05e Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Mon, 1 Feb 2016 20:01:40 +0000 Subject: [PATCH 5/8] Rework build process to better match tsconfig's --- build-helpers/typescript.js | 56 +++++++++++++++--------- esper.com/gulpfile.js | 10 ++++- esper.com/ts/chrome-ext.js/tsconfig.json | 6 +-- esper.com/ts/common/tsconfig.json | 2 +- esper.com/ts/common/typings.d.ts | 2 +- esper.com/ts/login.js/tsconfig.json | 6 +-- esper.com/ts/settings.js/tsconfig.json | 41 ++--------------- esper.com/ts/test.js/tsconfig.json | 4 +- esper.com/ts/time.js/tsconfig.json | 8 +--- esper.com/ts/typings | 1 - lib-ts/Watchable.ts | 2 +- lib-ts/tsconfig.json | 8 ++++ lib-ts/typings.d.ts | 6 +++ package.json | 4 +- stoat/content-script/tsconfig.json | 14 +----- stoat/event-page/tsconfig.json | 13 ++---- stoat/gcal-is/tsconfig.json | 8 +--- stoat/gmail-is/tsconfig.json | 8 +--- stoat/options-page/tsconfig.json | 8 +--- typings.json | 5 +-- 20 files changed, 86 insertions(+), 126 deletions(-) delete mode 120000 esper.com/ts/typings create mode 100644 lib-ts/tsconfig.json create mode 100644 lib-ts/typings.d.ts diff --git a/build-helpers/typescript.js b/build-helpers/typescript.js index 3a6f6da8..824f9fbe 100644 --- a/build-helpers/typescript.js +++ b/build-helpers/typescript.js @@ -4,7 +4,9 @@ var _ = require('lodash'), exec = require('gulp-exec'), filter = require('gulp-filter'), fs = require('fs'), + glob = require("glob"), merge = require('merge-stream'), + minimatch = require('minimatch'), path = require('path'), production = require('./production'), remember = require('gulp-remember'), @@ -23,30 +25,31 @@ var OBLIVION_BIN = "setup/bin/oblivion"; /* Gulp stream for compiling TypeScript. Supports using Oblivion. - globs: string[] - Globs with source files - tsConfigs: string[] - Paths to a config file (relative to CWD of gulpfile). - Config file should be in the form of a tsconfig.json file with `outFile`, - with the following optional extra vars: + tsConfigPaths: string[] - Paths to a config file (relative to CWD of + gulpfile). Config file should be in the form of a tsconfig.json file with + an `outFile` and no `files` attribue (all files in directory get globbed) + and with the following optional extra vars: - devFiles?: string[] - Files used only in development - prodFiles?: string[] - Files used only in production + devOnly?: string[] - Files used only in development + prodOnly?: string[] - Files used only in production oblivion?: boolean - Pre-process with Oblivion? + commonGlobs?: string[] - "Common" glob paths to add to path for each tsConfig outDir?: string - Path to output directory (modifies tsConfig.outFile path for Gulp output) */ -module.exports = function(globs, tsConfigPaths, outDir) { +module.exports = function(tsConfigPaths, commonGlobs, outDir) { 'use strict'; return merge.apply(null, _.map(tsConfigPaths, function(p) { - return build(globs, p, outDir); + return build(p, commonGlobs, outDir); }) ); } // Helper function for a single tsconfig.json file -var build = function(globs, tsConfigPath, outDir) { +var build = function(tsConfigPath, commonGlobs, outDir) { 'use strict'; var relPath = path.relative(__dirname, process.cwd()); @@ -55,31 +58,42 @@ var build = function(globs, tsConfigPath, outDir) { var project = projects[tsConfigPath]; if (! project) { project = projects[tsConfigPath] = ts.createProject(_.extend({ + // In theory, noExternalResolve should be faster but it isn't for + // in practice. Disable for now. noExternalResolve: false, + sortOutput: true, typescript: typescript }, compilerOpts)); } - // Get entry points from config files - var files = config.anyFiles || []; - if (production.isSet()) { - files = files.concat(config.prodFiles || []); - } else { - files = files.concat(config.devFiles || []); - } + // Include all files in tsconfig dir + var base = path.dirname(tsConfigPath); + var baseGlob = path.join(base, "**", "*.{ts,tsx}"); + var files = glob.sync(baseGlob); + // Files are relative to tsconfig.json file. Adjust paths so they're - // relative to cwd - var base = path.dirname(tsConfigPath); - files = _.map(files, function(f) { + // relative to cwd before processing + function adjustPaths(f) { f = path.join(base, f); return path.relative(process.cwd(), f); + } + + // Remove + add dev / prod files as appropriate + var exclusions = production.isSet() ? config.devOnly : config.prodOnly; + exclusions = _.map(exclusions, adjustPaths); + _.remove(files, function(f) { + return !!_.find(exclusions, function(e) { + return minimatch(f, e); + }); }); // Concatenate entry points to globs to ensure more consistent ordering - globs = files.concat(globs); - var ret = gulp.src(globs, { base: "." }); + var tsGlobs = files.concat(commonGlobs); + tsGlobs.push(baseGlob); + + var ret = gulp.src(tsGlobs, { base: "." }); /* Oblivion is a custom JS/TS pre-processor that converts HTML-like code to diff --git a/esper.com/gulpfile.js b/esper.com/gulpfile.js index 377f0d2d..b548dff9 100644 --- a/esper.com/gulpfile.js +++ b/esper.com/gulpfile.js @@ -30,9 +30,15 @@ var config = { jasmineDir: "pub/jasmine", + // Used for watcher only -- typescript helper uses mix of tsConfig base dir + // plus tsCommonGlobs tsGlobs: [ "ts/**/*.{ts,tsx}" ], + tsCommonGlobs: [ + "ts/common/**/*.{ts,tsx}", + "ts/lib/**/*.{ts,tsx}" + ], tsProjects: [ "ts/chrome-ext.js/tsconfig.json", "ts/login.js/tsconfig.json", @@ -72,8 +78,8 @@ gulp.task("build-js", function() { gulp.task("watch-js", watch(config.jsGlobs, "build-js")); gulp.task("build-ts", function() { - return helpers.typescript(config.tsGlobs, - config.tsProjects, + return helpers.typescript(config.tsProjects, + config.tsCommonGlobs, config.jsOut); }); diff --git a/esper.com/ts/chrome-ext.js/tsconfig.json b/esper.com/ts/chrome-ext.js/tsconfig.json index 73b8db02..fd5f1623 100644 --- a/esper.com/ts/chrome-ext.js/tsconfig.json +++ b/esper.com/ts/chrome-ext.js/tsconfig.json @@ -2,9 +2,5 @@ "compilerOptions": { "noImplicitAny": true, "outFile": "chrome-ext.js" - }, - - "anyFiles": [ - "chrome-ext.js.ts" - ] + } } diff --git a/esper.com/ts/common/tsconfig.json b/esper.com/ts/common/tsconfig.json index c3c1f07c..3f9bbb7e 100644 --- a/esper.com/ts/common/tsconfig.json +++ b/esper.com/ts/common/tsconfig.json @@ -1,5 +1,5 @@ { - "description": "Placeholder tsconfig so editor plugins recognize definitions", + "description": "Placeholder tsconfig so editor plugins recognize type defs", "compilerOptions": { "noImplicitAny": true, diff --git a/esper.com/ts/common/typings.d.ts b/esper.com/ts/common/typings.d.ts index 054af6df..314bcdff 100644 --- a/esper.com/ts/common/typings.d.ts +++ b/esper.com/ts/common/typings.d.ts @@ -1,3 +1,3 @@ -/* Include all typings for now */ +/* Include all typings for common */ /// diff --git a/esper.com/ts/login.js/tsconfig.json b/esper.com/ts/login.js/tsconfig.json index 8c193291..037b7540 100644 --- a/esper.com/ts/login.js/tsconfig.json +++ b/esper.com/ts/login.js/tsconfig.json @@ -5,11 +5,7 @@ "outFile": "login.js" }, - "anyFiles": [ - "login.js.tsx" - ], - - "devFiles": [ + "devOnly": [ "../common/Login.Fake.ts" ] } diff --git a/esper.com/ts/settings.js/tsconfig.json b/esper.com/ts/settings.js/tsconfig.json index ea0dbc91..c8792f66 100644 --- a/esper.com/ts/settings.js/tsconfig.json +++ b/esper.com/ts/settings.js/tsconfig.json @@ -6,45 +6,12 @@ "oblivion": true, - "anyFiles": [ - "Esper.ts", - "List.ts", - "Deferred.ts", - "Promise.ts", - "Util.ts", - "GmailCompose.ts", - "Pay.ts", - "Status.ts", - "Cache.ts", - "Svg.ts", - "Show.ts", - "ParseUrl.ts", - "CalPicker.ts", - "Settings.ts", - "Footer.ts", - "TeamSettings.ts", - "Plan.ts", - "AccountTab.ts", - "Preferences.ts", - "PreferencesTab.ts", - "WorkflowsTab.ts", - "CalendarsTab.ts", - "LabelsTab.ts", - "AboutTab.ts", - "TemplateTab.ts", - "Page.ts", - "Route.ts", - "Main.ts" + "devOnly": [ + "DevConf.ts" ], - "devFiles": [ - "DevConf.ts", - "Test.ts" - ], - - "prodFiles": [ - "ProdConf.ts", - "Test.ts" + "prodOnly": [ + "ProdConf.ts" ] } diff --git a/esper.com/ts/test.js/tsconfig.json b/esper.com/ts/test.js/tsconfig.json index 5a33e9b6..ac857973 100644 --- a/esper.com/ts/test.js/tsconfig.json +++ b/esper.com/ts/test.js/tsconfig.json @@ -5,7 +5,7 @@ "outFile": "test.js" }, - "devFiles": [ + "devOnly": [ "test.js.ts", "../lib/Test.ts", "../lib/ApiC.Test.ts", @@ -23,5 +23,5 @@ "Integration.Time.ts" ], - "prodFiles": [] + "prodOnly": [] } diff --git a/esper.com/ts/time.js/tsconfig.json b/esper.com/ts/time.js/tsconfig.json index b9ebf358..b12261b7 100644 --- a/esper.com/ts/time.js/tsconfig.json +++ b/esper.com/ts/time.js/tsconfig.json @@ -5,11 +5,7 @@ "outFile": "time.js" }, - "anyFiles": [ - "Main.ts" - ], - - "devFiles": [ + "devOnly": [ "../common/JasmineStub.ts", "Calendars.Test.ts", "DailyStats.Test.ts", @@ -20,7 +16,7 @@ "Views.CalendarLabeling.Test.tsx" ], - "prodFiles": [ + "prodOnly": [ ] } diff --git a/esper.com/ts/typings b/esper.com/ts/typings deleted file mode 120000 index 4ef8b830..00000000 --- a/esper.com/ts/typings +++ /dev/null @@ -1 +0,0 @@ -../../typings/browser \ No newline at end of file diff --git a/lib-ts/Watchable.ts b/lib-ts/Watchable.ts index 472d1f22..8028dfbf 100644 --- a/lib-ts/Watchable.ts +++ b/lib-ts/Watchable.ts @@ -139,7 +139,7 @@ module Esper.Watchable { unwatch(watcherId: string) { this.changeWatchers = - List.filter(this.changeWatchers, function(watcher) { + _.filter(this.changeWatchers, function(watcher) { return watcher.id !== watcherId; }); } diff --git a/lib-ts/tsconfig.json b/lib-ts/tsconfig.json new file mode 100644 index 00000000..763b40b4 --- /dev/null +++ b/lib-ts/tsconfig.json @@ -0,0 +1,8 @@ +{ + "description": "Placeholder tsconfig so editor plugins recognize defs", + + "compilerOptions": { + "noImplicitAny": true, + "jsx": "react" + } +} diff --git a/lib-ts/typings.d.ts b/lib-ts/typings.d.ts new file mode 100644 index 00000000..387ebfd1 --- /dev/null +++ b/lib-ts/typings.d.ts @@ -0,0 +1,6 @@ +/* + Placeholder typings file to help text editors recognize type defs for lib + code +*/ + +/// diff --git a/package.json b/package.json index e4498434..962a7e67 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "del": "^1.2.0", "ecstatic": "^0.8.0", "envify": "^3.4.0", + "glob": "^6.0.4", "gulp": "git://github.com/gulpjs/gulp.git#4.0", "gulp-autoprefixer": "^2.3.1", "gulp-cached": "^1.1.0", @@ -20,11 +21,12 @@ "gulp-remember": "^0.3.0", "gulp-rename": "^1.2.2", "gulp-sourcemaps": "^1.5.2", - "gulp-typescript": "^2.8.2", + "gulp-typescript": "^2.10.0", "gulp-uglify": "^1.2.0", "gulp-util": "^3.0.6", "livereload": "^0.3.7", "merge-stream": "^1.0.0", + "minimatch": "^3.0.0", "sync-exec": "^0.6.2", "typescript": "~1.7.5", "typings": "^0.6.3", diff --git a/stoat/content-script/tsconfig.json b/stoat/content-script/tsconfig.json index 73015bd8..198a63ed 100644 --- a/stoat/content-script/tsconfig.json +++ b/stoat/content-script/tsconfig.json @@ -5,18 +5,6 @@ "jsx": "react" }, - "oblivion": true, - - "files": [ - "Main.ts" - ], - - "devFiles": [ - "../common/DevConf.ts" - ], - - "prodFiles": [ - "../common/ProdConf.ts" - ] + "oblivion": true } diff --git a/stoat/event-page/tsconfig.json b/stoat/event-page/tsconfig.json index e0016d91..d40f982e 100644 --- a/stoat/event-page/tsconfig.json +++ b/stoat/event-page/tsconfig.json @@ -7,17 +7,12 @@ "oblivion": true, - "files": [ + "devOnly": [ + "../common/DevConf.ts" ], - "devFiles": [ - "../common/DevConf.ts", - "Main.ts" - ], - - "prodFiles": [ - "../common/ProdConf.ts", - "Main.ts" + "prodOnly": [ + "../common/ProdConf.ts" ] } diff --git a/stoat/gcal-is/tsconfig.json b/stoat/gcal-is/tsconfig.json index f896c1c5..1d7b1a5a 100644 --- a/stoat/gcal-is/tsconfig.json +++ b/stoat/gcal-is/tsconfig.json @@ -7,15 +7,11 @@ "oblivion": true, - "files": [ - "Main.ts" - ], - - "devFiles": [ + "devOnly": [ "../common/DevConf.ts" ], - "prodFiles": [ + "prodOnly": [ "../common/ProdConf.ts" ] } diff --git a/stoat/gmail-is/tsconfig.json b/stoat/gmail-is/tsconfig.json index 39c8a03d..30e14b97 100644 --- a/stoat/gmail-is/tsconfig.json +++ b/stoat/gmail-is/tsconfig.json @@ -7,15 +7,11 @@ "oblivion": true, - "files": [ - "Main.ts" - ], - - "devFiles": [ + "devOnly": [ "../common/DevConf.ts" ], - "prodFiles": [ + "prodOnly": [ "../common/ProdConf.ts" ] } diff --git a/stoat/options-page/tsconfig.json b/stoat/options-page/tsconfig.json index 88b4374b..5c737709 100644 --- a/stoat/options-page/tsconfig.json +++ b/stoat/options-page/tsconfig.json @@ -7,15 +7,11 @@ "oblivion": false, - "files": [ - "Main.ts" - ], - - "devFiles": [ + "devOnly": [ "../common/DevConf.ts" ], - "prodFiles": [ + "prodOnly": [ "../common/ProdConf.ts" ] } diff --git a/typings.json b/typings.json index ec2a270d..7c8a06bd 100644 --- a/typings.json +++ b/typings.json @@ -13,6 +13,8 @@ "jquery": "github:esperco/DefinitelyTyped/jquery/jquery.d.ts#f53108644c2f32b93de423d844650297fc415a8b", "jqueryui": "github:esperco/DefinitelyTyped/jqueryui/jqueryui.d.ts#f53108644c2f32b93de423d844650297fc415a8b", "lodash": "github:esperco/DefinitelyTyped/lodash/lodash.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "moment": "github:esperco/DefinitelyTyped/moment/moment.d.ts#f53108644c2f32b93de423d844650297fc415a8b", + "moment-node": "github:esperco/DefinitelyTyped/moment/moment-node.d.ts#f53108644c2f32b93de423d844650297fc415a8b", "moment-timezone": "github:esperco/DefinitelyTyped/moment-timezone/moment-timezone.d.ts#f53108644c2f32b93de423d844650297fc415a8b", "page": "github:esperco/DefinitelyTyped/page/page.d.ts#f53108644c2f32b93de423d844650297fc415a8b", "quill": "github:esperco/DefinitelyTyped/quill/quill.d.ts#b5000efa7905758a842aca9f3111d582cf030128", @@ -30,8 +32,5 @@ "react-global": "github:esperco/DefinitelyTyped/react/react-global.d.ts#b5000efa7905758a842aca9f3111d582cf030128", "segment-analytics": "github:esperco/DefinitelyTyped/segment-analytics/segment-analytics.d.ts#f53108644c2f32b93de423d844650297fc415a8b", "typeahead": "github:esperco/DefinitelyTyped/typeahead/typeahead.d.ts#7c749215797e4a18066f3a5e6fc99d82d7bf144e" - }, - "dependencies": { - "moment": "github:typings/typed-moment#a4075cd50e63efbedd850f654594f293ab81a385" } } From 3f937a6dd17d1513912c5fffa65cb78554cee923 Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Mon, 1 Feb 2016 23:14:53 +0000 Subject: [PATCH 6/8] Faster Typescript build helpers --- build-helpers/typescript.js | 66 ++++++++++++++++++++++-------- build-helpers/watch.js | 9 +++- esper.com/gulpfile.js | 13 ++---- esper.com/ts/test.js/tsconfig.json | 1 + stoat/content-script/Auth.ts | 1 + stoat/event-page/tsconfig.json | 10 +---- stoat/gcal-is/tsconfig.json | 10 +---- stoat/gmail-is/tsconfig.json | 10 +---- stoat/gulpfile.js | 19 ++------- stoat/options-page/tsconfig.json | 10 +---- 10 files changed, 68 insertions(+), 81 deletions(-) diff --git a/build-helpers/typescript.js b/build-helpers/typescript.js index 824f9fbe..cd52387f 100644 --- a/build-helpers/typescript.js +++ b/build-helpers/typescript.js @@ -23,7 +23,8 @@ var projects = {}; var OBLIVION_BIN = "setup/bin/oblivion"; /* - Gulp stream for compiling TypeScript. Supports using Oblivion. + Returns functions for building and compiling TypeScript projects. + Supports using Oblivion. tsConfigPaths: string[] - Paths to a config file (relative to CWD of gulpfile). Config file should be in the form of a tsconfig.json file with @@ -41,17 +42,26 @@ var OBLIVION_BIN = "setup/bin/oblivion"; module.exports = function(tsConfigPaths, commonGlobs, outDir) { 'use strict'; - return merge.apply(null, - _.map(tsConfigPaths, function(p) { - return build(p, commonGlobs, outDir); - }) - ); + var buildFns = _.map(tsConfigPaths, function(p) { + return function() { return buildOne(p, commonGlobs, outDir) }; + }); + + var watchFns = _.map(tsConfigPaths, function(p) { + return watchOne(p, commonGlobs, outDir); + }); + + return { + build: gulp.parallel.apply(gulp, buildFns), + watch: gulp.parallel.apply(gulp, watchFns) + } } // Helper function for a single tsconfig.json file -var build = function(tsConfigPath, commonGlobs, outDir) { +var buildOne = function(tsConfigPath, commonGlobs, outDir) { 'use strict'; + console.log("Building " + tsConfigPath); + var relPath = path.relative(__dirname, process.cwd()); var config = require(path.join(relPath, tsConfigPath)); var compilerOpts = config.compilerOptions || {}; @@ -72,7 +82,6 @@ var build = function(tsConfigPath, commonGlobs, outDir) { var baseGlob = path.join(base, "**", "*.{ts,tsx}"); var files = glob.sync(baseGlob); - // Files are relative to tsconfig.json file. Adjust paths so they're // relative to cwd before processing function adjustPaths(f) { @@ -80,20 +89,29 @@ var build = function(tsConfigPath, commonGlobs, outDir) { return path.relative(process.cwd(), f); } - // Remove + add dev / prod files as appropriate - var exclusions = production.isSet() ? config.devOnly : config.prodOnly; - exclusions = _.map(exclusions, adjustPaths); + /* + Prod => Exclude dev files and explicitly add prod files + Dev => Exclude prod files and explicitly add dev files + Explicit add necessary because we may want to add files outside + the tsconfig base dir on a one-off basis. + */ + var devFiles = _.map(config.devOnly, adjustPaths); + var prodFiles = _.map(config.prodOnly, adjustPaths); + var exclusions = []; + if (production.isSet()) { + exclusions = devFiles; + files = prodFiles.concat(files); + } else { + exclusions = prodFiles; + files = devFiles.concat(files); + } _.remove(files, function(f) { return !!_.find(exclusions, function(e) { return minimatch(f, e); }); }); - // Concatenate entry points to globs to ensure more consistent ordering - var tsGlobs = files.concat(commonGlobs); - tsGlobs.push(baseGlob); - - var ret = gulp.src(tsGlobs, { base: "." }); + var ret = gulp.src(commonGlobs.concat(files), { base: "." }); /* Oblivion is a custom JS/TS pre-processor that converts HTML-like code to @@ -168,5 +186,19 @@ var build = function(tsConfigPath, commonGlobs, outDir) { ret = ret.pipe(sourcemaps.write()); } - return ret.pipe(gulp.dest(outDir)); + return ret.pipe(gulp.dest(outDir)) + .on('end', function() { console.log(tsConfigPath, 'done'); }); +} + +// Watch a single tsConfigFile +var watchOne = function(tsConfigPath, commonGlobs, outDir) { + 'use strict'; + + var base = path.dirname(tsConfigPath); + var baseGlob = path.join(base, "**", "*.{ts,tsx}"); + var tsGlobs = [baseGlob].concat(commonGlobs); + + return watch(gulp)(tsGlobs, function() { + return buildOne(tsConfigPath, commonGlobs, outDir); + }); } diff --git a/build-helpers/watch.js b/build-helpers/watch.js index 92b423c8..281df124 100644 --- a/build-helpers/watch.js +++ b/build-helpers/watch.js @@ -1,4 +1,5 @@ "use strict"; +var _ = require("lodash"); /* Short-hand for returning a function that creates a watcher based on an @@ -11,14 +12,18 @@ function makeWatch(gulp) { /* globs: string[] - Globs to watch - task: string - Name of Gulp task + task: string|function - Name of Gulp task, or task itself */ return function(globs, task) { return function() { // Set a var on this function so other code knows we're in watch mode makeWatch.watchMode = true; - return gulp.watch(globs, gulp.series(task)); + if (! _.isFunction(task)) { + task = gulp.series(task); + } + + return gulp.watch(globs, task); }; }; }; diff --git a/esper.com/gulpfile.js b/esper.com/gulpfile.js index b548dff9..c97b86e1 100644 --- a/esper.com/gulpfile.js +++ b/esper.com/gulpfile.js @@ -30,11 +30,6 @@ var config = { jasmineDir: "pub/jasmine", - // Used for watcher only -- typescript helper uses mix of tsConfig base dir - // plus tsCommonGlobs - tsGlobs: [ - "ts/**/*.{ts,tsx}" - ], tsCommonGlobs: [ "ts/common/**/*.{ts,tsx}", "ts/lib/**/*.{ts,tsx}" @@ -77,13 +72,11 @@ gulp.task("build-js", function() { gulp.task("watch-js", watch(config.jsGlobs, "build-js")); -gulp.task("build-ts", function() { - return helpers.typescript(config.tsProjects, +var ts = helpers.typescript(config.tsProjects, config.tsCommonGlobs, config.jsOut); -}); - -gulp.task("watch-ts", watch(config.tsGlobs, "build-ts")); +gulp.task("build-ts", ts.build); +gulp.task("watch-ts", ts.watch); gulp.task("build-assets", function() { return helpers.assets(config.assetMap); diff --git a/esper.com/ts/test.js/tsconfig.json b/esper.com/ts/test.js/tsconfig.json index ac857973..ae33575e 100644 --- a/esper.com/ts/test.js/tsconfig.json +++ b/esper.com/ts/test.js/tsconfig.json @@ -19,6 +19,7 @@ "../lib/JQStore.Test.ts", "../lib/Queue.Test.ts", "../lib/ReactHelpers.Test.ts", + "Integration.ts", "Integration.Login.ts", "Integration.Time.ts" ], diff --git a/stoat/content-script/Auth.ts b/stoat/content-script/Auth.ts index d3fbedaf..245e48ac 100644 --- a/stoat/content-script/Auth.ts +++ b/stoat/content-script/Auth.ts @@ -143,6 +143,7 @@ module Esper.Auth { ); break; + /* Listen for request from the injected script at mail.google.com */ case "CredentialsRequest": obtainCredentials(request.value, false); diff --git a/stoat/event-page/tsconfig.json b/stoat/event-page/tsconfig.json index d40f982e..321a0b9d 100644 --- a/stoat/event-page/tsconfig.json +++ b/stoat/event-page/tsconfig.json @@ -5,14 +5,6 @@ "jsx": "react" }, - "oblivion": true, - - "devOnly": [ - "../common/DevConf.ts" - ], - - "prodOnly": [ - "../common/ProdConf.ts" - ] + "oblivion": true } diff --git a/stoat/gcal-is/tsconfig.json b/stoat/gcal-is/tsconfig.json index 1d7b1a5a..20a4de5d 100644 --- a/stoat/gcal-is/tsconfig.json +++ b/stoat/gcal-is/tsconfig.json @@ -5,14 +5,6 @@ "jsx": "react" }, - "oblivion": true, - - "devOnly": [ - "../common/DevConf.ts" - ], - - "prodOnly": [ - "../common/ProdConf.ts" - ] + "oblivion": true } diff --git a/stoat/gmail-is/tsconfig.json b/stoat/gmail-is/tsconfig.json index 30e14b97..aa658395 100644 --- a/stoat/gmail-is/tsconfig.json +++ b/stoat/gmail-is/tsconfig.json @@ -5,14 +5,6 @@ "jsx": "react" }, - "oblivion": true, - - "devOnly": [ - "../common/DevConf.ts" - ], - - "prodOnly": [ - "../common/ProdConf.ts" - ] + "oblivion": true } diff --git a/stoat/gulpfile.js b/stoat/gulpfile.js index 53b664f4..c8c36a17 100644 --- a/stoat/gulpfile.js +++ b/stoat/gulpfile.js @@ -21,17 +21,6 @@ var config = { jsBundles: ["vendor.js"], jsOut: "pub/js", - // Used for watcher only -- typescript helper uses mix of tsConfig base dir - // plus tsCommonGlobs - tsGlobs: [ - "common/**/*.{ts,tsx}", - "lib/**/*.{ts,tsx}", - "content-script/**/*.{ts,tsx}", - "event-page/**/*.{ts,tsx}", - "gcal-is/**/*.{ts,tsx}", - "gmail-is/**/*.{ts,tsx}", - "options-page/**/*.{ts,tsx}" - ], tsCommonGlobs: [ "common/**/*.{ts,tsx}", "lib/**/*.{ts,tsx}" @@ -60,13 +49,11 @@ gulp.task("build-less", function() { gulp.task("watch-less", watch(config.lessGlobs, "build-less")); -gulp.task("build-ts", function() { - return helpers.typescript(config.tsProjects, +var ts = helpers.typescript(config.tsProjects, config.tsCommonGlobs, config.jsOut); -}); - -gulp.task("watch-ts", watch(config.tsGlobs, "build-ts")); +gulp.task("build-ts", ts.build); +gulp.task("watch-ts", ts.watch); gulp.task("build-assets", function() { return helpers.assets(config.assetMap); diff --git a/stoat/options-page/tsconfig.json b/stoat/options-page/tsconfig.json index 5c737709..eb09788c 100644 --- a/stoat/options-page/tsconfig.json +++ b/stoat/options-page/tsconfig.json @@ -5,14 +5,6 @@ "jsx": "react" }, - "oblivion": false, - - "devOnly": [ - "../common/DevConf.ts" - ], - - "prodOnly": [ - "../common/ProdConf.ts" - ] + "oblivion": false } From c09d28e993ce59e59932fb1ef73bdd345dafc1ff Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Mon, 1 Feb 2016 23:27:15 +0000 Subject: [PATCH 7/8] Documentation update --- Makefile | 2 +- README.md | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 7a27bfd3..eefc2378 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: default setup clean vendor default: setup -# Put bower and tsd in path +# Put tsc and typings in path export PATH := node_modules/.bin:$(PATH) # Fetch libraries diff --git a/README.md b/README.md index 6ad08e54..26cbe16b 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,13 @@ in `node_modules` (or via the symlink `vendor`). Typings ------- -TypeScript typings are installed via -[TSD](https://github.com/DefinitelyTyped/tsd). To use, install TSD globally -with `npm install tsd -g` or use the binary in the `node_modules/.bin` -directory created after `make setup`. - -Do not modify d.ts files in `typings` directory directly. Modify -typings in https://github.com/esperco/DefinitelyTyped (`tsd.json` is set -to pull definitions from there instead of the official DefinitelyTyped repo). -This makes it easier for us to merge upstream later if we want to open-source -our definitions. +TypeScript typings are installed via the Typings definition manager. +[Typings](https://github.com/typings/typings). To use, install Typings +globally with `npm install typings -g` or use the binary in the +`node_modules/.bin` directory created after `make setup`. + +Do not modify d.ts files in the `typings` directory directly. Either modify +typings in https://github.com/esperco/DefinitelyTyped (`typings.json` uses +definitions from there instead of the official DefinitelyTyped repo), or +fork or use definitions in a separate repo. This makes it easier for us to +merge upstream later if we want to open-source our definitions. From 5dee17bbe6e80ff7a658b24259e7b1ec48794e4b Mon Sep 17 00:00:00 2001 From: Andrew Fong Date: Mon, 1 Feb 2016 23:27:55 +0000 Subject: [PATCH 8/8] Fix stray newline --- stoat/content-script/Auth.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/stoat/content-script/Auth.ts b/stoat/content-script/Auth.ts index 245e48ac..d3fbedaf 100644 --- a/stoat/content-script/Auth.ts +++ b/stoat/content-script/Auth.ts @@ -143,7 +143,6 @@ module Esper.Auth { ); break; - /* Listen for request from the injected script at mail.google.com */ case "CredentialsRequest": obtainCredentials(request.value, false);