diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29e5559f470..e91a4be786b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,24 +84,23 @@ Don't edit wiki directly. Instead, edit files in the `/docs`. # Debug Tests -Only IntelliJ Platform IDEs (IntelliJ IDEA, WebStorm) support debug. [Forked version of AVA](https://github.com/avajs/ava/pull/874) is used. Please see [AVA debug in the WebStorm](https://www.youtube.com/watch?v=C75UwuZXI98&feature=youtu.be). +Only IntelliJ Platform IDEs ([IntelliJ IDEA](https://confluence.jetbrains.com/display/IDEADEV/IDEA+2017.1+EAP), [WebStorm](https://confluence.jetbrains.com/display/WI/WebStorm+EAP)) support debug. Please prefer to use 2017.1. -Use one of the shared run configurations as a template and: +If you use IntelliJ IDEA or WebStorm 2017.1 — [ij-rc-producer](https://github.com/develar/ij-rc-producer) is used and you can run tests from an editor. -* Ensure that `Before launch` contains `Compile TypeScript` (note – currently do not add, please do`npm run compile` before run). +Or you can create Node.js run configuration manually: +* Ensure that `Before launch` contains `Compile TypeScript`. * Set `Node interpreter` to NodeJS 7. NodeJS 7 is required to debug. -* Set `Node parameters` to `--inspect`. -* Set `Application Parameters` to `--match="test name" relative-test-file-name` if you want to debug particular test. E.g. +* Set `Application Parameters` to `-t "test name" relative-test-file-name` if you want to debug particular test. E.g. ``` - --match="extraResources - one-package" test/out/globTest.js + -t "extraResources - one-package" globTest.js ``` * Set `Environment Variables`: - * `NODE_PATH` to `.`. * Optionally, `TEST_APP_TMP_DIR` to some directory (e.g. `/tmp/electron-builder-test`) to inspect output if test uses temporary directory (only if `--match` is used). Specified directory will be used instead of random temporary directory and *cleared* on each run. ## Run Test using CLI ```sh -TEST_APP_TMP_DIR=/tmp/electron-builder-test NODE_PATH=. ./node_modules/.bin/jest --env jest-environment-node-debug '/TestFileName\.\w+$' +TEST_APP_TMP_DIR=/tmp/electron-builder-test ./node_modules/.bin/jest --env jest-environment-node-debug -t 'boring' '/TestFileName\.\w+$' ``` where `TEST_APP_TMP_DIR` is specified to easily inspect and use test build, `boring` is the test name and `test/out/nsisTest.js` is the path to test file. \ No newline at end of file diff --git a/MAINTAINING.md b/MAINTAINING.md index 3f972e32c89..a90efd2eac0 100644 --- a/MAINTAINING.md +++ b/MAINTAINING.md @@ -9,4 +9,8 @@ To add `wiki` upstream: git remote add wiki git@github.com:electron-userland/electron-builder.wiki.git ``` -To sync: `yarn update-wiki` \ No newline at end of file +To sync: `yarn update-wiki` + +# Typings + +All typings are added into root `package.json` to avoid duplication errors in the IDE compiler (several `node.d.ts` files). \ No newline at end of file diff --git a/package.json b/package.json index cdab4ad137f..0281e9aec9c 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,11 @@ "homepage": "https://github.com/electron-userland/electron-builder", "devDependencies": { "@develar/semantic-release": "^6.3.26", + "@types/electron": "^1.4.30", + "@types/ini": "^1.3.29", + "@types/jest": "^16.0.3", + "@types/js-yaml": "^3.5.29", + "@types/source-map-support": "^0.2.28", "babel-plugin-array-includes": "^2.0.3", "babel-plugin-transform-async-to-module-method": "^6.16.0", "babel-plugin-transform-es2015-destructuring": "^6.19.0", diff --git a/packages/electron-auto-updater/package.json b/packages/electron-auto-updater/package.json index 3c88ad255c2..d55bf096e4e 100644 --- a/packages/electron-auto-updater/package.json +++ b/packages/electron-auto-updater/package.json @@ -13,16 +13,12 @@ ], "dependencies": { "bluebird-lst-c": "^1.0.5", - "debug": "^2.5.2", + "debug": "^2.6.0", "fs-extra-p": "^3.0.3", "js-yaml": "^3.7.0", "semver": "^5.3.0", "source-map-support": "^0.4.8", - "electron-builder-http": "1.0.0" - }, - "devDependencies": { - "@types/electron": "^1.4.30", - "@types/js-yaml": "^3.5.29" + "electron-builder-http": "0.0.0-semantic-release" }, "typings": "./out/electron-auto-updater.d.ts" } diff --git a/packages/electron-auto-updater/tsconfig.json b/packages/electron-auto-updater/tsconfig.json index 07dc799280e..8713872de3b 100755 --- a/packages/electron-auto-updater/tsconfig.json +++ b/packages/electron-auto-updater/tsconfig.json @@ -23,10 +23,12 @@ "../../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" + "../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" ], "include": [ - "src/**/*.ts", - "node_modules/@types/*/*.d.ts" + "src/**/*.ts" ] } \ No newline at end of file diff --git a/packages/electron-builder-http/.yarnclean b/packages/electron-builder-http/.yarnclean new file mode 100644 index 00000000000..25bdd148295 --- /dev/null +++ b/packages/electron-builder-http/.yarnclean @@ -0,0 +1,42 @@ +# test directories +__tests__ +test +tests +powered-test + +# asset directories +docs +doc +website +images +assets + +# examples +example +examples + +# code coverage directories +coverage +.nyc_output + +# build scripts +Makefile +Gulpfile.js +Gruntfile.js + +# configs +.tern-project +.gitattributes +.editorconfig +.*ignore +.eslintrc +.jshintrc +.flowconfig +.documentup.json +.yarn-metadata.json +.*.yml +*.yml + +# misc +*.gz +*.md diff --git a/packages/electron-builder-http/package.json b/packages/electron-builder-http/package.json index 7aa12c2481c..0df18445343 100644 --- a/packages/electron-builder-http/package.json +++ b/packages/electron-builder-http/package.json @@ -1,6 +1,6 @@ { "name": "electron-builder-http", - "version": "1.0.0", + "version": "0.0.0-semantic-release", "main": "out/main.js", "author": "Vladimir Krivosheev", "license": "MIT", @@ -10,10 +10,5 @@ "files": [ "out" ], - "dependencies": { - }, - "devDependencies": { - "@types/node": "^6.0.55" - }, "typings": "./out/electron-builder-http.d.ts" } diff --git a/packages/electron-builder-http/src/httpExecutor.ts b/packages/electron-builder-http/src/httpExecutor.ts index a2811cae60b..02b361f7939 100644 --- a/packages/electron-builder-http/src/httpExecutor.ts +++ b/packages/electron-builder-http/src/httpExecutor.ts @@ -13,7 +13,7 @@ export class HttpExecutorHolder { get httpExecutor(): HttpExecutor { if (this._httpExecutor == null) { - this._httpExecutor = new (require((global).__test_app == null ? "./nodeHttpExecutor" : "electron-builder/out/util/nodeHttpExecutor").NodeHttpExecutor)() + this._httpExecutor = new (require("electron-builder/out/util/nodeHttpExecutor").NodeHttpExecutor)() } return this._httpExecutor } diff --git a/packages/electron-builder-http/tsconfig.json b/packages/electron-builder-http/tsconfig.json index 7d6c451194a..2779367b101 100755 --- a/packages/electron-builder-http/tsconfig.json +++ b/packages/electron-builder-http/tsconfig.json @@ -19,7 +19,9 @@ "electron-builder-http": "out/electron-builder-http.d.ts" }, "include": [ - "src/**/*.ts", - "node_modules/@types/*/*.d.ts" + "src/**/*.ts" + ], + "files": [ + "../../node_modules/@types/node/index.d.ts" ] } \ No newline at end of file diff --git a/certs/create.sh b/packages/electron-builder/certs/create.sh similarity index 100% rename from certs/create.sh rename to packages/electron-builder/certs/create.sh diff --git a/certs/root_certs.keychain b/packages/electron-builder/certs/root_certs.keychain similarity index 100% rename from certs/root_certs.keychain rename to packages/electron-builder/certs/root_certs.keychain diff --git a/packages/electron-builder/package.json b/packages/electron-builder/package.json index 9ab7e37d618..224dacbba8e 100644 --- a/packages/electron-builder/package.json +++ b/packages/electron-builder/package.json @@ -80,14 +80,7 @@ "update-notifier": "^1.0.3", "uuid-1345": "^0.99.6", "yargs": "^6.5.0", - "electron-builder-http": "1.0.0" - }, - "devDependencies": { - "@types/node": "^6.0.55", - "@types/ini": "^1.3.29", - "@types/jest": "^16.0.2", - "@types/js-yaml": "^3.5.29", - "@types/source-map-support": "^0.2.28" + "electron-builder-http": "0.0.0-semantic-release" }, "typings": "./out/electron-builder.d.ts", "publishConfig": { diff --git a/packages/electron-builder/src/targets/appx.ts b/packages/electron-builder/src/targets/appx.ts index c22e2247771..7139b02c974 100644 --- a/packages/electron-builder/src/targets/appx.ts +++ b/packages/electron-builder/src/targets/appx.ts @@ -43,6 +43,8 @@ export default class AppXTarget extends Target { const preAppx = path.join(this.outDir, `pre-appx-${getArchSuffix(arch)}`) await emptyDir(preAppx) + const vendorPath = await getSignVendorPath() + const templatePath = path.join(__dirname, "..", "..", "templates", "appx") const safeName = sanitizeFileName(appInfo.name) const resourceList = await packager.resourceList @@ -52,7 +54,7 @@ export default class AppXTarget extends Target { if (resourceList.includes(`${size}.png`)) { return copy(path.join(packager.buildResourcesDir, `${size}.png`), target) } - return copy(path.join(templatePath, "assets", `SampleAppx.${size}.png`), target) + return copy(path.join(vendorPath, "appxAssets", `SampleAppx.${size}.png`), target) }), copyDir(appOutDir, path.join(preAppx, "app")), this.writeManifest(templatePath, preAppx, safeName, arch) @@ -63,7 +65,7 @@ export default class AppXTarget extends Target { use(this.options.makeappxArgs, (it: Array) => args.push(...it)) // wine supports only ia32 binary in any case makeappx crashed on wine // await execWine(path.join(await getSignVendorPath(), "windows-10", process.platform === "win32" ? process.arch : "ia32", "makeappx.exe"), args) - await spawn(path.join(await getSignVendorPath(), "windows-10", arch === Arch.ia32 ? "ia32" : "x64", "makeappx.exe"), args) + await spawn(path.join(vendorPath, "windows-10", arch === Arch.ia32 ? "ia32" : "x64", "makeappx.exe"), args) await packager.sign(destination) packager.dispatchArtifactCreated(destination, packager.generateName("appx", arch, true)) diff --git a/packages/electron-builder/src/targets/squirrelPack.ts b/packages/electron-builder/src/targets/squirrelPack.ts index c06c8102b45..972d516c0da 100644 --- a/packages/electron-builder/src/targets/squirrelPack.ts +++ b/packages/electron-builder/src/targets/squirrelPack.ts @@ -71,7 +71,7 @@ export async function buildInstaller(options: SquirrelOptions, outputDirectory: embeddedArchive.pipe(embeddedArchiveOut) embeddedArchive.file(appUpdate, {name: "Update.exe"}) - embeddedArchive.file(options.loadingGif ? path.resolve(options.loadingGif) : path.join(__dirname, "..", "..", "templates", "install-spinner.gif"), {name: "background.gif"}) + embeddedArchive.file(options.loadingGif ? path.resolve(options.loadingGif) : path.join(options.vendorPath, "install-spinner.gif"), {name: "background.gif"}) const version = convertVersion(options.version) const packageName = `${options.name}-${version}-full.nupkg` diff --git a/packages/electron-builder/src/targets/squirrelWindows.ts b/packages/electron-builder/src/targets/squirrelWindows.ts index 8a907cd4f5c..fe8fde60df5 100644 --- a/packages/electron-builder/src/targets/squirrelWindows.ts +++ b/packages/electron-builder/src/targets/squirrelWindows.ts @@ -9,9 +9,9 @@ import { buildInstaller, convertVersion, SquirrelOptions } from "./squirrelPack" import { SquirrelWindowsOptions } from "../options/winOptions" import { Target } from "./targetFactory" -const SW_VERSION = "1.5.1.3" +const SW_VERSION = "1.5.1.4" //noinspection SpellCheckingInspection -const SW_SHA2 = "526701c61fffed97f622b110cfd15c4a1197ce082705437e9ef938c0cb8f4172" +const SW_SHA2 = "30caa74802259f956d7b73f4b282917c10c6dd3d29f5ca3e4d996b2896f2aa0d" export default class SquirrelWindowsTarget extends Target { private readonly options: SquirrelWindowsOptions = Object.assign({}, this.packager.platformSpecificBuildOptions, this.packager.config.squirrelWindows) diff --git a/packages/electron-builder/src/windowsCodeSign.ts b/packages/electron-builder/src/windowsCodeSign.ts index 442e54e6044..f70b2a71536 100644 --- a/packages/electron-builder/src/windowsCodeSign.ts +++ b/packages/electron-builder/src/windowsCodeSign.ts @@ -6,11 +6,11 @@ import { getBinFromBintray } from "./util/binDownload" import isCi from "is-ci" import { WinBuildOptions } from "./options/winOptions" -const TOOLS_VERSION = "1.5.0" +const TOOLS_VERSION = "1.6.0" export function getSignVendorPath() { //noinspection SpellCheckingInspection - return getBinFromBintray("winCodeSign", TOOLS_VERSION, "5febefb4494f0f62f0f5c0cd6408f0930caf5943ccfeea2bbf90d2eeb34c571d") + return getBinFromBintray("winCodeSign", TOOLS_VERSION, "5a5e7de5087df96734a9bd96226aa40dbfaa87d44bb95e0fb4eee472e5efa583") } export interface SignOptions { diff --git a/packages/electron-builder/tsconfig.json b/packages/electron-builder/tsconfig.json index e42ef63362b..146862f9650 100755 --- a/packages/electron-builder/tsconfig.json +++ b/packages/electron-builder/tsconfig.json @@ -19,23 +19,19 @@ "electron-builder": "out/electron-builder.d.ts" }, "docs": "../../docs/Options.md", - "paths": { - "fs-extra-p": [ - "node_modules/fs-extra-p/index.d.ts" - ] - }, "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-http/out/electron-builder-http.d.ts", + "../../node_modules/@types/node/index.d.ts", + "../../node_modules/@types/js-yaml/index.d.ts", + "../../node_modules/@types/ini/index.d.ts", + "../../node_modules/@types/source-map-support/index.d.ts" ], "include": [ "src/**/*.ts", - "../../typings/*.d.ts", - "node_modules/@types/*/*.d.ts" - ], - "exclude": [ + "../../typings/*.d.ts" ] } \ No newline at end of file diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index 3481818ab34..9c544da43a3 100755 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -461,7 +461,7 @@ export class CheckingWinPackager extends WinPackager { async pack(outDir: string, arch: Arch, targets: Array, postAsyncTasks: Array>): Promise { // skip pack - const helperClass: typeof SquirrelWindowsTarget = require("out/targets/squirrelWindows").default + const helperClass: typeof SquirrelWindowsTarget = require("electron-builder/out/targets/squirrelWindows").default this.effectiveDistOptions = await (new helperClass(this, outDir).computeEffectiveDistOptions()) await this.sign(this.computeAppOutDir(outDir, arch)) diff --git a/test/src/helpers/runTests.ts b/test/src/helpers/runTests.ts index e56bbb93ec7..f4b512bb8c1 100755 --- a/test/src/helpers/runTests.ts +++ b/test/src/helpers/runTests.ts @@ -6,7 +6,7 @@ import { TEST_DIR, ELECTRON_VERSION } from "./config" import isCi from "is-ci" // we set NODE_PATH in this file, so, we cannot use 'out/awaiter' path here -const util = require("../../../out/util/util") +const util = require("../../../packages/electron-builder/out/util/util") const isEmptyOrSpaces = util.isEmptyOrSpaces const downloadElectron: (options: any) => Promise = BluebirdPromise.promisify(require("electron-download-tf")) diff --git a/test/src/mac/dmgTest.ts b/test/src/mac/dmgTest.ts index d9703e59763..df9d522d1b3 100644 --- a/test/src/mac/dmgTest.ts +++ b/test/src/mac/dmgTest.ts @@ -25,7 +25,7 @@ test.ifMac("custom background - new way", () => { platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager) }, { projectDirCreated: projectDir => BluebirdPromise.all([ - copy(path.join(__dirname, "..", "..", "..", "templates", "dmg", "background.tiff"), path.join(projectDir, customBackground)), + copy(path.join(__dirname, "..", "..", "..", "packages", "electron-builder", "templates", "dmg", "background.tiff"), path.join(projectDir, customBackground)), modifyPackageJson(projectDir, data => { data.build.mac = { icon: "customIcon" diff --git a/test/tsconfig.json b/test/tsconfig.json index 3f76f2eb9db..32ef69d29e6 100755 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -14,6 +14,9 @@ "noUnusedLocals": true, "skipLibCheck": true }, + "files": [ + "../node_modules/@types/jest/index.d.ts" + ], "include": [ "../typings/*.d.ts", "typings/*.d.ts", @@ -21,7 +24,6 @@ "../packages/electron-builder/node_modules/fs-extra-p/index.d.ts", "../packages/electron-builder/node_modules/bluebird-lst-c/index.d.ts", "../packages/electron-builder/node_modules/electron-macos-sign/index.d.ts", - "../packages/electron-builder/node_modules/@types/*/*.d.ts", "../packages/electron-builder-http/out/electron-builder-http.d.ts", "../packages/electron-auto-updater/out/electron-auto-updater.d.ts", "../packages/electron-builder/out/electron-builder.d.ts" diff --git a/yarn.lock b/yarn.lock index 60f8248fad9..162fe149acf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,6 +28,34 @@ dependencies: conventional-changelog "0.0.17" +"@types/electron@^1.4.30": + version "1.4.30" + resolved "https://registry.yarnpkg.com/@types/electron/-/electron-1.4.30.tgz#d79b1bc117b6cfa770220d6aeb5a475659cd7961" + dependencies: + "@types/node" "*" + +"@types/ini@^1.3.29": + version "1.3.29" + resolved "https://registry.yarnpkg.com/@types/ini/-/ini-1.3.29.tgz#1325e981e047d40d13ce0359b821475b97741d2f" + +"@types/jest@^16.0.3": + version "16.0.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-16.0.3.tgz#28a465586cd37d2638043ebcca91010ed89fc284" + +"@types/js-yaml@^3.5.29": + version "3.5.29" + resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.5.29.tgz#29f4dd9314fbccb080d8bd84b9c23811ec5090c2" + +"@types/node@*": + version "6.0.55" + resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.55.tgz#e5cb679a43561f42afd1bd6d58d3992ec8f31720" + +"@types/source-map-support@^0.2.28": + version "0.2.28" + resolved "https://registry.yarnpkg.com/@types/source-map-support/-/source-map-support-0.2.28.tgz#ce6497dfa9c9fbd21a753955b4a51d8993d759dd" + dependencies: + "@types/node" "*" + JSONStream@^1.0.4: version "1.3.0" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.0.tgz#680ab9ac6572a8a1a207e0b38721db1c77b215e5"