@naanlang/naan 1.0.7 → 1.0.8
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 +3 -4
- package/README.md +20 -2
- package/bin/index.js +2 -2
- package/dist/env_web.js +86 -17
- package/dist/naan.min.js +7 -7
- package/frameworks/browser/browser.nlg +26 -2
- package/frameworks/browser/sworker.js +17 -17
- package/frameworks/browser/workers.nlg +7 -0
- package/frameworks/client/psm_client.nlg +1 -0
- package/frameworks/common/common.nlg +33 -5
- package/frameworks/node/filesystem.nlg +32 -26
- package/frameworks/node/gitter.nlg +9 -4
- package/frameworks/node/https_request.nlg +19 -14
- package/frameworks/project/build.nlg +177 -68
- package/frameworks/project/projects.nlg +1 -1
- package/frameworks/running/running.nlg +32 -10
- package/frameworks/storage/psm.nlg +20 -4
- package/lib/browser/env_web.js +90 -21
- package/lib/core/naanlib.js +7 -7
- package/package.json +1 -1
- package/plugins/serviceAws/aws/aws-sdk-node.min.js +1 -1
- package/plugins/serviceAws/aws/aws-sdk.min.js +1 -1
- package/plugins/serviceAws/aws/lambda_ws_init.nlg +2 -1
- package/plugins/serviceAws/aws_dynamo.nlg +27 -20
- package/plugins/serviceAws/aws_dynextra.nlg +110 -5
- package/plugins/serviceAws/aws_lambda.nlg +4 -8
- package/plugins/serviceAws/aws_sqs.nlg +113 -0
- package/plugins/serviceAws/serviceAws.nlg +1 -1
- package/plugins/serviceYC/generic_api.yaml +36 -0
- package/plugins/serviceYC/naanide-relay-index.js +148 -0
- package/plugins/serviceYC/serviceYC.nlg +59 -0
- package/plugins/serviceYC/yc_function.nlg +161 -0
- package/test/test_01_core.nlg +2 -2
- package/test/test_02_context.nlg +2 -2
- package/test/test_05_strings.nlg +11 -1
- package/test/test_06_lingoparse.nlg +43 -14
package/lib/browser/env_web.js
CHANGED
|
@@ -311,11 +311,73 @@ exports.NaanControllerWeb = function() {
|
|
|
311
311
|
this.VsiteRefresh = function VsiteRefresh(url_origin) {
|
|
312
312
|
if (vsiteName && window.location.href.startsWith(url_origin)) {
|
|
313
313
|
window.location.reload(); // we have changed underneath
|
|
314
|
+
window.scroll(0,0); // Chrome 106 had flood pants 🤓
|
|
314
315
|
return (true);
|
|
315
316
|
}
|
|
316
317
|
return (false);
|
|
317
318
|
};
|
|
318
319
|
|
|
320
|
+
//==========================================================================
|
|
321
|
+
// Browser Console Terminal
|
|
322
|
+
//--------------------------------------------------------------------------
|
|
323
|
+
|
|
324
|
+
// Commands:
|
|
325
|
+
// Naanlang.debug(<text>) -- command line text entry
|
|
326
|
+
// Naanlang.int() -- interrupt and enter debugger
|
|
327
|
+
// Naanlang.detach() -- close the console terminal
|
|
328
|
+
|
|
329
|
+
var conDebTerm;
|
|
330
|
+
|
|
331
|
+
//
|
|
332
|
+
// ConsoleDebugTerminal
|
|
333
|
+
//
|
|
334
|
+
function ConsoleDebugTerminal() {
|
|
335
|
+
var termSelf = this;
|
|
336
|
+
//
|
|
337
|
+
// OnMessageOut
|
|
338
|
+
//
|
|
339
|
+
this.OnMessage = function OnMessage(msg) {
|
|
340
|
+
if (msg.id == "debugtext")
|
|
341
|
+
console.log("dbug-" + msg.level + " " + msg.text);
|
|
342
|
+
else if (msg.id == "textout")
|
|
343
|
+
console.log(msg.text);
|
|
344
|
+
};
|
|
345
|
+
//
|
|
346
|
+
// cmd
|
|
347
|
+
//
|
|
348
|
+
this.cmd = function cmd(keys) {
|
|
349
|
+
keys = keys.trim();
|
|
350
|
+
contSelf.Return(keys + "\n", termSelf);
|
|
351
|
+
return (keys);
|
|
352
|
+
};
|
|
353
|
+
//
|
|
354
|
+
// int
|
|
355
|
+
//
|
|
356
|
+
this.int = function int() {
|
|
357
|
+
contSelf.Interrupt();
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
//
|
|
362
|
+
// debug
|
|
363
|
+
//
|
|
364
|
+
function debug(text) {
|
|
365
|
+
if (!conDebTerm) {
|
|
366
|
+
conDebTerm = new ConsoleDebugTerminal();
|
|
367
|
+
contSelf.Attach(conDebTerm);
|
|
368
|
+
}
|
|
369
|
+
exports.debug = conDebTerm.cmd;
|
|
370
|
+
exports.int = conDebTerm.int;
|
|
371
|
+
exports.detach = function() {
|
|
372
|
+
contSelf.Detach(conDebTerm);
|
|
373
|
+
exports.debug = debug;
|
|
374
|
+
exports.int = undefined;
|
|
375
|
+
exports.detach = undefined;
|
|
376
|
+
conDebTerm = false;
|
|
377
|
+
};
|
|
378
|
+
return (conDebTerm.cmd(text));
|
|
379
|
+
}
|
|
380
|
+
exports.debug = debug;
|
|
319
381
|
|
|
320
382
|
//==========================================================================
|
|
321
383
|
// Clone Debug Interface
|
|
@@ -458,7 +520,7 @@ exports.NaanControllerWeb = function() {
|
|
|
458
520
|
statedoc.curversion = kStateCurrentVersion;
|
|
459
521
|
statedoc.firstver = kStateFirstVersion;
|
|
460
522
|
statedoc.licensee = "MIT-License";
|
|
461
|
-
statedoc.verstring = "1.0.
|
|
523
|
+
statedoc.verstring = "1.0.8+1";
|
|
462
524
|
statedoc.date = new Date().toISOString();
|
|
463
525
|
statedoc.prefs = prefs;
|
|
464
526
|
statedoc.naan = naanlib.saveState(false); // true to optimize, which is a bit slower
|
|
@@ -476,7 +538,7 @@ exports.NaanControllerWeb = function() {
|
|
|
476
538
|
|| statedoc.firstver > kStateCurrentVersion
|
|
477
539
|
|| statedoc.curversion < kStateFirstVersion
|
|
478
540
|
|| statedoc.licensee != "MIT-License"
|
|
479
|
-
|| statedoc.verstring != "1.0.
|
|
541
|
+
|| statedoc.verstring != "1.0.8+1")
|
|
480
542
|
{
|
|
481
543
|
localStorage.removeItem("NaanState_Hosted");
|
|
482
544
|
return (false);
|
|
@@ -528,27 +590,34 @@ exports.NaanControllerWeb = function() {
|
|
|
528
590
|
}
|
|
529
591
|
|
|
530
592
|
function virtualOpen() {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
593
|
+
try {
|
|
594
|
+
if (window.opener && window.opener.Naanlang) {
|
|
595
|
+
vsiteName = window.document.title; // consistent name at open and close
|
|
596
|
+
window.opener.Naanlang.naancon.DispatchMessage({
|
|
597
|
+
op: "VsiteOpen",
|
|
598
|
+
name: vsiteName,
|
|
599
|
+
naancont: contSelf,
|
|
600
|
+
title: vsiteName + " 1.0.8+1"
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
} catch (e) {
|
|
604
|
+
}
|
|
539
605
|
}
|
|
540
606
|
|
|
541
607
|
function virtualClose() {
|
|
542
|
-
|
|
543
|
-
window.opener.Naanlang
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
608
|
+
try {
|
|
609
|
+
if (window.opener && window.opener.Naanlang) {
|
|
610
|
+
window.opener.Naanlang.naancon.DispatchMessage({
|
|
611
|
+
op: "VsiteClose",
|
|
612
|
+
name: vsiteName,
|
|
613
|
+
naancont: contSelf,
|
|
614
|
+
title: vsiteName + " 1.0.8+1"
|
|
615
|
+
});
|
|
616
|
+
termTextOut("\x1b[90m\x1b[3m".concat("\nwindow closed", "\x1b[0m\n"));
|
|
617
|
+
}
|
|
618
|
+
} catch (e) {
|
|
551
619
|
}
|
|
620
|
+
vsiteName = false; // window is going away
|
|
552
621
|
}
|
|
553
622
|
|
|
554
623
|
/*jshint sub:true */
|
|
@@ -557,8 +626,8 @@ exports.NaanControllerWeb = function() {
|
|
|
557
626
|
naanlib.banner();
|
|
558
627
|
var hostpath = naanlib.js.r("path").dirname(window.location.href);
|
|
559
628
|
naanlib.start({
|
|
560
|
-
cmd: 'App.version = "1.0.
|
|
561
|
-
+ 'App.cache = "
|
|
629
|
+
cmd: 'App.version = "1.0.8+1";;\r\n'
|
|
630
|
+
+ 'App.cache = "a7694c55ac4ee13a1946011bac913099";;\r\n'
|
|
562
631
|
+ 'Naan.module.requireQuery({ naanver: App.cache });;\r\n'
|
|
563
632
|
+ 'Naan.module.webparse("naan_init.nlg", "' + hostpath + '", { naanver: App.cache });;\r\n'
|
|
564
633
|
});
|