@naanlang/naan 1.0.1 → 1.0.2

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 CHANGED
@@ -1,4 +1,4 @@
1
- Naan for NPM version 1.0.1-2 is released under the MIT License:
1
+ Naan for NPM version 1.0.2-1 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.1-2
7
+      Naan for NPM version 1.0.2-1
8
8
       Copyright (c) 2017-2022 Zulch Laboratories, Inc.
9
9
 
10
10
  #### Features
@@ -17,7 +17,7 @@ Naan is an async-first software platform for rapid development.
17
17
  - Preserves referential integrity when communicating among workers or hosts
18
18
  - Plugin architecture enables alternate languages and functionality
19
19
  - Custom language syntax can be added through simplified dialect extensions
20
- - Integrates transparently with all exising JavaScript libraries
20
+ - Integrates transparently with all existing JavaScript libraries
21
21
  - Can save and reload running program state across page loads or lambda invocations
22
22
  - Lightweight and efficient
23
23
 
@@ -67,7 +67,7 @@ Now make it executable with chmod:
67
67
 
68
68
 
69
69
  #### Dependencies:
70
-      We greatfully acknowlege these software packages used with Naan:
70
+      We gratefully acknowledge these software packages used with Naan:
71
71
  - [jszip.js](http://stuartk.com/jszip) - read and write zip files
72
72
  - [NodeJS-path](https://nodejs.org/) - NodeJS path utilities
73
73
  - [PouchDB](https://pouchdb.com/) - synchronizing database
package/bin/index.js CHANGED
@@ -32,50 +32,53 @@ var eval_text;
32
32
  var do_interactive;
33
33
  var cmd_text = "nodeparse('node_repl_init.nlg');;\n";
34
34
 
35
- process.argv.forEach((val, index) => {
35
+ process.argv.every((val, index) => {
36
36
  if (index < 2)
37
- return;
37
+ return (true);
38
38
  if (val == "-e") {
39
39
  eval_text = 1;
40
- return;
40
+ return (true);
41
41
  }
42
+ if (eval_text == 1 && val.substring(0,1) == "-")
43
+ return (false);
42
44
  if (val == "-h" || val == "--help") {
43
45
  console.log(
44
46
  "Usage: naan [options] [source file] [arguments]\n\n" +
45
47
  "Options:\n" +
46
48
  " -e <expression> evaluate an expression\n" +
47
49
  " -i, --interactive use REPL with -e or [source file]\n" +
48
- " -v, --version print the Naan version\n" +
49
- " -vv print the version and build\n"
50
+ " --version print the Naan version\n" +
51
+ " --buildno print the version and build\n" +
52
+ " -h, --help print this usage information\n"
50
53
  );
51
54
  process.exit(0);
52
55
  }
53
56
  if (val == "-i" || val == "--interactive") {
54
57
  do_interactive = true;
55
- return;
58
+ return (true);
56
59
  }
57
- if (val == "-v" || val == "--version") {
58
- console.log("1.0.1");
60
+ if (val == "--version") {
61
+ console.log("1.0.2");
59
62
  process.exit(0);
60
63
  }
61
- if (val == "-vv") {
62
- console.log("1.0.1-2");
64
+ if (val == "--buildno") {
65
+ console.log("1.0.2-1");
63
66
  process.exit(0);
64
67
  }
65
68
  if (val.substring(0,1) == "-") {
66
69
  console.log("naan: bad option: " + val);
67
70
  process.exit(9);
68
71
  }
69
- if (eval_text) {
70
- if (eval_text == 1)
71
- eval_text = val + '\n';
72
- return;
72
+ if (eval_text == 1) {
73
+ eval_text = val + '\n';
74
+ return (true);
73
75
  }
74
76
  if (!cmd_file) {
75
77
  cmd_file = val;
76
- return;
78
+ return (true);
77
79
  }
78
80
  // ignore extra arguments
81
+ return (true);
79
82
  });
80
83
 
81
84
  if (eval_text == 1) {
package/dist/env_web.js CHANGED
@@ -344,8 +344,8 @@ exports.NaanControllerWeb = function() {
344
344
  var statedoc = {};
345
345
  statedoc.curversion = kStateCurrentVersion;
346
346
  statedoc.firstver = kStateFirstVersion;
347
- statedoc.licensee = "$Licensee$";
348
- statedoc.verstring = "$Version$";
347
+ statedoc.licensee = "Zulch Laboratories, Inc.";
348
+ statedoc.verstring = "1.0.2-1";
349
349
  statedoc.date = new Date().toISOString();
350
350
  statedoc.prefs = prefs;
351
351
  statedoc.naan = naanlib.saveState(true); // true to optimize, which is a bit slower
@@ -362,8 +362,8 @@ exports.NaanControllerWeb = function() {
362
362
  if (statedoc===undefined || statedoc.naan === undefined
363
363
  || statedoc.firstver > kStateCurrentVersion
364
364
  || statedoc.curversion < kStateFirstVersion
365
- || statedoc.licensee != "$Licensee$"
366
- || statedoc.verstring != "$Version$")
365
+ || statedoc.licensee != "Zulch Laboratories, Inc."
366
+ || statedoc.verstring != "1.0.2-1")
367
367
  return (false);
368
368
  naanstate = statedoc.naan;
369
369
  replstate = statedoc.replstate; // get terminal state, if any
package/dist/naan.min.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * naan.min.js
3
3
  *
4
- * Naan for NPM version 1.0.1-2 is released under the MIT License:
4
+ * Naan for NPM version 1.0.2-1 is released under the MIT License:
5
5
  *
6
6
  * Copyright (c) 2017-2022 Zulch Laboratories, Inc.
7
7
  *
@@ -10,7 +10,7 @@
10
10
  *
11
11
  */
12
12
 
13
- var CurrentCacheName = "Naan IDE 1.0.1-2"
13
+ var CurrentCacheName = "Naan IDE 1.0.2-1"
14
14
 
15
15
 
16
16
  //
@@ -31,20 +31,20 @@ var msgport;
31
31
 
32
32
  var promiseport = new Promise(function (resolve, reject) {
33
33
  self.addEventListener('message', function(event) {
34
- console.log("[1.0.1-2] port received");
34
+ console.log("[1.0.2-1] port received");
35
35
  msgport = event.data.hereIsYourPort;
36
36
  msgport.onmessage = function(msg) {
37
37
  msg = msg.data;
38
38
  if (msg.id == "response")
39
39
  postResponse(msg);
40
40
  else if (msg.id == "text")
41
- console.log("[1.0.1-2] msg received:", msg.text);
41
+ console.log("[1.0.2-1] msg received:", msg.text);
42
42
  };
43
43
  /*
44
44
  // don't clutter the log
45
45
  msgport.postMessage({
46
46
  id: "text",
47
- text: "port received by 1.0.1-2",
47
+ text: "port received by 1.0.2-1",
48
48
  });
49
49
  */
50
50
  resolve(msgport);
@@ -74,7 +74,7 @@ var promiseport = new Promise(function (resolve, reject) {
74
74
  */
75
75
 
76
76
  self.addEventListener('install', function(event) {
77
- console.log("[1.0.1-2] install");
77
+ console.log("[1.0.2-1] install");
78
78
  self.skipWaiting();
79
79
  });
80
80
 
@@ -103,14 +103,14 @@ self.addEventListener('fetch', function(event) {
103
103
  promise = self.clients.matchAll({
104
104
  includeUncontrolled: true
105
105
  }).then(function(clientList) {
106
- console.log("[1.0.1-2] requesting new msgport");
106
+ console.log("[1.0.2-1] requesting new msgport");
107
107
  var urls = clientList.map(function(client) {
108
108
  client.postMessage({ // tell client(s) we need a fetch source
109
109
  msg: "Naan_need_fetch_port"
110
110
  });
111
111
  return (client.url);
112
112
  });
113
- console.log('[1.0.1-2] matching clients:', urls.join(', '));
113
+ console.log('[1.0.2-1] matching clients:', urls.join(', '));
114
114
  return (promiseport);
115
115
  });
116
116
  }
@@ -128,14 +128,14 @@ self.addEventListener('fetch', function(event) {
128
128
  msgport.postMessage({
129
129
  id: "fetch",
130
130
  seq: seqno,
131
- version: "1.0.1-2",
131
+ version: "1.0.2-1",
132
132
  request: {
133
133
  method: event.request.method,
134
134
  url: event.request.url
135
135
  },
136
136
  });
137
137
  } else {
138
- console.log("[1.0.1-2] fetch has no msgport");
138
+ console.log("[1.0.2-1] fetch has no msgport");
139
139
  return (reject("fatal delegation error"));
140
140
  }
141
141
  }) });
@@ -165,26 +165,26 @@ self.addEventListener('fetch', function(event) {
165
165
  */
166
166
 
167
167
  self.addEventListener('activate', function(event) {
168
- console.log("[1.0.1-2] activate");
168
+ console.log("[1.0.2-1] activate");
169
169
  self.clients.matchAll({ // for debugging, list controlled clients
170
170
  includeUncontrolled: true
171
171
  }).then(function(clientList) {
172
172
  var urls = clientList.map(function(client) {
173
173
  return (client.url);
174
174
  });
175
- console.log('[1.0.1-2] matching clients:', urls.join(', '));
175
+ console.log('[1.0.2-1] matching clients:', urls.join(', '));
176
176
  });
177
177
  var promise = caches.keys().then(function(cacheNames) { // delete old cache entries
178
178
  return (Promise.all(
179
179
  cacheNames.map(function(cacheName) {
180
180
  if (cacheName !== CurrentCacheName) {
181
- console.log('[1.0.1-2] deleting old cache:', cacheName);
181
+ console.log('[1.0.2-1] deleting old cache:', cacheName);
182
182
  return (caches.delete(cacheName));
183
183
  }
184
184
  })
185
185
  ));
186
186
  }).then(function() { // claim all clients
187
- console.log('[1.0.1-2] claiming clients for version', CurrentCacheName);
187
+ console.log('[1.0.2-1] claiming clients for version', CurrentCacheName);
188
188
  return (self.clients.claim());
189
189
  });
190
190
  if (event.waitUntil)
@@ -510,7 +510,7 @@ closure psmcFsConnector(psm, nicc, local connClassID, connector, watch) {
510
510
  if creds == "HostFS"
511
511
  api = connector.api
512
512
  else
513
- `(error, api) = MakeNideAPIclient(creds.urlName) // API to remote NodeJS filesystem
513
+ api = MakeNideAPIclient(creds.urlName) // API to remote NodeJS filesystem
514
514
  }
515
515
  if error
516
516
  list(error)
@@ -276,7 +276,7 @@ closure projConnector(projman, projtype, local connector, watch) {
276
276
  *
277
277
  * Nide.proj/
278
278
  * nide_cliser.cfg - JSON definition of the project (see below)
279
- * NaanIDE_version.txt - [default] substitution file defining 1.0.1-2 etc.
279
+ * NaanIDE_version.txt - [default] substitution file defining 1.0.2-1 etc.
280
280
  * NaanIDE_version_builds.txt - [default] contains current build number as decimal string
281
281
  * build/ - [optional] default build output location
282
282
  * NaanIDE.lic - [optional] defines Zulch Laboratories, Inc. and other license info
@@ -345,7 +345,7 @@ exports.NaanControllerWeb = function() {
345
345
  statedoc.curversion = kStateCurrentVersion;
346
346
  statedoc.firstver = kStateFirstVersion;
347
347
  statedoc.licensee = "MIT-License";
348
- statedoc.verstring = "1.0.1-2";
348
+ statedoc.verstring = "1.0.2-1";
349
349
  statedoc.date = new Date().toISOString();
350
350
  statedoc.prefs = prefs;
351
351
  statedoc.naan = naanlib.saveState(true); // true to optimize, which is a bit slower
@@ -363,7 +363,7 @@ exports.NaanControllerWeb = function() {
363
363
  || statedoc.firstver > kStateCurrentVersion
364
364
  || statedoc.curversion < kStateFirstVersion
365
365
  || statedoc.licensee != "MIT-License"
366
- || statedoc.verstring != "1.0.1-2")
366
+ || statedoc.verstring != "1.0.2-1")
367
367
  return (false);
368
368
  naanstate = statedoc.naan;
369
369
  replstate = statedoc.replstate; // get terminal state, if any
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * naan.min.js
3
3
  *
4
- * Naan for NPM version 1.0.1-2 is released under the MIT License:
4
+ * Naan for NPM version 1.0.2-1 is released under the MIT License:
5
5
  *
6
6
  * Copyright (c) 2017-2022 Zulch Laboratories, Inc.
7
7
  *
package/lib/env_node.js CHANGED
@@ -44,6 +44,9 @@ exports.NaanNodeREPL = function NaanNodeREPL(options) {
44
44
  naanlib.js.t = this; // allow us to be accessed from Naan
45
45
  var termops;
46
46
  var outEnable = !options.replDisable;
47
+ var useConsoleOut = false;
48
+ if (outEnable && process.env["RUNKIT_ENDPOINT_URL"])
49
+ useConsoleOut = true; // use console.log for output in RunKit
47
50
 
48
51
 
49
52
  //==========================================================================
@@ -131,7 +134,12 @@ exports.NaanNodeREPL = function NaanNodeREPL(options) {
131
134
  }, 1);
132
135
  }
133
136
  } else if (outEnable) {
134
- process.stdout.write(text);
137
+ if (useConsoleOut) { // stdout doesn't work
138
+ text = text.replace(/\r?\n$/, ""); // console.log already does a newline
139
+ console.log(text);
140
+ }
141
+ else
142
+ process.stdout.write(text);
135
143
  textToRemoteTerm(text);
136
144
  }
137
145
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naanlang/naan",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "author": "Richard C. Zulch",
5
5
  "description": "Naan™ software platform",
6
6
  "main": "./lib/core/naanlib.js",