@naanlang/naan 1.0.3 → 1.0.6

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 (44) 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 +30 -6
  5. package/dist/naan.min.js +4 -4
  6. package/frameworks/browser/https_request.nlg +120 -0
  7. package/frameworks/browser/sworker.js +29 -39
  8. package/frameworks/browser/terminals.nlg +6 -4
  9. package/frameworks/browser/workers.nlg +13 -6
  10. package/frameworks/client/apiclient.nlg +1 -1
  11. package/frameworks/client/psm_client.nlg +80 -32
  12. package/frameworks/common/common.nlg +104 -26
  13. package/frameworks/common/preferences.nlg +1 -0
  14. package/frameworks/common/watching.nlg +1 -0
  15. package/frameworks/node/apiserver.nlg +9 -5
  16. package/frameworks/node/filesystem.nlg +89 -31
  17. package/frameworks/node/gitter.nlg +27 -6
  18. package/frameworks/node/https_request.nlg +119 -0
  19. package/frameworks/node/node.nlg +1 -0
  20. package/frameworks/node/psm_server.nlg +29 -7
  21. package/frameworks/project/build.nlg +13 -7
  22. package/frameworks/project/proj_cliser.nlg +11 -3
  23. package/frameworks/project/proj_console.nlg +13 -4
  24. package/frameworks/project/proj_folder.nlg +10 -1
  25. package/frameworks/project/proj_lambda.nlg +13 -4
  26. package/frameworks/project/proj_static.nlg +11 -3
  27. package/frameworks/project/projects.nlg +102 -20
  28. package/lib/browser/env_web.js +32 -8
  29. package/lib/core/naanlib.js +4 -4
  30. package/package.json +2 -1
  31. package/plugins/serviceAws/aws/aws-sdk-node.min.js +2 -0
  32. package/plugins/serviceAws/aws/aws-sdk.min.js +2 -88
  33. package/plugins/serviceAws/aws_cloudwatchlogs.nlg +7 -6
  34. package/plugins/serviceAws/aws_dynamo.nlg +128 -45
  35. package/plugins/serviceAws/aws_lambda.nlg +11 -4
  36. package/plugins/serviceAws/aws_s3.nlg +44 -14
  37. package/plugins/serviceAws/dbt_aws.nlg +29 -36
  38. package/plugins/serviceAws/psm_aws.nlg +21 -16
  39. package/plugins/serviceAws/serviceAws.nlg +6 -4
  40. package/test/harness.nlg +3 -1
  41. package/test/test_01_core.nlg +5 -5
  42. package/test/test_02_context.nlg +4 -4
  43. package/test/test_03_jsinterop.nlg +9 -3
  44. package/plugins/serviceAws/aws_cognito.nlg +0 -76
package/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Naan for NPM version 1.0.3-1 is released under the MIT License:
1
+ Naan for NPM version 1.0.6-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.3-1
7
+      Naan for NPM version 1.0.6-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.3");
61
+ console.log("1.0.6");
62
62
  process.exit(0);
63
63
  }
64
64
  if (val == "--buildno") {
65
- console.log("1.0.3-1");
65
+ console.log("1.0.6-2");
66
66
  process.exit(0);
67
67
  }
68
68
  if (val.substring(0,1) == "-") {
package/dist/env_web.js CHANGED
@@ -74,14 +74,17 @@ 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
84
86
  var termlist = []; // list of terminals currently attached
87
+ contSelf.termlist = termlist;
85
88
  var prefs = { };
86
89
  var vsiteName;
87
90
 
@@ -306,8 +309,11 @@ exports.NaanControllerWeb = function() {
306
309
  //
307
310
 
308
311
  this.VsiteRefresh = function VsiteRefresh(url_origin) {
309
- if (window.location.href.startsWith(url_origin))
312
+ if (window.location.href.startsWith(url_origin)) {
310
313
  window.location.reload(); // we have changed underneath
314
+ return (true);
315
+ }
316
+ return (false);
311
317
  };
312
318
 
313
319
 
@@ -411,6 +417,16 @@ exports.NaanControllerWeb = function() {
411
417
  this.LoadPref = function LoadPref(key) {
412
418
  return (prefs[key]);
413
419
  };
420
+
421
+ //
422
+ // Working
423
+ //
424
+ // The application is working, so it is safe to save state.
425
+ //
426
+
427
+ this.Working = function Working() {
428
+ dontSaveUntilWorking = false;
429
+ };
414
430
 
415
431
  var saveEvent = new Event("NaanSave");
416
432
 
@@ -474,6 +490,10 @@ exports.NaanControllerWeb = function() {
474
490
 
475
491
  function saveLocal() {
476
492
  /*jshint sub:true */
493
+ if (dontSaveUntilWorking) { // saved state is problematic
494
+ localStorage.removeItem("NaanState_Hosted");
495
+ return (false);
496
+ }
477
497
  if (querystrings["nosave"])
478
498
  return (false);
479
499
  var statedoc = makeState();
@@ -497,6 +517,7 @@ exports.NaanControllerWeb = function() {
497
517
  if ("localStorage" in window && window["localStorage"] !== null)
498
518
  {
499
519
  var statestr = localStorage.getItem("NaanState_Hosted");
520
+ dontSaveUntilWorking = true;
500
521
  if (statestr)
501
522
  return (loadState(JSON.parse(statestr)));
502
523
  }
@@ -512,7 +533,8 @@ exports.NaanControllerWeb = function() {
512
533
  window.opener.Naanlang.naancon.DispatchMessage({
513
534
  op: "VsiteOpen",
514
535
  name: vsiteName,
515
- naancont: contSelf
536
+ naancont: contSelf,
537
+ title: vsiteName + " $Version$"
516
538
  });
517
539
  }
518
540
 
@@ -521,7 +543,8 @@ exports.NaanControllerWeb = function() {
521
543
  window.opener.Naanlang.naancon.DispatchMessage({
522
544
  op: "VsiteClose",
523
545
  name: vsiteName,
524
- naancont: contSelf
546
+ naancont: contSelf,
547
+ title: vsiteName + " $Version$"
525
548
  });
526
549
  termTextOut("\x1b[90m\x1b[3m".concat("\nwindow closed", "\x1b[0m\n"));
527
550
  }
@@ -540,9 +563,10 @@ exports.NaanControllerWeb = function() {
540
563
  naanlib.banner();
541
564
  naanlib.textLine("print();;\n");
542
565
  }
543
- naanlib.start({
544
- state: naanstate
545
- });
566
+ if (!naanlib.start({ state: naanstate })) { // state loading failed
567
+ localStorage.removeItem("NaanState_Hosted");
568
+ window.location.reload();
569
+ }
546
570
  }
547
571
 
548
572
  if (window.opener) {