Godot extension has been added

This commit is contained in:
Sameer Rahmani 2019-03-19 21:06:04 +00:00
parent 77429f150f
commit c1efcd482d
11 changed files with 191 additions and 23 deletions

9
john_titor/debug.js Normal file
View File

@ -0,0 +1,9 @@
var epc = require("elrpc");
var Promise = require('bluebird');
epc.startServer().then(function(server) {
server.defineMethod("github-notifications", function(args) {
return Promise.resolve(args + "22222");
});
server.wait();
});

View File

@ -1,8 +1,10 @@
(ns john-titor.commands
(:require
[john-titor.commands.protocols :as impl]
[john-titor.commands.echo :as echo]))
[john-titor.commands.echo :as echo]
[john-titor.commands.github :as github]))
(defn router
[server]
(impl/init (echo/->EchoCommand) server))
(impl/init (echo/->EchoCommand) server)
(impl/init (github/->GithubCommandRouter) server))

View File

@ -9,8 +9,8 @@
(init [_ server]
(defcommand server
"github-notifications"
#(u/on-value (github/notification-command %)))))
(fn [& args]
(u/wait-for (github/notification-command args))))))
(comment
(u/on-value (github/notification-command [])
#(println %)))
(u/wait-for (github/notification-command [])))

View File

@ -1,4 +1,5 @@
(ns john-titor.github
(:require-macros [cljs.core.async.macros :refer [go]])
(:require
[john-titor.github.core :as g]))

View File

@ -31,18 +31,18 @@
([url]
(api-get url {}))
([url opts]
(api-call http/get url options)))
(api-call http/get url opts)))
(defn api-post
[url opts]
(api-call http/post url options))
(api-call http/post url opts))
(defn notifications
([]
(notifications {}))
([opts]
(api-get "/notifications" {})
(go `(message "hello"))))
(go {:same "asd"})))
(comment
(notifications)

View File

@ -1,7 +1,12 @@
(ns john-titor.utils
(:require
[clojure.core.async :refer [take! <!!]]))
["bluebird" :as Promise]
[clojure.core.async :refer [take!]]))
(defn on-value
(defn wait-for
[ch]
(<!! ch))
(Promise.
(fn [resolve]
;; Handle the channel timeout here
(take! ch (fn [value]
(resolve (clj->js value)))))))

View File

@ -2,17 +2,13 @@
(function(){
var SHADOW_IMPORT_PATH = __dirname + '/../.shadow-cljs/builds/app/dev/out/cljs-runtime';
if (__dirname == '.') { SHADOW_IMPORT_PATH = "/Users/sameer.rahmani/.fg42/john_titor/.shadow-cljs/builds/app/dev/out/cljs-runtime"; }
if (__dirname == '.') { SHADOW_IMPORT_PATH = "/home/lxsameer/.fg42/john_titor/.shadow-cljs/builds/app/dev/out/cljs-runtime"; }
global.$CLJS = global;
try {require('source-map-support').install();} catch (e) {console.warn('no "source-map-support" (run "npm install source-map-support --save-dev" to get it)');}
global.CLOSURE_NO_DEPS = true;
<<<<<<< Updated upstream
global.CLOSURE_DEFINES = {"shadow.cljs.devtools.client.env.repl_pprint":false,"shadow.cljs.devtools.client.env.devtools_url":"","shadow.cljs.devtools.client.env.autoload":false,"shadow.cljs.devtools.client.env.proc_id":"e01e0e97-fd19-4247-a69e-568995e2aeb7","goog.ENABLE_DEBUG_LOADER":false,"shadow.cljs.devtools.client.env.server_port":9630,"shadow.cljs.devtools.client.env.use_document_host":true,"shadow.cljs.devtools.client.env.module_format":"goog","goog.LOCALE":"en","shadow.cljs.devtools.client.env.build_id":"app","shadow.cljs.devtools.client.env.ignore_warnings":false,"goog.DEBUG":true,"cljs.core._STAR_target_STAR_":"nodejs","shadow.cljs.devtools.client.env.ssl":false,"shadow.cljs.devtools.client.env.enabled":true,"shadow.cljs.devtools.client.env.server_host":"localhost","goog.TRANSPILE":"never"};
=======
global.CLOSURE_DEFINES = {"shadow.cljs.devtools.client.env.repl_pprint":false,"shadow.cljs.devtools.client.env.devtools_url":"","shadow.cljs.devtools.client.env.autoload":false,"shadow.cljs.devtools.client.env.proc_id":"06073e1c-1014-4dc0-a8ca-c2d800ea57c5","goog.ENABLE_DEBUG_LOADER":false,"shadow.cljs.devtools.client.env.server_port":9630,"shadow.cljs.devtools.client.env.use_document_host":true,"shadow.cljs.devtools.client.env.module_format":"goog","goog.LOCALE":"en","shadow.cljs.devtools.client.env.build_id":"app","shadow.cljs.devtools.client.env.ignore_warnings":false,"goog.DEBUG":true,"cljs.core._STAR_target_STAR_":"nodejs","shadow.cljs.devtools.client.env.ssl":false,"shadow.cljs.devtools.client.env.enabled":true,"shadow.cljs.devtools.client.env.server_host":"localhost","goog.TRANSPILE":"never"};
>>>>>>> Stashed changes
global.CLOSURE_DEFINES = {"shadow.cljs.devtools.client.env.repl_pprint":false,"shadow.cljs.devtools.client.env.devtools_url":"","shadow.cljs.devtools.client.env.autoload":false,"shadow.cljs.devtools.client.env.proc_id":"0893bd36-0953-4220-b00e-ea1a689dfb58","goog.ENABLE_DEBUG_LOADER":false,"shadow.cljs.devtools.client.env.server_port":9630,"shadow.cljs.devtools.client.env.use_document_host":true,"shadow.cljs.devtools.client.env.module_format":"goog","goog.LOCALE":"en","shadow.cljs.devtools.client.env.build_id":"app","shadow.cljs.devtools.client.env.ignore_warnings":false,"goog.DEBUG":true,"cljs.core._STAR_target_STAR_":"nodejs","shadow.cljs.devtools.client.env.ssl":false,"shadow.cljs.devtools.client.env.enabled":true,"shadow.cljs.devtools.client.env.server_host":"localhost","goog.TRANSPILE":"never"};
var goog = global.goog = {};
@ -3047,6 +3043,102 @@ SHADOW_IMPORT("shadow.js.shim.module$xhr2.js");
SHADOW_IMPORT("shadow.js.shim.module$elrpc.js");
SHADOW_IMPORT("john_titor.commands.protocols.js");
SHADOW_IMPORT("john_titor.commands.echo.js");
SHADOW_IMPORT("goog.net.eventtype.js");
SHADOW_IMPORT("goog.net.errorcode.js");
SHADOW_IMPORT("goog.promise.thenable.js");
SHADOW_IMPORT("goog.async.freelist.js");
SHADOW_IMPORT("goog.async.workqueue.js");
SHADOW_IMPORT("goog.debug.entrypointregistry.js");
SHADOW_IMPORT("goog.dom.htmlelement.js");
SHADOW_IMPORT("goog.dom.tagname.js");
SHADOW_IMPORT("goog.labs.useragent.util.js");
SHADOW_IMPORT("goog.labs.useragent.browser.js");
SHADOW_IMPORT("goog.labs.useragent.engine.js");
SHADOW_IMPORT("goog.async.nexttick.js");
SHADOW_IMPORT("goog.async.run.js");
SHADOW_IMPORT("goog.promise.resolver.js");
SHADOW_IMPORT("goog.promise.promise.js");
SHADOW_IMPORT("goog.disposable.idisposable.js");
SHADOW_IMPORT("goog.disposable.disposable.js");
SHADOW_IMPORT("goog.labs.useragent.platform.js");
SHADOW_IMPORT("goog.useragent.useragent.js");
SHADOW_IMPORT("goog.events.browserfeature.js");
SHADOW_IMPORT("goog.events.eventid.js");
SHADOW_IMPORT("goog.events.event.js");
SHADOW_IMPORT("goog.events.eventtype.js");
SHADOW_IMPORT("goog.events.browserevent.js");
SHADOW_IMPORT("goog.events.listenable.js");
SHADOW_IMPORT("goog.events.listener.js");
SHADOW_IMPORT("goog.events.listenermap.js");
SHADOW_IMPORT("goog.events.events.js");
SHADOW_IMPORT("goog.events.eventtarget.js");
SHADOW_IMPORT("goog.timer.timer.js");
SHADOW_IMPORT("goog.json.json.js");
SHADOW_IMPORT("goog.json.hybrid.js");
SHADOW_IMPORT("goog.debug.errorcontext.js");
SHADOW_IMPORT("goog.debug.debug.js");
SHADOW_IMPORT("goog.debug.logrecord.js");
SHADOW_IMPORT("goog.debug.logbuffer.js");
SHADOW_IMPORT("goog.debug.logger.js");
SHADOW_IMPORT("goog.log.log.js");
SHADOW_IMPORT("goog.net.httpstatus.js");
SHADOW_IMPORT("goog.net.xhrlike.js");
SHADOW_IMPORT("goog.net.xmlhttpfactory.js");
SHADOW_IMPORT("goog.net.wrapperxmlhttpfactory.js");
SHADOW_IMPORT("goog.net.xmlhttp.js");
SHADOW_IMPORT("goog.net.xhrio.js");
SHADOW_IMPORT("goog.dom.tags.js");
SHADOW_IMPORT("goog.string.typedstring.js");
SHADOW_IMPORT("goog.string.const.js");
SHADOW_IMPORT("goog.html.safescript.js");
SHADOW_IMPORT("goog.fs.url.js");
SHADOW_IMPORT("goog.i18n.bidi.js");
SHADOW_IMPORT("goog.html.trustedresourceurl.js");
SHADOW_IMPORT("goog.html.safeurl.js");
SHADOW_IMPORT("goog.html.safestyle.js");
SHADOW_IMPORT("goog.html.safestylesheet.js");
SHADOW_IMPORT("goog.html.safehtml.js");
SHADOW_IMPORT("goog.html.legacyconversions.js");
SHADOW_IMPORT("goog.mochikit.async.deferred.js");
SHADOW_IMPORT("goog.dom.browserfeature.js");
SHADOW_IMPORT("goog.dom.asserts.js");
SHADOW_IMPORT("goog.dom.safe.js");
SHADOW_IMPORT("goog.html.uncheckedconversions.js");
SHADOW_IMPORT("goog.math.coordinate.js");
SHADOW_IMPORT("goog.math.size.js");
SHADOW_IMPORT("goog.dom.dom.js");
SHADOW_IMPORT("goog.net.jsloader.js");
SHADOW_IMPORT("goog.net.jsonp.js");
SHADOW_IMPORT("com.cognitect.transit.util.js");
SHADOW_IMPORT("com.cognitect.transit.delimiters.js");
SHADOW_IMPORT("com.cognitect.transit.caching.js");
SHADOW_IMPORT("com.cognitect.transit.eq.js");
SHADOW_IMPORT("com.cognitect.transit.types.js");
SHADOW_IMPORT("com.cognitect.transit.impl.decoder.js");
SHADOW_IMPORT("com.cognitect.transit.impl.reader.js");
SHADOW_IMPORT("com.cognitect.transit.handlers.js");
SHADOW_IMPORT("com.cognitect.transit.impl.writer.js");
SHADOW_IMPORT("com.cognitect.transit.js");
SHADOW_IMPORT("cognitect.transit.js");
SHADOW_IMPORT("goog.crypt.crypt.js");
SHADOW_IMPORT("goog.useragent.product.js");
SHADOW_IMPORT("goog.crypt.base64.js");
SHADOW_IMPORT("no.en.core.js");
SHADOW_IMPORT("cljs_http.util.js");
SHADOW_IMPORT("cljs.core.async.impl.protocols.js");
SHADOW_IMPORT("cljs.core.async.impl.buffers.js");
SHADOW_IMPORT("cljs.core.async.impl.dispatch.js");
SHADOW_IMPORT("cljs.core.async.impl.channels.js");
SHADOW_IMPORT("cljs.core.async.impl.timers.js");
SHADOW_IMPORT("cljs.core.async.impl.ioc_helpers.js");
SHADOW_IMPORT("cljs.core.async.js");
SHADOW_IMPORT("cljs_http.core.js");
SHADOW_IMPORT("cljs_http.client.js");
SHADOW_IMPORT("john_titor.github.core.js");
SHADOW_IMPORT("john_titor.github.js");
SHADOW_IMPORT("shadow.js.shim.module$bluebird.js");
SHADOW_IMPORT("john_titor.utils.js");
SHADOW_IMPORT("john_titor.commands.github.js");
SHADOW_IMPORT("john_titor.commands.js");
SHADOW_IMPORT("john_titor.core.js");
SHADOW_IMPORT("shadow.module.main.append.js");

23
lib/extensions/godot.el Normal file
View File

@ -0,0 +1,23 @@
;;; GodotExtension --- Godot Game engine development in FG42.
;;; Commentary:
;;; Code:
(require 'fpkg)
(require 'fg42/extension)
(require 'extensions/godot/init)
;; Dependencies ----------------------------------
(depends-on 'gdscript-mode)
(defun godot-doc ()
"TBD"
"TBD")
;; Extension -------------------------------------
(extension godot
:version "2.32"
:on-initialize extensions/godot-initialize
:docs "lib/extensions/godot/readme.org")
(provide 'extensions/godot)
;;; irc.el ends here

View File

@ -0,0 +1,17 @@
;;; IRCExtension --- Enables irc client on FG42
;;; Commentary:
;;; Code:
(defun setup-gdscript()
(setq-default indent-tabs-mode nil)
(setq tab-width 4)
(setq gdscript-tabs-mode t)
(setq gdscript-tab-width 4))
;;;###autoload
(defun extensions/godot-initialize ()
(add-hook 'gdscript-mode-hook 'setup-gdscript)
(message "Godot Engine extension has been loaded."))
(provide 'extensions/godot/init)
;;; init.el ends here

View File

@ -1,6 +1,8 @@
;;; john_title --- Enables RPC for john titor client
;;; Commentary:
;;; Code:
(require 'john_titor)
(defun john-titor-connect ()
"Connect to john titor via RPC."
(interactive)
@ -12,7 +14,6 @@
(interactive)
(john_titor/disconnect))
;;;###autoload
(defun extensions/john-titor-initialize ()
"Initialize the john_titor extention."

View File

@ -10,24 +10,42 @@
"Connect to john titor via RPC."
(setq epc-connection
(if debug-on-error
(epc:start-epc "node" '("../../../john_titor/target/main.js"))
(epc:start-epc "node" '("../../../john_titor/app.js")))))
(epc:start-epc "node" (list (concat
(getenv "HOME")
"/.fg42/john_titor/target/main.js")))
(epc:start-epc "node" (list (concat
(getenv "HOME")
"/.fg42/john_titor/app.js"))))))
(defun john_titor/call-sync (command args)
"Call the given COMMAND with the given ARGS via john titor epc."
(epc:call-sync command args))
(epc:call-sync epc-connection command args))
(defun eval-string (str)
"Evaluate the given STR."
(message str)
(eval (car (read-from-string (format "(progn %s)" str)))))
(defun john_titor/call (command args f)
"Call the COMMAND with the given ARGS in async fashion and call F as callback."
(deferred:$
(epc:call-deferred epc-connection command args)
(deferred:nextc it f)))
(deferred:nextc it
(lambda (x)
(funcall f x)))
(deferred:error it
(lambda (err)
(message "ERROR: %s" err)))))
(defun john_titor/disconnect ()
"Disconnect from the john titor client."
(epc:stop-epc epc-connection))
(epc:stop-epc epc-connection)
(setq epc-connection nil))
(defun john_titor/restart ()
"Restart the epc server."
(john_titor/disconnect)
(john_titor/connect))
(provide 'john_titor)
;;; john_titor.el ends here