From ef6e720761f7f2c3aab70e1b390fa78d680a3b42 Mon Sep 17 00:00:00 2001 From: Nguyen Long Nhat Date: Thu, 11 May 2017 20:35:07 +0700 Subject: [PATCH 1/7] Add Github package [ci skip] --- docs/build-instructions/build-status.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/build-instructions/build-status.md b/docs/build-instructions/build-status.md index 6a366b430..9a58f0c60 100644 --- a/docs/build-instructions/build-status.md +++ b/docs/build-instructions/build-status.md @@ -29,6 +29,7 @@ | [Exception Reporting](https://github.com/atom/exception-reporting) | [![macOS Build Status](https://travis-ci.org/atom/exception-reporting.svg?branch=master)](https://travis-ci.org/atom/exception-reporting) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/i0pla7qbpv7celg2/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/exception-reporting/branch/master) | [![Dependency Status](https://david-dm.org/atom/exception-reporting.svg)](https://david-dm.org/atom/exception-reporting) | | [Find and Replace](https://github.com/atom/find-and-replace) | [![macOS Build Status](https://travis-ci.org/atom/find-and-replace.svg?branch=master)](https://travis-ci.org/atom/find-and-replace) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/6w4baiiq5mw4nxky/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/find-and-replace/branch/master) | [![Dependency Status](https://david-dm.org/atom/find-and-replace.svg)](https://david-dm.org/atom/find-and-replace) | | [Fuzzy Finder](https://github.com/atom/fuzzy-finder) | [![macOS Build Status](https://travis-ci.org/atom/fuzzy-finder.svg?branch=master)](https://travis-ci.org/atom/fuzzy-finder) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/b4b2dg5n9r1wdqad/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/fuzzy-finder/branch/master) | [![Dependency Status](https://david-dm.org/atom/fuzzy-finder.svg)](https://david-dm.org/atom/fuzzy-finder) | +| [Github](https://github.com/atom/github) | [![macOS Build Status](https://travis-ci.com/atom/github.svg?token=RwrCnzpsZN5oEq5S5p7V&branch=master)](https://travis-ci.com/atom/github) | [![Windows Build status](https://ci.appveyor.com/api/projects/status/psctk8vrva49dseb/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/github/branch/master) | [![Dependency Status](https://david-dm.org/atom/github.svg)](https://david-dm.org/atom/github) | | [Git Diff](https://github.com/atom/git-diff) | [![macOS Build Status](https://travis-ci.org/atom/git-diff.svg?branch=master)](https://travis-ci.org/atom/git-diff) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/9auj52cs0vso66nv/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/git-diff/branch/master) | [![Dependency Status](https://david-dm.org/atom/git-diff.svg)](https://david-dm.org/atom/git-diff) | | [Go to Line](https://github.com/atom/go-to-line) | [![macOS Build Status](https://travis-ci.org/atom/go-to-line.svg?branch=master)](https://travis-ci.org/atom/go-to-line) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/qf0isc8ulw4wxi0b/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/go-to-line/branch/master) | [![Dependency Status](https://david-dm.org/atom/go-to-line.svg)](https://david-dm.org/atom/go-to-line) | | [Grammar Selector](https://github.com/atom/grammar-selector) | [![macOS Build Status](https://travis-ci.org/atom/grammar-selector.svg?branch=master)](https://travis-ci.org/atom/grammar-selector) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/pg8qss03bfh4ngqm/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/grammar-selector/branch/master) | [![Dependency Status](https://david-dm.org/atom/grammar-selector.svg)](https://david-dm.org/atom/grammar-selector) | From b225b2d7f075fe09d69e3fdcd84e243080a34d0f Mon Sep 17 00:00:00 2001 From: Nguyen Long Nhat Date: Fri, 12 May 2017 00:35:55 +0700 Subject: [PATCH 2/7] Rename Github into GitHub [ci skip] --- docs/build-instructions/build-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build-instructions/build-status.md b/docs/build-instructions/build-status.md index 9a58f0c60..8ac5fd7df 100644 --- a/docs/build-instructions/build-status.md +++ b/docs/build-instructions/build-status.md @@ -29,7 +29,7 @@ | [Exception Reporting](https://github.com/atom/exception-reporting) | [![macOS Build Status](https://travis-ci.org/atom/exception-reporting.svg?branch=master)](https://travis-ci.org/atom/exception-reporting) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/i0pla7qbpv7celg2/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/exception-reporting/branch/master) | [![Dependency Status](https://david-dm.org/atom/exception-reporting.svg)](https://david-dm.org/atom/exception-reporting) | | [Find and Replace](https://github.com/atom/find-and-replace) | [![macOS Build Status](https://travis-ci.org/atom/find-and-replace.svg?branch=master)](https://travis-ci.org/atom/find-and-replace) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/6w4baiiq5mw4nxky/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/find-and-replace/branch/master) | [![Dependency Status](https://david-dm.org/atom/find-and-replace.svg)](https://david-dm.org/atom/find-and-replace) | | [Fuzzy Finder](https://github.com/atom/fuzzy-finder) | [![macOS Build Status](https://travis-ci.org/atom/fuzzy-finder.svg?branch=master)](https://travis-ci.org/atom/fuzzy-finder) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/b4b2dg5n9r1wdqad/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/fuzzy-finder/branch/master) | [![Dependency Status](https://david-dm.org/atom/fuzzy-finder.svg)](https://david-dm.org/atom/fuzzy-finder) | -| [Github](https://github.com/atom/github) | [![macOS Build Status](https://travis-ci.com/atom/github.svg?token=RwrCnzpsZN5oEq5S5p7V&branch=master)](https://travis-ci.com/atom/github) | [![Windows Build status](https://ci.appveyor.com/api/projects/status/psctk8vrva49dseb/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/github/branch/master) | [![Dependency Status](https://david-dm.org/atom/github.svg)](https://david-dm.org/atom/github) | +| [GitHub](https://github.com/atom/github) | [![macOS Build Status](https://travis-ci.com/atom/github.svg?token=RwrCnzpsZN5oEq5S5p7V&branch=master)](https://travis-ci.com/atom/github) | [![Windows Build status](https://ci.appveyor.com/api/projects/status/psctk8vrva49dseb/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/github/branch/master) | [![Dependency Status](https://david-dm.org/atom/github.svg)](https://david-dm.org/atom/github) | | [Git Diff](https://github.com/atom/git-diff) | [![macOS Build Status](https://travis-ci.org/atom/git-diff.svg?branch=master)](https://travis-ci.org/atom/git-diff) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/9auj52cs0vso66nv/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/git-diff/branch/master) | [![Dependency Status](https://david-dm.org/atom/git-diff.svg)](https://david-dm.org/atom/git-diff) | | [Go to Line](https://github.com/atom/go-to-line) | [![macOS Build Status](https://travis-ci.org/atom/go-to-line.svg?branch=master)](https://travis-ci.org/atom/go-to-line) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/qf0isc8ulw4wxi0b/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/go-to-line/branch/master) | [![Dependency Status](https://david-dm.org/atom/go-to-line.svg)](https://david-dm.org/atom/go-to-line) | | [Grammar Selector](https://github.com/atom/grammar-selector) | [![macOS Build Status](https://travis-ci.org/atom/grammar-selector.svg?branch=master)](https://travis-ci.org/atom/grammar-selector) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/pg8qss03bfh4ngqm/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/grammar-selector/branch/master) | [![Dependency Status](https://david-dm.org/atom/grammar-selector.svg)](https://david-dm.org/atom/grammar-selector) | From b21de45a82e46c8e1274775e97a694bf280d8bce Mon Sep 17 00:00:00 2001 From: Nguyen Long Nhat Date: Tue, 16 May 2017 23:24:30 +0700 Subject: [PATCH 3/7] Github into GitHub [ci skip] --- docs/build-instructions/build-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build-instructions/build-status.md b/docs/build-instructions/build-status.md index 8ac5fd7df..c6c21ea0e 100644 --- a/docs/build-instructions/build-status.md +++ b/docs/build-instructions/build-status.md @@ -41,7 +41,7 @@ | [Markdown Preview](https://github.com/atom/markdown-preview) | [![macOS Build Status](https://travis-ci.org/atom/markdown-preview.svg?branch=master)](https://travis-ci.org/atom/markdown-preview) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/bvh0evhh4v6w9b29/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/markdown-preview/branch/master) | [![Dependency Status](https://david-dm.org/atom/markdown-preview.svg)](https://david-dm.org/atom/markdown-preview) | | [Metrics](https://github.com/atom/metrics) | [![macOS Build Status](https://travis-ci.org/atom/metrics.svg?branch=master)](https://travis-ci.org/atom/metrics) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/b5doi205xl3iex04/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/metrics/branch/master) | [![Dependency Status](https://david-dm.org/atom/metrics.svg)](https://david-dm.org/atom/metrics) | | [Notifications](https://github.com/atom/notifications) | [![macOS Build Status](https://travis-ci.org/atom/notifications.svg?branch=master)](https://travis-ci.org/atom/notifications) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/ps3p8tj2okw57x0e/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/notifications/branch/master) | [![Dependency Status](https://david-dm.org/atom/notifications.svg)](https://david-dm.org/atom/notifications) | -| [Open on Github](https://github.com/atom/open-on-github) | [![macOS Build Status](https://travis-ci.org/atom/open-on-github.svg?branch=master)](https://travis-ci.org/atom/open-on-github) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/ccl6na4qsna5wncr/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/open-on-github/branch/master) | [![Dependency Status](https://david-dm.org/atom/open-on-github.svg)](https://david-dm.org/atom/open-on-github) | +| [Open on GitHub](https://github.com/atom/open-on-github) | [![macOS Build Status](https://travis-ci.org/atom/open-on-github.svg?branch=master)](https://travis-ci.org/atom/open-on-github) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/ccl6na4qsna5wncr/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/open-on-github/branch/master) | [![Dependency Status](https://david-dm.org/atom/open-on-github.svg)](https://david-dm.org/atom/open-on-github) | | [Package Generator](https://github.com/atom/package-generator) | [![macOS Build Status](https://travis-ci.org/atom/package-generator.svg?branch=master)](https://travis-ci.org/atom/package-generator)| [![Windows Build Status](https://ci.appveyor.com/api/projects/status/7t1i4hdmljhigp9u/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/package-generator/branch/master) | [![Dependency Status](https://david-dm.org/atom/package-generator.svg)](https://david-dm.org/atom/package-generator) | | [Settings View](https://github.com/atom/settings-view) | [![macOS Build Status](https://travis-ci.org/atom/settings-view.svg?branch=master)](https://travis-ci.org/atom/settings-view) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/hatgxg6k2g3grafq/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/settings-view/branch/master) | [![Dependency Status](https://david-dm.org/atom/settings-view.svg)](https://david-dm.org/atom/settings-view) | | [Snippets](https://github.com/atom/snippets) | [![macOS Build Status](https://travis-ci.org/atom/snippets.svg?branch=master)](https://travis-ci.org/atom/snippets) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/8hlc0onofkgbxw53/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/snippets/branch/master) | [![Dependency Status](https://david-dm.org/atom/snippets.svg)](https://david-dm.org/atom/snippets) | From e8249b7f9a5f6591542e50e78d180c157eeec6e1 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 16 May 2017 15:08:45 -0400 Subject: [PATCH 4/7] :fire: color --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 8c3d860a7..5054185d3 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "chart.js": "^2.3.0", "clear-cut": "^2.0.2", "coffee-script": "1.11.1", - "color": "^0.7.3", "dedent": "^0.6.0", "devtron": "1.3.0", "event-kit": "^2.3.0", From edcce4bfa7a9a9533589087e4633f32b9094c52f Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 16 May 2017 16:41:44 -0400 Subject: [PATCH 5/7] Revert "Remove 'color' dependency" --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5054185d3..8c3d860a7 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "chart.js": "^2.3.0", "clear-cut": "^2.0.2", "coffee-script": "1.11.1", + "color": "^0.7.3", "dedent": "^0.6.0", "devtron": "1.3.0", "event-kit": "^2.3.0", From effd0f5adf32b6c9b050eee6b7f062e4ba978e8a Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Wed, 17 May 2017 10:56:54 +0200 Subject: [PATCH 6/7] WIP install dev dependencies when transpiling --- ...e-packages-with-custom-transpiler-paths.js | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/script/lib/transpile-packages-with-custom-transpiler-paths.js b/script/lib/transpile-packages-with-custom-transpiler-paths.js index 354a00a12..73f4a0b6e 100644 --- a/script/lib/transpile-packages-with-custom-transpiler-paths.js +++ b/script/lib/transpile-packages-with-custom-transpiler-paths.js @@ -1,29 +1,38 @@ 'use strict' const CompileCache = require('../../src/compile-cache') -const fs = require('fs') +const fs = require('fs-extra') const glob = require('glob') const path = require('path') const CONFIG = require('../config') +const runApmInstall = require('./run-apm-install') + +require('colors') + module.exports = function () { console.log(`Transpiling packages with custom transpiler configurations in ${CONFIG.intermediateAppPath}`) - let pathsToCompile = [] for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) { const packagePath = path.join(CONFIG.intermediateAppPath, 'node_modules', packageName) const metadataPath = path.join(packagePath, 'package.json') const metadata = require(metadataPath) if (metadata.atomTranspilers) { + console.log(' transpiling for package '.cyan + packageName.cyan) + const nodeModulesPath = path.join(packagePath, 'node_modules') + const nodeModulesBackupPath = path.join(packagePath, 'node_modules.bak') + fs.copySync(nodeModulesPath, nodeModulesBackupPath) + runApmInstall(packagePath) + CompileCache.addTranspilerConfigForPath(packagePath, metadata.name, metadata, metadata.atomTranspilers) for (let config of metadata.atomTranspilers) { - pathsToCompile = pathsToCompile.concat(glob.sync(path.join(packagePath, config.glob), {nodir: true})) + const pathsToCompile = glob.sync(path.join(packagePath, config.glob), {nodir: true}) + pathsToCompile.forEach(transpilePath) } - } - } - for (let path of pathsToCompile) { - transpilePath(path) + fs.removeSync(nodeModulesPath) + fs.renameSync(nodeModulesBackupPath, nodeModulesPath) + } } } From e01721f24ab8ac588fb150d6e0d9806d9e1926a0 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 17 May 2017 15:51:19 +0200 Subject: [PATCH 7/7] Extract `backup-node-modules.js` --- script/lib/backup-node-modules.js | 20 +++++++++++++++++++ ...e-packages-with-custom-transpiler-paths.js | 8 +++----- script/test | 7 ++----- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 script/lib/backup-node-modules.js diff --git a/script/lib/backup-node-modules.js b/script/lib/backup-node-modules.js new file mode 100644 index 000000000..f7df0cfec --- /dev/null +++ b/script/lib/backup-node-modules.js @@ -0,0 +1,20 @@ +const fs = require('fs-extra') +const path = require('path') + +module.exports = function(packagePath) { + const nodeModulesPath = path.join(packagePath, 'node_modules') + const nodeModulesBackupPath = path.join(packagePath, 'node_modules.bak') + if (fs.existsSync(nodeModulesBackupPath)) { + throw new Error("Cannot back up " + nodeModulesPath + "; " + nodeModulesBackupPath + " already exists") + } + + fs.copySync(nodeModulesPath, nodeModulesBackupPath) + + return function restoreNodeModules() { + if (!fs.existsSync(nodeModulesBackupPath)) { + throw new Error("Cannot restore " + nodeModulesPath + "; " + nodeModulesBackupPath + " does not exist") + } + fs.removeSync(nodeModulesPath) + fs.renameSync(nodeModulesBackupPath, nodeModulesPath) + } +} diff --git a/script/lib/transpile-packages-with-custom-transpiler-paths.js b/script/lib/transpile-packages-with-custom-transpiler-paths.js index 73f4a0b6e..cc3fce72f 100644 --- a/script/lib/transpile-packages-with-custom-transpiler-paths.js +++ b/script/lib/transpile-packages-with-custom-transpiler-paths.js @@ -6,6 +6,7 @@ const glob = require('glob') const path = require('path') const CONFIG = require('../config') +const backupNodeModules = require('./backup-node-modules') const runApmInstall = require('./run-apm-install') require('colors') @@ -19,9 +20,7 @@ module.exports = function () { const metadata = require(metadataPath) if (metadata.atomTranspilers) { console.log(' transpiling for package '.cyan + packageName.cyan) - const nodeModulesPath = path.join(packagePath, 'node_modules') - const nodeModulesBackupPath = path.join(packagePath, 'node_modules.bak') - fs.copySync(nodeModulesPath, nodeModulesBackupPath) + const restoreNodeModules = backupNodeModules(packagePath) runApmInstall(packagePath) CompileCache.addTranspilerConfigForPath(packagePath, metadata.name, metadata, metadata.atomTranspilers) @@ -30,8 +29,7 @@ module.exports = function () { pathsToCompile.forEach(transpilePath) } - fs.removeSync(nodeModulesPath) - fs.renameSync(nodeModulesBackupPath, nodeModulesPath) + restoreNodeModules() } } } diff --git a/script/test b/script/test index 1b44bab0b..aa940ab27 100755 --- a/script/test +++ b/script/test @@ -11,6 +11,7 @@ const glob = require('glob') const path = require('path') const CONFIG = require('./config') +const backupNodeModules = require('./lib/backup-node-modules') const runApmInstall = require('./lib/run-apm-install') const resourcePath = CONFIG.repositoryRootPath @@ -94,11 +95,7 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) { if (require(pkgJsonPath).atomTestRunner) { console.log(`Installing test runner dependencies for ${packageName}`.bold.green) if (fs.existsSync(nodeModulesPath)) { - fs.copySync(nodeModulesPath, nodeModulesBackupPath) - finalize = () => { - fs.removeSync(nodeModulesPath) - fs.renameSync(nodeModulesBackupPath, nodeModulesPath) - } + finalize = backupNodeModules(repositoryPackagePath) } else { finalize = () => fs.removeSync(nodeModulesPath) }