@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.
Files changed (36) hide show
  1. package/LICENSE.md +3 -4
  2. package/README.md +20 -2
  3. package/bin/index.js +2 -2
  4. package/dist/env_web.js +86 -17
  5. package/dist/naan.min.js +7 -7
  6. package/frameworks/browser/browser.nlg +26 -2
  7. package/frameworks/browser/sworker.js +17 -17
  8. package/frameworks/browser/workers.nlg +7 -0
  9. package/frameworks/client/psm_client.nlg +1 -0
  10. package/frameworks/common/common.nlg +33 -5
  11. package/frameworks/node/filesystem.nlg +32 -26
  12. package/frameworks/node/gitter.nlg +9 -4
  13. package/frameworks/node/https_request.nlg +19 -14
  14. package/frameworks/project/build.nlg +177 -68
  15. package/frameworks/project/projects.nlg +1 -1
  16. package/frameworks/running/running.nlg +32 -10
  17. package/frameworks/storage/psm.nlg +20 -4
  18. package/lib/browser/env_web.js +90 -21
  19. package/lib/core/naanlib.js +7 -7
  20. package/package.json +1 -1
  21. package/plugins/serviceAws/aws/aws-sdk-node.min.js +1 -1
  22. package/plugins/serviceAws/aws/aws-sdk.min.js +1 -1
  23. package/plugins/serviceAws/aws/lambda_ws_init.nlg +2 -1
  24. package/plugins/serviceAws/aws_dynamo.nlg +27 -20
  25. package/plugins/serviceAws/aws_dynextra.nlg +110 -5
  26. package/plugins/serviceAws/aws_lambda.nlg +4 -8
  27. package/plugins/serviceAws/aws_sqs.nlg +113 -0
  28. package/plugins/serviceAws/serviceAws.nlg +1 -1
  29. package/plugins/serviceYC/generic_api.yaml +36 -0
  30. package/plugins/serviceYC/naanide-relay-index.js +148 -0
  31. package/plugins/serviceYC/serviceYC.nlg +59 -0
  32. package/plugins/serviceYC/yc_function.nlg +161 -0
  33. package/test/test_01_core.nlg +2 -2
  34. package/test/test_02_context.nlg +2 -2
  35. package/test/test_05_strings.nlg +11 -1
  36. package/test/test_06_lingoparse.nlg +43 -14
@@ -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.7+1";
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.7+1")
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
- vsiteName = window.document.title; // consistent name at open and close
532
- if (window.opener && window.opener.Naanlang)
533
- window.opener.Naanlang.naancon.DispatchMessage({
534
- op: "VsiteOpen",
535
- name: vsiteName,
536
- naancont: contSelf,
537
- title: vsiteName + " 1.0.7+1"
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
- if (window.opener && window.opener.Naanlang) {
543
- window.opener.Naanlang.naancon.DispatchMessage({
544
- op: "VsiteClose",
545
- name: vsiteName,
546
- naancont: contSelf,
547
- title: vsiteName + " 1.0.7+1"
548
- });
549
- vsiteName = false; // window is going away
550
- termTextOut("\x1b[90m\x1b[3m".concat("\nwindow closed", "\x1b[0m\n"));
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.7+1";;\r\n'
561
- + 'App.cache = "cb-1.0.7+1";;\r\n'
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
  });