diff --git a/.idea/electron-builder.iml b/.idea/electron-builder.iml index e89b057ed9e..09d8a907b9d 100644 --- a/.idea/electron-builder.iml +++ b/.idea/electron-builder.iml @@ -7,9 +7,11 @@ + + diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index 169b0d6fbf4..0b52efa2bb6 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -9,7 +9,7 @@ FROM buildpack-deps:yakkety-curl # python for node-gyp -ENV XZ_VERSION 5.2.2 +ENV XZ_VERSION 5.2.3 # we don't use our bundled 7za because it is better to build for specific platform - not generic ENV USE_SYSTEM_7ZA true @@ -19,7 +19,7 @@ ENV DEBUG_COLORS true ENV FORCE_COLOR true ENV DEBIAN_FRONTEND noninteractive -RUN curl -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv dist yarn && apt-get update -y && apt-get upgrade -y && \ +RUN curl -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv dist /yarn && apt-get update -y && apt-get upgrade -y && \ apt-get install --no-install-recommends -y xvfb git snapcraft qtbase5-dev xorriso bsdtar build-essential autoconf libssl-dev icnsutils libopenjp2-7 graphicsmagick gcc-multilib g++-multilib libgnome-keyring-dev lzip rpm yasm python libcurl3 && \ curl -O http://mirrors.kernel.org/ubuntu/pool/universe/libi/libicns/libicns1_0.8.1-3.1_amd64.deb && dpkg --install libicns1_0.8.1-3.1_amd64.deb && unlink libicns1_0.8.1-3.1_amd64.deb && \ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \ diff --git a/docs/Publishing Artifacts.md b/docs/Publishing Artifacts.md index 296c2e97822..16611c8a531 100644 --- a/docs/Publishing Artifacts.md +++ b/docs/Publishing Artifacts.md @@ -2,13 +2,13 @@ Travis and AppVeyor support publishing artifacts. But it requires additional con `electron-builder` allows you to just add `GH_TOKEN` environment variable and that's all. -Currently, [GitHub Releases](https://help.github.com/articles/about-releases/) and [Bintray](https://bintray.com) are supported. +Currently, [GitHub Releases](https://help.github.com/articles/about-releases/), [Bintray](https://bintray.com) and [S3](https://aws.amazon.com/s3/) are supported. ## CLI Flags ``` Publishing: --publish, -p [choices: "onTag", "onTagOrDraft", "always", "never"] - --draft Create a draft (unpublished) releas [boolean] + --draft Create a draft (unpublished) release [boolean] --prerelease Identify the release as a prerelease [boolean] ``` CLI `--publish` option values: @@ -44,9 +44,9 @@ But please consider using automatic rules instead of explicitly specifying `publ "release": "build" ``` and if you run `npm run release`, a release will be drafted (if doesn't already exist) and artifacts published. - + ## GitHub Repository and Bintray Package - + Detected automatically using: * [repository](https://docs.npmjs.com/files/package.json#repository) in the application or development `package.json`, * if not set, env `TRAVIS_REPO_SLUG` or `APPVEYOR_ACCOUNT_NAME`/`APPVEYOR_PROJECT_NAME` or `CIRCLE_PROJECT_USERNAME`/`CIRCLE_PROJECT_REPONAME`, @@ -67,6 +67,7 @@ But please consider using automatic rules instead of explicitly specifying `publ * [publish Bintray](#BintrayOptions) * [publish Generic (any https server)](#GenericServerOptions) * [publish GitHub](#GithubOptions) +* [publish S3](#S3Options) ### `publish` @@ -75,6 +76,7 @@ Can be specified in the [build](https://github.com/electron-userland/electron-bu If `GH_TOKEN` is set — defaults to `[{provider: "github"}]`. If `BT_TOKEN` is set and `GH_TOKEN` is not set — defaults to `[{provider: "bintray"}]`. +If `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are set and neither `GH_TOKEN` and `BT_TOKEN` are set — defaults to `[{provider: "s3"}]`. Array of option objects. Order is important — first item will be used as a default auto-update server on Windows (NSIS). @@ -82,7 +84,7 @@ Amazon S3 — `https` must be used, so, if you use direct Amazon S3 endpoints, f | Name | Description | --- | --- -| **provider** | The provider, one of `github`, `bintray`, `generic`. +| **provider** | The provider, one of `github`, `s3`, `bintray`, `generic`. | owner | The owner. @@ -107,4 +109,16 @@ Amazon S3 — `https` must be used, so, if you use direct Amazon S3 endpoints, f | repo | The repository name. [Detected automatically](https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts#github-repository). | vPrefixedTagName | Whether to use `v`-prefixed tag name. Defaults to `true`. + +### `publish` S3 + +[Getting your credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html). + +| Name | Description +| --- | --- +| bucket | The bucket name. +| channel | The channel. Defaults to `latest`. +| acl | The ACL. Defaults to `public-read`. +| storageClass | The type of storage to use for the object. One of `STANDARD`, `REDUCED_REDUNDANCY`, `STANDARD_IA`. Defaults to `STANDARD`. + \ No newline at end of file diff --git a/package.json b/package.json index 44403cc6e50..6ad182ae24e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "license": "MIT", "scripts": { - "compile": "ts-babel packages/electron-builder-http packages/electron-builder-core packages/electron-builder-util packages/electron-builder packages/electron-builder-squirrel-windows packages/electron-updater test", + "compile": "ts-babel packages/electron-builder-http packages/electron-builder-core packages/electron-builder-util packages/electron-builder-publisher packages/electron-builder packages/electron-builder-squirrel-windows packages/electron-updater packages/electron-publisher-s3 test", "lint": "node test/out/helpers/lint.js", "pretest": "node ./test/vendor/yarn.js compile && node ./test/vendor/yarn.js lint && node ./test/vendor/yarn.js check-deps", "check-deps": "node ./test/out/helpers/checkDeps.js", @@ -25,6 +25,7 @@ "7zip-bin": "^2.0.4", "archiver": "^1.3.0", "asar-electron-builder": "^0.13.5", + "aws-sdk": "^2.9.0", "bluebird-lst-c": "^1.0.6", "chalk": "^1.1.3", "chromium-pickle-js": "^0.2.0", @@ -72,7 +73,7 @@ "jest-environment-node-debug": "^0.0.2", "path-sort": "^0.1.0", "source-map-support": "^0.4.11", - "ts-babel": "^1.3.5", + "ts-babel": "^1.3.6", "tslint": "^4.4.2", "typescript": "^2.2.0", "whitespace": "^2.1.0" diff --git a/packages/electron-builder-http/src/httpExecutor.ts b/packages/electron-builder-http/src/httpExecutor.ts index 9a63cea8401..ef52b91bcd2 100644 --- a/packages/electron-builder-http/src/httpExecutor.ts +++ b/packages/electron-builder-http/src/httpExecutor.ts @@ -34,7 +34,7 @@ export class HttpExecutorHolder { get httpExecutor(): HttpExecutor { if (this._httpExecutor == null) { - this._httpExecutor = new (require("electron-builder/out/util/nodeHttpExecutor").NodeHttpExecutor)() + this._httpExecutor = new (require("electron-builder-util/out/nodeHttpExecutor").NodeHttpExecutor)() } return this._httpExecutor } diff --git a/packages/electron-builder-http/src/publishOptions.ts b/packages/electron-builder-http/src/publishOptions.ts index 57d67206e4e..d91c1e33a60 100644 --- a/packages/electron-builder-http/src/publishOptions.ts +++ b/packages/electron-builder-http/src/publishOptions.ts @@ -1,6 +1,6 @@ -export type PublishProvider = "github" | "bintray" | "generic" +export type PublishProvider = "github" | "bintray" | "s3" | "generic" -export type Publish = string | Array | PublishConfiguration | GithubOptions | BintrayOptions | GenericServerOptions | Array | Array | Array | Array | null +export type Publish = string | Array | PublishConfiguration | GithubOptions | S3Options | BintrayOptions | GenericServerOptions | Array | Array | Array | Array | Array | null /* ### `publish` @@ -9,6 +9,7 @@ Can be specified in the [build](https://github.com/electron-userland/electron-bu If `GH_TOKEN` is set — defaults to `[{provider: "github"}]`. If `BT_TOKEN` is set and `GH_TOKEN` is not set — defaults to `[{provider: "bintray"}]`. +If `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are set and neither `GH_TOKEN` and `BT_TOKEN` are set — defaults to `[{provider: "s3"}]`. Array of option objects. Order is important — first item will be used as a default auto-update server on Windows (NSIS). @@ -16,16 +17,16 @@ Amazon S3 — `https` must be used, so, if you use direct Amazon S3 endpoints, f */ export interface PublishConfiguration { /* - The provider, one of `github`, `bintray`, `generic`. + The provider, one of `github`, `s3`, `bintray`, `generic`. */ provider: PublishProvider /* The owner. */ - owner?: string + owner?: string | null - token?: string + token?: string | null } /* @@ -43,6 +44,35 @@ export interface GenericServerOptions extends PublishConfiguration { channel?: string | null } +/* +### `publish` S3 + +[Getting your credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html). + */ +export interface S3Options extends PublishConfiguration { + /* + The bucket name. + */ + bucket?: string + + /** + The channel. Defaults to `latest`. + */ + channel?: string | null + + /** + The ACL. Defaults to `public-read`. + */ + acl?: "private" | "public-read" | null + + /* + The type of storage to use for the object. One of `STANDARD`, `REDUCED_REDUNDANCY`, `STANDARD_IA`. Defaults to `STANDARD`. + */ + storageClass?: "STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | null + + secret?: string | null +} + export interface VersionInfo { readonly version: string } @@ -64,7 +94,7 @@ export interface GithubOptions extends PublishConfiguration { /* The repository name. [Detected automatically](https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts#github-repository). */ - repo?: string + repo?: string | null /* Whether to use `v`-prefixed tag name. Defaults to `true`. @@ -79,15 +109,15 @@ export interface BintrayOptions extends PublishConfiguration { /* The Bintray package name. */ - package?: string + package?: string | null /* The Bintray repository name. Defaults to `generic`. */ - repo?: string + repo?: string | null /* The Bintray user account. Used in cases where the owner is an organization. */ - user?: string + user?: string | null } \ No newline at end of file diff --git a/packages/electron-builder-http/tsconfig.json b/packages/electron-builder-http/tsconfig.json index bd2c7f644c6..42a03126691 100755 --- a/packages/electron-builder-http/tsconfig.json +++ b/packages/electron-builder-http/tsconfig.json @@ -11,9 +11,6 @@ "src/**/*.ts" ], "files": [ - "../../node_modules/@types/node/index.d.ts", - "../../node_modules/fs-extra-p/index.d.ts", - "../../typings/debug.d.ts", - "../../node_modules/@types/js-yaml/index.d.ts" + "../../typings/debug.d.ts" ] } \ No newline at end of file diff --git a/packages/electron-builder-publisher/package.json b/packages/electron-builder-publisher/package.json new file mode 100644 index 00000000000..870ebc66950 --- /dev/null +++ b/packages/electron-builder-publisher/package.json @@ -0,0 +1,22 @@ +{ + "name": "electron-builder-publisher", + "version": "0.0.0-semantic-release", + "main": "out/publisher.js", + "author": "Vladimir Krivosheev", + "license": "MIT", + "repository": "electron-userland/electron-builder", + "bugs": "https://github.com/electron-userland/electron-builder/issues", + "homepage": "https://github.com/electron-userland/electron-builder", + "files": [ + "out" + ], + "dependencies": { + "fs-extra-p": "^3.1.0", + "progress": "^1.1.8", + "mime": "^1.3.4", + "bluebird-lst-c": "^1.0.6", + "electron-builder-http": "~0.0.0-semantic-release", + "electron-builder-util": "~0.0.0-semantic-release" + }, + "typings": "./out/electron-builder-publisher.d.ts" +} diff --git a/packages/electron-builder-publisher/readme.md b/packages/electron-builder-publisher/readme.md new file mode 100644 index 00000000000..d777bb6dd22 --- /dev/null +++ b/packages/electron-builder-publisher/readme.md @@ -0,0 +1,5 @@ +# electron-publisher-s3 + +Part of [electron-builder](https://github.com/electron-userland/electron-builder). + +See the [Publishing Artifacts.](https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts) section of the [Wiki](https://github.com/electron-userland/electron-builder/wiki) for more information. \ No newline at end of file diff --git a/packages/electron-builder/src/publish/BintrayPublisher.ts b/packages/electron-builder-publisher/src/BintrayPublisher.ts similarity index 91% rename from packages/electron-builder/src/publish/BintrayPublisher.ts rename to packages/electron-builder-publisher/src/BintrayPublisher.ts index ef139c55920..23909552271 100644 --- a/packages/electron-builder/src/publish/BintrayPublisher.ts +++ b/packages/electron-builder-publisher/src/BintrayPublisher.ts @@ -1,16 +1,15 @@ -import { Publisher, PublishOptions } from "./publisher" import BluebirdPromise from "bluebird-lst-c" -import { log } from "electron-builder-util/out/log" -import { debug, isEmptyOrSpaces } from "electron-builder-util" +import { configureRequestOptions, HttpError } from "electron-builder-http" import { BintrayClient, Version } from "electron-builder-http/out/bintray" import { BintrayOptions } from "electron-builder-http/out/publishOptions" +import { debug, isEmptyOrSpaces } from "electron-builder-util" +import { log } from "electron-builder-util/out/log" +import { httpExecutor } from "electron-builder-util/out/nodeHttpExecutor" import { ClientRequest } from "http" -import { NodeHttpExecutor } from "../util/nodeHttpExecutor" -import { HttpError, configureRequestOptions } from "electron-builder-http" +import { Publisher, PublishOptions } from "./publisher" export class BintrayPublisher extends Publisher { private _versionPromise: BluebirdPromise - private readonly httpExecutor: NodeHttpExecutor = new NodeHttpExecutor() private readonly client: BintrayClient @@ -58,7 +57,7 @@ export class BintrayPublisher extends Publisher { let badGatewayCount = 0 for (let i = 0; i < 3; i++) { try { - return await this.httpExecutor.doApiRequest(configureRequestOptions({ + return await httpExecutor.doApiRequest(configureRequestOptions({ hostname: "api.bintray.com", path: `/content/${this.client.owner}/${this.client.repo}/${this.client.packageName}/${version.name}/${fileName}`, method: "PUT", diff --git a/packages/electron-builder/src/publish/gitHubPublisher.ts b/packages/electron-builder-publisher/src/gitHubPublisher.ts similarity index 79% rename from packages/electron-builder/src/publish/gitHubPublisher.ts rename to packages/electron-builder-publisher/src/gitHubPublisher.ts index e5eecc2b260..6905020268f 100644 --- a/packages/electron-builder/src/publish/gitHubPublisher.ts +++ b/packages/electron-builder-publisher/src/gitHubPublisher.ts @@ -1,14 +1,13 @@ -import { isEmptyOrSpaces } from "electron-builder-util" -import { log, warn } from "electron-builder-util/out/log" -import { debug } from "electron-builder-util" -import { parse as parseUrl } from "url" -import mime from "mime" import BluebirdPromise from "bluebird-lst-c" -import { PublishOptions, Publisher } from "./publisher" +import { configureRequestOptions, HttpError } from "electron-builder-http" import { GithubOptions } from "electron-builder-http/out/publishOptions" +import { debug, isEmptyOrSpaces } from "electron-builder-util" +import { log, warn } from "electron-builder-util/out/log" +import { httpExecutor } from "electron-builder-util/out/nodeHttpExecutor" import { ClientRequest } from "http" -import { HttpError, configureRequestOptions } from "electron-builder-http" -import { NodeHttpExecutor } from "../util/nodeHttpExecutor" +import mime from "mime" +import { parse as parseUrl } from "url" +import { Publisher, PublishOptions } from "./publisher" export interface Release { id: number @@ -30,7 +29,6 @@ interface Asset { export class GitHubPublisher extends Publisher { private tag: string private _releasePromise: Promise - private readonly httpExecutor = new NodeHttpExecutor() private readonly token: string @@ -63,7 +61,7 @@ export class GitHubPublisher extends Publisher { private async getOrCreateRelease(): Promise { // we don't use "Get a release by tag name" because "tag name" means existing git tag, but we draft release and don't create git tag - const releases = await this.githubRequest>(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token) + const releases = await GitHubPublisher.githubRequest>(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token) for (const release of releases) { if (release.tag_name === this.tag || release.tag_name === this.version) { if (release.draft) { @@ -104,7 +102,7 @@ export class GitHubPublisher extends Publisher { let badGatewayCount = 0 uploadAttempt: for (let i = 0; i < 3; i++) { try { - return await this.httpExecutor.doApiRequest(configureRequestOptions({ + return await httpExecutor.doApiRequest(configureRequestOptions({ hostname: parsedUrl.hostname, path: parsedUrl.path, method: "POST", @@ -121,10 +119,10 @@ export class GitHubPublisher extends Publisher { // delete old artifact and re-upload log(`Artifact ${fileName} already exists, overwrite one`) - const assets = await this.githubRequest>(`/repos/${this.info.owner}/${this.info.repo}/releases/${release.id}/assets`, this.token, null) + const assets = await GitHubPublisher.githubRequest>(`/repos/${this.info.owner}/${this.info.repo}/releases/${release.id}/assets`, this.token, null) for (const asset of assets) { if (asset!.name === fileName) { - await this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/assets/${asset!.id}`, this.token, null, "DELETE") + await GitHubPublisher.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/assets/${asset!.id}`, this.token, null, "DELETE") continue uploadAttempt } } @@ -143,7 +141,7 @@ export class GitHubPublisher extends Publisher { } private createRelease() { - return this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token, { + return GitHubPublisher.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token, { tag_name: this.tag, name: this.version, draft: this.options.draft == null || this.options.draft, @@ -154,7 +152,7 @@ export class GitHubPublisher extends Publisher { // test only //noinspection JSUnusedGlobalSymbols async getRelease(): Promise { - return this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/${(await this._releasePromise).id}`, this.token) + return GitHubPublisher.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/${(await this._releasePromise).id}`, this.token) } //noinspection JSUnusedGlobalSymbols @@ -166,7 +164,7 @@ export class GitHubPublisher extends Publisher { for (let i = 0; i < 3; i++) { try { - return await this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/${release.id}`, this.token, null, "DELETE") + return await GitHubPublisher.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases/${release.id}`, this.token, null, "DELETE") } catch (e) { if (e instanceof HttpError) { @@ -186,8 +184,8 @@ export class GitHubPublisher extends Publisher { warn(`Cannot delete release ${release.id}`) } - private githubRequest(path: string, token: string | null, data: {[name: string]: any; } | null = null, method?: "GET" | "DELETE" | "PUT"): Promise { - return this.httpExecutor.request(configureRequestOptions({ + private static githubRequest(path: string, token: string | null, data: {[name: string]: any; } | null = null, method?: "GET" | "DELETE" | "PUT"): Promise { + return httpExecutor.request(configureRequestOptions({ hostname: "api.github.com", path: path, headers: {Accept: "application/vnd.github.v3+json"} diff --git a/packages/electron-builder-publisher/src/publisher.ts b/packages/electron-builder-publisher/src/publisher.ts new file mode 100644 index 00000000000..981d8542519 --- /dev/null +++ b/packages/electron-builder-publisher/src/publisher.ts @@ -0,0 +1,30 @@ +import { ClientRequest } from "http" +import { uploadFile } from "./uploader" +import { stat } from "fs-extra-p" +import { basename } from "path" + +export type PublishPolicy = "onTag" | "onTagOrDraft" | "always" | "never" + +export interface PublishOptions { + publish?: PublishPolicy | null + + draft?: boolean + prerelease?: boolean +} + +export abstract class Publisher { + async upload(file: string, artifactName?: string): Promise { + const fileName = artifactName || basename(file) + const fileStat = await stat(file) + await this.doUpload(fileName, fileStat.size, uploadFile.bind(this, file, fileStat, fileName), file) + } + + uploadData(data: Buffer, fileName: string): Promise { + if (data == null || fileName == null) { + throw new Error("data or fileName is null") + } + return this.doUpload(fileName, data.length, it => it.end(data)) + } + + protected abstract doUpload(fileName: string, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void, file?: string): Promise +} \ No newline at end of file diff --git a/packages/electron-builder/src/publish/uploader.ts b/packages/electron-builder-publisher/src/uploader.ts similarity index 100% rename from packages/electron-builder/src/publish/uploader.ts rename to packages/electron-builder-publisher/src/uploader.ts diff --git a/packages/electron-builder-publisher/tsconfig.json b/packages/electron-builder-publisher/tsconfig.json new file mode 100755 index 00000000000..7c248fb0c05 --- /dev/null +++ b/packages/electron-builder-publisher/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "out" + }, + "declaration": { + "electron-builder-publisher": "out/electron-builder-publisher.d.ts" + }, + "include": [ + "src/**/*.ts" + ], + "files": [ + "../../typings/mime.d.ts", + "../../typings/debug.d.ts", + "../../typings/progress.d.ts" + ] +} \ No newline at end of file diff --git a/packages/electron-builder-squirrel-windows/tsconfig.json b/packages/electron-builder-squirrel-windows/tsconfig.json index d56487f3ffb..7c038b2bfe0 100755 --- a/packages/electron-builder-squirrel-windows/tsconfig.json +++ b/packages/electron-builder-squirrel-windows/tsconfig.json @@ -10,13 +10,7 @@ "src/**/*.ts" ], "files": [ - "../../node_modules/@types/node/index.d.ts", "../../typings/debug.d.ts", - "../electron-builder/out/electron-builder.d.ts", - "../electron-builder-core/out/electron-builder-core.d.ts", - "../electron-builder-util/out/electron-builder-util.d.ts", - "../../node_modules/fs-extra-p/index.d.ts", - "../../node_modules/bluebird-lst-c/index.d.ts", - "../../node_modules/fs-extra-p/index.d.ts" + "../electron-builder/out/electron-builder.d.ts" ] } \ No newline at end of file diff --git a/packages/electron-builder-util/package.json b/packages/electron-builder-util/package.json index 9001b6622b6..f01a11f4c60 100644 --- a/packages/electron-builder-util/package.json +++ b/packages/electron-builder-util/package.json @@ -20,7 +20,9 @@ "node-emoji": "^1.5.1", "electron-builder-http": "~0.0.0-semantic-release", "source-map-support": "^0.4.11", - "7zip-bin": "^2.0.4" + "7zip-bin": "^2.0.4", + "ini": "^1.3.4", + "tunnel-agent": "^0.4.3" }, "typings": "./out/electron-builder-util.d.ts" } diff --git a/packages/electron-builder-util/src/binDownload.ts b/packages/electron-builder-util/src/binDownload.ts index 3d64beef957..ee5eff6aa66 100644 --- a/packages/electron-builder-util/src/binDownload.ts +++ b/packages/electron-builder-util/src/binDownload.ts @@ -1,10 +1,10 @@ import { spawn, debug, debug7zArgs, getTempName, getCacheDirectory } from "./util" import { rename, unlink, emptyDir } from "fs-extra-p" -import { download } from "electron-builder-http" import { path7za } from "7zip-bin" import * as path from "path" import BluebirdPromise from "bluebird-lst-c" import { statOrNull } from "./fs" +import { httpExecutor } from "./nodeHttpExecutor" const versionToPromise = new Map>() @@ -46,7 +46,7 @@ async function doGetBin(name: string, dirName: string, url: string, sha2: string debug(`Download ${name} from ${url} to ${archiveName}`) // 7z doesn't create out dir, so, we don't create dir in parallel to download - dir creation will create parent dirs for archive file also await emptyDir(tempUnpackDir) - await download(url, archiveName, { + await httpExecutor.download(url, archiveName, { skipDirCreation: true, sha2: sha2, }) diff --git a/packages/electron-builder/src/util/nodeHttpExecutor.ts b/packages/electron-builder-util/src/nodeHttpExecutor.ts similarity index 98% rename from packages/electron-builder/src/util/nodeHttpExecutor.ts rename to packages/electron-builder-util/src/nodeHttpExecutor.ts index d4581bf61f9..611fb7905a6 100644 --- a/packages/electron-builder/src/util/nodeHttpExecutor.ts +++ b/packages/electron-builder-util/src/nodeHttpExecutor.ts @@ -67,6 +67,8 @@ export class NodeHttpExecutor extends HttpExecutor() @@ -34,7 +35,7 @@ export class PublishManager { if (process.env.npm_lifecycle_event === "release") { publishOptions.publish = "always" } - else if (isAuthTokenSet()) { + else { const tag = getCiTag() if (tag != null) { log(`Tag ${tag} is defined, so artifacts will be published`) @@ -119,7 +120,7 @@ export class PublishManager { getOrCreatePublisher(publishConfig: PublishConfiguration, buildInfo: BuildInfo): Publisher | null { let publisher = this.nameToPublisher.get(publishConfig.provider) if (publisher == null) { - publisher = createPublisher(buildInfo, publishConfig, this.publishOptions) + publisher = createPublisher(buildInfo.metadata.version!, publishConfig, this.publishOptions) this.nameToPublisher.set(publishConfig.provider, publisher) } return publisher @@ -185,7 +186,7 @@ async function writeUpdateInfo(event: ArtifactCreated, _publishConfigs: Array it.provider === "generic") + const genericPublishConfig = publishConfigs.find(it => it.provider === "generic" || it.provider === "s3") if (genericPublishConfig != null) { packager.info.dispatchArtifactCreated({ file: updateInfoFile, @@ -251,8 +252,7 @@ async function writeUpdateInfo(event: ArtifactCreated, _publishConfigs: ArraypublishConfig).url, macros)) return url.format(Object.assign({}, baseUrl, {pathname: path.posix.resolve(baseUrl.pathname || "/", encodeURI(fileName))})) } + else if (publishConfig.provider === "s3") { + const bucket = (publishConfig).bucket + return `https://s3.amazonaws.com/${bucket}/${fileName}` + } else { const gh = publishConfig return `https://github.com${`/${gh.owner}/${gh.repo}/releases`}/download/v${version}/${encodeURI(fileName)}` @@ -313,12 +317,16 @@ export function getPublishConfigs(packager: PlatformPackager, targetSpecifi return null } - if (publishers == null && !isEmptyOrSpaces(process.env.GH_TOKEN)) { - publishers = [{provider: "github"}] - } - // if both tokens are set — still publish to github (because default publisher is github) - if (publishers == null && !isEmptyOrSpaces(process.env.BT_TOKEN)) { - publishers = [{provider: "bintray"}] + if (publishers == null) { + if (!isEmptyOrSpaces(process.env.GH_TOKEN)) { + publishers = [{provider: "github"}] + } + else if (!isEmptyOrSpaces(process.env.BT_TOKEN)) { + publishers = [{provider: "bintray"}] + } + else if (!isEmptyOrSpaces(process.env.AWS_ACCESS_KEY_ID) && !isEmptyOrSpaces(process.env.AWS_SECRET_ACCESS_KEY)) { + publishers = [{provider: "s3"}] + } } } diff --git a/packages/electron-builder/src/publish/publisher.ts b/packages/electron-builder/src/publish/publisher.ts index c092d7812f1..62f1933ad11 100644 --- a/packages/electron-builder/src/publish/publisher.ts +++ b/packages/electron-builder/src/publish/publisher.ts @@ -1,35 +1,5 @@ -import { ClientRequest } from "http" -import { uploadFile } from "./uploader" -import { stat } from "fs-extra-p" -import { basename } from "path" import { BuildInfo } from "../packagerApi" -import { PublishConfiguration, GithubOptions, BintrayOptions, GenericServerOptions } from "electron-builder-http/out/publishOptions" - -export type PublishPolicy = "onTag" | "onTagOrDraft" | "always" | "never" - -export interface PublishOptions { - publish?: PublishPolicy | null - - draft?: boolean - prerelease?: boolean -} - -export abstract class Publisher { - async upload(file: string, artifactName?: string): Promise { - const fileName = artifactName || basename(file) - const fileStat = await stat(file) - await this.doUpload(fileName, fileStat.size, uploadFile.bind(this, file, fileStat, fileName)) - } - - uploadData(data: Buffer, fileName: string): Promise { - if (data == null || fileName == null) { - throw new Error("data or fileName is null") - } - return this.doUpload(fileName, data.length, it => it.end(data)) - } - - protected abstract doUpload(fileName: string, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void): Promise -} +import { PublishConfiguration, GithubOptions, S3Options, BintrayOptions, GenericServerOptions } from "electron-builder-http/out/publishOptions" export async function getResolvedPublishConfig(packager: BuildInfo, publishConfig: PublishConfiguration, errorIfCannot: boolean): Promise { if (publishConfig.provider === "generic") { @@ -39,6 +9,13 @@ export async function getResolvedPublishConfig(packager: BuildInfo, publishConfi return publishConfig } + if (publishConfig.provider === "s3") { + if ((publishConfig).bucket == null) { + throw new Error(`Please specify "bucket" for "s3" update server`) + } + return publishConfig + } + async function getInfo() { const info = await packager.repositoryInfo if (info != null) { diff --git a/packages/electron-builder/tsconfig.json b/packages/electron-builder/tsconfig.json index e3b89242ac9..af32a24f21c 100755 --- a/packages/electron-builder/tsconfig.json +++ b/packages/electron-builder/tsconfig.json @@ -7,18 +7,6 @@ "electron-builder": "out/electron-builder.d.ts" }, "docs": "../../docs/Options.md", - "files": [ - "../../node_modules/fs-extra-p/index.d.ts", - "../../node_modules/bluebird-lst-c/index.d.ts", - "../../node_modules/7zip-bin/index.d.ts", - "../../node_modules/electron-macos-sign/index.d.ts", - "../electron-builder-http/out/electron-builder-http.d.ts", - "../electron-builder-util/out/electron-builder-util.d.ts", - "../electron-builder-core/out/electron-builder-core.d.ts", - "../../node_modules/@types/node/index.d.ts", - "../../node_modules/@types/js-yaml/index.d.ts", - "../../node_modules/@types/ini/index.d.ts" - ], "include": [ "src/**/*.ts", "../../typings/*.d.ts" diff --git a/packages/electron-publisher-s3/package.json b/packages/electron-publisher-s3/package.json new file mode 100644 index 00000000000..37d77f81af1 --- /dev/null +++ b/packages/electron-publisher-s3/package.json @@ -0,0 +1,22 @@ +{ + "name": "electron-publisher-s3", + "version": "0.0.0-semantic-release", + "main": "out/s3Publisher.js", + "author": "Vladimir Krivosheev", + "license": "MIT", + "repository": "electron-userland/electron-builder", + "bugs": "https://github.com/electron-userland/electron-builder/issues", + "homepage": "https://github.com/electron-userland/electron-builder", + "files": [ + "out" + ], + "dependencies": { + "fs-extra-p": "^3.1.0", + "aws-sdk": "^2.9.0", + "mime": "^1.3.4", + "bluebird-lst-c": "^1.0.6", + "electron-builder-publisher": "~0.0.0-semantic-release", + "electron-builder-util": "~0.0.0-semantic-release" + }, + "typings": "./out/electron-publisher-s3.d.ts" +} diff --git a/packages/electron-publisher-s3/readme.md b/packages/electron-publisher-s3/readme.md new file mode 100644 index 00000000000..d777bb6dd22 --- /dev/null +++ b/packages/electron-publisher-s3/readme.md @@ -0,0 +1,5 @@ +# electron-publisher-s3 + +Part of [electron-builder](https://github.com/electron-userland/electron-builder). + +See the [Publishing Artifacts.](https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts) section of the [Wiki](https://github.com/electron-userland/electron-builder/wiki) for more information. \ No newline at end of file diff --git a/packages/electron-publisher-s3/src/s3Publisher.ts b/packages/electron-publisher-s3/src/s3Publisher.ts new file mode 100644 index 00000000000..dc56d9032f0 --- /dev/null +++ b/packages/electron-publisher-s3/src/s3Publisher.ts @@ -0,0 +1,54 @@ +import { Publisher } from "electron-builder-publisher" +import { S3Options } from "electron-builder-http/out/publishOptions" +import { ClientRequest } from "http" +import { S3 } from "aws-sdk" +import { createReadStream } from "fs-extra-p" +import mime from "mime" +import BluebirdPromise from "bluebird-lst-c" +import { debug, isEmptyOrSpaces } from "electron-builder-util" + +export default class S3Publisher extends Publisher { + private readonly s3 = new S3({signatureVersion: "v4"}) + + constructor(private readonly info: S3Options) { + super() + + debug(`Creating S3 Publisher — bucket: ${info.bucket}`) + + if (isEmptyOrSpaces(process.env.AWS_ACCESS_KEY_ID)) { + throw new Error(`Env AWS_ACCESS_KEY_ID is not set`) + } + if (isEmptyOrSpaces(process.env.AWS_SECRET_ACCESS_KEY)) { + throw new Error(`Env AWS_SECRET_ACCESS_KEY is not set`) + } + } + + // http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html + protected async doUpload(fileName: string, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void, file: string): Promise { + debug(`S3 Publisher: uploading ${fileName} to ${this.info.bucket}`) + + return new BluebirdPromise((resolve, reject) => { + //noinspection JSUnusedLocalSymbols + const fileStream = createReadStream(file) + fileStream.on("error", reject) + + this.s3.upload({ + Bucket: this.info.bucket!, + Key: fileName, + ACL: this.info.acl || "public-read", + Body: fileStream, + ContentLength: dataLength, + ContentType: mime.lookup(fileName), + StorageClass: this.info.storageClass || undefined + }, (error: Error, data: any) => { + if (error != null) { + reject(error) + return + } + + debug(`S3 Publisher: ${fileName} was uploaded to ${data.Location}`) + resolve() + }) + }) + } +} diff --git a/packages/electron-publisher-s3/tsconfig.json b/packages/electron-publisher-s3/tsconfig.json new file mode 100755 index 00000000000..a3b38f727cd --- /dev/null +++ b/packages/electron-publisher-s3/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "out" + }, + "declaration": { + "electron-publisher-s3": "out/electron-publisher-s3.d.ts" + }, + "include": [ + "src/**/*.ts" + ], + "files": [ + "../../typings/mime.d.ts", + "../../typings/debug.d.ts" + ] +} \ No newline at end of file diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 4ca408191a6..d04fea107b4 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -5,7 +5,7 @@ import { RequestHeaders, executorHolder } from "electron-builder-http" import { Provider, UpdateCheckResult, FileInfo, UpdaterSignal } from "./api" import { BintrayProvider } from "./BintrayProvider" import BluebirdPromise from "bluebird-lst-c" -import { BintrayOptions, PublishConfiguration, GithubOptions, GenericServerOptions, VersionInfo } from "electron-builder-http/out/publishOptions" +import { BintrayOptions, PublishConfiguration, GithubOptions, S3Options, GenericServerOptions, VersionInfo } from "electron-builder-http/out/publishOptions" import { readFile } from "fs-extra-p" import { safeLoad } from "js-yaml" import { GenericProvider } from "./GenericProvider" @@ -56,7 +56,7 @@ export abstract class AppUpdater extends EventEmitter { protected versionInfo: VersionInfo | null private fileInfo: FileInfo | null - constructor(options: PublishConfiguration | BintrayOptions | GithubOptions | null | undefined) { + constructor(options: PublishConfiguration | null | undefined) { super() this.on("error", (error: Error) => { @@ -98,7 +98,7 @@ export abstract class AppUpdater extends EventEmitter { return "Deprecated. Do not use it." } - setFeedURL(value: PublishConfiguration | BintrayOptions | GithubOptions | GenericServerOptions | string) { + setFeedURL(value: PublishConfiguration | string) { // https://github.com/electron-userland/electron-builder/issues/1105 let client: Provider if (typeof value === "string") { @@ -239,7 +239,7 @@ export abstract class AppUpdater extends EventEmitter { } } -function createClient(data: string | PublishConfiguration | BintrayOptions | GithubOptions) { +function createClient(data: string | PublishConfiguration | BintrayOptions | GithubOptions | S3Options) { if (typeof data === "string") { throw new Error("Please pass PublishConfiguration object") } @@ -248,6 +248,11 @@ function createClient(data: string | PublishConfiguration | BintrayOptions | Git switch (provider) { case "github": return new GitHubProvider(data) + case "s3": + return new GenericProvider({ + url: `https://s3.amazonaws.com/${(data).bucket || ""}`, + channel: (data).channel || "" + }) case "generic": return new GenericProvider(data) case "bintray": diff --git a/packages/electron-updater/src/GenericProvider.ts b/packages/electron-updater/src/GenericProvider.ts index cdd6ca2836a..8570d8dd99c 100644 --- a/packages/electron-updater/src/GenericProvider.ts +++ b/packages/electron-updater/src/GenericProvider.ts @@ -16,7 +16,7 @@ export class GenericProvider extends Provider { async getLatestVersion(): Promise { let result: UpdateInfo | null = null const channelFile = getChannelFilename(this.channel) - const pathname = path.posix.resolve(this.baseUrl.pathname || "/", `${channelFile}`) + const pathname = path.posix.resolve(this.baseUrl.pathname || "/", channelFile) try { const options: RequestOptions = { hostname: this.baseUrl.hostname, diff --git a/packages/electron-updater/src/MacUpdater.ts b/packages/electron-updater/src/MacUpdater.ts index 416a5b74b5a..fe785b6fb22 100644 --- a/packages/electron-updater/src/MacUpdater.ts +++ b/packages/electron-updater/src/MacUpdater.ts @@ -1,5 +1,5 @@ import { AppUpdater } from "./AppUpdater" -import { BintrayOptions, PublishConfiguration, GithubOptions, VersionInfo } from "electron-builder-http/out/publishOptions" +import { PublishConfiguration, VersionInfo } from "electron-builder-http/out/publishOptions" import BluebirdPromise from "bluebird-lst-c" import { FileInfo } from "./api" import AutoUpdater = Electron.AutoUpdater @@ -7,7 +7,7 @@ import AutoUpdater = Electron.AutoUpdater export class MacUpdater extends AppUpdater { private readonly nativeUpdater: AutoUpdater = require("electron").autoUpdater - constructor(options?: PublishConfiguration | BintrayOptions | GithubOptions) { + constructor(options?: PublishConfiguration) { super(options) this.nativeUpdater.on("error", it => { diff --git a/packages/electron-updater/src/NsisUpdater.ts b/packages/electron-updater/src/NsisUpdater.ts index b09ecd779b7..1865578c1d9 100644 --- a/packages/electron-updater/src/NsisUpdater.ts +++ b/packages/electron-updater/src/NsisUpdater.ts @@ -3,7 +3,7 @@ import * as path from "path" import { tmpdir } from "os" import { download, DownloadOptions } from "electron-builder-http" import { DOWNLOAD_PROGRESS, FileInfo } from "./api" -import { BintrayOptions, PublishConfiguration, GithubOptions, VersionInfo } from "electron-builder-http/out/publishOptions" +import { PublishConfiguration, VersionInfo } from "electron-builder-http/out/publishOptions" import { mkdtemp, remove } from "fs-extra-p" import "source-map-support/register" import { AppUpdater } from "./AppUpdater" @@ -13,7 +13,7 @@ export class NsisUpdater extends AppUpdater { private quitAndInstallCalled = false private quitHandlerAdded = false - constructor(options?: PublishConfiguration | BintrayOptions | GithubOptions) { + constructor(options?: PublishConfiguration) { super(options) } diff --git a/packages/electron-updater/tsconfig.json b/packages/electron-updater/tsconfig.json index 266fc6bad79..4a5a2048faa 100755 --- a/packages/electron-updater/tsconfig.json +++ b/packages/electron-updater/tsconfig.json @@ -8,13 +8,7 @@ }, "files": [ "../../typings/semver.d.ts", - "../../typings/debug.d.ts", - "../../node_modules/fs-extra-p/index.d.ts", - "../../node_modules/bluebird-lst-c/index.d.ts", - "../electron-builder-http/out/electron-builder-http.d.ts", - "../../node_modules/@types/electron/index.d.ts", - "../../node_modules/@types/node/index.d.ts", - "../../node_modules/@types/js-yaml/index.d.ts" + "../../typings/debug.d.ts" ], "include": [ "src/**/*.ts" diff --git a/packages/tsconfig-base.json b/packages/tsconfig-base.json index a05e33e4e5c..30b60eadaaa 100644 --- a/packages/tsconfig-base.json +++ b/packages/tsconfig-base.json @@ -12,6 +12,8 @@ "noEmitHelpers": true, "noFallthroughCasesInSwitch": true, "noUnusedLocals": true, - "skipLibCheck": true + "skipLibCheck": true, + "moduleResolution": "Node", + "baseUrl": "." } } \ No newline at end of file diff --git a/test/src/ArtifactPublisherTest.ts b/test/src/ArtifactPublisherTest.ts index 3a9d1b1d6bc..62566683e86 100644 --- a/test/src/ArtifactPublisherTest.ts +++ b/test/src/ArtifactPublisherTest.ts @@ -1,8 +1,10 @@ -import { GitHubPublisher } from "electron-builder/out/publish/gitHubPublisher" +import { GitHubPublisher } from "electron-builder-publisher/out/gitHubPublisher" import { join } from "path" -import { BintrayPublisher } from "electron-builder/out/publish/BintrayPublisher" +import { BintrayPublisher } from "electron-builder-publisher/out/BintrayPublisher" import isCi from "is-ci" import { HttpError } from "electron-builder-http" +import { createPublisher } from "electron-builder/out/publish/PublishManager" +import { S3Options } from "electron-builder-http/out/publishOptions" if (isCi && process.platform === "win32") { fit("Skip ArtifactPublisherTest suite on Windows CI", () => { @@ -85,6 +87,20 @@ testAndIgnoreApiRate("GitHub upload", async () => { } }) +if (process.env.AWS_ACCESS_KEY_ID != null && process.env.AWS_SECRET_ACCESS_KEY != null) { + test("S3 upload", async () => { + const publisher = createPublisher("0.0.1", {provider: "s3", bucket: "electron-builder-test"}, {}) + try { + await publisher.upload(iconPath) + // test overwrite + await publisher.upload(iconPath) + } + finally { + // await publisher.deleteRelease() + } + }) +} + testAndIgnoreApiRate("prerelease", async () => { const publisher = new GitHubPublisher({provider: "github", owner: "actperepo", repo: "ecb2", token: token}, versionNumber(), { draft: false, diff --git a/test/src/linux/linuxPackagerTest.ts b/test/src/linux/linuxPackagerTest.ts index a9e59d58a00..b10ff64c4db 100755 --- a/test/src/linux/linuxPackagerTest.ts +++ b/test/src/linux/linuxPackagerTest.ts @@ -39,9 +39,11 @@ test.ifNotWindows("icons from ICNS", app({targets: Platform.LINUX.createTarget() await build({ targets: Platform.LINUX.createTarget(), projectDir: projectDir, + publish: "never", config: { electronVersion: ELECTRON_VERSION, compression: "store", + npmRebuild: false, } }) diff --git a/test/src/nsisUpdaterTest.ts b/test/src/nsisUpdaterTest.ts index 370b0d5bea2..245b643cac8 100644 --- a/test/src/nsisUpdaterTest.ts +++ b/test/src/nsisUpdaterTest.ts @@ -28,7 +28,7 @@ g.__test_app = { process.env.TEST_UPDATER_PLATFORM = "win32" test("check updates - no versions at all", async () => { - const updater = new NsisUpdater({ + const updater = new NsisUpdater({ provider: "bintray", owner: "actperepo", package: "no-versions", @@ -38,7 +38,7 @@ test("check updates - no versions at all", async () => { }) test("cannot find suitable file for version", async () => { - const updater = new NsisUpdater({ + const updater = new NsisUpdater({ provider: "bintray", owner: "actperepo", package: "incorrect-file-version", diff --git a/yarn.lock b/yarn.lock index e3e62710886..35a55cf9ef4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -50,7 +50,7 @@ dependencies: "@types/node" "*" -abab@^1.0.0: +abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" @@ -58,15 +58,15 @@ abbrev@1: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" -acorn-globals@^1.0.4: - version "1.0.9" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-1.0.9.tgz#55bb5e98691507b74579d0513413217c380c54cf" +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" dependencies: - acorn "^2.1.0" + acorn "^4.0.4" -acorn@^2.1.0, acorn@^2.4.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" +acorn@^4.0.4: + version "4.0.8" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.8.tgz#f41e52020ce78118a3c68ed0e9215eb8fc68b5b1" align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" @@ -205,6 +205,20 @@ asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" +aws-sdk@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.9.0.tgz#f258dcc295b1e7eca49d3624abfbf5f7d644172c" + dependencies: + buffer "4.9.1" + crypto-browserify "1.0.9" + jmespath "0.15.0" + querystring "0.2.0" + sax "1.1.5" + url "0.10.3" + uuid "3.0.0" + xml2js "0.4.15" + xmlbuilder "2.6.2" + aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" @@ -221,7 +235,7 @@ babel-code-frame@^6.20.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.0.0, babel-core@^6.21.0, babel-core@^6.22.0: +babel-core@^6.0.0, babel-core@^6.22.0, babel-core@^6.22.1: version "6.22.1" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.22.1.tgz#9c5fd658ba1772d28d721f6d25d968fc7ae21648" dependencies: @@ -454,7 +468,7 @@ balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" -base64-js@1.1.2: +base64-js@1.1.2, base64-js@^1.0.2: version "1.1.2" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.1.2.tgz#d6400cac1c4c660976d90d07a04351d89395f5e8" @@ -542,6 +556,14 @@ buffer-shims@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" +buffer@4.9.1: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + buffers@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" @@ -750,11 +772,15 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" -cssom@0.3.x, "cssom@>= 0.3.0 < 0.4.0": +crypto-browserify@1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-1.0.9.tgz#cc5449685dfb85eb11c9828acc7cb87ab5bbfcc0" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.2" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" -"cssstyle@>= 0.2.36 < 0.3.0": +"cssstyle@>= 0.2.37 < 0.3.0": version "0.2.37" resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" dependencies: @@ -1236,9 +1262,9 @@ iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" -iconv-lite@^0.4.13: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" +ieee754@^1.1.4: + version "1.1.8" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" imurmurhash@^0.1.4: version "0.1.4" @@ -1390,7 +1416,7 @@ isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" -isarray@1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1656,6 +1682,10 @@ jest-util@^18.1.0: jest-mock "^18.0.0" mkdirp "^0.5.1" +jmespath@0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" + jodid25519@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" @@ -1678,29 +1708,28 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" jsdom@^9.9.1: - version "9.9.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.9.1.tgz#84f3972ad394ab963233af8725211bce4d01bfd5" + version "9.10.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.10.0.tgz#72d04d9fd5f1164d016dc350ef889af6d0d1a25a" dependencies: - abab "^1.0.0" - acorn "^2.4.0" - acorn-globals "^1.0.4" + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" array-equal "^1.0.0" content-type-parser "^1.0.1" - cssom ">= 0.3.0 < 0.4.0" - cssstyle ">= 0.2.36 < 0.3.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" escodegen "^1.6.1" html-encoding-sniffer "^1.0.1" - iconv-lite "^0.4.13" nwmatcher ">= 1.3.9 < 2.0.0" parse5 "^1.5.1" - request "^2.55.0" - sax "^1.1.4" - symbol-tree ">= 3.1.0 < 4.0.0" - tough-cookie "^2.3.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" webidl-conversions "^3.0.1" whatwg-encoding "^1.0.1" - whatwg-url "^4.1.0" - xml-name-validator ">= 2.0.1 < 3.0.0" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" jsesc@^1.3.0: version "1.3.0" @@ -1874,6 +1903,10 @@ lodash@^4.14.0, lodash@^4.2.0, lodash@^4.5.1, lodash@^4.8.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.5.0.tgz#19bb3f4d51278f0b8c818ed145c74ecf9fe40e6d" + longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -2295,6 +2328,10 @@ prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -2307,6 +2344,10 @@ qs@~6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + randomatic@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" @@ -2416,7 +2457,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.45.0, request@^2.55.0: +request@^2.45.0, request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -2490,7 +2531,11 @@ sanitize-filename@^1.6.1: dependencies: truncate-utf8-bytes "^1.0.0" -sax@^1.1.4: +sax@1.1.5, sax@>=0.6.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.1.5.tgz#1da50a8d00cdecd59405659f5ff85349fe773743" + +sax@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" @@ -2536,7 +2581,7 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -source-map-support@^0.4.10, source-map-support@^0.4.11, source-map-support@^0.4.2: +source-map-support@^0.4.11, source-map-support@^0.4.2: version "0.4.11" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322" dependencies: @@ -2657,7 +2702,7 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" -"symbol-tree@>= 3.1.0 < 4.0.0": +symbol-tree@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.1.tgz#8549dd1d01fa9f893c18cc9ab0b106b4d9b168cb" @@ -2713,7 +2758,7 @@ touch@0.0.3: dependencies: nopt "~1.0.10" -tough-cookie@^2.3.1, tough-cookie@~2.3.0: +tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" dependencies: @@ -2737,16 +2782,16 @@ truncate-utf8-bytes@^1.0.0: dependencies: utf8-byte-length "^1.0.1" -ts-babel@^1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ts-babel/-/ts-babel-1.3.5.tgz#533245e99eef8d6da639b2fc0d88d126072227ba" +ts-babel@^1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/ts-babel/-/ts-babel-1.3.6.tgz#c98e4e480dc5cf5216798a5a8e62f268ec6adfe2" dependencies: - babel-core "^6.21.0" + babel-core "^6.22.1" bluebird-lst-c "^1.0.6" chalk "^1.1.3" fs-extra-p "^3.1.0" markdown-it "^8.2.2" - source-map-support "^0.4.10" + source-map-support "^0.4.11" tslint@^4.4.2: version "4.4.2" @@ -2819,6 +2864,13 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" +url@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + utf8-byte-length@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz#f45f150c4c66eee968186505ab93fcbb8ad6bf61" @@ -2833,14 +2885,14 @@ uuid-1345@^0.99.6: dependencies: macaddress "^0.2.7" +uuid@3.0.0, uuid@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.0.tgz#6728fc0459c450d796a99c31837569bdf672d728" + uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - validate-npm-package-license@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" @@ -2878,7 +2930,7 @@ whatwg-encoding@^1.0.1: dependencies: iconv-lite "0.4.13" -whatwg-url@^4.1.0: +whatwg-url@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.3.0.tgz#92aaee21f4f2a642074357d70ef8500a7cbb171a" dependencies: @@ -2957,11 +3009,24 @@ xdg-basedir@^2.0.0: dependencies: os-homedir "^1.0.0" -"xml-name-validator@>= 2.0.1 < 3.0.0": +xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -xmlbuilder@8.2.2: +xml2js@0.4.15: + version "0.4.15" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.15.tgz#95cd03ff2dd144ec28bc6273bf2b2890c581ad0c" + dependencies: + sax ">=0.6.0" + xmlbuilder ">=2.4.6" + +xmlbuilder@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-2.6.2.tgz#f916f6d10d45dc171b1be2e6e673fb6e0cc35d0a" + dependencies: + lodash "~3.5.0" + +xmlbuilder@8.2.2, xmlbuilder@>=2.4.6: version "8.2.2" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773"