@naanlang/naan 1.0.4 → 1.0.5

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 (39) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +8 -6
  3. package/bin/index.js +2 -2
  4. package/dist/env_web.js +25 -5
  5. package/dist/naan.min.js +4 -4
  6. package/frameworks/browser/https_request.nlg +120 -0
  7. package/frameworks/browser/sworker.js +19 -19
  8. package/frameworks/browser/terminals.nlg +5 -3
  9. package/frameworks/browser/workers.nlg +1 -0
  10. package/frameworks/client/psm_client.nlg +7 -1
  11. package/frameworks/common/common.nlg +95 -25
  12. package/frameworks/common/preferences.nlg +1 -0
  13. package/frameworks/common/watching.nlg +1 -0
  14. package/frameworks/node/https_request.nlg +119 -0
  15. package/frameworks/node/node.nlg +1 -0
  16. package/frameworks/project/proj_cliser.nlg +11 -3
  17. package/frameworks/project/proj_console.nlg +13 -4
  18. package/frameworks/project/proj_folder.nlg +10 -1
  19. package/frameworks/project/proj_lambda.nlg +13 -4
  20. package/frameworks/project/proj_static.nlg +11 -3
  21. package/frameworks/project/projects.nlg +80 -15
  22. package/frameworks/running/executors.nlg +1 -0
  23. package/lib/browser/env_web.js +27 -7
  24. package/lib/core/naanlib.js +4 -4
  25. package/package.json +1 -1
  26. package/plugins/serviceAws/aws/aws-sdk-node.min.js +2 -0
  27. package/plugins/serviceAws/aws/aws-sdk.min.js +2 -88
  28. package/plugins/serviceAws/aws_cloudwatchlogs.nlg +7 -6
  29. package/plugins/serviceAws/aws_dynamo.nlg +127 -44
  30. package/plugins/serviceAws/aws_lambda.nlg +11 -4
  31. package/plugins/serviceAws/aws_s3.nlg +44 -14
  32. package/plugins/serviceAws/dbt_aws.nlg +29 -36
  33. package/plugins/serviceAws/psm_aws.nlg +21 -16
  34. package/plugins/serviceAws/serviceAws.nlg +6 -4
  35. package/test/harness.nlg +3 -1
  36. package/test/test_01_core.nlg +5 -5
  37. package/test/test_02_context.nlg +4 -4
  38. package/test/test_03_jsinterop.nlg +9 -3
  39. package/plugins/serviceAws/aws_cognito.nlg +0 -76
package/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Naan for NPM version 1.0.4-2 is released under the MIT License:
1
+ Naan for NPM version 1.0.5-2 is released under the MIT License:
2
2
 
3
3
  Copyright (c) 2017-2022 Zulch Laboratories, Inc.
4
4
 
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  Naan is an async-first software platform for rapid development.
5
5
 
6
6
  #### Release:
7
-      Naan for NPM version 1.0.4-2
7
+      Naan for NPM version 1.0.5-2
8
8
       Copyright (c) 2017-2022 Zulch Laboratories, Inc.
9
9
 
10
10
  #### Features
@@ -23,7 +23,7 @@ Naan is an async-first software platform for rapid development.
23
23
 
24
24
  #### Installation
25
25
 
26
- Please ensure you have a recent version of [node.js](http://nodejs.org/)
26
+ Please ensure you have a recent version of [node.js](http://nodejs.org/). The minimum is `v14.14.0`
27
27
 
28
28
  For use everywhere as a command line app:
29
29
 
@@ -42,11 +42,11 @@ It can also evaluate an expression or execute a source file.
42
42
 
43
43
  ##### Command line usage
44
44
 
45
- -h, --help print usage information
46
45
  -e <expression> evaluate an expression
47
46
  -i, --interactive use REPL with -e or [source file]
48
- -v, --version print Naan version
49
- -vv print Naan version with build number
47
+ --version print Naan version
48
+ --buildno print Naan version with build number
49
+ -h, --help print usage information
50
50
 
51
51
  Naan prints the results of evaluating each expression with the REPL, but not
52
52
  by default with an expression or source file. The interactive flag overrides
@@ -64,10 +64,12 @@ Now make it executable with chmod:
64
64
 
65
65
  chmod a+x helloworld
66
66
 
67
+ #### For More Information
67
68
 
69
+ [NaanIDE](https://www.npmjs.com/package/@naanlang/naanide) -- the Naan IDE -- includes more detailed documentation on Naan.
68
70
 
69
71
  #### Dependencies:
70
-      We gratefully acknowledge these software packages used with Naan:
72
+ We gratefully acknowledge these software packages used with Naan:
71
73
  - [jszip.js](http://stuartk.com/jszip) - read and write zip files
72
74
  - [NodeJS-path](https://nodejs.org/) - NodeJS path utilities
73
75
  - [PouchDB](https://pouchdb.com/) - synchronizing database
package/bin/index.js CHANGED
@@ -58,11 +58,11 @@ process.argv.every((val, index) => {
58
58
  return (true);
59
59
  }
60
60
  if (val == "--version") {
61
- console.log("1.0.4");
61
+ console.log("1.0.5");
62
62
  process.exit(0);
63
63
  }
64
64
  if (val == "--buildno") {
65
- console.log("1.0.4-2");
65
+ console.log("1.0.5-2");
66
66
  process.exit(0);
67
67
  }
68
68
  if (val.substring(0,1) == "-") {
package/dist/env_web.js CHANGED
@@ -74,10 +74,12 @@ exports.NaanControllerWeb = function() {
74
74
  //
75
75
 
76
76
  var naanlib = new exports.Naanlib();
77
+ var dontSaveUntilWorking; // true when state loaded, must be reset to save state again
77
78
  var contSelf = this; // this is us, for access within nested functions
78
79
  exports.naancon = this; // access to this instance
79
80
  contSelf.anaan = naanlib.js.n;
80
81
  naanlib.js.t = contSelf;
82
+ naanlib.js.q = querystrings;
81
83
  var replstate; // latest known state of the REPL
82
84
  var naanstate; // desired state for the interpreter
83
85
  var replqueue; // text destined for terminal when opened
@@ -412,6 +414,16 @@ exports.NaanControllerWeb = function() {
412
414
  this.LoadPref = function LoadPref(key) {
413
415
  return (prefs[key]);
414
416
  };
417
+
418
+ //
419
+ // Working
420
+ //
421
+ // The application is working, so it is safe to save state.
422
+ //
423
+
424
+ this.Working = function Working() {
425
+ dontSaveUntilWorking = false;
426
+ };
415
427
 
416
428
  var saveEvent = new Event("NaanSave");
417
429
 
@@ -475,6 +487,10 @@ exports.NaanControllerWeb = function() {
475
487
 
476
488
  function saveLocal() {
477
489
  /*jshint sub:true */
490
+ if (dontSaveUntilWorking) { // saved state is problematic
491
+ localStorage.removeItem("NaanState_Hosted");
492
+ return (false);
493
+ }
478
494
  if (querystrings["nosave"])
479
495
  return (false);
480
496
  var statedoc = makeState();
@@ -498,6 +514,7 @@ exports.NaanControllerWeb = function() {
498
514
  if ("localStorage" in window && window["localStorage"] !== null)
499
515
  {
500
516
  var statestr = localStorage.getItem("NaanState_Hosted");
517
+ dontSaveUntilWorking = true;
501
518
  if (statestr)
502
519
  return (loadState(JSON.parse(statestr)));
503
520
  }
@@ -513,7 +530,8 @@ exports.NaanControllerWeb = function() {
513
530
  window.opener.Naanlang.naancon.DispatchMessage({
514
531
  op: "VsiteOpen",
515
532
  name: vsiteName,
516
- naancont: contSelf
533
+ naancont: contSelf,
534
+ title: vsiteName + " $Version$"
517
535
  });
518
536
  }
519
537
 
@@ -522,7 +540,8 @@ exports.NaanControllerWeb = function() {
522
540
  window.opener.Naanlang.naancon.DispatchMessage({
523
541
  op: "VsiteClose",
524
542
  name: vsiteName,
525
- naancont: contSelf
543
+ naancont: contSelf,
544
+ title: vsiteName + " $Version$"
526
545
  });
527
546
  termTextOut("\x1b[90m\x1b[3m".concat("\nwindow closed", "\x1b[0m\n"));
528
547
  }
@@ -541,9 +560,10 @@ exports.NaanControllerWeb = function() {
541
560
  naanlib.banner();
542
561
  naanlib.textLine("print();;\n");
543
562
  }
544
- naanlib.start({
545
- state: naanstate
546
- });
563
+ if (!naanlib.start({ state: naanstate })) { // state loading failed
564
+ localStorage.removeItem("NaanState_Hosted");
565
+ window.location.reload();
566
+ }
547
567
  }
548
568
 
549
569
  if (window.opener) {