@naanlang/naan 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/bin/index.js +5 -2
- package/dist/env_web.js +11 -1
- package/dist/naan.min.js +4 -4
- package/frameworks/browser/https_request.nlg +2 -0
- package/frameworks/browser/sworker.js +23 -23
- package/frameworks/browser/terminals.nlg +123 -21
- package/frameworks/browser/workers.nlg +4 -1
- package/frameworks/browser/ws_client.nlg +5 -3
- package/frameworks/client/apiclient.nlg +8 -6
- package/frameworks/client/relaycon.nlg +3 -1
- package/frameworks/node/apiserver.nlg +190 -4
- package/frameworks/node/worker.nlg +112 -10
- package/frameworks/node/ws_client.nlg +5 -3
- package/frameworks/project/build.nlg +3 -1
- package/frameworks/project/projects.nlg +1 -1
- package/frameworks/running/executors.nlg +3 -1
- package/frameworks/running/taskexec.nlg +5 -1
- package/lib/browser/env_web.js +17 -7
- package/lib/browser/env_webworker.js +22 -3
- package/lib/core/naanlib.js +4 -4
- package/lib/env_node.js +15 -4
- package/lib/env_nodeworker.js +21 -1
- package/package.json +8 -5
- package/plugins/serviceAws/aws/aws-sdk-node.min.js +2 -2
- package/plugins/serviceAws/aws/aws-sdk.min.js +3 -2
- package/plugins/serviceAws/aws_dynamo.nlg +19 -19
- package/plugins/serviceYC/generic_api.yaml +36 -0
- package/plugins/serviceYC/naanide-relay-index.js +148 -0
- package/plugins/serviceYC/serviceYC.nlg +60 -0
- package/plugins/serviceYC/yc_apigateway.nlg +205 -0
- package/plugins/serviceYC/yc_function.nlg +163 -0
- package/plugins/serviceYC/yc_vm.nlg +207 -0
- package/test/test_07_lingo.nlg +1 -1
package/lib/env_node.js
CHANGED
|
@@ -55,6 +55,7 @@ exports.NaanNodeREPL = function NaanNodeREPL(options) {
|
|
|
55
55
|
var naanlib = new Naan.Naanlib();
|
|
56
56
|
var servSelf = this;
|
|
57
57
|
naanlib.js.t = this; // allow us to be accessed from Naan
|
|
58
|
+
naanlib.js.k = require('worker_threads');
|
|
58
59
|
var termops;
|
|
59
60
|
var outEnable = !options.replDisable;
|
|
60
61
|
var useConsoleOut = false;
|
|
@@ -109,8 +110,8 @@ exports.NaanNodeREPL = function NaanNodeREPL(options) {
|
|
|
109
110
|
{ // Node REPL does too much crap
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
if (!options.replDisable)
|
|
113
|
-
{
|
|
113
|
+
if (process.stdin.isTTY && !options.replDisable)
|
|
114
|
+
{ // must have TTY for local REPL
|
|
114
115
|
replServer = repl.start({ prompt: '', eval: myEval});
|
|
115
116
|
|
|
116
117
|
replServer.on('line', function(cmd) { // process raw command line
|
|
@@ -202,10 +203,20 @@ exports.NaanNodeREPL = function NaanNodeREPL(options) {
|
|
|
202
203
|
//
|
|
203
204
|
// Respond to a message. Note that this calls Naan via timeouts to handle the use case that the
|
|
204
205
|
// messages are originating from the interpreter itself, so that it does not call itself back
|
|
205
|
-
//
|
|
206
|
+
// recursively. That would be Very Bad™.
|
|
206
207
|
//
|
|
207
|
-
|
|
208
|
+
|
|
209
|
+
var replyHook;
|
|
210
|
+
this.OnReplyHook = function OnReplyHook(proc) {
|
|
211
|
+
replyHook = proc;
|
|
212
|
+
return (proc);
|
|
213
|
+
};
|
|
214
|
+
|
|
208
215
|
this.ReplyMessage = function ReplyMessage(data) {
|
|
216
|
+
if (replyHook)
|
|
217
|
+
setTimeout(function() {
|
|
218
|
+
replyHook(data);
|
|
219
|
+
}, 1);
|
|
209
220
|
if (termops)
|
|
210
221
|
{
|
|
211
222
|
setTimeout(function () {
|
package/lib/env_nodeworker.js
CHANGED
|
@@ -62,6 +62,7 @@ exports.NaanWorkerActivate = function NaanWorkerActivate(cbReady) {
|
|
|
62
62
|
var workSelf = this;
|
|
63
63
|
workSelf.anaan = naanlib.js.n;
|
|
64
64
|
naanlib.js.t = workSelf;
|
|
65
|
+
naanlib.js.k = threads;
|
|
65
66
|
|
|
66
67
|
|
|
67
68
|
//==========================================================================
|
|
@@ -127,7 +128,21 @@ exports.NaanWorkerActivate = function NaanWorkerActivate(cbReady) {
|
|
|
127
128
|
workerListener = proc;
|
|
128
129
|
return (proc);
|
|
129
130
|
};
|
|
130
|
-
|
|
131
|
+
|
|
132
|
+
workSelf.DispatchMessage = function DispatchMessage(data) {
|
|
133
|
+
msgPort.postMessage({ // target is sending a message
|
|
134
|
+
id: "targetsend",
|
|
135
|
+
data: data
|
|
136
|
+
});
|
|
137
|
+
return (data);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
var targetReceiver;
|
|
141
|
+
workSelf.OnReceive = function OnReceive(proc) {
|
|
142
|
+
targetReceiver = proc;
|
|
143
|
+
return (proc);
|
|
144
|
+
};
|
|
145
|
+
|
|
131
146
|
workSelf.ReplyDebugger = function ReplyDebugger(data) {
|
|
132
147
|
msgPort.postMessage({ // target is sending debug data
|
|
133
148
|
id: "debugout",
|
|
@@ -175,6 +190,11 @@ exports.NaanWorkerActivate = function NaanWorkerActivate(cbReady) {
|
|
|
175
190
|
if (debugListener)
|
|
176
191
|
debugListener(msg.data); // target received a message
|
|
177
192
|
}
|
|
193
|
+
else if (msg.id == "targetreceive")
|
|
194
|
+
{
|
|
195
|
+
if (targetReceiver)
|
|
196
|
+
targetReceiver(msg.data);
|
|
197
|
+
}
|
|
178
198
|
});
|
|
179
199
|
|
|
180
200
|
naanlib.banner();
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naanlang/naan",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"author": "Richard C. Zulch",
|
|
5
5
|
"description": "Naan™ software platform",
|
|
6
6
|
"main": "./lib/core/naanlib.js",
|
|
7
7
|
"browser": "./dist/naanlib.min.js",
|
|
8
|
-
"license"
|
|
9
|
-
"repository":
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/naanlang/naan.git"
|
|
12
|
+
},
|
|
10
13
|
"bin": {
|
|
11
|
-
"naan": "
|
|
14
|
+
"naan": "bin/index.js"
|
|
12
15
|
},
|
|
13
16
|
"scripts": {
|
|
14
|
-
"start": "node
|
|
17
|
+
"start": "node bin/index.js",
|
|
15
18
|
"debug": "node --inspect-brk lib/node_repl.js",
|
|
16
19
|
"test": "node test/node_test.js"
|
|
17
20
|
}
|