Skip to content

Commit

Permalink
Merge branch 'master' into sm-atomicons
Browse files Browse the repository at this point in the history
  • Loading branch information
simurai committed Jun 2, 2017
2 parents 3425692 + d16996f commit d2d3645
Show file tree
Hide file tree
Showing 39 changed files with 278 additions and 230 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Atom is a large open source project — it's made up of over [200 repositori
Atom is intentionally very modular. Nearly every non-editor UI element you interact with comes from a package, even fundamental things like tabs and the status-bar. These packages are packages in the same way that packages in the [Atom package repository](https://atom.io/packages) are packages, with one difference: they are bundled into the [default distribution](https://github.com/atom/atom/blob/10b8de6fc499a7def9b072739486e68530d67ab4/package.json#L58).

<a id="atom-packages-image"/>

![atom-packages](https://cloud.githubusercontent.com/assets/69169/10472281/84fc9792-71d3-11e5-9fd1-19da717df079.png)

To get a sense for the packages that are bundled with Atom, you can go to Settings > Packages within Atom and take a look at the Core Packages section.
Expand Down
2 changes: 1 addition & 1 deletion docs/build-instructions/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Ubuntu LTS 12.04 64-bit is the recommended platform.
* OS with 64-bit or 32-bit architecture
* C++11 toolchain
* Git
* Node.js 6.x (we recommend installing it via [nvm](https://github.com/creationix/nvm))
* Node.js 6.x or later (we recommend installing it via [nvm](https://github.com/creationix/nvm))
* npm 3.10.x or later (run `npm install -g npm`)
* Ensure node-gyp uses python2 (run `npm config set python /usr/bin/python2 -g`, use `sudo` if you didn't install node via nvm)
* Development headers for [libsecret](https://wiki.gnome.org/Projects/Libsecret).
Expand Down
2 changes: 1 addition & 1 deletion docs/build-instructions/macOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Requirements

* macOS 10.8 or later
* Node.js 6.x (we recommend installing it via [nvm](https://github.com/creationix/nvm))
* Node.js 6.x or later (we recommend installing it via [nvm](https://github.com/creationix/nvm))
* npm 3.10.x or later (run `npm install -g npm`)
* Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (run `xcode-select --install` to install)

Expand Down
2 changes: 1 addition & 1 deletion docs/build-instructions/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

* Node.js 6.x (the architecture of node available to the build system will determine whether you build 32-bit or 64-bit Atom)
* Node.js 6.x or later (the architecture of node available to the build system will determine whether you build 32-bit or 64-bit Atom)
* Python v2.7.x
* The python.exe must be available at `%SystemDrive%\Python27\python.exe`. If it is installed elsewhere create a symbolic link to the directory containing the python.exe using: `mklink /d %SystemDrive%\Python27 D:\elsewhere\Python27`
* 7zip (7z.exe available from the command line) - for creating distribution zip files
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"event-kit": "^2.3.0",
"find-parent-dir": "^0.3.0",
"first-mate": "7.0.7",
"fs-plus": "^3.0.0",
"fs-plus": "^3.0.1",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "5.0.0",
Expand Down Expand Up @@ -78,8 +78,8 @@
"atom-light-ui": "0.46.0",
"base16-tomorrow-dark-theme": "1.5.0",
"base16-tomorrow-light-theme": "1.5.0",
"one-dark-ui": "1.10.4",
"one-light-ui": "1.10.4",
"one-dark-ui": "1.10.5",
"one-light-ui": "1.10.5",
"one-dark-syntax": "1.7.1",
"one-light-syntax": "1.7.1",
"solarized-dark-syntax": "1.1.2",
Expand All @@ -104,7 +104,7 @@
"exception-reporting": "0.41.4",
"find-and-replace": "0.208.3",
"fuzzy-finder": "1.5.8",
"github": "0.2.0",
"github": "0.3.1",
"git-diff": "1.3.6",
"go-to-line": "0.32.1",
"grammar-selector": "0.49.4",
Expand All @@ -121,14 +121,14 @@
"settings-view": "0.250.0",
"snippets": "1.1.4",
"spell-check": "0.71.4",
"status-bar": "1.8.8",
"status-bar": "1.8.10",
"styleguide": "0.49.6",
"symbols-view": "0.116.0",
"tabs": "0.106.0",
"timecop": "0.36.0",
"tree-view": "0.217.1",
"update-package-dependencies": "0.12.0",
"welcome": "0.36.3",
"welcome": "0.36.4",
"whitespace": "0.36.2",
"wrap-guide": "0.40.2",
"language-c": "0.58.1",
Expand Down
5 changes: 2 additions & 3 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const yargs = require('yargs')
const argv = yargs
.usage('Usage: $0 [options]')
.help('help')
.describe('code-sign', 'Code-sign executables (macOS and Windows only)')
.describe('code-sign', 'Code-sign executables (macOS and Windows only)')
.describe('create-windows-installer', 'Create installer (Windows only)')
.describe('create-debian-package', 'Create .deb package (Linux only)')
.describe('create-rpm-package', 'Create .rpm package (Linux only)')
Expand Down Expand Up @@ -77,8 +77,7 @@ dumpSymbols()
} else if (process.platform === 'win32') {
if (argv.createWindowsInstaller) {
return createWindowsInstaller(packagedAppPath, argv.codeSign).then(() => packagedAppPath)
}
else {
} else {
console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
if (argv.codeSign) {
codeSignOnWindows(packagedAppPath)
Expand Down
20 changes: 15 additions & 5 deletions script/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ const apmMetadata = require(path.join(apmRootPath, 'package.json'))
const channel = getChannel()

module.exports = {
appMetadata, apmMetadata, channel,
repositoryRootPath, apmRootPath, scriptRootPath,
buildOutputPath, docsOutputPath, intermediateAppPath, symbolsPath,
electronDownloadPath, atomHomeDirPath, homeDirPath,
getApmBinPath, getNpmBinPath,
appMetadata,
apmMetadata,
channel,
repositoryRootPath,
apmRootPath,
scriptRootPath,
buildOutputPath,
docsOutputPath,
intermediateAppPath,
symbolsPath,
electronDownloadPath,
atomHomeDirPath,
homeDirPath,
getApmBinPath,
getNpmBinPath,
snapshotAuxiliaryData: {}
}

Expand Down
14 changes: 7 additions & 7 deletions script/lib/backup-node-modules.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
const fs = require('fs-extra')
const path = require('path')

module.exports = function(packagePath) {
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")
throw new Error('Cannot back up ' + nodeModulesPath + '; ' + nodeModulesBackupPath + ' already exists')
}

// some packages may have no node_modules after deduping, but we still want
// to "back-up" and later restore that fact
if (!fs.existsSync(nodeModulesPath)) {
const msg = "Skipping backing up " + nodeModulesPath + " as it does not exist"
const msg = 'Skipping backing up ' + nodeModulesPath + ' as it does not exist'
console.log(msg.gray)

const restore = function stubRestoreNodeModules() {
const restore = function stubRestoreNodeModules () {
if (fs.existsSync(nodeModulesPath)) {
fs.removeSync(nodeModulesPath)
}
Expand All @@ -26,11 +26,11 @@ module.exports = function(packagePath) {

fs.copySync(nodeModulesPath, nodeModulesBackupPath)

const restore = function restoreNodeModules() {
const restore = function restoreNodeModules () {
if (!fs.existsSync(nodeModulesBackupPath)) {
throw new Error("Cannot restore " + nodeModulesPath + "; " + nodeModulesBackupPath + " does not exist")
throw new Error('Cannot restore ' + nodeModulesPath + '; ' + nodeModulesBackupPath + ' does not exist')
}

if (fs.existsSync(nodeModulesPath)) {
fs.removeSync(nodeModulesPath)
}
Expand Down
6 changes: 3 additions & 3 deletions script/lib/clean-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ module.exports = function () {
const fs = require('fs-extra')

const apmDependenciesPath = path.join(CONFIG.apmRootPath, 'node_modules')
console.log(`Cleaning ${apmDependenciesPath}`);
console.log(`Cleaning ${apmDependenciesPath}`)
fs.removeSync(apmDependenciesPath)

const atomDependenciesPath = path.join(CONFIG.repositoryRootPath, 'node_modules')
console.log(`Cleaning ${atomDependenciesPath}`);
console.log(`Cleaning ${atomDependenciesPath}`)
fs.removeSync(atomDependenciesPath)

const scriptDependenciesPath = path.join(CONFIG.scriptRootPath, 'node_modules')
console.log(`Cleaning ${scriptDependenciesPath}`);
console.log(`Cleaning ${scriptDependenciesPath}`)
fs.removeSync(scriptDependenciesPath)
}
1 change: 0 additions & 1 deletion script/lib/clean-output-directory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const fs = require('fs-extra')
const path = require('path')
const CONFIG = require('../config')

module.exports = function () {
Expand Down
5 changes: 2 additions & 3 deletions script/lib/code-sign-on-mac.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function (packagedAppPath) {
return
}

let certPath = process.env.ATOM_MAC_CODE_SIGNING_CERT_PATH;
let certPath = process.env.ATOM_MAC_CODE_SIGNING_CERT_PATH
if (!certPath) {
certPath = path.join(os.tmpdir(), 'mac.p12')
downloadFileFromGithub(process.env.ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL, certPath)
Expand All @@ -33,7 +33,6 @@ module.exports = function (packagedAppPath) {
'-T', '/usr/bin/codesign'
])


console.log('Running incantation to suppress dialog when signing on macOS Sierra')
try {
spawnSync('security', [
Expand All @@ -42,7 +41,7 @@ module.exports = function (packagedAppPath) {
process.env.ATOM_MAC_CODE_SIGNING_KEYCHAIN
])
} catch (e) {
console.log('Incantation failed... maybe this isn\'t Sierra?');
console.log('Incantation failed... maybe this isn\'t Sierra?')
}

console.log(`Code-signing application at ${packagedAppPath}`)
Expand Down
2 changes: 1 addition & 1 deletion script/lib/code-sign-on-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function (packagedAppPath) {
}
}

function signFile(filePath) {
function signFile (filePath) {
const signCommand = path.resolve(__dirname, '..', 'node_modules', 'electron-winstaller', 'vendor', 'signtool.exe')
const args = [ // Changing any of these should also be done in create-windows-installer.js
'sign',
Expand Down
12 changes: 6 additions & 6 deletions script/lib/compress-artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ module.exports = function (packagedAppPath) {

function getArchiveName () {
switch (process.platform) {
case 'darwin': return 'atom-mac.zip'
case 'win32': return `atom-windows.zip`
default: return `atom-${getLinuxArchiveArch()}.tar.gz`
case 'darwin': return 'atom-mac.zip'
case 'win32': return 'atom-windows.zip'
default: return `atom-${getLinuxArchiveArch()}.tar.gz`
}
}

function getLinuxArchiveArch () {
switch (process.arch) {
case 'ia32': return 'i386'
case 'x64' : return 'amd64'
default: return process.arch
case 'ia32': return 'i386'
case 'x64' : return 'amd64'
default: return process.arch
}
}

Expand Down
2 changes: 1 addition & 1 deletion script/lib/copy-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const glob = require('glob')
const includePathInPackagedApp = require('./include-path-in-packaged-app')

module.exports = function () {
console.log(`Copying assets to ${CONFIG.intermediateAppPath}`);
console.log(`Copying assets to ${CONFIG.intermediateAppPath}`)
let srcPaths = [
path.join(CONFIG.repositoryRootPath, 'benchmarks', 'benchmark-runner.js'),
path.join(CONFIG.repositoryRootPath, 'dot-atom'),
Expand Down
14 changes: 10 additions & 4 deletions script/lib/create-debian-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,22 @@ module.exports = function (packagedAppPath) {
const packageSizeInKilobytes = spawnSync('du', ['-sk', packagedAppPath]).stdout.toString().split(/\s+/)[0]
const controlFileTemplate = fs.readFileSync(path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'debian', 'control.in'))
const controlFileContents = template(controlFileTemplate)({
appFileName: atomExecutableName, version: appVersion, arch: arch,
installedSize: packageSizeInKilobytes, description: appDescription
appFileName: atomExecutableName,
version: appVersion,
arch: arch,
installedSize: packageSizeInKilobytes,
description: appDescription
})
fs.writeFileSync(path.join(debianPackageConfigPath, 'control'), controlFileContents)

console.log(`Writing desktop entry file into "${debianPackageApplicationsDirPath}"`)
const desktopEntryTemplate = fs.readFileSync(path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'atom.desktop.in'))
const desktopEntryContents = template(desktopEntryTemplate)({
appName: appName, appFileName: atomExecutableName, description: appDescription,
installDir: '/usr', iconPath: atomExecutableName
appName: appName,
appFileName: atomExecutableName,
description: appDescription,
installDir: '/usr',
iconPath: atomExecutableName
})
fs.writeFileSync(path.join(debianPackageApplicationsDirPath, `${atomExecutableName}.desktop`), desktopEntryContents)

Expand Down
16 changes: 11 additions & 5 deletions script/lib/create-rpm-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const assert = require('assert')
const fs = require('fs-extra')
const os = require('os')
const path = require('path')
const spawnSync = require('./spawn-sync')
const template = require('lodash.template')
Expand Down Expand Up @@ -51,16 +50,23 @@ module.exports = function (packagedAppPath) {
const rpmPackageSpecFilePath = path.join(rpmPackageSpecsDirPath, 'atom.spec')
const rpmPackageSpecsTemplate = fs.readFileSync(path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'redhat', 'atom.spec.in'))
const rpmPackageSpecsContents = template(rpmPackageSpecsTemplate)({
appName: appName, appFileName: atomExecutableName, apmFileName: apmExecutableName,
description: appDescription, installDir: '/usr', version: appVersion
appName: appName,
appFileName: atomExecutableName,
apmFileName: apmExecutableName,
description: appDescription,
installDir: '/usr',
version: appVersion
})
fs.writeFileSync(rpmPackageSpecFilePath, rpmPackageSpecsContents)

console.log(`Writing desktop entry file into "${rpmPackageBuildDirPath}"`)
const desktopEntryTemplate = fs.readFileSync(path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'atom.desktop.in'))
const desktopEntryContents = template(desktopEntryTemplate)({
appName: appName, appFileName: atomExecutableName, description: appDescription,
installDir: '/usr', iconPath: atomExecutableName
appName: appName,
appFileName: atomExecutableName,
description: appDescription,
installDir: '/usr',
iconPath: atomExecutableName
})
fs.writeFileSync(path.join(rpmPackageBuildDirPath, `${atomExecutableName}.desktop`), desktopEntryContents)

Expand Down
8 changes: 4 additions & 4 deletions script/lib/delete-msbuild-from-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ module.exports = function () {
process.env['PATH'] =
process.env['PATH']
.split(';')
.filter(function(p) {
.filter(function (p) {
if (fs.existsSync(path.join(p, 'msbuild.exe'))) {
console.log('Excluding "' + p + '" from PATH to avoid msbuild.exe mismatch that causes errors during module installation')
return false;
return false
} else {
return true;
return true
}
})
.join(';');
.join(';')
}
2 changes: 1 addition & 1 deletion script/lib/generate-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function checkDeprecatedPackagesMetadata () {
for (let packageName of Object.keys(deprecatedPackagesMetadata)) {
const packageMetadata = deprecatedPackagesMetadata[packageName]
if (packageMetadata.version && !semver.validRange(packageMetadata.version)) {
throw new Error(`Invalid range: ${version} (${name}).`)
throw new Error(`Invalid range: ${packageMetadata.version} (${packageName}).`)
}
}
}
Expand Down
Loading

0 comments on commit d2d3645

Please sign in to comment.