@naanlang/naan 1.3.2 → 1.4.1
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 +1 -1
- package/README.md +1 -1
- package/bin/index.js +25 -15
- package/dist/naan.min.js +5 -5
- package/frameworks/browser/sworker.js +23 -23
- package/frameworks/browser/terminals.nlg +26 -11
- package/frameworks/browser/ws_client.nlg +1 -1
- package/frameworks/client/psm_client.nlg +3 -1
- package/frameworks/client/relaycon.nlg +3 -2
- package/frameworks/common/common.nlg +5 -2
- package/frameworks/common/preferences.nlg +1 -1
- package/frameworks/node/apiserver.nlg +3 -3
- package/frameworks/node/filesystem.nlg +5 -4
- package/frameworks/node/psm_server.nlg +1 -1
- package/frameworks/node/shell.nlg +134 -0
- package/frameworks/node/worker.nlg +104 -46
- package/frameworks/project/build.nlg +1 -2
- package/frameworks/project/jszip.js +0 -0
- package/frameworks/project/projects.nlg +1 -1
- package/frameworks/running/debugnub.nlg +102 -12
- package/frameworks/running/debugutil.nlg +30 -13
- package/frameworks/running/executors.nlg +64 -28
- package/frameworks/running/running.nlg +85 -3
- package/frameworks/running/sourcecode.nlg +3 -1
- package/frameworks/running/taskexec.nlg +24 -4
- package/frameworks/storage/dbt_pouch.nlg +30 -17
- package/frameworks/storage/file_manager.nlg +1 -1
- package/frameworks/storage/psm.nlg +11 -1
- package/frameworks/storage/psm_dbtables.nlg +21 -22
- package/frameworks/storage/resources.nlg +12 -4
- package/frameworks/storage/storage.nlg +2 -2
- package/lib/browser/env_web.js +6 -6
- package/lib/browser/env_webworker.js +2 -0
- package/lib/core/naanlib.js +5 -5
- package/lib/env_nodeworker.js +2 -0
- package/package.json +1 -1
- package/plugins/gitClient/gitClient.nlg +3 -3
- package/plugins/gitClient/gitutils.nlg +2 -2
- package/plugins/nodeLib/node_https.nlg +2 -2
- package/plugins/openSearch/openSearch.nlg +2 -2
- package/plugins/serviceAws/lambda_naan_control.nlg +3 -3
- package/plugins/serviceAws/psm_aws.nlg +4 -2
- package/plugins/serviceAws/serviceAws.nlg +1 -1
- package/plugins/serviceGC/gc_api.nlg +5 -5
- package/plugins/serviceGitHub/gitops.nlg +4 -3
- package/plugins/serviceGitHub/psm_github.nlg +1 -1
- package/plugins/serviceGitHub/serviceGitHub.nlg +1 -1
- package/plugins/serviceGitLab/gitops.nlg +2 -1
- package/plugins/serviceGitLab/psm_gitlab.nlg +2 -2
- package/plugins/serviceGitLab/serviceGitLab.nlg +1 -1
- package/plugins/serviceYC/yc_vm.nlg +1 -1
- package/test/harness.nlg +9 -9
- package/test/test_01_core.nlg +24 -2
- package/test/test_02_context.nlg +2 -2
- package/test/test_07_lingo.nlg +3 -3
- package/plugins/serviceGC/russian_trusted_root_ca_pem.crt +0 -33
|
@@ -38,10 +38,12 @@
|
|
|
38
38
|
|
|
39
39
|
closure FSview(table, rootpath, local view) {
|
|
40
40
|
global(JSpath)
|
|
41
|
-
if !table
|
|
41
|
+
if !table || !string(rootpath)
|
|
42
42
|
return (list(Error("invalid arguments")))
|
|
43
43
|
view = new(object, this)
|
|
44
44
|
view.table = table
|
|
45
|
+
if rootpath != "" && rootpath.slice(-1) != "/"
|
|
46
|
+
rootpath = rootpath.concat("/") // "" or "<path>/"
|
|
45
47
|
view.rootpath = rootpath
|
|
46
48
|
view.path = JSpath.posix // for view.path.join(), etc.
|
|
47
49
|
|
|
@@ -118,23 +120,21 @@ closure FSview(table, rootpath, local view) {
|
|
|
118
120
|
// checkPathName
|
|
119
121
|
//
|
|
120
122
|
// Return a `(path, name) tuple for a directory, or false if callback executed due to error. The
|
|
121
|
-
// name is the empty string if the path is empty. Path "/" has name "
|
|
122
|
-
//
|
|
123
|
+
// name is the empty string if the path is empty. Path "/" has name "". Otherwise the name is the
|
|
124
|
+
// last segment of the path, omitting any trailing slash. A key invariant is that the information
|
|
125
|
+
// should be the same whether the pathname was part of the rootpath or specified in the source
|
|
126
|
+
// path to an operation. That is why this "steals" the rootpath name if needed.
|
|
123
127
|
//
|
|
124
|
-
function checkPathName(path, callback, local name
|
|
125
|
-
if path
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
name = path
|
|
135
|
-
else
|
|
136
|
-
name = path.slice(slashdex+1, -1) // omit trailing "/"
|
|
137
|
-
}
|
|
128
|
+
function checkPathName(path, callback, local name) {
|
|
129
|
+
if checkPath(path, callback)
|
|
130
|
+
return (false) // non-string
|
|
131
|
+
if path != "" && path.slice(-1) != "/"
|
|
132
|
+
path = path.concat("/") // force to be directory
|
|
133
|
+
if path == "/" && rootpath != ""
|
|
134
|
+
name = rootpath // avoid making "//"
|
|
135
|
+
else
|
|
136
|
+
name = rootpath.concat(path)
|
|
137
|
+
name = name.split("/").slice(0,-1).pop() || "" // <|| ""> not needed
|
|
138
138
|
list(path, name)
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -683,7 +683,7 @@ closure FSview(table, rootpath, local view) {
|
|
|
683
683
|
return // already executed callback with error
|
|
684
684
|
dirdict = {
|
|
685
685
|
name: name
|
|
686
|
-
path: path
|
|
686
|
+
path: rootpath.concat(path)
|
|
687
687
|
data: {
|
|
688
688
|
platform: table.type
|
|
689
689
|
semantics: "dbfs"
|
|
@@ -743,14 +743,13 @@ closure FSview(table, rootpath, local view) {
|
|
|
743
743
|
`(path, name) = checkPathName(path, callback)
|
|
744
744
|
if !path
|
|
745
745
|
return // already executed callback with error
|
|
746
|
-
options = {
|
|
746
|
+
options = merge({
|
|
747
747
|
prefix: path
|
|
748
748
|
deep: true
|
|
749
|
-
}
|
|
750
|
-
if name == "" && rootpath != ""
|
|
751
|
-
name = rootpath.split("/").slice(0,-1).pop() || ""
|
|
749
|
+
}, options)
|
|
752
750
|
treedict = {
|
|
753
751
|
name: name
|
|
752
|
+
path: rootpath.concat(path)
|
|
754
753
|
data: {
|
|
755
754
|
platform: table.type
|
|
756
755
|
semantics: "dbfs"
|
|
@@ -142,9 +142,14 @@ closure ResourceManager(dbname, prefix, local reman, watch, result) {
|
|
|
142
142
|
reman.unWatch = watch.unWatch
|
|
143
143
|
reman.dbname = dbname
|
|
144
144
|
reman.conns = {}
|
|
145
|
-
|
|
145
|
+
try {
|
|
146
|
+
require("./dbt_pouch.nlg")
|
|
147
|
+
result = PouchDB(dbname)
|
|
148
|
+
} catch {
|
|
149
|
+
result = list(Error("PouchDB not available", exception))
|
|
150
|
+
}
|
|
146
151
|
if result.0
|
|
147
|
-
return (result)
|
|
152
|
+
return (list(result)) // can't access our vault database
|
|
148
153
|
reman.db = result.1
|
|
149
154
|
|
|
150
155
|
// vault
|
|
@@ -423,19 +428,22 @@ closure ResourceTracker(reman, local retor, watch) {
|
|
|
423
428
|
// Start tracking resources.
|
|
424
429
|
retor.open = function open() {
|
|
425
430
|
if retor.classIdList
|
|
426
|
-
return
|
|
431
|
+
return (list(false, { open: true })) // already open
|
|
427
432
|
watch.reset()
|
|
428
433
|
retor.resids = { } // start empty
|
|
429
434
|
retor.classIdList = []
|
|
430
435
|
for classID in reman.connectors()
|
|
431
436
|
addConnResources(classID)
|
|
432
437
|
reman.watch(remanUpdateOnChange)
|
|
438
|
+
list(false, { ok: true })
|
|
433
439
|
}
|
|
434
440
|
|
|
435
441
|
// close
|
|
436
442
|
//
|
|
437
443
|
// stop tracking resources.
|
|
438
444
|
retor.close = function close(local classID, connector) {
|
|
445
|
+
if !retor.classIdList
|
|
446
|
+
return (list(false, { open: false }))
|
|
439
447
|
watch.reset()
|
|
440
448
|
if retor.classIdList {
|
|
441
449
|
for classID in retor.classIdList {
|
|
@@ -446,6 +454,7 @@ closure ResourceTracker(reman, local retor, watch) {
|
|
|
446
454
|
}
|
|
447
455
|
reman.unWatch(remanUpdateOnChange)
|
|
448
456
|
retor.resids = false
|
|
457
|
+
list(false, { ok: true })
|
|
449
458
|
}
|
|
450
459
|
|
|
451
460
|
// finis
|
|
@@ -466,7 +475,6 @@ function rsrcInit(local manifest) {
|
|
|
466
475
|
|
|
467
476
|
Naan.module.build(module.id, "resources", function(modobj, compobj) {
|
|
468
477
|
require("./storage.nlg")
|
|
469
|
-
require("./dbt_pouch.nlg")
|
|
470
478
|
commonWatching = require("../common/watching.nlg")
|
|
471
479
|
compobj.manifest = manifest
|
|
472
480
|
module.exports.ResourceManager = ResourceManager
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* column positioning: // // !
|
|
8
8
|
*
|
|
9
|
-
* Copyright (c) 2020-
|
|
9
|
+
* Copyright (c) 2020-2024 by Richard C. Zulch
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ function storInit(local manifest) {
|
|
|
26
26
|
require("../common/common.nlg").LiveImport()
|
|
27
27
|
require("../common/watching.nlg")
|
|
28
28
|
compobj.manifest = manifest
|
|
29
|
-
LoadComponentOnDemand(list(DbConnector, ListBrowserDBs, PouchDB), "
|
|
29
|
+
LoadComponentOnDemand(list(DbConnector, ListBrowserDBs, PouchDB), "naanlib:storage/dbt_pouch.nlg")
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
// storReload
|
package/lib/browser/env_web.js
CHANGED
|
@@ -536,7 +536,7 @@ exports.NaanControllerWeb = function() {
|
|
|
536
536
|
statedoc.curversion = kStateCurrentVersion;
|
|
537
537
|
statedoc.firstver = kStateFirstVersion;
|
|
538
538
|
statedoc.licensee = "MIT-License";
|
|
539
|
-
statedoc.verstring = "1.
|
|
539
|
+
statedoc.verstring = "1.4.1+1";
|
|
540
540
|
statedoc.date = new Date().toISOString();
|
|
541
541
|
statedoc.prefs = prefs;
|
|
542
542
|
statedoc.naan = naanlib.saveState(false); // true to optimize, which is a bit slower
|
|
@@ -554,7 +554,7 @@ exports.NaanControllerWeb = function() {
|
|
|
554
554
|
|| statedoc.firstver > kStateCurrentVersion
|
|
555
555
|
|| statedoc.curversion < kStateFirstVersion
|
|
556
556
|
|| statedoc.licensee != "MIT-License"
|
|
557
|
-
|| statedoc.verstring != "1.
|
|
557
|
+
|| statedoc.verstring != "1.4.1+1")
|
|
558
558
|
{
|
|
559
559
|
localStorage.removeItem("NaanState_Hosted");
|
|
560
560
|
return (false);
|
|
@@ -613,7 +613,7 @@ exports.NaanControllerWeb = function() {
|
|
|
613
613
|
op: "VsiteOpen",
|
|
614
614
|
name: vsiteName,
|
|
615
615
|
naancont: contSelf,
|
|
616
|
-
title: vsiteName + " 1.
|
|
616
|
+
title: vsiteName + " 1.4.1+1"
|
|
617
617
|
});
|
|
618
618
|
}
|
|
619
619
|
} catch (e) {
|
|
@@ -627,7 +627,7 @@ exports.NaanControllerWeb = function() {
|
|
|
627
627
|
op: "VsiteClose",
|
|
628
628
|
name: vsiteName,
|
|
629
629
|
naancont: contSelf,
|
|
630
|
-
title: vsiteName + " 1.
|
|
630
|
+
title: vsiteName + " 1.4.1+1"
|
|
631
631
|
});
|
|
632
632
|
termTextOut("\x1b[90m\x1b[3m".concat("\nwindow closed", "\x1b[0m\n"));
|
|
633
633
|
}
|
|
@@ -642,8 +642,8 @@ exports.NaanControllerWeb = function() {
|
|
|
642
642
|
naanlib.banner();
|
|
643
643
|
var hostpath = window.location.origin.concat(naanlib.js.r("path").dirname(window.location.pathname));
|
|
644
644
|
naanlib.start({
|
|
645
|
-
cmd: 'App.version = "1.
|
|
646
|
-
+ 'App.cache = "
|
|
645
|
+
cmd: 'App.version = "1.4.1+1";;\r\n'
|
|
646
|
+
+ 'App.cache = "e319a60c34bb3a4866dfc9f6c698b9aa";;\r\n'
|
|
647
647
|
+ 'Naan.module.requireQuery({ naanver: App.cache });;\r\n'
|
|
648
648
|
+ 'Naan.module.webparse("naan_init.nlg", "' + hostpath + '", { naanver: App.cache });;\r\n'
|
|
649
649
|
});
|
|
@@ -145,6 +145,8 @@ exports.NaanControllerWebWorker = function NaanControllerWebWorker() {
|
|
|
145
145
|
naanlib.textLine(msg.text); // keyboard text from terminal
|
|
146
146
|
else if (msg.id == "start")
|
|
147
147
|
{ // start execution with optional state
|
|
148
|
+
targSelf.workerID = msg.workerID;
|
|
149
|
+
targSelf.workerGUID = msg.workerGUID;
|
|
148
150
|
naanlib.banner();
|
|
149
151
|
naanlib.start({
|
|
150
152
|
state: msg.state,
|