Permalink
Browse files

keep up with master + hack around package.json/postinstall

  • Loading branch information...
1 parent ffa09eb commit 9654320cb2a3fa8b0a01566316f843811b5f0a30 @tmpvar tmpvar committed Aug 23, 2012
View
@@ -24,11 +24,14 @@ __AppJS 0.0.18 Distributables:__
* [Windows](http://dists.appjs.org/0.0.18/appjs-0.0.18-win32-ia32.zip) -> app.exe
__npm install__
+*OS X install is currently broken*
+
AppJS can be now be installed via npm.
npm install appjs
__AppJS requires 32bit Node on OS X__. It works on 64bit OS X but __Node must be 32bit__. We're working on solving this, but it's a limitation of Chrome itself so it's a work in progress.
+Help us gain traction by [starring this chromium issue](http://code.google.com/p/chromium/issues/detail?id=18323).
(Windows requires [MSVC++ 2010 runtimes](http://www.microsoft.com/en-us/download/details.aspx?id=5555))
View
@@ -5,7 +5,6 @@
* npm publish appjs-mac
* npm publish appjs-linux
* npm publish appjs
-* drag for OSX if possible
* appjs/bin/* for appjs cli
* `$ appjs package [someapp]`
* Hot keys for Mac like CMD + Q, CMD + V
View
0 bin/app.js 100644 → 100755
No changes.
View
@@ -260,12 +260,12 @@
'cflags': [
'-fPIC',
'-Wall',
+ '-Wno-c++11-extensions',
'-std=c++0x'
],
'conditions': [
['OS=="mac"', {
'sources': [
- 'src/includes/cef_base_mac.mm',
'src/native_window/native_window_mac.mm'
],
'defines': [
@@ -286,7 +286,6 @@
}],
['OS=="linux"', {
'sources': [
- 'src/includes/cef_base_gtk.cpp',
'src/native_window/native_window_linux.cpp',
],
'defines': [
@@ -309,8 +308,28 @@
}
}],
['OS=="win"', {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
+ 'OmitFramePointers': 'true',
+ 'EnableFunctionLevelLinking': 'true',
+ 'EnableIntrinsicFunctions': 'true',
+ 'RuntimeTypeInfo': 'false',
+ 'ExceptionHandling': '1',
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalOptions': [
+ '/LTCG', # link time code generation
+ ],
+ },
+ 'VCLinkerTool': {
+ 'LinkTimeCodeGeneration': 1, # link-time code generation
+ 'OptimizeReferences': 2, # /OPT:REF
+ 'EnableCOMDATFolding': 2, # /OPT:ICF
+ 'LinkIncremental': 1, # disable incremental linking
+ },
+ },
'sources': [
- 'src/includes/cef_base_win.cpp',
'src/includes/util_win.cpp',
'src/native_window/native_window_win.cpp',
],
@@ -319,11 +338,11 @@
'_WINSOCKAPI_'
],
'link_settings': {
- 'libraries': [
- 'GdiPlus.lib',
- '<(module_root_dir)/deps/cef/lib/Release/libcef.lib',
- '<(module_root_dir)/build/Release/lib/libcef_dll_wrapper.node'
- ],
+ 'libraries': [
+ 'GdiPlus.lib',
+ '<(module_root_dir)/deps/cef/lib/Release/libcef.lib',
+ '<(module_root_dir)/build/Release/lib/libcef_dll_wrapper.node'
+ ],
},
}]
]
View
@@ -1,4 +1,5 @@
var path = require('path'),
+ fs = require('fs'),
//errorHandler = require('npm/lib/utils/error-handler'),
exec = require('child_process').exec,
platform = process.platform,
@@ -8,18 +9,18 @@ var path = require('path'),
if (platform == "linux") {
dependency += '-' + arch;
}
-
-console.log('Installing '+dependency+' pacakge...');
-
-exec('npm install '+dependency,{cwd:path.resolve(__dirname,'../../../')},function(err,stdout,stderr){
+fs.exists(__dirname + '/../node_modules/' + dependency, function(exists) {
+ if (exists) { return; }
+ console.log('Installing '+dependency+' pacakge...');
+ exec('npm install '+dependency,{cwd:path.resolve(__dirname,'../../../')},function(err,stdout,stderr){
- if(err) {
- console.log('Error installing '+dependency);
- console.log('Please use `npm install '+dependency+' and install the package manually');
- } else {
- console.log(stderr);
- }
-
+ if(err) {
+ console.log('Error installing '+dependency);
+ console.log('Please use `npm install '+dependency+' and install the package manually');
+ } else {
+ console.log(stderr);
+ }
+ });
});
/*npm.load({}, function(){
npm.commands.install([dependency], errorHandler);
View
@@ -1,12 +0,0 @@
-Index: libcef/browser_webkit_init.cc
-===================================================================
-50a51,59
-> WebKit::WebRuntimeFeatures::enableShadowDOM(true);
-> WebKit::WebRuntimeFeatures::enableStyleScoped(true);
-> WebKit::WebRuntimeFeatures::enableGamepad(true);
-> //WebKit::WebRuntimeFeatures::enablePointerLock(true);
-> //WebKit::WebRuntimeFeatures::enableMediaStream(true);
-> //WebKit::WebRuntimeFeatures::enableMediaSource(true);
-> //WebKit::WebRuntimeFeatures::enableVideoTrack(true);
-> //WebKit::WebRuntimeFeatures::enableInputTypeDate(true);
-> //WebKit::WebRuntimeFeatures::enableScriptedSpeech(true);
View
No changes.
View
@@ -28,7 +28,7 @@ The [Chromium Embedded Frame](https://github.com/appjs/appjs/downloads) distribu
mkdir deps
cd deps
wget --no-check-certificate https://github.com/downloads/appjs/appjs/cef_binary_${CEFVERSION}_darwin_ia32.tar.gz
- tar -xzf https://github.com/downloads/appjs/appjs/cef_binary_${CEFVERSION}_darwin_ia32.tar.gz
+ tar -xzf cef_binary_${CEFVERSION}_darwin_ia32.tar.gz
ln -s cef_binary_${CEFVERSION}_darwin_ia32 cef
cd ..
node-gyp build
@@ -19,8 +19,12 @@ window.on('ready', function(){
window.require = require;
window.process = process;
window.module = module;
+
+ function F12(e){ return e.keyIdentifier === 'F12' }
+ function Command_Option_J(e){ return e.keyCode === 74 && e.metaKey && e.altKey }
+
window.addEventListener('keydown', function(e){
- if (e.keyIdentifier === 'F12') {
+ if (F12(e) || Command_Option_J(e)) {
window.frame.openDevTools();
}
});
View
@@ -76,19 +76,17 @@ module.exports = function bridge(nativeWindow, win, unwrapEphemeral){
var logger = function logger(type, error){
if (typeof node !== 'undefined') {
logger = function logger(type, error){
- node.process.AppjsEmitter.emit('log', type, 'browser', error);
+ node.process.emit('appjs-log', type, 'browser', error);
};
logger(type, context, error);
}
}
} else {
var LOCAL = char(16), FOREIGN = char(15);
var logger = function logger(type, error){
- process.AppjsEmitter.emit('log', type, 'node', error);
- }
+ process.emit('appjs-log', type, 'node', error);
+ };
nativeWindow.once('context-released', function released(){
- nativeWindow.onmessage = function(){ return ''; }
- unwrap = wrap = pipe.send = pipe.listen = function(){ return {} };
mirror = {
type : function(){ return ['object'] },
keys : function(){ return [] },
@@ -105,7 +103,11 @@ module.exports = function bridge(nativeWindow, win, unwrapEphemeral){
construct : function(){ return UNDEFINED },
apply : function(){ return UNDEFINED }
};
- nativeWindow = foreignObjects = foreignIDs = localObjects = localIDs = localCanonicals = foreignCanonicals = null;
+ unwrap = wrap = pipe.send = pipe.listen = function(){ return {} };
+ nativeWindow.onmessage = function(){ return ''; }
+ nativeWindow = null;
+ foreignObjects = foreignIDs = foreignCanonicals = null;
+ localObjects = localIDs = localCanonicals = null;
});
}
View
@@ -78,6 +78,9 @@ decorate(App.prototype, [
function serveFilesFrom(root){
this.router.use(staticRouter(root));
return this;
+ },
+ function on(type, listener){
+ process.on('appjs-'+type, listener.bind(this));
}
]);
View
@@ -3,15 +3,20 @@ var ServerResponse = require('http').ServerResponse,
fs = require('fs'),
path = require('path'),
mime = require('mime'),
- inherit = require('../utils').inherit;
+ inherit = require('../utils').inherit,
+ decorate = require('../utils').decorate;
var EMPTY = new Buffer(0);
+var appjsVersion = 'AppJS' + require('../../package.json').version;
+
+
module.exports = Response;
function Response(callback){
this.callback = callback;
+ this.headers = baseHeaders.child();
}
inherit(Response, ServerResponse, [
@@ -63,7 +68,7 @@ inherit(Response, ServerResponse, [
}
}
- this.callback(this.statusCode, this.responseCode, this.mimetype, this.data);
+ this.callback(this.statusCode, this.responseCode, this.mimetype, this.headers.toArrays(), this.data);
},
function sendFile(status, filepath){
var self = this;
@@ -91,3 +96,93 @@ inherit(Response, ServerResponse, [
});
}
]);
+
+
+
+
+function Headers(init){
+ if (init instanceof Headers) {
+ this.inheritHeaders(init);
+ } else {
+ this.names = Object.create(null);
+ this.headers = Object.create(null);
+ if (init) {
+ this.setHeaders(init);
+ }
+ }
+}
+
+decorate(Headers.prototype, true, [
+ function setHeader(name, value){
+ var key = name.toLowerCase();
+ this.names[key] = name;
+ this.headers[key] = value;
+ },
+ function setHeaders(source){
+ if (source instanceof Headers) {
+ source.listHeaders().forEach(function(name){
+ var key = name.toLowerCase();
+ this.names[key] = name;
+ this.headers[key] = source.headers[key];
+ }, this);
+ } else {
+ for (var k in Object(source)) {
+ this.setHeader(k, source[k]);
+ }
+ }
+ },
+ function inheritHeaders(source){
+ if (source instanceof Headers) {
+ if (!this.names || !this.listHeaders().length) {
+ this.names = Object.create(source.names);
+ this.headers = Object.create(source.headers);
+ } else {
+ this.names.__proto__ = source.names;
+ this.headers.__proto__ = source.headers;
+ }
+ } else {
+ // throw?
+ }
+ },
+ function getHeader(name){
+ return this.headers[name.toLowerCase()];
+ },
+ function removeHeader(name){
+ var key = name.toLowerCase();
+ delete this.names[key];
+ delete this.headers[key];
+ },
+ function listHeaders(){
+ var i=0, k=[];
+ for (k[i++] in this.names);
+ return k;
+ },
+ function toArrays(){
+ var out = { names: [], headers: [] }
+ for (var k in this.names) {
+ out.names.push(this.names[k]);
+ out.headers.push(this.headers[k]);
+ }
+ return out;
+ },
+ function toObject(){
+ var out = {};
+ this.listHeaders().forEach(function(key){
+ out[this.names[key]] = this.headers[key];
+ }, this);
+ return out;
+ },
+ function child(){
+ return new Headers(this);
+ }
+]);
+
+
+
+var baseHeaders = new Headers({
+ 'Host': 'http://appjs',
+ 'Connection': 'Keep-Alive',
+ 'Keep-Alive': 'timeout=3, max=100',
+ 'Server': appjsVersion
+});
+
Oops, something went wrong.

0 comments on commit 9654320

Please sign in to comment.