Merge pull request #1389 from atom/rename-to-electron

Rename to electron
This commit is contained in:
Cheng Zhao 2015-04-17 15:22:07 +08:00
commit cd0aa4a956
76 changed files with 375 additions and 313 deletions

View file

@ -1,25 +1,14 @@
# Atom Shell [![Build Status](https://travis-ci.org/atom/atom-shell.svg?branch=master)](https://travis-ci.org/atom/atom-shell)
# Electron [![Build Status](https://travis-ci.org/atom/electron.svg?branch=master)](https://travis-ci.org/atom/electron)
The Atom Shell framework lets you write cross-platform desktop applications
The Electron framework lets you write cross-platform desktop applications
using JavaScript, HTML and CSS. It is based on [io.js](http://iojs.org) and
[Chromium](http://www.chromium.org) and is used in the [Atom
editor](https://github.com/atom/atom).
## Downloads
Prebuilt binaries and debug symbols of atom-shell for Linux, Windows and Mac can
be found on the [releases](https://github.com/atom/atom-shell/releases) page.
You can also use [`npm`](https://docs.npmjs.com/) to install prebuilt atom-shell
binaries:
```
# Install globally in your $PATH
npm install atom-shell -g
# Install as a development dependency
npm install atom-shell --save-dev
```
Prebuilt binaries and debug symbols of Electron for Linux, Windows and Mac can
be found on the [releases](https://github.com/atom/electron/releases) page.
### Mirrors
@ -28,8 +17,8 @@ npm install atom-shell --save-dev
## Documentation
Guides and the API reference are located in the
[docs](https://github.com/atom/atom-shell/tree/master/docs) directory. It also
contains documents describing how to build and contribute to atom-shell.
[docs](https://github.com/atom/electron/tree/master/docs) directory. It also
contains documents describing how to build and contribute to Electron.
## Community

View file

@ -1,8 +1,10 @@
{
'variables': {
'project_name%': 'atom',
'product_name%': 'Atom',
'version%': '0.23.0',
'project_name%': 'electron',
'product_name%': 'Electron',
'company_name%': 'GitHub, Inc',
'company_abbr%': 'github',
'version%' : '0.23.0',
'atom_source_root': '<!(["python", "tools/atom_source_root.py"])',
},
@ -11,6 +13,10 @@
'vendor/native_mate/native_mate_files.gypi',
],
'target_defaults': {
'defines': [
'ATOM_PRODUCT_NAME="<(product_name)"',
'ATOM_PROJECT_NAME="<(project_name)"',
],
'mac_framework_dirs': [
'<(atom_source_root)/external_binaries',
],
@ -41,6 +47,7 @@
'<(project_name)_helper',
],
'xcode_settings': {
'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name)',
'INFOPLIST_FILE': 'atom/browser/resources/mac/Info.plist',
'LD_RUNPATH_SEARCH_PATHS': [
'@executable_path/../Frameworks',
@ -201,7 +208,6 @@
'vendor/node/node.gyp:node',
],
'defines': [
'PRODUCT_NAME="<(product_name)"',
# This is defined in skia/skia_common.gypi.
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
# Disable warnings for g_settings_list_schemas.
@ -371,9 +377,6 @@
'vendor',
'<(libchromiumcontent_src_dir)',
],
'defines': [
'PRODUCT_NAME="<(product_name)"',
],
'export_dependent_settings': [
'<(project_name)_lib',
],
@ -395,6 +398,7 @@
'<(libchromiumcontent_dir)/snapshot_blob.bin',
],
'xcode_settings': {
'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name).framework',
'INFOPLIST_FILE': 'atom/common/resources/mac/Info.plist',
'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name) Framework.framework/<(product_name) Framework',
'LD_RUNPATH_SEARCH_PATHS': [
@ -472,6 +476,7 @@
],
'mac_bundle': 1,
'xcode_settings': {
'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name).helper',
'INFOPLIST_FILE': 'atom/renderer/resources/mac/Info.plist',
'LD_RUNPATH_SEARCH_PATHS': [
'@executable_path/../../..',

View file

@ -29,7 +29,7 @@ int AtomInitializeICUandStartNode(int argc, char *argv[]) {
brightray::MainApplicationBundlePath()
.Append("Contents")
.Append("Frameworks")
.Append(PRODUCT_NAME " Framework.framework"));
.Append(ATOM_PRODUCT_NAME " Framework.framework"));
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
}

View file

@ -6,7 +6,9 @@
#include "base/mac/bundle_locations.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "brightray/common/application_info.h"
#include "brightray/common/mac/main_application_bundle.h"
#include "content/public/common/content_paths.h"
@ -19,19 +21,30 @@ base::FilePath GetFrameworksPath() {
.Append("Frameworks");
}
base::FilePath GetHelperAppPath(const base::FilePath& frameworks_path,
const std::string& name) {
return frameworks_path.Append(name + " Helper.app")
.Append("Contents")
.Append("MacOS")
.Append(name + " Helper");
}
} // namespace
void AtomMainDelegate::OverrideFrameworkBundlePath() {
base::mac::SetOverrideFrameworkBundlePath(
GetFrameworksPath().Append(PRODUCT_NAME " Framework.framework"));
GetFrameworksPath().Append(ATOM_PRODUCT_NAME " Framework.framework"));
}
void AtomMainDelegate::OverrideChildProcessPath() {
base::FilePath helper_path =
GetFrameworksPath().Append(PRODUCT_NAME " Helper.app")
.Append("Contents")
.Append("MacOS")
.Append(PRODUCT_NAME " Helper");
base::FilePath frameworks_path = GetFrameworksPath();
base::FilePath helper_path = GetHelperAppPath(frameworks_path,
ATOM_PRODUCT_NAME);
if (!base::PathExists(helper_path))
helper_path = GetHelperAppPath(frameworks_path,
brightray::GetApplicationName());
if (!base::PathExists(helper_path))
LOG(FATAL) << "Unable to find helper app";
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
}

View file

@ -4,12 +4,11 @@
#include "atom/browser/atom_browser_main_parts.h"
#import "atom/browser/mac/atom_application.h"
#import "atom/browser/mac/atom_application_delegate.h"
#include "base/files/file_path.h"
#import "base/mac/foundation_util.h"
#include "atom/browser/mac/atom_application.h"
#include "atom/browser/mac/atom_application_delegate.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
#import "vendor/brightray/common/mac/main_application_bundle.h"
namespace atom {
@ -23,12 +22,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() {
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
[NSApp setDelegate:(id<NSFileManagerDelegate>)delegate];
base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
.Append("Contents")
.Append("Frameworks")
.Append(PRODUCT_NAME " Framework.framework");
NSBundle* frameworkBundle = [NSBundle
bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
NSBundle* frameworkBundle = base::mac::FrameworkBundle();
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"
bundle:frameworkBundle];
[mainNib instantiateWithOwner:application topLevelObjects:nil];

View file

@ -9,6 +9,7 @@
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#include "atom/common/atom_version.h"
#include "brightray/common/application_info.h"
namespace atom {
@ -31,11 +32,11 @@ void Browser::ClearRecentDocuments() {
}
std::string Browser::GetExecutableFileVersion() const {
return ATOM_VERSION_STRING;
return brightray::GetApplicationVersion();
}
std::string Browser::GetExecutableFileProductName() const {
return "Atom-Shell";
return brightray::GetApplicationName();
}
} // namespace atom

View file

@ -4,13 +4,13 @@
#include "atom/browser/browser.h"
#import "atom/browser/mac/atom_application.h"
#import "atom/browser/mac/atom_application_delegate.h"
#include "atom/browser/mac/atom_application.h"
#include "atom/browser/mac/atom_application_delegate.h"
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h"
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "brightray/common/application_info.h"
namespace atom {
@ -27,15 +27,11 @@ void Browser::ClearRecentDocuments() {
}
std::string Browser::GetExecutableFileVersion() const {
NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
NSString *version = [infoDictionary objectForKey:@"CFBundleVersion"];
return base::SysNSStringToUTF8(version);
return brightray::GetApplicationVersion();
}
std::string Browser::GetExecutableFileProductName() const {
NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
NSString *version = [infoDictionary objectForKey:@"CFBundleName"];
return base::SysNSStringToUTF8(version);
return brightray::GetApplicationName();
}
int Browser::DockBounce(BounceType type) {

View file

@ -118,7 +118,7 @@ void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
}
void Browser::SetAppUserModelID(const std::string& name) {
app_user_model_id_ = base::string16(L"atom-shell.app.");
app_user_model_id_ = base::string16(L"electron.app.");
app_user_model_id_ += base::UTF8ToUTF16(name);
SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
}
@ -142,7 +142,7 @@ std::string Browser::GetExecutableFileProductName() const {
return base::UTF16ToUTF8(version_info->product_name());
}
return "Atom-Shell";
return ATOM_PRODUCT_NAME;
}
} // namespace atom

View file

@ -25,10 +25,10 @@ app.on('ready', function() {
if (process.platform == 'darwin') {
var template = [
{
label: 'Atom Shell',
label: 'Electron',
submenu: [
{
label: 'About Atom Shell',
label: 'About Electron',
selector: 'orderFrontStandardAboutPanel:'
},
{
@ -42,7 +42,7 @@ app.on('ready', function() {
type: 'separator'
},
{
label: 'Hide Atom Shell',
label: 'Hide Electron',
accelerator: 'Command+H',
selector: 'hide:'
},

View file

@ -1,6 +1,6 @@
<html>
<head>
<title>Atom Shell</title>
<title>Electron</title>
<style>
body {
color: #555;
@ -72,19 +72,19 @@
};
</script>
<h2 style="-webkit-app-region: drag">Welcome to Atom Shell</h2>
<h2 style="-webkit-app-region: drag">Welcome to Electron</h2>
<p>
To run your app with atom-shell, execute the following command under your
To run your app with Electron, execute the following command under your
Console (or Terminal):
</p>
<script>document.write('<pre>' + command + '</pre>')</script>
<p>
The <code>path-to-your-app</code> should be the path to your own atom-shell
app, you can read the <a href='https://github.com/atom/atom-shell/blob/master/docs/tutorial/quick-start.md'>quick start</a>
guide in atom-shell's <a href='https://github.com/atom/atom-shell/blob/master/docs'>docs</a>
The <code>path-to-your-app</code> should be the path to your own Electron
app, you can read the <a href='https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md'>quick start</a>
guide in Electron's <a href='https://github.com/atom/electron/blob/master/docs'>docs</a>
on how to write one.
</p>

View file

@ -50,7 +50,7 @@ if (option.file && !option.webdriver) {
} catch(e) {
if (e.code == 'MODULE_NOT_FOUND') {
app.focus();
dialog.showErrorBox('Error opening app', 'The app provided is not a valid atom-shell app, please read the docs on how to write one:\nhttps://github.com/atom/atom-shell/tree/master/docs');
dialog.showErrorBox('Error opening app', 'The app provided is not a valid electron app, please read the docs on how to write one:\nhttps://github.com/atom/electron/tree/master/docs');
process.exit(1);
} else {
console.error('App threw an error when running', e);
@ -58,7 +58,7 @@ if (option.file && !option.webdriver) {
}
}
} else if (option.version) {
console.log('v' + process.versions['atom-shell']);
console.log('v' + process.versions['electron']);
process.exit(0);
} else {
require('./default_app.js');

View file

@ -1,6 +1,5 @@
{
"name": "atom-shell-default-app",
"productName": "Atom Shell Default App",
"version": "0.1.0",
"name": "electron",
"productName": "Electron",
"main": "main.js"
}

View file

@ -144,7 +144,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
// Override the user agent to contain application and atom-shell's version.
Browser* browser = Browser::Get();
std::string product_name = base::StringPrintf(
"%s/%s Chrome/%s AtomShell/" ATOM_VERSION_STRING,
"%s/%s Chrome/%s " ATOM_PRODUCT_NAME "/" ATOM_VERSION_STRING,
RemoveWhitespace(browser->GetName()).c_str(),
browser->GetVersion().c_str(),
CHROME_VERSION_STRING);
@ -226,7 +226,7 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
if (options.Get(switches::kKiosk, &kiosk) && kiosk) {
SetKiosk(kiosk);
}
std::string title("Atom Shell");
std::string title("Electron");
options.Get(switches::kTitle, &title);
SetTitle(title);

View file

@ -126,7 +126,7 @@ void NodeDebugger::SendConnectMessage() {
"Protocol-Version: 1\r\n"
"Embedding-Host: %s\r\n"
"%s: 0\r\n",
v8::V8::GetVersion(), "Atom-Shell", kContentLength), true);
v8::V8::GetVersion(), ATOM_PRODUCT_NAME, kContentLength), true);
}
// static

View file

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.github.atom-shell</string>
<string>${ATOM_BUNDLE_ID}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View file

@ -120,7 +120,7 @@ struct RunState {
};
bool CreateDialogThread(RunState* run_state) {
base::Thread* thread = new base::Thread("AtomShell_FileDialogThread");
base::Thread* thread = new base::Thread(ATOM_PRODUCT_NAME "FileDialogThread");
thread->init_com_with_mta(false);
if (!thread->Start())
return false;

View file

@ -25,7 +25,7 @@ namespace atom {
namespace {
const char kViewClassName[] = "AtomMenuBar";
const char kViewClassName[] = "ElectronMenuBar";
// Default color of the menu bar.
const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);

View file

@ -24,7 +24,7 @@ const UINT kNotifyIconMessage = WM_APP + 1;
// |kBaseIconId| is 2 to avoid conflicts with plugins that hard-code id 1.
const UINT kBaseIconId = 2;
const wchar_t kNotifyIconHostWindowClass[] = L"AtomShell_NotifyIconHostWindow";
const wchar_t kNotifyIconHostWindowClass[] = L"Electron_NotifyIconHostWindow";
} // namespace

View file

@ -63,7 +63,8 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
mate::Dictionary versions;
if (dict.Get("versions", &versions)) {
versions.Set("atom-shell", ATOM_VERSION_STRING);
versions.Set(ATOM_PROJECT_NAME, ATOM_VERSION_STRING);
versions.Set("atom-shell", ATOM_VERSION_STRING); // For compatibility.
versions.Set("chrome", CHROME_VERSION_STRING);
}
}

View file

@ -8,7 +8,13 @@ class CrashReporter
start: (options={}) ->
{@productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
@productName ?= 'Atom-Shell'
app =
if process.type is 'browser'
require 'app'
else
require('remote').require 'app'
@productName ?= app.getName()
companyName ?= 'GitHub, Inc'
submitUrl ?= 'http://54.249.141.255:1127/post'
autoSubmit ?= true
@ -17,11 +23,7 @@ class CrashReporter
extra._productName ?= @productName
extra._companyName ?= companyName
extra._version ?=
if process.type is 'browser'
require('app').getVersion()
else
require('remote').require('app').getVersion()
extra._version ?= app.getVersion()
start = => binding.start @productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra

View file

@ -64,7 +64,7 @@ void CrashReporterLinux::InitBreakpad(const std::string& product_name,
bool skip_system_crash_handler) {
EnableCrashDumping(product_name);
crash_keys_.SetKeyValue("prod", "Atom-Shell");
crash_keys_.SetKeyValue("prod", ATOM_PRODUCT_NAME);
crash_keys_.SetKeyValue("ver", version.c_str());
upload_url_ = submit_url;

View file

@ -32,7 +32,7 @@ void CrashReporterMac::InitBreakpad(const std::string& product_name,
NSMutableDictionary* parameters =
[NSMutableDictionary dictionaryWithCapacity:4];
[parameters setValue:@"Atom-Shell"
[parameters setValue:@ATOM_PRODUCT_NAME
forKey:@BREAKPAD_PRODUCT];
[parameters setValue:base::SysUTF8ToNSString(product_name)
forKey:@BREAKPAD_PRODUCT_DISPLAY];

View file

@ -103,7 +103,7 @@ google_breakpad::CustomClientInfo* CrashReporterWin::GetCustomInfo(
custom_info_entries_.reserve(2 + upload_parameters_.size());
custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
L"prod", L"Atom-Shell"));
L"prod", L"Electron"));
custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
L"ver", base::UTF8ToWide(version).c_str()));

View file

@ -73,7 +73,7 @@ int Main(const wchar_t* cmd) {
NULL);
cmd_line.AppendSwitch("no-window");
cmd_line.AppendSwitchASCII("max-reports", "128");
cmd_line.AppendSwitchASCII("reporter", "atom-shell-crash-service");
cmd_line.AppendSwitchASCII("reporter", ATOM_PROJECT_NAME "-crash-service");
cmd_line.AppendSwitchNative("pipe-name", pipe_name);
breakpad::CrashService crash_service;

View file

@ -9,7 +9,7 @@
namespace brightray {
std::string GetApplicationName() {
return "Atom-Shell";
return ATOM_PRODUCT_NAME;
}
std::string GetApplicationVersion() {

View file

@ -15,6 +15,7 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_paths.h"
#include "native_mate/locker.h"
#include "native_mate/dictionary.h"
@ -27,7 +28,7 @@ using content::BrowserThread;
#define REFERENCE_MODULE(name) \
extern "C" void _register_ ## name(void); \
void (*fp_register_ ## name)(void) = _register_ ## name
// Atom Shell's builtin modules.
// Electron's builtin modules.
REFERENCE_MODULE(atom_browser_app);
REFERENCE_MODULE(atom_browser_auto_updater);
REFERENCE_MODULE(atom_browser_content_tracing);
@ -157,6 +158,10 @@ node::Environment* NodeBindings::CreateEnvironment(
mate::Dictionary process(context->GetIsolate(), env->process_object());
process.Set("type", process_type);
process.Set("resourcesPath", resources_path);
// The path to helper app.
base::FilePath helper_exec_path;
PathService::Get(content::CHILD_PROCESS_EXE, &helper_exec_path);
process.Set("helperExecPath", helper_exec_path);
return env;
}

View file

@ -3,11 +3,11 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>Atom Framework</string>
<string>${PRODUCT_NAME} Framework</string>
<key>CFBundleIdentifier</key>
<string>com.github.AtomFramework</string>
<string>${ATOM_BUNDLE_ID}</string>
<key>CFBundleName</key>
<string>Atom Framework</string>
<string>${PRODUCT_NAME} Framework</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>

View file

@ -57,7 +57,7 @@
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="238522557">
<reference key="NSMenu" ref="110575045"/>
<string key="NSTitle">About Atom</string>
<string key="NSTitle">About</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="229763992"/>
@ -118,7 +118,7 @@
</object>
<object class="NSMenuItem" id="755159360">
<reference key="NSMenu" ref="110575045"/>
<string key="NSTitle">Hide Atom</string>
<string key="NSTitle">Hide</string>
<string key="NSKeyEquiv">h</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@ -154,7 +154,7 @@
</object>
<object class="NSMenuItem" id="632727374">
<reference key="NSMenu" ref="110575045"/>
<string key="NSTitle">Quit Atom</string>
<string key="NSTitle">Quit</string>
<string key="NSKeyEquiv">q</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>

View file

@ -72,7 +72,7 @@ window.confirm = (message, title='') ->
# But we do not support prompt().
window.prompt = ->
throw new Error('prompt() is and will not be supported in atom-shell.')
throw new Error('prompt() is and will not be supported.')
window.opener =
postMessage: (message, targetOrigin='*') ->

View file

@ -2,15 +2,15 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.github.atom-shell.helper</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSUIElement</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>CFBundleIdentifier</key>
<string>${ATOM_BUNDLE_ID}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSUIElement</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>

View file

@ -23,14 +23,14 @@ Under most cases you should just do everything in `ready` event.
## Event: ready
Emitted when atom-shell has done everything initialization.
Emitted when Electron has done everything initialization.
## Event: window-all-closed
Emitted when all windows have been closed.
This event is only emitted when the application is not going to quit. If a
user pressed `Cmd + Q`, or the developer called `app.quit()`, atom-shell would
user pressed `Cmd + Q`, or the developer called `app.quit()`, Electron would
first try to close all windows and then emit the `will-quit` event, and in
this case the `window-all-closed` would not be emitted.
@ -155,7 +155,7 @@ used.
Usually the `name` field of `package.json` is a short lowercased name, according
to the spec of npm modules. So usually you should also specify a `productName`
field, which is your application's full capitalized name, and it will be
preferred over `name` by atom-shell.
preferred over `name` by Electron.
## app.resolveProxy(url, callback)

View file

@ -84,7 +84,7 @@ You can also create a window without chrome by using
* `extra-plugin-dirs` Array - Array of paths that would be searched for
plugins. Note that if you want to add a directory under your app, you
should use `__dirname` or `process.resourcesPath` to join the paths to
make them absolute, using relative paths would make atom-shell search
make them absolute, using relative paths would make Electron search
under current working directory.
* `experimental-features` Boolean
* `experimental-canvas-features` Boolean
@ -116,7 +116,7 @@ would cancel the close.
Usually you would want to use the `beforeunload` handler to decide whether the
window should be closed, which will also be called when the window is
reloaded. In atom-shell, returning an empty string or `false` would cancel the
reloaded. In Electron, returning an empty string or `false` would cancel the
close. An example is:
```javascript
@ -124,7 +124,7 @@ window.onbeforeunload = function(e) {
console.log('I do not want to be closed');
// Unlike usual browsers, in which a string should be returned and the user is
// prompted to confirm the page unload. atom-shell gives the power completely
// prompted to confirm the page unload. Electron gives the power completely
// to the developers, return empty string or false would prevent the unloading
// now. You can also use the dialog API to let user confirm it.
return false;
@ -512,7 +512,7 @@ process.
* `printBackground` Boolean - Also prints the background color and image of
the web page, defaults to `false`.
Prints window's web page. When `silent` is set to `false`, atom-shell will pick
Prints window's web page. When `silent` is set to `false`, Electron will pick
up system's default printer and default settings for printing.
Calling `window.print()` in web page is equivalent to call

View file

@ -1,7 +1,7 @@
# Supported Chrome command line switches
Following command lines switches in Chrome browser are also Supported in
atom-shell, you can use [app.commandLine.appendSwitch][append-switch] to append
Electron, you can use [app.commandLine.appendSwitch][append-switch] to append
them in your app's main script before the [ready][ready] event of [app][app]
module is emitted:

View file

@ -15,7 +15,7 @@ crashReporter.start({
## crashReporter.start(options)
* `options` Object
* `productName` String, default: Atom-Shell
* `productName` String, default: Electron
* `companyName` String, default: GitHub, Inc
* `submitUrl` String, default: http://54.249.141.255:1127/post
* URL that crash reports would be sent to as POST
@ -36,14 +36,14 @@ sent or the crash reporter is not started, `null` will be returned.
The crash reporter will send the following data to the `submitUrl` as `POST`:
* `rept` String - e.g. 'atom-shell-crash-service'
* `ver` String - The version of atom-shell
* `rept` String - e.g. 'electron-crash-service'
* `ver` String - The version of Electron
* `platform` String - e.g. 'win32'
* `process_type` String - e.g. 'renderer'
* `ptime` Number
* `_version` String - The version in `package.json`
* `_productName` String - The product name in the crashReporter `options` object
* `prod` String - Name of the underlying product. In this case Atom-Shell
* `prod` String - Name of the underlying product. In this case Electron
* `_companyName` String - The company name in the crashReporter `options` object
* `upload_file_minidump` File - The crashreport as file
* All level one properties of the `extra` object in the crashReporter `options` object

View file

@ -1,7 +1,7 @@
# `File` object
The DOM's File interface provides abstraction around native files, in order to
let users work on native files directly with HTML5 file API, atom-shell has
let users work on native files directly with HTML5 file API, Electron has
added a `path` attribute to `File` interface which exposes the file's real path
on filesystem.

View file

@ -41,7 +41,7 @@ var win = new BrowserWindow({ transparent: true, frame: false });
## Draggable region
By default, the frameless window is non-draggable. Apps need to specify
`-webkit-app-region: drag` in CSS to tell atom-shell which regions are draggable
`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable
(like the OS's standard titlebar), and apps can also use
`-webkit-app-region: no-drag` to exclude the non-draggable area from the
draggable region. Note that only rectangular shape is currently supported.

View file

@ -33,10 +33,10 @@ Another example of creating the application menu with the simple template API:
// main.js
var template = [
{
label: 'Atom Shell',
label: 'Electron',
submenu: [
{
label: 'About Atom Shell',
label: 'About Electron',
selector: 'orderFrontStandardAboutPanel:'
},
{
@ -50,7 +50,7 @@ var template = [
type: 'separator'
},
{
label: 'Hide Atom Shell',
label: 'Hide Electron',
accelerator: 'Command+H',
selector: 'hide:'
},
@ -228,7 +228,7 @@ Linux, and here are some notes on making your app's menu more native-like.
On OS X there are many system defined standard menus, like the `Services` and
`Windows` menus. To make your menu a standard menu, you can just set your menu's
label to one of followings, and atom-shell will recognize them and make them
label to one of followings, and Electron will recognize them and make them
become standard menus:
* `Window`

View file

@ -1,6 +1,6 @@
# NativeImage
In atom-shell for the APIs that take images, you can pass either file paths or
In Electron for the APIs that take images, you can pass either file paths or
`NativeImage` instances. When passing `null`, an empty image will be used.
For example when creating tray or setting window's icon, you can pass image's

View file

@ -1,9 +1,9 @@
# Process object
The `process` object in atom-shell has following differences between the one in
The `process` object in Electron has following differences between the one in
upstream node:
* `process.type` String - Process's type, can be `browser` (i.e. main process) or `renderer`.
* `process.versions['atom-shell']` String - Version of atom-shell.
* `process.versions['electron']` String - Version of Electron.
* `process.versions['chrome']` String - Version of Chromium.
* `process.resourcesPath` String - Path to JavaScript source code.

View file

@ -3,7 +3,7 @@
The `remote` module provides a simple way to do inter-process communication
between the renderer process and the main process.
In atom-shell, only GUI-related modules are available in the renderer process.
In Electron, only GUI-related modules are available in the renderer process.
Without the `remote` module, users who wanted to call a main process API in
the renderer process would have to explicitly send inter-process messages
to the main process. With the `remote` module, users can invoke methods of
@ -35,7 +35,7 @@ corresponding remote object in the renderer process, namely the `win` object.
## Lifetime of remote objects
Atom-shell makes sure that as long as the remote object in the renderer process
Electron makes sure that as long as the remote object in the renderer process
lives (in other words, has not been garbage collected), the corresponding object
in the main process would never be released. When the remote object has been
garbage collected, the corresponding object in the main process would be

View file

@ -1,10 +1,10 @@
# Synopsis
All [node.js's built-in modules](http://nodejs.org/api/) are available in
atom-shell, and third-party node modules are fully supported too (including the
Electron, and third-party node modules are fully supported too (including the
[native modules](../tutorial/using-native-node-modules.md)).
Atom-shell also provides some extra built-in modules for developing native
Electron also provides some extra built-in modules for developing native
desktop applications. Some modules are only available on the main process, some
are only available on the renderer process, and some can be used on both processes.
The basic rule is: if a module is GUI or low-level system related, then it should

View file

@ -1,7 +1,7 @@
# `<webview>` tag
Use the `webview` tag to embed 'guest' content (such as web pages) in your
atom-shell app. The guest content is contained within the `webview` container;
Electron app. The guest content is contained within the `webview` container;
an embedder page within your app controls how the guest content is laid out and
rendered.

View file

@ -1,48 +1,50 @@
# Technical differences to NW.js (formerly node-webkit)
Like NW.js, atom-shell provides a platform to write desktop applications
__Note: Electron was previously named Atom Shell.__
Like NW.js, Electron provides a platform to write desktop applications
with JavaScript and HTML, and has Node integration to grant access to low level
system in web pages.
But there are also fundamental differences between the two projects that make
atom-shell a completely separate product from NW.js:
Electron a completely separate product from NW.js:
**1. Entry of application**
__1. Entry of application__
In NW.js, the main entry of an application is a web page, you specify a
main page in the `package.json` and it would be opened in a browser window as
the application's main window.
While in atom-shell, the entry point is a JavaScript script, instead of
While in Electron, the entry point is a JavaScript script, instead of
providing a URL directly, you need to manually create a browser window and load
html file in it with corresponding API. You also need to listen to window events
to decide when to quit the application.
So atom-shell works more like the Node.js runtime, and APIs are more low level,
you can also use atom-shell for web testing purpose like
So Electron works more like the Node.js runtime, and APIs are more low level,
you can also use Electron for web testing purpose like
[phantomjs](http://phantomjs.org/).
**2. Build system**
__2. Build system__
In order to avoid the complexity of building the whole Chromium, atom-shell uses
In order to avoid the complexity of building the whole Chromium, Electron uses
[libchromiumcontent](https://github.com/brightray/libchromiumcontent) to access
Chromium's Content API, libchromiumcontent is a single, shared library that
includes the Chromium Content module and all its dependencies. So users don't
need a powerful machine to build atom-shell.
need a powerful machine to build Electron.
**3. Node integration**
__3. Node integration__
In NW.js, the Node integration in web pages requires patching Chromium to
work, while in atom-shell we chose a different way to integrate libuv loop to
work, while in Electron we chose a different way to integrate libuv loop to
each platform's message loop to avoid hacking Chromium, see the
[`node_bindings`](../../atom/common/) code for how that was done.
**4. Multi-context**
__4. Multi-context__
If you are an experienced NW.js user, you should be familiar with the
concept of Node context and web context, these concepts were invented because
of how the NW.js was implemented.
By using the [multi-context](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/)
feature of Node, atom-shell doesn't introduce a new JavaScript context in web
feature of Node, Electron doesn't introduce a new JavaScript context in web
pages.

View file

@ -30,17 +30,17 @@ $ sudo npm install npm -g
## Getting the code
```bash
$ git clone https://github.com/atom/atom-shell.git
$ git clone https://github.com/atom/electron.git
```
## Bootstrapping
The bootstrap script will download all necessary build dependencies and create
build project files. Notice that we're using `ninja` to build `atom-shell` so
build project files. Notice that we're using `ninja` to build Electron so
there is no `Makefile` generated.
```bash
$ cd atom-shell
$ cd electron
$ ./script/bootstrap.py -v
```
@ -98,7 +98,7 @@ versions of clang. Try using clang 3.0, default version in Ubuntu 12.04.
If you get an error like:
````
/usr/bin/ld: warning: libudev.so.0, needed by /home/suyash/projects/atom-shell/vendor/brightray/vendor/download/libchromiumcontent/Release/libchromiumcontent.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libudev.so.0, needed by .../vendor/brightray/vendor/download/libchromiumcontent/Release/libchromiumcontent.so, not found (try using -rpath or -rpath-link)
````
and you are on Ubuntu 13.04+, 64 bit system, try doing

View file

@ -14,17 +14,17 @@ following python modules:
## Getting the code
```bash
$ git clone https://github.com/atom/atom-shell.git
$ git clone https://github.com/atom/electron.git
```
## Bootstrapping
The bootstrap script will download all necessary build dependencies and create
build project files. Notice that we're using `ninja` to build `atom-shell` so
build project files. Notice that we're using `ninja` to build Electron so
there is no Xcode project generated.
```bash
$ cd atom-shell
$ cd electron
$ ./script/bootstrap.py -v
```
@ -42,12 +42,12 @@ You can also only build the `Debug` target:
$ ./script/build.py -c D
```
After building is done, you can find `Atom.app` under `out/D`.
After building is done, you can find `Electron.app` under `out/D`.
## 32bit support
Currently atom-shell can only be built for 64bit target on OS X, and there is no
plan to support 32bit on OS X in future.
Electron can only be built for 64bit target on OS X, and there is no plan to
support 32bit OS X in future.
## Tests

View file

@ -6,15 +6,15 @@
* Visual Studio 2013 - [download VS 2013 Community Edition for
free](http://www.visualstudio.com/products/visual-studio-community-vs)
* [Python 2.7](http://www.python.org/download/releases/2.7/)
* 32bit [node.js](http://nodejs.org/download/)
* [Node.js](http://nodejs.org/download/)
* [git](http://git-scm.com)
If you don't have a Windows installation at the moment,
[modern.ie](https://www.modern.ie/en-us/virtualization-tools#downloads) has
timebombed versions of Windows that you can use to build Atom Shell.
timebombed versions of Windows that you can use to build Electron.
The building of atom-shell is done entirely with command-line scripts, so you
can use any editor you like to develop atom-shell, but it also means you can
The building of Electron is done entirely with command-line scripts, so you
can use any editor you like to develop Electron, but it also means you can
not use Visual Studio for the development. Support of building with Visual
Studio will come in the future.
@ -24,17 +24,17 @@ Studio will come in the future.
## Getting the code
```powershell
git clone https://github.com/atom/atom-shell.git
git clone https://github.com/atom/electron.git
```
## Bootstrapping
The bootstrap script will download all necessary build dependencies and create
build project files. Notice that we're using `ninja` to build atom-shell so
build project files. Notice that we're using `ninja` to build Electron so
there is no Visual Studio project generated.
```powershell
cd atom-shell
cd electron
python script\bootstrap.py -v
```
@ -54,10 +54,16 @@ python script\build.py -c D
After building is done, you can find `atom.exe` under `out\D`.
## 64bit support
## 64bit build
Currently atom-shell can only be built for 32bit target on Windows, support for
64bit will come in future.
To build for the 64bit target, you need to pass `--target_arch=x64` when running
the bootstrap script:
```powershell
python script\bootstrap.py -v --target_arch=x64
```
The other building steps are exactly the same.
## Tests

View file

@ -1,13 +1,13 @@
# Build system overview
Atom Shell uses `gyp` for project generation, and `ninja` for building, project
Electron uses `gyp` for project generation, and `ninja` for building, project
configurations can be found in `.gyp` and `.gypi` files.
## Gyp files
Following `gyp` files contain the main rules of building Atom Shell:
Following `gyp` files contain the main rules of building Electron:
* `atom.gyp` defines how Atom Shell itself is built.
* `atom.gyp` defines how Electron itself is built.
* `common.gypi` adjusts the build configurations of Node to make it build
together with Chromium.
* `vendor/brightray/brightray.gyp` defines how `brightray` is built, and
@ -23,7 +23,7 @@ Chromium introduced the "component build", which builds each component as a
separate shared library, making linking very quick but sacrificing file size
and performance.
In Atom Shell we took a very similar approach: for `Debug` builds, the binary
In Electron we took a very similar approach: for `Debug` builds, the binary
will be linked to shared library version of Chromium's components to achieve
fast linking time; for `Release` builds, the binary will be linked to the static
library versions, so we can have the best possible binary size and performance.
@ -35,7 +35,7 @@ script. By default both static libraries and shared libraries will be
downloaded and the final size should be between 800MB and 2GB according to the
platform.
If you only want to build Atom Shell quickly for testing or development, you
If you only want to build Electron quickly for testing or development, you
can only download the shared library versions by passing the `--dev` parameter:
```bash
@ -45,20 +45,20 @@ $ ./script/build.py -c D
## Two-phrase project generation
Atom Shell links with different sets of libraries in `Release` and `Debug`
Electron links with different sets of libraries in `Release` and `Debug`
builds, however `gyp` doesn't support configuring different link settings for
different configurations.
To work around this Atom Shell uses a `gyp` variable
To work around this Electron uses a `gyp` variable
`libchromiumcontent_component` to control which link settings to use, and only
generates one target when running `gyp`.
## Target names
Unlike most projects that use `Release` and `Debug` as target names, Atom Shell
Unlike most projects that use `Release` and `Debug` as target names, Electron
uses `R` and `D` instead. This is because `gyp` randomly crashes if there is
only one `Release` or `Debug` build configuration is defined, and Atom Shell has
only one `Release` or `Debug` build configuration is defined, and Electron has
to only generate one target for one time as stated above.
This only affects developers, if you are only building Atom Shell for rebranding
This only affects developers, if you are only building Electron for rebranding
you are not affected.

View file

@ -25,4 +25,4 @@ Guide](https://github.com/styleguide/javascript), and also following rules:
When creating a new API, we should prefer getters and setters instead of
jQuery's one-function style, for example, `.getText()` and `.setText(text)`
are preferred to `.text([text])`. There is a
[discussion](https://github.com/atom/atom-shell/issues/46) of this.
[discussion](https://github.com/atom/electron/issues/46) of this.

View file

@ -8,13 +8,13 @@ forcing users to download large debugging files. The server functions like
[Microsoft's symbol server](http://support.microsoft.com/kb/311503) so the
documentation there can be useful.
Note that because released atom-shell builds are heavily optimized, debugging is
Note that because released Electron builds are heavily optimized, debugging is
not always easy. The debugger will not be able to show you the content of all
variables and the execution path can seem strange because of inlining, tail
calls, and other compiler optimizations. The only workaround is to build an
unoptimized local build.
The official symbol server URL for atom-shell is
The official symbol server URL for Electron is
http://54.249.141.255:8086/atom-shell/symbols.
You cannot visit this URL directly: you must add it to the symbol path of your
debugging tool. In the examples below, a local cache directory is used to avoid
@ -24,7 +24,7 @@ appropriate cache directory on your machine.
## Using the symbol server in Windbg
The Windbg symbol path is configured with a string value delimited with asterisk
characters. To use only the atom-shell symbol server, add the following entry to
characters. To use only the Electron symbol server, add the following entry to
your symbol path (__note:__ you can replace `c:\code\symbols` with any writable
directory on your computer, if you'd prefer a different location for downloaded
symbols):

View file

@ -2,7 +2,7 @@
## Overview
The source code of atom-shell is separated into a few parts, and we are mostly
The source code of Electron is separated into a few parts, and we are mostly
following Chromium on the separation conventions.
You may need to become familiar with [Chromium's multi-process
@ -11,7 +11,7 @@ to understand the source code better.
## Structure of source code
* **atom** - Source code of atom-shell.
* **atom** - Source code of Electron.
* **app** - System entry code.
* **browser** - The frontend including the main window, UI, and all of the
main process things. This talks to the renderer to manage web pages.
@ -20,7 +20,7 @@ to understand the source code better.
* **cocoa** - Cocoa specific source code.
* **gtk** - GTK+ specific source code.
* **win** - Windows GUI specific source code.
* **default_app** - The default page to show when atom-shell is started
* **default_app** - The default page to show when Electron is started
without providing an app.
* **api** - The implementation of the main process APIs.
* **lib** - Javascript part of the API implementation.
@ -36,12 +36,12 @@ to understand the source code better.
loop into Chromium's message loop.
* **lib** - Common Javascript initialization code.
* **api** - The implementation of common APIs, and foundations of
atom-shell's built-in modules.
Electron's built-in modules.
* **lib** - Javascript part of the API implementation.
* **chromium_src** - Source code that copied from Chromium.
* **docs** - Documentations.
* **spec** - Automatic tests.
* **atom.gyp** - Building rules of atom-shell.
* **atom.gyp** - Building rules of Electron.
* **common.gypi** - Compiler specific settings and building rules for other
components like `node` and `breakpad`.

View file

@ -1,14 +1,14 @@
# Application distribution
To distribute your app with atom-shell, you should name the folder of your app
as `app`, and put it under atom-shell's resources directory (on OS X it is
`Atom.app/Contents/Resources/`, and on Linux and Windows it is `resources/`),
like this:
To distribute your app with Electron, you should name the folder of your app
as `app`, and put it under Electron's resources directory (on OS X it is
`Electron.app/Contents/Resources/`, and on Linux and Windows it is
`resources/`), like this:
On OS X:
```text
atom-shell/Atom.app/Contents/Resources/app/
electron/Electron.app/Contents/Resources/app/
├── package.json
├── main.js
└── index.html
@ -17,14 +17,14 @@ atom-shell/Atom.app/Contents/Resources/app/
On Windows and Linux:
```text
atom-shell/resources/app
electron/resources/app
├── package.json
├── main.js
└── index.html
```
Then execute `Atom.app` (or `atom` on Linux, and `atom.exe` on Windows), and
atom-shell will start as your app. The `atom-shell` directory would then be
Then execute `Electron.app` (or `electron` on Linux, `electron.exe` on Windows),
and Electron will start as your app. The `electron` directory would then be
your distribution that should be delivered to final users.
## Packaging your app into a file
@ -34,20 +34,20 @@ package your app into an [asar](https://github.com/atom/asar) archive to avoid
exposing your app's source code to users.
To use an `asar` archive to replace the `app` folder, you need to rename the
archive to `app.asar`, and put it under atom-shell's resources directory like
bellow, and atom-shell will then try read the archive and start from it.
archive to `app.asar`, and put it under Electron's resources directory like
bellow, and Electron will then try read the archive and start from it.
On OS X:
```text
atom-shell/Atom.app/Contents/Resources/
electron/Electron.app/Contents/Resources/
└── app.asar
```
On Windows and Linux:
```text
atom-shell/resources/
electron/resources/
└── app.asar
```
@ -55,62 +55,81 @@ More details can be found in [Application packaging](application-packaging.md).
## Rebranding with downloaded binaries
After bundling your app into atom-shell, you will want to rebrand atom-shell
After bundling your app into Electron, you will want to rebrand Electron
before distributing it to users.
If you don't care about the executable name on Windows or the helper process
name on OS X, you can simply rename the downloaded binaries, and there is also a
grunt task that can download prebuilt atom-shell binaries for your current
platform automatically:
[grunt-download-atom-shell](https://github.com/atom/grunt-download-atom-shell).
### Windows
You can not rename the `atom.exe` otherwise native modules will not load. But
you can edit the executable's icon and other information with tools like
[rcedit](https://github.com/atom/rcedit) or [ResEdit](http://www.resedit.net).
If you don't use any native Node module, it is fine to rename `atom.exe` to any
name you want.
You can rename `electron.exe` to any name you like, and edit its icon and other
information with tools like [rcedit](https://github.com/atom/rcedit) or
[ResEdit](http://www.resedit.net).
### OS X
You can rename `Atom.app` to whatever you want, and you also have to rename the
`CFBundleDisplayName`, `CFBundleIdentifier` and `CFBundleName` fields in
following manifest files if they have these keys:
You can rename `Electron.app` to any name you want, and you also have to rename
the `CFBundleDisplayName`, `CFBundleIdentifier` and `CFBundleName` fields in
following files:
* `Atom.app/Contents/Info.plist`
* `Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist`
* `Electron.app/Contents/Info.plist`
* `Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist`
You can also rename the helper app to avoid showing `Electron Helper` in the
Activity Monitor, but make sure you have renamed the helper app's executable
file's name.
The structure of a renamed app would be like:
```
MyApp.app/Contents
├── Info.plist
├── MacOS/
│   └── MyApp
└── Frameworks/
├── MyApp Helper EH.app
| ├── Info.plist
| └── MacOS/
|    └── MyApp Helper EH
├── MyApp Helper NP.app
| ├── Info.plist
| └── MacOS/
|    └── MyApp Helper NP
└── MyApp Helper.app
├── Info.plist
└── MacOS/
   └── MyApp Helper
```
### Linux
You can rename the `atom` executable to whatever you want.
You can rename the `electron` executable to any name you like.
## Rebranding by rebuilding atom-shell from source
## Rebranding by rebuilding Electron from source
The best way to rename atom-shell is to change the product name and then build
from source. To do this you need to override the `GYP_DEFINES` environment
variable and have a clean rebuild:
It is also possible to rebrand Electron by changing the product name and
building it from source. To do this you need to override the `GYP_DEFINES`
environment variable and have a clean rebuild:
__Windows__
```cmd
> set "GYP_DEFINES=project_name=myapp product_name=MyApp"
> python script\clean.py
> python script\bootstrap.py
> python script\build.py -c Release -t myapp
> python script\build.py -c R -t myapp
```
__Bash__
```bash
$ export GYP_DEFINES="project_name=myapp product_name=MyApp"
$ script/clean.py
$ script/bootstrap.py
$ script/build.py -c Release -t myapp
```
### grunt-build-atom-shell
Manually checking out atom-shell's code and rebuilding could be complicated, so
Manually checking out Electron's code and rebuilding could be complicated, so
a Grunt task has been created that will handle this automatically:
[grunt-build-atom-shell](https://github.com/paulcbetts/grunt-build-atom-shell).

View file

@ -7,7 +7,7 @@ source code.
## Generating `asar` archive
An [asar][asar] archive is a simple tar-like format that concatenates files
into a single file, atom-shell can read arbitrary files from it without unpacking
into a single file, Electron can read arbitrary files from it without unpacking
the whole file.
Following is the steps to package your app into an `asar` archive:
@ -26,12 +26,12 @@ $ asar pack your-app app.asar
## Using `asar` archives
In atom-shell there are two sets of APIs: Node APIs provided by Node.js, and Web
In Electron there are two sets of APIs: Node APIs provided by Node.js, and Web
APIs provided by Chromium. Both APIs support reading files from `asar` archives.
### Node API
With special patches in atom-shell, Node APIs like `fs.readFile` and `require`
With special patches in Electron, Node APIs like `fs.readFile` and `require`
treat `asar` archives as virtual directories, and the files in it as normal
files in the filesystem.
@ -124,7 +124,7 @@ also cause errors.
Most `fs` APIs can read file or get file's information from `asar` archives
without unpacking, but for some APIs that rely on passing the real file path to
underlying system calls, atom-shell will extract the needed file into a
underlying system calls, Electron will extract the needed file into a
temporary file and pass the path of the temporary file to the APIs to make them
work. This adds a little overhead for those APIs.

View file

@ -2,14 +2,14 @@
The devtools of browser window can only debug the renderer process scripts.
(I.e. the web pages.) In order to provide a way to debug the scripts of
the main process, atom-shell has provided the `--debug` and `--debug-brk`
the main process, Electron has provided the `--debug` and `--debug-brk`
switches.
## Command line switches
### `--debug=[port]`
When this switch is used atom-shell would listen for V8 debugger protocol
When this switch is used Electron would listen for V8 debugger protocol
messages on `port`, the `port` is `5858` by default.
### `--debug-brk=[port]`
@ -18,7 +18,7 @@ Like `--debug` but pauses the script on the first line.
## Use node-inspector for debugging
__Note:__ Atom Shell uses node v0.11.13, which currently doesn't work very well
__Note:__ Electron uses node v0.11.13, which currently doesn't work very well
with node-inspector, and the main process would crash if you inspect the
`process` object under node-inspector's console.
@ -28,18 +28,18 @@ with node-inspector, and the main process would crash if you inspect the
$ node-inspector
```
### 2. Enable debug mode for atom-shell
### 2. Enable debug mode for Electron
You can either start atom-shell with a debug flag like:
You can either start Electron with a debug flag like:
```bash
$ atom-shell --debug=5858 your/app
$ electron --debug=5858 your/app
```
or, to pause your script on the first line:
```bash
$ atom-shell --debug-brk=5858 your/app
$ electron --debug-brk=5858 your/app
```
### 3. Load the debugger UI

View file

@ -6,7 +6,7 @@ applications can put shortcuts in the JumpList of task bar, and on Mac
applications can put a custom menu in the dock menu.
This guide introduces how to integrate your application into those desktop
environments with atom-shell APIs.
environments with Electron APIs.
## Recent documents (Windows & OS X)
@ -26,7 +26,7 @@ To add a file to recent documents, you can use
```javascript
var app = require('app');
app.addRecentDocument('/Users/aryastark/github/atom-shell/README.md');
app.addRecentDocument('/Users/USERNAME/Desktop/work.type');
```
And you can use [app.clearRecentDocuments](clearrecentdocuments) API to empty

View file

@ -1,6 +1,6 @@
# DevTools extension
To make debugging more easy, atom-shell has added basic support for
To make debugging more easy, Electron has added basic support for
[Chrome DevTools Extension][devtools-extension].
For most devtools extensions, you can simply download their source codes and use
@ -16,7 +16,7 @@ $ cd /some-directory
$ git clone --recursive https://github.com/facebook/react-devtools.git
```
Then you can load it in atom-shell by opening the devtools in arbitray window,
Then you can load it in Electron by opening the devtools in arbitray window,
and run this code in the console of devtools:
```javascript
@ -33,20 +33,20 @@ require('remote').require('browser-window').removeDevToolsExtension('React Devel
## Format of devtools extension
Ideally all devtools extension written for Chrome browser can be loaded by
atom-shell, but they have to be in a plain directory, for those packaged `crx`
extensions, there is no way in atom-shell to load them unless you find a way to
Electron, but they have to be in a plain directory, for those packaged `crx`
extensions, there is no way in Electron to load them unless you find a way to
extract them into a directory.
## Background pages
Currently atom-shell doesn't support the background pages of chrome extensions,
Currently Electron doesn't support the background pages of chrome extensions,
so for some devtools extensions that rely on this feature, they may not work
well in atom-shell
well in Electron
## `chrome.*` APIs
Some chrome extensions use `chrome.*` APIs for some features, there is some
effort to implement those APIs in atom-shell to make them work, but we have
effort to implement those APIs in Electron to make them work, but we have
only implemented few for now.
So if the devtools extension is using APIs other than `chrome.devtools.*`, it is

View file

@ -39,7 +39,7 @@ _online-status.html_
There may be instances where one wants to respond to these events in the
main process as well. The main process however does not have a
`navigator` object and thus cannot detect these events directly. Using
Atom-shell's inter-process communication utilities, the events can be forwarded
Electron's inter-process communication utilities, the events can be forwarded
to the main process and handled as needed, as shown in the following example.
_main.js_

View file

@ -123,7 +123,7 @@ Finally the `index.html` is the web page you want to show:
<body>
<h1>Hello World!</h1>
We are using node.js <script>document.write(process.version)</script>
and atom-shell <script>document.write(process.versions['atom-shell'])</script>.
and atom-shell <script>document.write(process.versions['electron'])</script>.
</body>
</html>
```
@ -150,8 +150,8 @@ $ ./atom-shell/atom your-app/
On OS X:
```bash
$ ./Atom.app/Contents/MacOS/Atom your-app/
$ ./Electron.app/Contents/MacOS/Atom your-app/
```
`Atom.app` here is part of the atom-shell's release package, you can download
it from [here](https://github.com/atom/atom-shell/releases).
`Electron.app` here is part of the atom-shell's release package, you can download
it from [here](https://github.com/atom/electron/releases).

View file

@ -1,14 +1,14 @@
# Using native Node modules
The native Node modules are supported by atom-shell, but since atom-shell is
The native Node modules are supported by Electron, but since Electron is
using a different V8 version from official Node, you have to manually specify
the location of atom-shell's headers when building native modules.
the location of Electron's headers when building native modules.
## Native Node module compatibility
Since Node v0.11.x there were vital changes in the V8 API. So generally all
native modules written for Node v0.10.x wouldn't work for Node v0.11.x. And
because atom-shell internally uses Node v0.11.13, it carries with the same
because Electron internally uses Node v0.11.13, it carries with the same
problem.
To solve this, you should use modules that support Node v0.11.x,
@ -20,16 +20,16 @@ For old modules that only support Node v0.10.x, you should use the
### The node-gyp way
To build Node modules with headers of atom-shell, you need to tell `node-gyp`
To build Node modules with headers of Electron, you need to tell `node-gyp`
where to download headers and which version to use:
```bash
$ cd /path-to-module/
$ HOME=~/.atom-shell-gyp node-gyp rebuild --target=0.16.0 --arch=ia32 --dist-url=https://atom.io/download/atom-shell
$ HOME=~/.electron-gyp node-gyp rebuild --target=0.16.0 --arch=ia32 --dist-url=https://atom.io/download/atom-shell
```
The `HOME=~/.atom-shell-gyp` changes where to find development headers. The
`--target=0.16.0` is version of atom-shell. The `--dist-url=...` specifies
The `HOME=~/.electron-gyp` changes where to find development headers. The
`--target=0.16.0` is version of Electron. The `--dist-url=...` specifies
where to download the headers. The `--arch=ia32` says the module is built for
32bit system.
@ -42,5 +42,5 @@ Node modules, except that you need to setup some environment variables:
export npm_config_disturl=https://atom.io/download/atom-shell
export npm_config_target=0.23.0
export npm_config_arch=x64
HOME=~/.atom-shell-gyp npm install module-name
HOME=~/.electron-gyp npm install module-name
```

View file

@ -8,14 +8,14 @@ From [ChromeDriver - WebDriver for Chrome][chrome-driver]:
> implements WebDriver's wire protocol for Chromium. It is being developed by
> members of the Chromium and WebDriver teams.
In atom-shell's [releases](https://github.com/atom/atom-shell/releases) page you
can find archives of `chromedriver`, there is no difference between atom-shell's
In Electron's [releases](https://github.com/atom/electron/releases) page you
can find archives of `chromedriver`, there is no difference between Electron's
distribution of `chromedriver` and upstream ones, so in order to use
`chromedriver` together with atom-shell, you will need some special setup.
`chromedriver` together with Electron, you will need some special setup.
Also notice that only minor version update releases (e.g. `vX.X.0` releases)
include `chromedriver` archives, because `chromedriver` doesn't change as
frequent as atom-shell itself.
frequent as Electron itself.
## Setting up with WebDriverJs
@ -42,9 +42,9 @@ $ npm install selenium-webdriver
### 3. Connect to chrome driver
The usage of `selenium-webdriver` with atom-shell is basically the same with
The usage of `selenium-webdriver` with Electron is basically the same with
upstream, except that you have to manually specify how to connect chrome driver
and where to find atom-shell's binary:
and where to find Electron's binary:
```javascript
var webdriver = require('selenium-webdriver');
@ -53,9 +53,9 @@ var driver = new webdriver.Builder().
// The "9515" is the port opened by chrome driver.
usingServer('http://localhost:9515').
withCapabilities({chromeOptions: {
// Here is the path to your atom-shell binary.
// Here is the path to your Electron binary.
binary: '/Path-to-Your-App.app/Contents/MacOS/Atom'}}).
forBrowser('atom-shell').
forBrowser('electron').
build();
driver.get('http://www.google.com');

View file

@ -1,5 +1,5 @@
{
"name": "atom-shell",
"name": "electron",
"devDependencies": {
"asar": "0.2.2",
"coffee-script": "~1.7.1",

View file

@ -31,8 +31,8 @@ def main():
create_chrome_version_h()
touch_config_gypi()
update_atom_shell()
update_atom_modules('spec', args.target_arch)
run_update()
update_electron_modules('spec', args.target_arch)
def parse_args():
@ -92,7 +92,7 @@ def update_node_modules(dirname, env=None):
execute_stdout([NPM, 'install'], env)
def update_atom_modules(dirname, target_arch):
def update_electron_modules(dirname, target_arch):
env = os.environ.copy()
env['npm_config_arch'] = target_arch
env['npm_config_target'] = get_atom_shell_version()
@ -133,7 +133,7 @@ def touch_config_gypi():
f.write(content)
def update_atom_shell():
def run_update():
update = os.path.join(SOURCE_ROOT, 'script', 'update.py')
execute_stdout([sys.executable, update])

View file

@ -5,6 +5,8 @@ import os
import subprocess
import sys
from lib.util import atom_gyp
CONFIGURATIONS = ['Release', 'Debug']
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
@ -26,7 +28,7 @@ def main():
def parse_args():
parser = argparse.ArgumentParser(description='Build atom-shell')
parser = argparse.ArgumentParser(description='Build project')
parser.add_argument('-c', '--configuration',
help='Build with Release or Debug configuration',
nargs='+',
@ -34,7 +36,7 @@ def parse_args():
required=False)
parser.add_argument('-t', '--target',
help='Build specified target',
default='atom',
default=atom_gyp()['project_name%'],
required=False)
return parser.parse_args()

View file

@ -10,7 +10,7 @@ import stat
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
get_target_arch
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
execute, get_chromedriver_version
execute, get_chromedriver_version, atom_gyp
ATOM_SHELL_VERSION = get_atom_shell_version()
@ -21,11 +21,14 @@ OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
'download', 'libchromiumcontent', 'static_library')
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
TARGET_BINARIES = {
'darwin': [
],
'win32': [
'atom.exe',
'{0}.exe'.format(PROJECT_NAME), # 'electron.exe'
'content_shell.pak',
'd3dcompiler_47.dll',
'ffmpegsumo.dll',
@ -40,7 +43,7 @@ TARGET_BINARIES = {
'snapshot_blob.bin',
],
'linux': [
'atom',
PROJECT_NAME, # 'electron'
'content_shell.pak',
'icudtl.dat',
'libffmpegsumo.so',
@ -51,7 +54,7 @@ TARGET_BINARIES = {
}
TARGET_DIRECTORIES = {
'darwin': [
'Atom.app',
'{0}.app'.format(PRODUCT_NAME),
],
'win32': [
'resources',
@ -128,7 +131,8 @@ def strip_binaries():
def copy_system_libraries():
ldd = execute(['ldd', os.path.join(OUT_DIR, 'atom')])
executable_path = os.path.join(OUT_DIR, PROJECT_NAME) # our/R/electron
ldd = execute(['ldd', executable_path])
lib_re = re.compile('\t(.*) => (.+) \(.*\)$')
for line in ldd.splitlines():
m = lib_re.match(line)
@ -148,14 +152,14 @@ def create_version():
def create_symbols():
destination = os.path.join(DIST_DIR, 'Atom-Shell.breakpad.syms')
destination = os.path.join(DIST_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
dump_symbols = os.path.join(SOURCE_ROOT, 'script', 'dump-symbols.py')
execute([sys.executable, dump_symbols, destination])
def create_dist_zip():
dist_name = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
PLATFORM, get_target_arch())
dist_name = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME, ATOM_SHELL_VERSION,
PLATFORM, get_target_arch())
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
with scoped_cwd(DIST_DIR):
@ -181,14 +185,15 @@ def create_chromedriver_zip():
def create_symbols_zip():
dist_name = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
PLATFORM,
get_target_arch())
dist_name = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
ATOM_SHELL_VERSION,
PLATFORM,
get_target_arch())
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
with scoped_cwd(DIST_DIR):
files = ['LICENSE', 'version']
dirs = ['Atom-Shell.breakpad.syms']
dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)]
make_zip(zip_file, files, dirs)

View file

@ -4,9 +4,14 @@ import os
import subprocess
import sys
from lib.util import atom_gyp
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
def main():
os.chdir(SOURCE_ROOT)
@ -16,12 +21,14 @@ def main():
config = 'R'
if sys.platform == 'darwin':
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'Atom.app',
'Contents', 'MacOS', 'Atom')
atom_shell = os.path.join(SOURCE_ROOT, 'out', config,
'{0}.app'.format(PRODUCT_NAME), 'Contents',
'MacOS', PRODUCT_NAME)
elif sys.platform == 'win32':
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom.exe')
atom_shell = os.path.join(SOURCE_ROOT, 'out', config,
'{0}.exe'.format(PROJECT_NAME))
else:
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom')
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME)
subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:])

View file

@ -54,7 +54,7 @@ def download_and_unzip(framework):
def download_framework(framework):
filename = framework + '.zip'
url = FRAMEWORKS_URL + '/' + filename
download_dir = tempdir(prefix='atom-shell-')
download_dir = tempdir(prefix='electron-')
path = os.path.join(download_dir, filename)
download('Download ' + framework, url, path)

View file

@ -45,7 +45,7 @@ def get_files_list(version):
def download_files(url, files):
directory = tempfile.mkdtemp(prefix='atom-shell-tmp')
directory = tempfile.mkdtemp(prefix='electron-tmp')
return directory, [
download(f, url + f, os.path.join(directory, f))
for f in files

View file

@ -4,19 +4,26 @@ import os
import sys
from lib.config import PLATFORM, s3_config
from lib.util import execute, s3put, scoped_cwd
from lib.util import atom_gyp, execute, s3put, scoped_cwd
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
def main():
# Upload the index.json.
with scoped_cwd(SOURCE_ROOT):
atom_shell = os.path.join(OUT_DIR, 'atom')
if PLATFORM == 'win32':
atom_shell += '.exe'
if sys.platform == 'darwin':
atom_shell = os.path.join(OUT_DIR, '{0}.app'.format(PRODUCT_NAME),
'Contents', 'MacOS', PRODUCT_NAME)
elif sys.platform == 'win32':
atom_shell = os.path.join(OUT_DIR, '{0}.exe'.format(PROJECT_NAME))
else:
atom_shell = os.path.join(OUT_DIR, PROJECT_NAME)
index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
execute([atom_shell,
os.path.join('tools', 'dump-version-info.js'),

View file

@ -2,16 +2,21 @@
import os
import glob
import sys
from lib.config import s3_config
from lib.util import execute, rm_rf, safe_mkdir, s3put
from lib.util import atom_gyp, execute, rm_rf, safe_mkdir, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SYMBOLS_DIR = 'dist\\symbols'
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent'
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
PDB_LIST = [
'out\\R\\atom.exe.pdb',
'out\\R\\{0}.exe.pdb'.format(PROJECT_NAME),
'out\\R\\node.dll.pdb',
]
@ -22,7 +27,7 @@ def main():
rm_rf(SYMBOLS_DIR)
safe_mkdir(SYMBOLS_DIR)
for pdb in PDB_LIST:
run_symstore(pdb, SYMBOLS_DIR, 'AtomShell')
run_symstore(pdb, SYMBOLS_DIR, PRODUCT_NAME)
bucket, access_key, secret_key = s3_config()
files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')
@ -40,5 +45,4 @@ def upload_symbols(bucket, access_key, secret_key, files):
if __name__ == '__main__':
import sys
sys.exit(main())

View file

@ -8,24 +8,29 @@ import sys
import tempfile
from lib.config import PLATFORM, get_target_arch
from lib.util import execute, get_atom_shell_version, parse_version, \
from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \
get_chromedriver_version, scoped_cwd
from lib.github import GitHub
ATOM_SHELL_REPO = 'atom/atom-shell'
ATOM_SHELL_REPO = 'atom/electron'
ATOM_SHELL_VERSION = get_atom_shell_version()
CHROMEDRIVER_VERSION = get_chromedriver_version()
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
DIST_NAME = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
PLATFORM,
get_target_arch())
SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
PLATFORM,
get_target_arch())
DIST_NAME = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME,
ATOM_SHELL_VERSION,
PLATFORM,
get_target_arch())
SYMBOLS_NAME = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
ATOM_SHELL_VERSION,
PLATFORM,
get_target_arch())
CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION,
PLATFORM,
get_target_arch())

View file

@ -15,11 +15,11 @@ describe 'app module', ->
describe 'app.getName()', ->
it 'returns the name field of package.json', ->
assert.equal app.getName(), 'Atom Shell Test App'
assert.equal app.getName(), 'Electron Test'
describe 'app.setName(name)', ->
it 'overrides the name', ->
assert.equal app.getName(), 'Atom Shell Test App'
assert.equal app.getName(), 'Electron Test'
app.setName 'test-name'
assert.equal app.getName(), 'test-name'
app.setName 'Atom Shell Test App'
app.setName 'Electron Test App'

View file

@ -27,8 +27,8 @@ describe 'crash-reporter module', ->
process.throwDeprecation = false
form.parse req, (error, fields, files) ->
process.throwDeprecation = true
assert.equal fields['prod'], 'Atom-Shell'
assert.equal fields['ver'], process.versions['atom-shell']
assert.equal fields['prod'], 'Electron'
assert.equal fields['ver'], process.versions['electron']
assert.equal fields['process_type'], 'renderer'
assert.equal fields['platform'], process.platform
assert.equal fields['extra1'], 'extra1'

View file

@ -1,6 +1,6 @@
{
"name": "atom-shell-specs",
"productName": "Atom Shell Test App",
"name": "electron-test",
"productName": "Electron Test",
"main": "static/main.js",
"version": "0.1.0",
"devDependencies": {

View file

@ -137,7 +137,7 @@ app.on('ready', function() {
require('protocol').registerProtocol('test-if-crashes', function() {});
window = new BrowserWindow({
title: 'atom-shell tests',
title: 'Electron Tests',
show: false,
width: 800,
height: 600,

2
vendor/node vendored

@ -1 +1 @@
Subproject commit da4d745446fcc63bfc205477703533712dd01e2c
Subproject commit 9f7ab575d78fa4c50cc5529f15646c8a37eb3258