From 5d9b61e1bffb7a604f9e62223c1d150eb3e4a6bb Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Tue, 18 Dec 2018 10:47:18 -0500 Subject: [PATCH 1/7] Copy flow files so that the module returns typed values --- package.json | 3 +- src/AUTO/index.js | 2 +- src/AbstractAPI/index.js | 2 +- src/AbstractCLI/index.js | 2 +- src/Client/index.js | 2 +- src/sketch.js | 6 +- src/support/factories.js | 2 +- src/{index.js.flow => types.js} | 15 ++- src/utils.js | 2 +- yarn.lock | 161 +++++++++++++++++++++++++++++++- 10 files changed, 180 insertions(+), 17 deletions(-) rename src/{index.js.flow => types.js} (98%) diff --git a/package.json b/package.json index 8279e97c..234c4128 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "main": "lib/index.js", "scripts": { "prepublish": "yarn run build", - "build": "babel ./src -d ./lib", + "build": "babel ./src -d ./lib && flow-copy-source src lib", "lint": "eslint .", "test": "jest", "test-inspect": "node --inspect-brk ./node_modules/.bin/jest --runInBand", @@ -46,6 +46,7 @@ "eslint-plugin-prettier": "^2.6.2", "eslint-plugin-react": "^7.11.1", "flow-bin": "^0.80.0", + "flow-copy-source": "^2.0.2", "flow-typed": "^2.5.1", "jest": "^23.6.0", "jest-fetch-mock": "GrahamTheCoder/jest-fetch-mock#blob-fix", diff --git a/src/AUTO/index.js b/src/AUTO/index.js index b6d612ed..8010ea0b 100644 --- a/src/AUTO/index.js +++ b/src/AUTO/index.js @@ -1,5 +1,5 @@ // @flow -import type { AbstractInterface } from "../"; +import type { AbstractInterface } from "../types"; import AbstractCLI, { type Options as OptionsCLI } from "../AbstractCLI"; import AbstractAPI, { type Options as OptionsAPI } from "../AbstractAPI"; diff --git a/src/AbstractAPI/index.js b/src/AbstractAPI/index.js index 638c371d..4bc5f28b 100644 --- a/src/AbstractAPI/index.js +++ b/src/AbstractAPI/index.js @@ -23,7 +23,7 @@ import type { Comment, Layer, ListOptions -} from "../"; +} from "../types"; import parseShareURL from "./parseShareURL"; import randomTraceId from "./randomTraceId"; diff --git a/src/AbstractCLI/index.js b/src/AbstractCLI/index.js index 9328fdeb..23a6c674 100644 --- a/src/AbstractCLI/index.js +++ b/src/AbstractCLI/index.js @@ -16,7 +16,7 @@ import type { FileDescriptor, LayerDescriptor, CollectionDescriptor -} from "../"; +} from "../types"; const logSpawn = log.extend("AbstractCLI:spawn"); const logError = log.extend("AbstractCLI:error"); diff --git a/src/Client/index.js b/src/Client/index.js index 220eeec1..6cc6ea11 100644 --- a/src/Client/index.js +++ b/src/Client/index.js @@ -1,5 +1,5 @@ // @flow -import type { AbstractInterface } from "../"; +import type { AbstractInterface } from "../types"; import { AUTO } from "../transports"; type Options = { diff --git a/src/sketch.js b/src/sketch.js index dff00f3a..11883a9c 100644 --- a/src/sketch.js +++ b/src/sketch.js @@ -1,6 +1,10 @@ // @flow /* global process NSString PROSketchBootstrap */ -import type { ProjectDescriptor, BranchDescriptor, FileDescriptor } from "."; +import type { + ProjectDescriptor, + BranchDescriptor, + FileDescriptor +} from "./types"; export function isSketchPlugin() { // New versions of skpm set process type to "sketch". For older diff --git a/src/support/factories.js b/src/support/factories.js index f8f35692..829afda5 100644 --- a/src/support/factories.js +++ b/src/support/factories.js @@ -8,7 +8,7 @@ import type { LayerDescriptor, CollectionDescriptor, CommentDescriptor -} from "../"; +} from "../types"; export function buildOptions(options: *) { return { diff --git a/src/index.js.flow b/src/types.js similarity index 98% rename from src/index.js.flow rename to src/types.js index 2ef0d978..bec32028 100644 --- a/src/index.js.flow +++ b/src/types.js @@ -24,7 +24,7 @@ export type ActivityDescriptor = {| export type NotificationDescriptor = {| notificationId: string -|} +|}; type ObjectDescriptor = {| projectId: string, @@ -1252,7 +1252,10 @@ export interface AbstractInterface { activities?: { list: ( - objectDescriptor?: BranchDescriptor | OrganizationDescriptor | ProjectDescriptor, + objectDescriptor?: + | BranchDescriptor + | OrganizationDescriptor + | ProjectDescriptor, options?: ListOptions ) => Promise, info: (activityDescriptor: ActivityDescriptor) => Promise @@ -1290,7 +1293,9 @@ export interface AbstractInterface { list: ( { projectId: $PropertyType - } & $Shape, + } & $Shape< + BranchDescriptor & CommitDescriptor & PageDescriptor & LayerDescriptor + >, options?: ListOptions ) => Promise, info: (commentDescriptor: CommentDescriptor) => Promise @@ -1347,6 +1352,8 @@ export interface AbstractInterface { objectDescriptor?: OrganizationDescriptor, options?: ListOptions ) => Promise, - info: (notificationDescriptor: NotificationDescriptor) => Promise + info: ( + notificationDescriptor: NotificationDescriptor + ) => Promise }; } diff --git a/src/utils.js b/src/utils.js index ce0f631e..f04ea528 100644 --- a/src/utils.js +++ b/src/utils.js @@ -5,7 +5,7 @@ import type { PageDescriptor, FileDescriptor, LayerDescriptor -} from "./"; +} from "./types"; export function objectBranchDescriptor( objectDescriptor: diff --git a/yarn.lock b/yarn.lock index a356df2d..c6a51de7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1391,6 +1391,11 @@ camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= +camelcase@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" + integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA== + caniuse-lite@^1.0.30000898: version "1.0.30000899" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000899.tgz#6febdbbc388a7982f620ee0e3d09aab0c061389e" @@ -1445,7 +1450,7 @@ charenc@~0.0.1: resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc= -chokidar@^2.0.3: +chokidar@^2.0.0, chokidar@^2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== @@ -1641,6 +1646,17 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + crypt@~0.0.1: version "0.0.2" resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" @@ -1707,7 +1723,7 @@ debug@^4.0.1: dependencies: ms "^2.1.1" -decamelize@^1.1.1: +decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -2127,6 +2143,19 @@ exec-sh@^0.2.0: dependencies: merge "^1.2.0" +execa@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" + integrity sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw== + dependencies: + cross-spawn "^6.0.0" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -2340,6 +2369,13 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + flat-cache@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" @@ -2355,6 +2391,17 @@ flow-bin@^0.80.0: resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.80.0.tgz#04cc1ee626a6f50786f78170c92ebe1745235403" integrity sha512-0wRnqvXErQRPrx6GBLB5swgndfWkotd9MgfePgT7Z+VsE046c8Apzl7KKTCypB/pzn0pZF2g5Jurxxb2umET8g== +flow-copy-source@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flow-copy-source/-/flow-copy-source-2.0.2.tgz#096e579a9bb63a38afc5d4dd68ac847a5be27594" + integrity sha512-IHKgy45Q+Xs7UanUZyFFJae/ubMKtzj0dU4vs1YoqlfKl2wzLTaqehyTpjqO4vLAnL48yGvLfnttncX5Utn/4g== + dependencies: + chokidar "^2.0.0" + fs-extra "^7.0.0" + glob "^7.0.0" + kefir "^3.7.3" + yargs "^12.0.1" + flow-typed@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/flow-typed/-/flow-typed-2.5.1.tgz#0ff565cc94d2af8c557744ba364b6f14726a6b9f" @@ -2418,6 +2465,15 @@ fs-extra@^5.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -2438,12 +2494,12 @@ fs.realpath@^1.0.0: fsevents@^1.2.2, fsevents@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== + integrity sha1-LVUtnRG1UvS2nO/V6T2KZBR01yA= dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" prebuiltVariants: - fsevents-v1.2.4-darwin-x64-57 "68372c379d6603f30c1591917ec8a75fb9cd2cd6" + fsevents-v1.2.4-darwin-x64-57 "2d552d9d11b552f4b69cefd5e93d8a641474d720" fstream@~1.0.10: version "1.0.11" @@ -2816,6 +2872,11 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -3687,6 +3748,13 @@ jsx-ast-utils@^2.0.1: dependencies: array-includes "^3.0.3" +kefir@^3.7.3: + version "3.8.5" + resolved "https://registry.yarnpkg.com/kefir/-/kefir-3.8.5.tgz#ce8d952707ea833d9d995a96b92daa744dea83ba" + integrity sha512-u4UxHyIvdOOM62Y/yAtYPeYEg/yUfwl5/QF3ksrTRxEdhpa7LAFChntZxVqbcf0gCGblZzL/JnV/gZYWOps3Qw== + dependencies: + symbol-observable "1.0.4" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -3723,6 +3791,13 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + left-pad@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" @@ -3845,6 +3920,13 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -3878,6 +3960,15 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" +mem@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.0.0.tgz#6437690d9471678f6cc83659c00cbafcd6b0cdaf" + integrity sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^1.0.0" + p-is-promise "^1.1.0" + merge-stream@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" @@ -4053,6 +4144,11 @@ needle@^2.2.1: iconv-lite "^0.4.4" sax "^1.2.4" +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + node-fetch@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" @@ -4283,6 +4379,15 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" +os-locale@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.0.1.tgz#3b014fbf01d87f60a1e5348d80fe870dc82c4620" + integrity sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw== + dependencies: + execa "^0.10.0" + lcid "^2.0.0" + mem "^4.0.0" + os-name@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/os-name/-/os-name-2.0.1.tgz#b9a386361c17ae3a21736ef0599405c9a8c5dc5e" @@ -4318,11 +4423,21 @@ p-cancelable@^0.3.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + integrity sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4= + p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -4422,7 +4537,7 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2: resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= -path-key@^2.0.0: +path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= @@ -5306,6 +5421,11 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" +symbol-observable@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" + integrity sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0= + symbol-tree@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" @@ -5784,6 +5904,11 @@ y18n@^3.2.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= +"y18n@^3.2.1 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -5794,6 +5919,14 @@ yallist@^3.0.0, yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k= +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" @@ -5827,6 +5960,24 @@ yargs@^11.0.0: y18n "^3.2.1" yargs-parser "^9.0.2" +yargs@^12.0.1: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" + yargs@^4.2.0: version "4.8.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" From a438c565357710b0e6cfe90be548c27f35508e47 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Thu, 20 Dec 2018 11:59:41 -0500 Subject: [PATCH 2/7] Try to fix the yarn lock file --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6a51de7..ce93032b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2494,12 +2494,12 @@ fs.realpath@^1.0.0: fsevents@^1.2.2, fsevents@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - integrity sha1-LVUtnRG1UvS2nO/V6T2KZBR01yA= + integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" prebuiltVariants: - fsevents-v1.2.4-darwin-x64-57 "2d552d9d11b552f4b69cefd5e93d8a641474d720" + fsevents-v1.2.4-darwin-x64-57 "3f69dac5ce1ea824bccf6d0852713f570300fd4b" fstream@~1.0.10: version "1.0.11" From d4b9340b4ceeea84b248c0776ebb312eec894c24 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Thu, 20 Dec 2018 12:03:13 -0500 Subject: [PATCH 3/7] :shirt: lint fix --- src/types.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types.js b/src/types.js index a94470ef..83c72c8a 100644 --- a/src/types.js +++ b/src/types.js @@ -1384,7 +1384,9 @@ export interface AbstractInterface { objectDescriptor?: OrganizationDescriptor, options?: ListOptions ) => CursorPromise, - info: (notificationDescriptor: NotificationDescriptor) => Promise + info: ( + notificationDescriptor: NotificationDescriptor + ) => Promise }; } From b9360fae4e0527b784f2de3e3cf8edbcd07c68c4 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Thu, 20 Dec 2018 12:05:21 -0500 Subject: [PATCH 4/7] Fixing bad merge --- src/AbstractAPI/Cursor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AbstractAPI/Cursor.js b/src/AbstractAPI/Cursor.js index 779ba4be..984debd2 100644 --- a/src/AbstractAPI/Cursor.js +++ b/src/AbstractAPI/Cursor.js @@ -1,5 +1,5 @@ /* @flow */ -import type { CursorMeta, CursorPromise, CursorResponse } from "../"; +import type { CursorMeta, CursorPromise, CursorResponse } from "../types"; export default class Cursor { lastResponse: ?Promise | void>; From cb8cb1e9b8a98d9240e6d7c150da703302903cad Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Tue, 8 Jan 2019 16:47:26 -0800 Subject: [PATCH 5/7] Remove 'latest' string literal from descriptor types --- src/types.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types.js b/src/types.js index 3d4ba2ed..8e1dc529 100644 --- a/src/types.js +++ b/src/types.js @@ -38,12 +38,12 @@ export type CommitDescriptor = {| export type BranchDescriptor = {| ...ObjectDescriptor, - sha: $PropertyType | "latest" + sha: $PropertyType |}; export type FileDescriptor = {| ...ObjectDescriptor, - sha: $PropertyType | "latest", + sha: $PropertyType, fileId: string |}; @@ -55,7 +55,7 @@ export type PageDescriptor = {| export type LayerDescriptor = {| ...ObjectDescriptor, - sha: $PropertyType | "latest", + sha: $PropertyType, fileId: string, pageId: string, layerId: string From 2760ed1652db4a94875cc5662442d244d7629f2e Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Thu, 10 Jan 2019 14:38:49 -0800 Subject: [PATCH 6/7] Move flow-copy-source to prebuild and ignore test files --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4452fe86..ac7df0d1 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ }, "scripts": { "prepublish": "yarn run build", - "build": "babel ./src -d ./lib && flow-copy-source src lib", + "build": "babel ./src --ignore **/*/__mocks__,**/test.js -d ./lib", + "prebuild": "flow-copy-source --ignore '**/*/__mocks__/*.js' --ignore '**/*test.js' ./src ./lib", "lint": "eslint .", "test": "jest", "test-inspect": "node --inspect-brk ./node_modules/.bin/jest --runInBand", @@ -70,4 +71,4 @@ "peerDependencies": { "@elasticprojects/abstract-cli": "^0.31.0" } -} +} \ No newline at end of file From cfc83bb4dda8fa492fe6a0e3f1da48b8fe02be46 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Thu, 10 Jan 2019 14:39:25 -0800 Subject: [PATCH 7/7] Export types from module index --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index c2fcc559..73b996eb 100644 --- a/src/index.js +++ b/src/index.js @@ -5,3 +5,4 @@ import * as TRANSPORTS from "./transports"; export { client, Sketch, TRANSPORTS }; export { client as Client }; // Deprecated: prefer Abstract.client factory +export type * from "./types";