From 77960f1d425c1d708251c7c1afb3ea09e7bbe812 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 13 Jul 2018 14:32:07 -0700 Subject: [PATCH 01/21] Enable repo-local core packages in the 'packages' folder --- src/main-process/atom-protocol-handler.js | 3 +++ src/package-manager.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main-process/atom-protocol-handler.js b/src/main-process/atom-protocol-handler.js index 1affba02a..50f16b459 100644 --- a/src/main-process/atom-protocol-handler.js +++ b/src/main-process/atom-protocol-handler.js @@ -20,6 +20,9 @@ class AtomProtocolHandler { if (!safeMode) { this.loadPaths.push(path.join(process.env.ATOM_HOME, 'dev', 'packages')) + if (process.env.ATOM_DEV_RESOURCE_PATH) { + this.loadPaths.push(path.join(process.env.ATOM_DEV_RESOURCE_PATH, 'packages')) + } } this.loadPaths.push(path.join(process.env.ATOM_HOME, 'packages')) diff --git a/src/package-manager.js b/src/package-manager.js index 17a5f2214..ece7dd017 100644 --- a/src/package-manager.js +++ b/src/package-manager.js @@ -61,6 +61,9 @@ module.exports = class PackageManager { if (params.configDirPath != null && !params.safeMode) { if (this.devMode) { this.packageDirPaths.push(path.join(params.configDirPath, 'dev', 'packages')) + if (process.env.ATOM_DEV_RESOURCE_PATH) { + this.packageDirPaths.push(path.join(process.env.ATOM_DEV_RESOURCE_PATH, 'packages')) + } } this.packageDirPaths.push(path.join(params.configDirPath, 'packages')) } From 86b8ead239a408fefdbe7c7015ddaf202555cfb5 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 13 Jul 2018 15:49:18 -0700 Subject: [PATCH 02/21] :shirt: --- src/main-process/atom-protocol-handler.js | 2 +- src/package-manager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main-process/atom-protocol-handler.js b/src/main-process/atom-protocol-handler.js index 50f16b459..ae3675d47 100644 --- a/src/main-process/atom-protocol-handler.js +++ b/src/main-process/atom-protocol-handler.js @@ -22,7 +22,7 @@ class AtomProtocolHandler { this.loadPaths.push(path.join(process.env.ATOM_HOME, 'dev', 'packages')) if (process.env.ATOM_DEV_RESOURCE_PATH) { this.loadPaths.push(path.join(process.env.ATOM_DEV_RESOURCE_PATH, 'packages')) - } + } } this.loadPaths.push(path.join(process.env.ATOM_HOME, 'packages')) diff --git a/src/package-manager.js b/src/package-manager.js index ece7dd017..c683937c0 100644 --- a/src/package-manager.js +++ b/src/package-manager.js @@ -63,7 +63,7 @@ module.exports = class PackageManager { this.packageDirPaths.push(path.join(params.configDirPath, 'dev', 'packages')) if (process.env.ATOM_DEV_RESOURCE_PATH) { this.packageDirPaths.push(path.join(process.env.ATOM_DEV_RESOURCE_PATH, 'packages')) - } + } } this.packageDirPaths.push(path.join(params.configDirPath, 'packages')) } From 6753b929cb3b88553b010aa55ea8851625bf3839 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 13 Jul 2018 17:29:06 -0700 Subject: [PATCH 03/21] Don't depend on ATOM_DEV_RESOURCE_PATH for local core package path --- spec/package-manager-spec.js | 8 +++++--- src/main-process/atom-protocol-handler.js | 4 +--- src/package-manager.js | 4 +--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/spec/package-manager-spec.js b/spec/package-manager-spec.js index 73f948536..dd87f85fa 100644 --- a/spec/package-manager-spec.js +++ b/spec/package-manager-spec.js @@ -30,13 +30,15 @@ describe('PackageManager', () => { expect(packageManger.packageDirPaths[0]).toBe(path.join(configDirPath, 'packages')) }) - it('adds regular package path and dev package path in dev mode', () => { + it('adds regular package path, dev package path, and Atom repo package path in dev mode and dev resource path is set', () => { const packageManger = new PackageManager({}) const configDirPath = path.join('~', 'someConfig') - packageManger.initialize({configDirPath, devMode: true}) - expect(packageManger.packageDirPaths.length).toBe(2) + const resourcePath = path.join('~', '/atom') + packageManger.initialize({configDirPath, resourcePath, devMode: true}) + expect(packageManger.packageDirPaths.length).toBe(3) expect(packageManger.packageDirPaths).toContain(path.join(configDirPath, 'packages')) expect(packageManger.packageDirPaths).toContain(path.join(configDirPath, 'dev', 'packages')) + expect(packageManger.packageDirPaths).toContain(path.join(resourcePath, 'packages')) }) }) diff --git a/src/main-process/atom-protocol-handler.js b/src/main-process/atom-protocol-handler.js index ae3675d47..47c3da14f 100644 --- a/src/main-process/atom-protocol-handler.js +++ b/src/main-process/atom-protocol-handler.js @@ -20,9 +20,7 @@ class AtomProtocolHandler { if (!safeMode) { this.loadPaths.push(path.join(process.env.ATOM_HOME, 'dev', 'packages')) - if (process.env.ATOM_DEV_RESOURCE_PATH) { - this.loadPaths.push(path.join(process.env.ATOM_DEV_RESOURCE_PATH, 'packages')) - } + this.loadPaths.push(path.join(resourcePath, 'packages')) } this.loadPaths.push(path.join(process.env.ATOM_HOME, 'packages')) diff --git a/src/package-manager.js b/src/package-manager.js index c683937c0..0c7943bca 100644 --- a/src/package-manager.js +++ b/src/package-manager.js @@ -61,9 +61,7 @@ module.exports = class PackageManager { if (params.configDirPath != null && !params.safeMode) { if (this.devMode) { this.packageDirPaths.push(path.join(params.configDirPath, 'dev', 'packages')) - if (process.env.ATOM_DEV_RESOURCE_PATH) { - this.packageDirPaths.push(path.join(process.env.ATOM_DEV_RESOURCE_PATH, 'packages')) - } + this.packageDirPaths.push(path.join(this.resourcePath, 'packages')) } this.packageDirPaths.push(path.join(params.configDirPath, 'packages')) } From 9e71365c95b23c6b0db61cdd47130050d25ffb8c Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 7 Aug 2018 14:32:26 -0700 Subject: [PATCH 04/21] Run `apm install` in local package folders to prepare for dev mode --- script/bootstrap | 24 +++++++++++++++++++++++- script/lib/run-apm-install.js | 4 ++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 430d7959a..2d50dcd6c 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -2,8 +2,11 @@ 'use strict' -const childProcess = require('child_process') +const path = require('path') +const glob = require('glob') +const colors = require('colors') const CONFIG = require('./config') +const childProcess = require('child_process') const cleanDependencies = require('./lib/clean-dependencies') const deleteMsbuildFromPath = require('./lib/delete-msbuild-from-path') const dependenciesFingerprint = require('./lib/dependencies-fingerprint') @@ -34,4 +37,23 @@ childProcess.execFileSync( ) runApmInstall(CONFIG.repositoryRootPath) +if (!process.env.CI) { + var files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) + if (files.length > 0) { + console.log('Installing core packages for use in dev mode...') + + files.forEach(file => { + const packageDir = path.dirname(file) + process.stdout.write(`Installing packages/${path.basename(packageDir)} `) + runApmInstall(path.dirname(file), true) + + if (process.platform === 'win32') { + return process.stdout.write('done\n'.green); + } else { + return process.stdout.write('\u2713\n'.green); + } + }) + } +} + dependenciesFingerprint.write() diff --git a/script/lib/run-apm-install.js b/script/lib/run-apm-install.js index 3f56e8dd4..ef561125a 100644 --- a/script/lib/run-apm-install.js +++ b/script/lib/run-apm-install.js @@ -4,7 +4,7 @@ const childProcess = require('child_process') const CONFIG = require('../config') -module.exports = function (packagePath) { +module.exports = function (packagePath, stderrOnly) { const installEnv = Object.assign({}, process.env) // Set resource path so that apm can load metadata related to Atom. installEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath @@ -14,6 +14,6 @@ module.exports = function (packagePath) { childProcess.execFileSync( CONFIG.getApmBinPath(), ['--loglevel=error', 'install'], - {env: installEnv, cwd: packagePath, stdio: 'inherit'} + {env: installEnv, cwd: packagePath, stdio: ['inherit', stderrOnly ? 'pipe' : 'inherit', 'inherit'] } ) } From dbaa75b598d89d1b68cd3ec80a1d17d34d2ff88b Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 7 Aug 2018 16:29:47 -0700 Subject: [PATCH 05/21] Move script/bootstrap dependency module to later in bootstrap script --- script/bootstrap | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 2d50dcd6c..197c0b4c2 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -3,8 +3,6 @@ 'use strict' const path = require('path') -const glob = require('glob') -const colors = require('colors') const CONFIG = require('./config') const childProcess = require('child_process') const cleanDependencies = require('./lib/clean-dependencies') @@ -38,6 +36,9 @@ childProcess.execFileSync( runApmInstall(CONFIG.repositoryRootPath) if (!process.env.CI) { + const glob = require('glob') + const colors = require('colors') + var files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) if (files.length > 0) { console.log('Installing core packages for use in dev mode...') From 067ba9812e5c8554ce9291ccd37011d7dd948cf8 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 7 Aug 2018 16:49:49 -0700 Subject: [PATCH 06/21] :shirt: Curse ye, linter --- script/lib/run-apm-install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/run-apm-install.js b/script/lib/run-apm-install.js index ef561125a..c9e53c71e 100644 --- a/script/lib/run-apm-install.js +++ b/script/lib/run-apm-install.js @@ -14,6 +14,6 @@ module.exports = function (packagePath, stderrOnly) { childProcess.execFileSync( CONFIG.getApmBinPath(), ['--loglevel=error', 'install'], - {env: installEnv, cwd: packagePath, stdio: ['inherit', stderrOnly ? 'pipe' : 'inherit', 'inherit'] } + {env: installEnv, cwd: packagePath, stdio: ['inherit', stderrOnly ? 'pipe' : 'inherit', 'inherit']} ) } From 653822bf1564e01b74ee520642b247ac32ef9080 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 9 Aug 2018 06:11:47 -0700 Subject: [PATCH 07/21] Pass new CI parameter to runApmInstall --- script/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/bootstrap b/script/bootstrap index a0f8bff4e..7b9828b3b 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -54,7 +54,7 @@ if (!process.env.CI) { files.forEach(file => { const packageDir = path.dirname(file) process.stdout.write(`Installing packages/${path.basename(packageDir)} `) - runApmInstall(path.dirname(file), true) + runApmInstall(path.dirname(file), false, true) if (process.platform === 'win32') { return process.stdout.write('done\n'.green); From b107cd547c4f15d1a4b9f68eaf0db3bdb8448597 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 9 Aug 2018 08:29:35 -0700 Subject: [PATCH 08/21] Create 'script/dev' for streamlined launch of Atom dev mode --- script/bootstrap | 25 +---------------------- script/dev | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ script/dev.cmd | 5 +++++ 3 files changed, 58 insertions(+), 24 deletions(-) create mode 100755 script/dev create mode 100644 script/dev.cmd diff --git a/script/bootstrap b/script/bootstrap index 7b9828b3b..6e92b1f59 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -2,9 +2,8 @@ 'use strict' -const path = require('path') -const CONFIG = require('./config') const childProcess = require('child_process') +const CONFIG = require('./config') const cleanDependencies = require('./lib/clean-dependencies') const deleteMsbuildFromPath = require('./lib/delete-msbuild-from-path') const dependenciesFingerprint = require('./lib/dependencies-fingerprint') @@ -43,26 +42,4 @@ childProcess.execFileSync( ) runApmInstall(CONFIG.repositoryRootPath, ci) -if (!process.env.CI) { - const glob = require('glob') - const colors = require('colors') - - var files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) - if (files.length > 0) { - console.log('Installing core packages for use in dev mode...') - - files.forEach(file => { - const packageDir = path.dirname(file) - process.stdout.write(`Installing packages/${path.basename(packageDir)} `) - runApmInstall(path.dirname(file), false, true) - - if (process.platform === 'win32') { - return process.stdout.write('done\n'.green); - } else { - return process.stdout.write('\u2713\n'.green); - } - }) - } -} - dependenciesFingerprint.write() diff --git a/script/dev b/script/dev new file mode 100755 index 000000000..af7d6a431 --- /dev/null +++ b/script/dev @@ -0,0 +1,52 @@ +#!/usr/bin/env node + +'use strict' + +// Run bootstrap first to ensure all the dependencies used later in this script +// are installed. +require('./bootstrap') + +const path = require('path') +const glob = require('glob') +const colors = require('colors') +const CONFIG = require('./config') +const {spawn} = require('child_process') +const runApmInstall = require('./lib/run-apm-install') + +// Install the local core packages in-place so they can be used in dev mode +var files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) +if (files.length > 0) { + console.log('\nInstalling core packages for use in dev mode...') + + files.forEach(file => { + const packageDir = path.dirname(file) + process.stdout.write(`Installing packages/${path.basename(packageDir)} `) + runApmInstall(path.dirname(file), false, true) + + if (process.platform === 'win32') { + return process.stdout.write('done\n'.green); + } else { + return process.stdout.write('\u2713\n'.green); + } + }) +} + +// Launch Atom in dev mode +let atomToLaunch = (process.argv.length > 2 && process.argv[2]) || 'atom' +console.log(`\nLaunching ${atomToLaunch}!\n`.green) + +const atomProcess = spawn(atomToLaunch, ['--dev', CONFIG.repositoryRootPath], { + detached: true, + stdio: 'ignore', + windowsHide: true, + env: Object.assign(process.env, { ATOM_DEV_RESOURCE_PATH: CONFIG.repositoryRootPath }) +}) + +atomProcess.on('error', e => { + if (e.code === 'ENOENT') { + console.error(`The executable '${atomToLaunch}' could not be found!\n`.red) + } else { + console.error(`An error occurred when attempting to launch '${atomToLaunch}'\n`.red, e) + } +}) +atomProcess.unref() diff --git a/script/dev.cmd b/script/dev.cmd new file mode 100644 index 000000000..de161d393 --- /dev/null +++ b/script/dev.cmd @@ -0,0 +1,5 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\dev" %* +) ELSE ( + node "%~dp0\dev" %* +) From 28c891e74189c6ae6a2df7585368f0dd7998e1bf Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 9 Aug 2018 08:40:34 -0700 Subject: [PATCH 09/21] Default to 'atom.cmd' on Windows --- script/dev | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/dev b/script/dev index af7d6a431..d082a6d76 100755 --- a/script/dev +++ b/script/dev @@ -32,7 +32,10 @@ if (files.length > 0) { } // Launch Atom in dev mode -let atomToLaunch = (process.argv.length > 2 && process.argv[2]) || 'atom' +let atomToLaunch = + (process.argv.length > 2 && process.argv[2]) || + process.platform === 'win32' ? 'atom.cmd' : 'atom' + console.log(`\nLaunching ${atomToLaunch}!\n`.green) const atomProcess = spawn(atomToLaunch, ['--dev', CONFIG.repositoryRootPath], { From 2b73c6b28ab5d5f489cf6c962ebf355ac192d397 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 14 Aug 2018 15:02:55 -0700 Subject: [PATCH 10/21] :shirt: --- script/dev | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/dev b/script/dev index d082a6d76..4932842b6 100755 --- a/script/dev +++ b/script/dev @@ -6,15 +6,15 @@ // are installed. require('./bootstrap') +require('colors') const path = require('path') const glob = require('glob') -const colors = require('colors') const CONFIG = require('./config') const {spawn} = require('child_process') const runApmInstall = require('./lib/run-apm-install') // Install the local core packages in-place so they can be used in dev mode -var files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) +const files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) if (files.length > 0) { console.log('\nInstalling core packages for use in dev mode...') @@ -24,9 +24,9 @@ if (files.length > 0) { runApmInstall(path.dirname(file), false, true) if (process.platform === 'win32') { - return process.stdout.write('done\n'.green); + return process.stdout.write('done\n'.green) } else { - return process.stdout.write('\u2713\n'.green); + return process.stdout.write('\u2713\n'.green) } }) } From 9dcd9b1fa4af0fe2ca2e9ba01a172dee831fafa6 Mon Sep 17 00:00:00 2001 From: Linus Eriksson Date: Thu, 5 Apr 2018 22:53:05 +0200 Subject: [PATCH 11/21] :arrow_up: tree-view@0.223.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa9efb6ea..2c0faaa46 100644 --- a/package.json +++ b/package.json @@ -225,7 +225,7 @@ "symbols-view": "0.118.2", "tabs": "0.109.2", "timecop": "0.36.2", - "tree-view": "0.222.0", + "tree-view": "0.223.0", "update-package-dependencies": "0.13.1", "welcome": "0.36.6", "whitespace": "0.37.6", From be3a87dd010ec435a791bf3eb6041853c2a85069 Mon Sep 17 00:00:00 2001 From: Linus Eriksson Date: Fri, 10 Aug 2018 17:41:13 +0200 Subject: [PATCH 12/21] :arrow_up: tree-view@0.224.0 --- package-lock.json | 15 ++++++++++++--- package.json | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5a4c216d..52234826c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,15 @@ "source-map": "0.1.32" } }, + "@atom/temp": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/@atom/temp/-/temp-0.8.4.tgz", + "integrity": "sha1-RVFIywz2ygNI5xpc+ZiGq8rERek=", + "requires": { + "os-tmpdir": "^1.0.0", + "rimraf": "~2.6.2" + } + }, "@atom/watcher": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@atom/watcher/-/watcher-1.0.8.tgz", @@ -6026,13 +6035,13 @@ } }, "tree-view": { - "version": "https://www.atom.io/api/packages/tree-view/versions/0.222.0/tarball", - "integrity": "sha512-H3l7Q6+mUMKdUUxmxDl+23hGC77R6dbJG93jy8cNPMfMvHqdKgtW5THVYSPpsqABvN0HrrufR0dWBS9kUWYZMw==", + "version": "https://www.atom.io/api/packages/tree-view/versions/0.224.0/tarball", + "integrity": "sha512-dt7zWh5ZPNRxrnr+pj2J9YMHPqSnE9wd2Q/TCHns4ITlGiG8YeGbWvZDRIkFaRp2CHTYhLSUdtw5EU59tD92aA==", "requires": { + "@atom/temp": "~0.8.4", "fs-plus": "^3.0.0", "minimatch": "~0.3.0", "pathwatcher": "^8.0.0", - "temp": "~0.8.1", "underscore-plus": "^1.0.0" }, "dependencies": { diff --git a/package.json b/package.json index 2c0faaa46..e851c6cf6 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "text-buffer": "13.14.6", "timecop": "https://www.atom.io/api/packages/timecop/versions/0.36.2/tarball", "tree-sitter": "0.13.6", - "tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.222.0/tarball", + "tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.224.0/tarball", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.8", "update-package-dependencies": "https://www.atom.io/api/packages/update-package-dependencies/versions/0.13.1/tarball", @@ -225,7 +225,7 @@ "symbols-view": "0.118.2", "tabs": "0.109.2", "timecop": "0.36.2", - "tree-view": "0.223.0", + "tree-view": "0.224.0", "update-package-dependencies": "0.13.1", "welcome": "0.36.6", "whitespace": "0.37.6", From daebcecc0d1882517f4a2266271759989ee960ce Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 20 Aug 2018 15:24:59 -0700 Subject: [PATCH 13/21] :arrow_up: tree-view --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 52234826c..532b5e649 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6035,8 +6035,8 @@ } }, "tree-view": { - "version": "https://www.atom.io/api/packages/tree-view/versions/0.224.0/tarball", - "integrity": "sha512-dt7zWh5ZPNRxrnr+pj2J9YMHPqSnE9wd2Q/TCHns4ITlGiG8YeGbWvZDRIkFaRp2CHTYhLSUdtw5EU59tD92aA==", + "version": "https://www.atom.io/api/packages/tree-view/versions/0.224.1/tarball", + "integrity": "sha512-xg2cTttLKeIj8e7IVXsmVOkC2VvFPG8vqLBV7if2uKPjMWNrIan3o+StmliO9hjpxOdb4ScFRfMafN2yRQnoag==", "requires": { "@atom/temp": "~0.8.4", "fs-plus": "^3.0.0", diff --git a/package.json b/package.json index e851c6cf6..15ce9bc16 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "text-buffer": "13.14.6", "timecop": "https://www.atom.io/api/packages/timecop/versions/0.36.2/tarball", "tree-sitter": "0.13.6", - "tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.224.0/tarball", + "tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.224.1/tarball", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.8", "update-package-dependencies": "https://www.atom.io/api/packages/update-package-dependencies/versions/0.13.1/tarball", @@ -225,7 +225,7 @@ "symbols-view": "0.118.2", "tabs": "0.109.2", "timecop": "0.36.2", - "tree-view": "0.224.0", + "tree-view": "0.224.1", "update-package-dependencies": "0.13.1", "welcome": "0.36.6", "whitespace": "0.37.6", From b84592ba10048d8e9630f895ddf226eadcd2d65d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 20 Aug 2018 14:08:54 -0700 Subject: [PATCH 14/21] Allow nightly releases to auto-update This change removes a bad version check which prevented nightly releases to be considered for auto-update checks. The fix is to only skip auto-updates when using a build with a version containing `-dev`. Fixes #17885 --- src/main-process/auto-update-manager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main-process/auto-update-manager.coffee b/src/main-process/auto-update-manager.coffee index bc81d425d..74bf2f886 100644 --- a/src/main-process/auto-update-manager.coffee +++ b/src/main-process/auto-update-manager.coffee @@ -94,7 +94,7 @@ class AutoUpdateManager scheduleUpdateCheck: -> # Only schedule update check periodically if running in release version and # and there is no existing scheduled update check. - unless /\w{7}/.test(@version) or @checkForUpdatesIntervalID + unless /-dev/.test(@version) or @checkForUpdatesIntervalID checkForUpdates = => @check(hidePopups: true) fourHours = 1000 * 60 * 60 * 4 @checkForUpdatesIntervalID = setInterval(checkForUpdates, fourHours) From 2e8d5c99a37496f9eabeb88f8111e1295f626cf2 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 20 Aug 2018 16:34:38 -0700 Subject: [PATCH 15/21] :arrow_up: tree-view --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 532b5e649..915307cf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6035,8 +6035,8 @@ } }, "tree-view": { - "version": "https://www.atom.io/api/packages/tree-view/versions/0.224.1/tarball", - "integrity": "sha512-xg2cTttLKeIj8e7IVXsmVOkC2VvFPG8vqLBV7if2uKPjMWNrIan3o+StmliO9hjpxOdb4ScFRfMafN2yRQnoag==", + "version": "https://www.atom.io/api/packages/tree-view/versions/0.224.2/tarball", + "integrity": "sha512-zQgrwWo2aBInkSCsldNP9sZJA4OnzznQgKJzQNhClMZJMWEr1Pl1tWnq3x67ie6dINkJ/JWqzbjxz2v2T5U2ig==", "requires": { "@atom/temp": "~0.8.4", "fs-plus": "^3.0.0", diff --git a/package.json b/package.json index 15ce9bc16..6a0f015b1 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "text-buffer": "13.14.6", "timecop": "https://www.atom.io/api/packages/timecop/versions/0.36.2/tarball", "tree-sitter": "0.13.6", - "tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.224.1/tarball", + "tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.224.2/tarball", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.8", "update-package-dependencies": "https://www.atom.io/api/packages/update-package-dependencies/versions/0.13.1/tarball", @@ -225,7 +225,7 @@ "symbols-view": "0.118.2", "tabs": "0.109.2", "timecop": "0.36.2", - "tree-view": "0.224.1", + "tree-view": "0.224.2", "update-package-dependencies": "0.13.1", "welcome": "0.36.6", "whitespace": "0.37.6", From 94f972e0bfb27b5b14de0282d761545a6ac82c2e Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 21 Aug 2018 06:40:25 -0700 Subject: [PATCH 16/21] Teach --dev to detect Atom repo in process.cwd() --- src/main-process/get-dev-resource-path.js | 31 +++++++++++++++++++++++ src/main-process/main.js | 9 ++----- src/main-process/parse-command-line.js | 3 ++- 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 src/main-process/get-dev-resource-path.js diff --git a/src/main-process/get-dev-resource-path.js b/src/main-process/get-dev-resource-path.js new file mode 100644 index 000000000..735748d6e --- /dev/null +++ b/src/main-process/get-dev-resource-path.js @@ -0,0 +1,31 @@ +'use strict' + +const path = require('path') +const fs = require('fs-plus') +const CSON = require('season') +const electron = require('electron') + +module.exports = function () { + const appResourcePath = path.dirname(path.dirname(__dirname)) + const defaultRepositoryPath = path.join(electron.app.getPath('home'), 'github', 'atom') + + if (process.env.ATOM_DEV_RESOURCE_PATH) { + return process.env.ATOM_DEV_RESOURCE_PATH + } else if (isAtomRepoPath(process.cwd())) { + return process.cwd() + } else if (fs.statSyncNoException(defaultRepositoryPath)) { + return defaultRepositoryPath + } + + return appResourcePath +} + +function isAtomRepoPath(repoPath) { + let packageJsonPath = path.join(repoPath, 'package.json') + if (fs.statSyncNoException(packageJsonPath)) { + let packageJson = CSON.readFileSync(packageJsonPath) + return packageJson.name === 'atom' + } + + return false +} diff --git a/src/main-process/main.js b/src/main-process/main.js index ee7b96232..20d56baeb 100644 --- a/src/main-process/main.js +++ b/src/main-process/main.js @@ -8,6 +8,7 @@ const electron = require('electron') const fs = require('fs') const path = require('path') const yargs = require('yargs') +const getDevResourcePath = require('./get-dev-resource-path') const args = yargs(process.argv) @@ -24,13 +25,7 @@ if (args.resourcePath) { const defaultRepositoryPath = path.join(electron.app.getPath('home'), 'github', 'atom') if (args.dev || args.test || args.benchmark || args.benchmarkTest) { - if (process.env.ATOM_DEV_RESOURCE_PATH) { - resourcePath = process.env.ATOM_DEV_RESOURCE_PATH - } else if (fs.statSyncNoException(defaultRepositoryPath)) { - resourcePath = defaultRepositoryPath - } else { - resourcePath = stableResourcePath - } + resourcePath = getDevResourcePath() || stableResourcePath } else { resourcePath = stableResourcePath } diff --git a/src/main-process/parse-command-line.js b/src/main-process/parse-command-line.js index f24422ef4..070bf5113 100644 --- a/src/main-process/parse-command-line.js +++ b/src/main-process/parse-command-line.js @@ -5,6 +5,7 @@ const yargs = require('yargs') const {app} = require('electron') const path = require('path') const fs = require('fs-plus') +const getDevResourcePath = require('./get-dev-resource-path') module.exports = function parseCommandLine (processArgs) { const options = yargs(processArgs).wrap(yargs.terminalWidth()) @@ -119,7 +120,7 @@ module.exports = function parseCommandLine (processArgs) { let pathsToOpen = [] let urlsToOpen = [] let devMode = args['dev'] - let devResourcePath = process.env.ATOM_DEV_RESOURCE_PATH || path.join(app.getPath('home'), 'github', 'atom') + let devResourcePath = getDevResourcePath let resourcePath = null for (const path of args._) { From 4a218cbb7ac1b880a66abec6dfa13509850a3121 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 21 Aug 2018 06:41:29 -0700 Subject: [PATCH 17/21] Delete unneeded script/dev and move package install back to bootstrap --- script/bootstrap | 26 ++++++++++++++++++++++- script/dev | 55 ------------------------------------------------ script/dev.cmd | 5 ----- 3 files changed, 25 insertions(+), 61 deletions(-) delete mode 100755 script/dev delete mode 100644 script/dev.cmd diff --git a/script/bootstrap b/script/bootstrap index 6e92b1f59..68c003228 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -2,8 +2,12 @@ 'use strict' -const childProcess = require('child_process') +require('colors') +const path = require('path') +const glob = require('glob') const CONFIG = require('./config') +const {spawn} = require('child_process') +const childProcess = require('child_process') const cleanDependencies = require('./lib/clean-dependencies') const deleteMsbuildFromPath = require('./lib/delete-msbuild-from-path') const dependenciesFingerprint = require('./lib/dependencies-fingerprint') @@ -42,4 +46,24 @@ childProcess.execFileSync( ) runApmInstall(CONFIG.repositoryRootPath, ci) +if (!process.env.CI) { + // Install the local core packages in-place so they can be used in dev mode + const files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) + if (files.length > 0) { + console.log('Installing core packages for use in dev mode...') + + files.forEach(file => { + const packageDir = path.dirname(file) + process.stdout.write(`Installing packages/${path.basename(packageDir)} `) + runApmInstall(path.dirname(file), false, true) + + if (process.platform === 'win32') { + return process.stdout.write('done\n'.green) + } else { + return process.stdout.write('\u2713\n'.green) + } + }) + } +} + dependenciesFingerprint.write() diff --git a/script/dev b/script/dev deleted file mode 100755 index 4932842b6..000000000 --- a/script/dev +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -// Run bootstrap first to ensure all the dependencies used later in this script -// are installed. -require('./bootstrap') - -require('colors') -const path = require('path') -const glob = require('glob') -const CONFIG = require('./config') -const {spawn} = require('child_process') -const runApmInstall = require('./lib/run-apm-install') - -// Install the local core packages in-place so they can be used in dev mode -const files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) -if (files.length > 0) { - console.log('\nInstalling core packages for use in dev mode...') - - files.forEach(file => { - const packageDir = path.dirname(file) - process.stdout.write(`Installing packages/${path.basename(packageDir)} `) - runApmInstall(path.dirname(file), false, true) - - if (process.platform === 'win32') { - return process.stdout.write('done\n'.green) - } else { - return process.stdout.write('\u2713\n'.green) - } - }) -} - -// Launch Atom in dev mode -let atomToLaunch = - (process.argv.length > 2 && process.argv[2]) || - process.platform === 'win32' ? 'atom.cmd' : 'atom' - -console.log(`\nLaunching ${atomToLaunch}!\n`.green) - -const atomProcess = spawn(atomToLaunch, ['--dev', CONFIG.repositoryRootPath], { - detached: true, - stdio: 'ignore', - windowsHide: true, - env: Object.assign(process.env, { ATOM_DEV_RESOURCE_PATH: CONFIG.repositoryRootPath }) -}) - -atomProcess.on('error', e => { - if (e.code === 'ENOENT') { - console.error(`The executable '${atomToLaunch}' could not be found!\n`.red) - } else { - console.error(`An error occurred when attempting to launch '${atomToLaunch}'\n`.red, e) - } -}) -atomProcess.unref() diff --git a/script/dev.cmd b/script/dev.cmd deleted file mode 100644 index de161d393..000000000 --- a/script/dev.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\dev" %* -) ELSE ( - node "%~dp0\dev" %* -) From 7b50f72ac2885fd90cb7b084474f72129bc87d4d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 21 Aug 2018 06:43:28 -0700 Subject: [PATCH 18/21] Call getDevResourcePath --- src/main-process/parse-command-line.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main-process/parse-command-line.js b/src/main-process/parse-command-line.js index 070bf5113..1d25fe70c 100644 --- a/src/main-process/parse-command-line.js +++ b/src/main-process/parse-command-line.js @@ -120,7 +120,7 @@ module.exports = function parseCommandLine (processArgs) { let pathsToOpen = [] let urlsToOpen = [] let devMode = args['dev'] - let devResourcePath = getDevResourcePath + let devResourcePath = getDevResourcePath() let resourcePath = null for (const path of args._) { From 0a7b62cd06dfd8e58746224278ae8e3909cc393d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 21 Aug 2018 06:47:45 -0700 Subject: [PATCH 19/21] Convert stderrOnly param of runApmInstall to stdioOptions --- script/bootstrap | 2 +- script/lib/run-apm-install.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 68c003228..27b61bb1f 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -55,7 +55,7 @@ if (!process.env.CI) { files.forEach(file => { const packageDir = path.dirname(file) process.stdout.write(`Installing packages/${path.basename(packageDir)} `) - runApmInstall(path.dirname(file), false, true) + runApmInstall(path.dirname(file), false, ['inherit', 'pipe', 'inherit']) if (process.platform === 'win32') { return process.stdout.write('done\n'.green) diff --git a/script/lib/run-apm-install.js b/script/lib/run-apm-install.js index df1550a4f..982ed7165 100644 --- a/script/lib/run-apm-install.js +++ b/script/lib/run-apm-install.js @@ -4,7 +4,7 @@ const childProcess = require('child_process') const CONFIG = require('../config') -module.exports = function (packagePath, ci, stderrOnly) { +module.exports = function (packagePath, ci, stdioOptions) { const installEnv = Object.assign({}, process.env) // Set resource path so that apm can load metadata related to Atom. installEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath @@ -14,6 +14,6 @@ module.exports = function (packagePath, ci, stderrOnly) { childProcess.execFileSync( CONFIG.getApmBinPath(), ['--loglevel=error', ci ? 'ci' : 'install'], - {env: installEnv, cwd: packagePath, stdio: ['inherit', stderrOnly ? 'pipe' : 'inherit', 'inherit']} + {env: installEnv, cwd: packagePath, stdio: stdioOptions || 'inherit'} ) } From 8cd788e00f2ee939046724c11cc344f46977116e Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 21 Aug 2018 06:50:37 -0700 Subject: [PATCH 20/21] :shirt: --- src/main-process/get-dev-resource-path.js | 2 +- src/main-process/main.js | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main-process/get-dev-resource-path.js b/src/main-process/get-dev-resource-path.js index 735748d6e..fe89e58fb 100644 --- a/src/main-process/get-dev-resource-path.js +++ b/src/main-process/get-dev-resource-path.js @@ -20,7 +20,7 @@ module.exports = function () { return appResourcePath } -function isAtomRepoPath(repoPath) { +function isAtomRepoPath (repoPath) { let packageJsonPath = path.join(repoPath, 'package.json') if (fs.statSyncNoException(packageJsonPath)) { let packageJson = CSON.readFileSync(packageJsonPath) diff --git a/src/main-process/main.js b/src/main-process/main.js index 20d56baeb..77dacd792 100644 --- a/src/main-process/main.js +++ b/src/main-process/main.js @@ -4,8 +4,6 @@ if (typeof snapshotResult !== 'undefined') { const startTime = Date.now() -const electron = require('electron') -const fs = require('fs') const path = require('path') const yargs = require('yargs') const getDevResourcePath = require('./get-dev-resource-path') @@ -22,8 +20,6 @@ if (args.resourcePath) { resourcePath = args.resourcePath } else { const stableResourcePath = path.dirname(path.dirname(__dirname)) - const defaultRepositoryPath = path.join(electron.app.getPath('home'), 'github', 'atom') - if (args.dev || args.test || args.benchmark || args.benchmarkTest) { resourcePath = getDevResourcePath() || stableResourcePath } else { From 78e16b1c8320b1f7be459e64440ab373feb94160 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 21 Aug 2018 06:52:35 -0700 Subject: [PATCH 21/21] Move requires relevant to package bootstrapping after npm install step --- script/bootstrap | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 27b61bb1f..1abfc48d0 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -2,11 +2,8 @@ 'use strict' -require('colors') const path = require('path') -const glob = require('glob') const CONFIG = require('./config') -const {spawn} = require('child_process') const childProcess = require('child_process') const cleanDependencies = require('./lib/clean-dependencies') const deleteMsbuildFromPath = require('./lib/delete-msbuild-from-path') @@ -47,6 +44,10 @@ childProcess.execFileSync( runApmInstall(CONFIG.repositoryRootPath, ci) if (!process.env.CI) { + require('colors') + const glob = require('glob') + const {spawn} = require('child_process') + // Install the local core packages in-place so they can be used in dev mode const files = glob.sync(path.join(CONFIG.repositoryRootPath, 'packages/*/package.json')) if (files.length > 0) {