Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d59796b
runat-1128988: Use system rather than 'gcli'
joewalker Feb 4, 2015
9813ead
runat-1128988: Output doesn't need to cache a conversionContext
joewalker Feb 4, 2015
60c4415
runat-1128988: Remove call to setTimeout because this Promise is async
joewalker Feb 4, 2015
1c90cac
runat-1128988: Add missing bind
joewalker Feb 4, 2015
7bc315f
runat-1128988: Escape the { in a regexp so it's not a match count
joewalker Feb 4, 2015
ddc3506
runat-1128988: Use a better default connection
joewalker Feb 5, 2015
32b0006
runat-1128988: Add json -> dom and json -> string converters
joewalker Feb 5, 2015
c8ccc9f
runat-1128988: Audit test skips for PhantomJS 2.0
joewalker Feb 5, 2015
05b78be
runat-1128988: More robust error reporting
joewalker Feb 5, 2015
60323f6
runat-1128988: Minor comment improvements
joewalker Feb 5, 2015
f59f82f
runat-1128988: Check for hidden options in a function
joewalker Feb 5, 2015
fc6a032
runat-1128988: Fix error handling in websocket server
joewalker Feb 5, 2015
a8f6a6a
runat-1128988: Don't pass terminal to addDebugAids
joewalker Feb 5, 2015
8096a5d
runat-1128988: Make a system immutable once created
joewalker Feb 5, 2015
8292a26
runat-1128988: Use a blank type when we can't resolve the delegate type
joewalker Feb 5, 2015
8246a77
runat-1128988: Strip values from selection lookups
joewalker Feb 5, 2015
f525d59
runat-1128988: Report rejected promises
joewalker Feb 5, 2015
2f57fa9
runat-1128988: Update gcli/index API to not include system
joewalker Feb 5, 2015
9c82b30
runat-1128988: Rename api.js to system.js
joewalker Feb 5, 2015
304a18c
runat-1128988: Mark tests that fail when run remotely
joewalker Feb 5, 2015
118be54
runat-1128988: Rationalize commands 1: Remove uncared for commands
joewalker Feb 6, 2015
75c9db4
runat-1128988: Rationalize commands 1: Create item groups
joewalker Feb 6, 2015
3975380
runat-1128988: Add system.toString for debugging purposes.
joewalker Feb 6, 2015
dc4a419
runat-1128988: Improve 'command not found' error message
joewalker Feb 6, 2015
dba9008
runat-1128988: Improve 'type not found' debugging
joewalker Feb 6, 2015
5c4c5f7
runat-1128988: Add 'location' support to filter commands
joewalker Feb 6, 2015
7a95a19
runat-1128988: Fix lingering input bug
joewalker Feb 6, 2015
9ca5302
runat-1128988: Minor comment clarifications and add a missing ';'
joewalker Feb 12, 2015
1a8fd03
runat-1128988: Introduce GcliFront to mirror protocol.js Front
joewalker Feb 12, 2015
7127930
runat-1128988: Remove rdp.js from GCLI/web tree
joewalker Feb 12, 2015
f488696
runat-1128988: Fix isRemote test detection
joewalker Feb 12, 2015
ce979a9
runat-1128988: A collection of nit fixes
joewalker Feb 12, 2015
c7d092b
runat-1128988: Split getSelectionInfo into getSelection[Lookup|Data]
joewalker Feb 12, 2015
fd63021
runat-1128988: Create connection API: system.connectSystems
joewalker Feb 12, 2015
166ec79
runat-1128988: 'system' should use a GcliFront not a connector
joewalker Feb 13, 2015
e2a1c6a
runat-1128988: Be less brutal with errors
joewalker Feb 13, 2015
0691a90
runat-1128988: Use `function*() ...` for generators
joewalker Feb 13, 2015
cd39f73
runat-1128988: Improve support for custom properties for commands
joewalker Feb 15, 2015
969e9da
runat-1128988: Use .catch(...) in place of .then(null, ...)
joewalker Mar 5, 2015
b62acdf
runat-1128988: Protect from NPE in debug code
joewalker Mar 5, 2015
9c1f388
runat-1128988: Fix typo in variable name and statement ordering
joewalker Mar 5, 2015
0ed2dc7
runat-1128988: Fix duplicate comments
joewalker Mar 5, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 10 additions & 49 deletions gcli.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,16 @@

exports.gcliHome = __dirname;

var system = require('./lib/gcli/api').createSystem();
var system = require('./lib/gcli/system').createSystem();

/*
* GCLI is built from a number of components (called items) composed as
* required for each environment.
* When adding to or removing from this list, we should keep the basics in sync
* with the other environments.
* See:
* - lib/gcli/index.js: Generic basic set (without commands)
* - lib/gcli/demo.js: Adds demo commands to basic set for use in web demo
* - gcli.js: Add commands to basic set for use in Node command line
* - mozilla/gcli/index.js: From scratch listing for Firefox
* - lib/gcli/connectors/index.js: Client only items when executing remotely
* - lib/gcli/connectors/direct.js: Test items for connecting to in-process GCLI
*/
var items = [
require('./lib/gcli/index').items,

require('./lib/gcli/cli').items,
require('./lib/gcli/commands/clear').items,
// require('./lib/gcli/commands/connect').items,
require('./lib/gcli/commands/context').items,
require('./lib/gcli/commands/exec').items,
require('./lib/gcli/commands/global').items,
require('./lib/gcli/commands/help').items,
require('./lib/gcli/commands/intro').items,
require('./lib/gcli/commands/lang').items,
require('./lib/gcli/commands/mocks').items,
require('./lib/gcli/commands/pref').items,
require('./lib/gcli/commands/preflist').items,
require('./lib/gcli/commands/test').items,

require('./lib/gcli/commands/demo/alert').items,
// require('./lib/gcli/commands/demo/bugs').items,
// require('./lib/gcli/commands/demo/demo').items,
require('./lib/gcli/commands/demo/echo').items,
// require('./lib/gcli/commands/demo/edit').items,
// require('./lib/gcli/commands/demo/git').items,
// require('./lib/gcli/commands/demo/hg').items,
require('./lib/gcli/commands/demo/sleep').items,
// require('./lib/gcli/commands/demo/theme').items,
require('./lib/gcli/items/basic').items,
require('./lib/gcli/items/ui').items,
require('./lib/gcli/items/remote').items,
require('./lib/gcli/items/standard').items,
require('./lib/gcli/items/demo').items,
require('./lib/gcli/items/server').items,

require('./lib/gcli/commands/server/exit').items,
require('./lib/gcli/commands/server/firefox').items,
require('./lib/gcli/commands/server/orion').items,
require('./lib/gcli/commands/server/server').items,
require('./lib/gcli/commands/server/standard').items
].reduce(function(prev, curr) { return prev.concat(curr); }, []);

system.addItems(items);
Expand Down Expand Up @@ -116,7 +79,7 @@ function logResults(output) {
requisition.updateExec(command)
.then(logResults)
.then(extraActions)
.then(null, util.errorHandler);
.catch(util.errorHandler);

/**
* Start a NodeJS REPL to execute commands
Expand All @@ -133,10 +96,8 @@ function startRepl() {
if (command.length !== 0) {
requisition.updateExec(command)
.then(logResults)
.then(
function() { callback(); },
function(ex) { util.errorHandler(ex); callback(); }
);
.then(function() { callback(); })
.catch(function(ex) { util.errorHandler(ex); callback(); });
}
};

Expand Down
21 changes: 10 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@
paths: { i18n: '../scripts/i18n', text: '../scripts/text' }
});

var modules = [ 'gcli/index', 'gcli/demo', 'gcli/test/index' ];
var modules = [ 'gcli/index', 'gcli/items/demo', 'gcli/test/index' ];
require(modules, function(gcli, demo, test) {
// Add demo commands. You'll probably want to replace this with
// your own set of commands
gcli.addItems(demo.items);
// Add the commands/types/converters as required
var system = gcli.createSystem();
system.addItems(gcli.items); // Common infrastructure: types, etc
system.addItems(gcli.commandItems); // Common set of useful commands
system.addItems(demo.items); // Extra demo commands

// To run commands remotely,
// Hook GCLI into this page, using gcli-root above
var options = {};
gcli.createTerminal(options).then(function() {
// Run the unit test at each startup.
test.run(options);
}).then(null, console.error);
gcli.createTerminal(system).then(function(terminal) {
terminal.language.showIntro(); // Intro text
test.run(terminal, false); // Run the unit test at each startup
}).catch(console.error.bind(console));
});
</script>

Expand Down
217 changes: 0 additions & 217 deletions lib/gcli/api.js

This file was deleted.

Loading