@naanlang/naan 1.0.0

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 (98) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +46 -0
  3. package/dist/env_web.js +431 -0
  4. package/dist/naan.min.js +73 -0
  5. package/frameworks/browser/browser.nlg +30 -0
  6. package/frameworks/browser/pouchdb/pouchdb.min.js +7 -0
  7. package/frameworks/browser/spark-md5/spark-md5.min.js +1 -0
  8. package/frameworks/browser/sworker.js +192 -0
  9. package/frameworks/browser/terminals.nlg +787 -0
  10. package/frameworks/browser/workers.nlg +386 -0
  11. package/frameworks/client/apiclient.nlg +183 -0
  12. package/frameworks/client/client.nlg +29 -0
  13. package/frameworks/client/psm_client.nlg +572 -0
  14. package/frameworks/common/common.nlg +464 -0
  15. package/frameworks/common/preferences.nlg +131 -0
  16. package/frameworks/common/repltools.nlg +100 -0
  17. package/frameworks/common/watching.nlg +97 -0
  18. package/frameworks/node/apiserver.nlg +399 -0
  19. package/frameworks/node/filesystem.nlg +1012 -0
  20. package/frameworks/node/gitter.nlg +234 -0
  21. package/frameworks/node/node.nlg +81 -0
  22. package/frameworks/node/psm_server.nlg +465 -0
  23. package/frameworks/node/worker.nlg +560 -0
  24. package/frameworks/project/build.nlg +1229 -0
  25. package/frameworks/project/jszip.js +30 -0
  26. package/frameworks/project/jszip.nlg +87 -0
  27. package/frameworks/project/proj_cliser.nlg +139 -0
  28. package/frameworks/project/proj_console.nlg +137 -0
  29. package/frameworks/project/proj_folder.nlg +143 -0
  30. package/frameworks/project/proj_lambda.nlg +137 -0
  31. package/frameworks/project/proj_static.nlg +138 -0
  32. package/frameworks/project/project.nlg +29 -0
  33. package/frameworks/project/projects.nlg +587 -0
  34. package/frameworks/project/uglifyjs.js +1 -0
  35. package/frameworks/project/uglifyjs.nlg +79 -0
  36. package/frameworks/running/debugcom.nlg +163 -0
  37. package/frameworks/running/debugnub.nlg +565 -0
  38. package/frameworks/running/debugutil.nlg +510 -0
  39. package/frameworks/running/executors.nlg +767 -0
  40. package/frameworks/running/running.nlg +151 -0
  41. package/frameworks/running/sourcecode.nlg +346 -0
  42. package/frameworks/running/taskexec.nlg +196 -0
  43. package/frameworks/storage/dbt_pouch.nlg +773 -0
  44. package/frameworks/storage/file_manager.nlg +772 -0
  45. package/frameworks/storage/psm.nlg +326 -0
  46. package/frameworks/storage/psm_dbtables.nlg +814 -0
  47. package/frameworks/storage/resources.nlg +445 -0
  48. package/frameworks/storage/storage.nlg +52 -0
  49. package/lib/browser/env_web.js +431 -0
  50. package/lib/browser/env_webworker.js +146 -0
  51. package/lib/browser/require.js +1653 -0
  52. package/lib/core/naanlib.js +73 -0
  53. package/lib/env_node.js +282 -0
  54. package/lib/env_nodeworker.js +165 -0
  55. package/lib/node_repl.js +25 -0
  56. package/lib/node_repl_init.nlg +52 -0
  57. package/package.json +13 -0
  58. package/plugins/gitClient/clientops.nlg +317 -0
  59. package/plugins/gitClient/gitClient.nlg +63 -0
  60. package/plugins/gitClient/gitutils.nlg +1331 -0
  61. package/plugins/gitClient/minimatch.js +945 -0
  62. package/plugins/gitClient/minimatch_license.txt +15 -0
  63. package/plugins/gitClient/minimatch_readme.md +208 -0
  64. package/plugins/nodeLib/nodeLib.nlg +26 -0
  65. package/plugins/nodeLib/node_cp.nlg +65 -0
  66. package/plugins/nodeLib/node_fs.nlg +137 -0
  67. package/plugins/nodeLib/node_https.nlg +172 -0
  68. package/plugins/nodeLib/node_util.nlg +180 -0
  69. package/plugins/serviceAws/aws/aws-sdk.min.js +88 -0
  70. package/plugins/serviceAws/aws/lambda_rest_index.js +122 -0
  71. package/plugins/serviceAws/aws/lambda_rest_init.nlg +58 -0
  72. package/plugins/serviceAws/aws/lambda_ws_index.js +498 -0
  73. package/plugins/serviceAws/aws/lambda_ws_init.nlg +49 -0
  74. package/plugins/serviceAws/aws_cloudwatchlogs.nlg +122 -0
  75. package/plugins/serviceAws/aws_cognito.nlg +76 -0
  76. package/plugins/serviceAws/aws_dynamo.nlg +509 -0
  77. package/plugins/serviceAws/aws_lambda.nlg +95 -0
  78. package/plugins/serviceAws/aws_s3.nlg +134 -0
  79. package/plugins/serviceAws/aws_utils.nlg +86 -0
  80. package/plugins/serviceAws/dbt_aws.nlg +769 -0
  81. package/plugins/serviceAws/lambda_naan_control.nlg +175 -0
  82. package/plugins/serviceAws/psm_aws.nlg +258 -0
  83. package/plugins/serviceAws/serviceAws.nlg +38 -0
  84. package/plugins/serviceGitHub/gitops.nlg +522 -0
  85. package/plugins/serviceGitHub/psm_github.nlg +205 -0
  86. package/plugins/serviceGitHub/serviceGitHub.nlg +65 -0
  87. package/plugins/serviceGitLab/gitops.nlg +528 -0
  88. package/plugins/serviceGitLab/psm_gitlab.nlg +205 -0
  89. package/plugins/serviceGitLab/serviceGitLab.nlg +65 -0
  90. package/test/harness.nlg +312 -0
  91. package/test/node_test.js +33 -0
  92. package/test/test_01_core.nlg +768 -0
  93. package/test/test_02_context.nlg +269 -0
  94. package/test/test_03_jsinterop.nlg +137 -0
  95. package/test/test_04_numerics.nlg +450 -0
  96. package/test/test_05_strings.nlg +63 -0
  97. package/test/test_06_lingoparse.nlg +500 -0
  98. package/test/test_07_lingo.nlg +623 -0
@@ -0,0 +1,79 @@
1
+ /*
2
+ * uglifyjs.nlg
3
+ * Naanlib/frameworks/project/
4
+ *
5
+ * Naan wrapper for the UglifyJS library.
6
+ *
7
+ * Origin:
8
+ * https://github.com/mishoo/UglifyJS
9
+ *
10
+ * License:
11
+ * BSD
12
+ *
13
+ * Installation:
14
+ * npm install uglify-js -g
15
+ * uglifyjs --self -c -m -o uglifyjs.js
16
+ *
17
+ * column positioning: // // !
18
+ *
19
+ * Copyright (c) 2021 by Richard C. Zulch
20
+ *
21
+ */
22
+
23
+
24
+ /*
25
+ * UglifyJS
26
+ *
27
+ * Construct a UglifyJS wrapper object.
28
+ *
29
+ */
30
+
31
+ closure UglifyJS(local uglify) {
32
+ uglify = new(object, this)
33
+
34
+ // reload
35
+ // Load the library if needed, and throw an exception if unavailable.
36
+
37
+ function reload() {
38
+ if !uglify.jslib {
39
+ uglify.jslib = JsLoadScript("frameworks/project/uglifyjs.js", "UglifyJS")
40
+ if !uglify.jslib
41
+ return (list(Error("UglifyJS not accessible")))
42
+ }
43
+ }
44
+
45
+ // minify
46
+ // Minify some code.
47
+ uglify.minify = function minify(code, options, local result) {
48
+ reload()
49
+ result = uglify.jslib.minify(code, options)
50
+ if result.error
51
+ list(Error("UglifyJS error:", result.error.message, "file:", result.error.filename, "line:", result.error.line, "col:", result.error.col))
52
+ else
53
+ list(false, result.code)
54
+ }
55
+
56
+ // finis
57
+
58
+ reload()
59
+ if uglify.jslib
60
+ uglify
61
+ };
62
+
63
+
64
+ /*
65
+ * uglifyInit
66
+ *
67
+ * Initialize the module.
68
+ *
69
+ */
70
+
71
+ function uglifyInit(local manifest) {
72
+ manifest = `(UglifyJS, uglifyInit)
73
+
74
+ Naan.module.build(module.id, "uglifyjs", function(modobj, compobj) {
75
+ require("./project.nlg")
76
+ compobj.manifest = manifest
77
+ module.exports.UglifyJS = UglifyJS
78
+ })
79
+ } ();
@@ -0,0 +1,163 @@
1
+ /*
2
+ * debugcom.nlg
3
+ *
4
+ * Debug commander interface to remote debugging.
5
+ *
6
+ * column positioning: // // !
7
+ *
8
+ * Copyright (c) 2021 by Richard C. Zulch
9
+ *
10
+ */
11
+
12
+
13
+ /*
14
+ * DebugCommand
15
+ *
16
+ * Create a debug commander for local debugger access to the remote executor.
17
+ *
18
+ */
19
+
20
+ closure DebugCommand(executor, notify, local decom, excon) {
21
+ decom = new(object, this)
22
+ executor.DebugCmd({
23
+ op: "attach"
24
+ })
25
+ decom.executor = executor
26
+
27
+ // debugData
28
+ // Debug data has arrived from the remote debugger.
29
+ //
30
+ decom.debugData = function debugData(msg) {
31
+ // ### debuglog("DebugCommand data:", totuple(msg))
32
+ if msg.error
33
+ debuglog(" ", ErrorString(msg.error))
34
+ if msg.op == "pauser" {
35
+ decom.entryReason = msg.entry
36
+ decom.running = msg.depth <= 1 && !msg.entry
37
+ decom.bpenable = msg.bpenable
38
+ decom.exenable = msg.exenable
39
+ notify.runState(debugStatus())
40
+ } else if msg.op == "status" {
41
+ decom.running = msg.depth == 0
42
+ decom.bpenable = msg.bpenable
43
+ decom.exenable = msg.exenable
44
+ notify.runState(debugStatus())
45
+ } else if msg.op == "exception" {
46
+ decom.running = false
47
+ if array(msg.exceptstr)
48
+ msg.exceptstr = totuple(msg.exceptstr)
49
+ if array(msg.exception)
50
+ msg.exception = totuple(msg.exception)
51
+ notify.hitException(msg)
52
+ } else if msg.op == "breakpoint" {
53
+ decom.running = false
54
+ notify.hitBreakpoint(msg)
55
+ } else if msg.op == "stepped" {
56
+ decom.running = false
57
+ notify.hitStep(msg)
58
+ }
59
+ }
60
+
61
+ // detach
62
+ // Detach from the remote debugger, rendering this commander obsolete.
63
+ //
64
+ decom.detach = function detach() {
65
+ decom.executor.DebugCmd({
66
+ op: "detach"
67
+ })
68
+ decom.executor = false
69
+ }
70
+
71
+ // context
72
+ // Obtain a remote execution context object. This returns a standard `(error, context) tuple.
73
+ //
74
+ decom.context = function context() {
75
+ if excon
76
+ excon
77
+ else
78
+ excon = executor.context()
79
+ }
80
+
81
+ // remote
82
+ // Obtain a remote debug utilities object. This returns just the new object.
83
+ //
84
+ decom.remote = function remote() {
85
+ DebugRemote(decom)
86
+ }
87
+
88
+ // debugStatus
89
+ // Report the debug status in a dictionary.
90
+ //
91
+ decom.debugStatus = function debugStatus(local status) {
92
+ status = { }
93
+ status.running = decom.running
94
+ status.bpenable = decom.bpenable
95
+ status.exenable = decom.exenable
96
+ status
97
+ }
98
+
99
+ //
100
+ // Run control.
101
+ //
102
+
103
+ decom.pause = function pause() {
104
+ decom.executor.DebugCmd({
105
+ op: "pause"
106
+ })
107
+ }
108
+
109
+ decom.resume = function resume() {
110
+ decom.executor.DebugCmd({
111
+ op: "resume"
112
+ })
113
+ }
114
+
115
+ decom.stepOver = function stepOver() {
116
+ decom.executor.DebugCmd({
117
+ op: "stepover"
118
+ })
119
+ }
120
+
121
+ decom.stepInto = function stepInto() {
122
+ decom.executor.DebugCmd({
123
+ op: "stepinto"
124
+ })
125
+ }
126
+
127
+ decom.stepOut = function stepOut() {
128
+ decom.executor.DebugCmd({
129
+ op: "stepout"
130
+ })
131
+ }
132
+
133
+ decom.stop = function stop() {
134
+ decom.executor.DebugCmd({
135
+ op: "stop"
136
+ })
137
+ decom.running = true
138
+ notify.runState(debugStatus())
139
+ }
140
+
141
+ // finis
142
+
143
+ decom
144
+ };
145
+
146
+
147
+ /*
148
+ * dcomInit
149
+ *
150
+ * Initialize the component.
151
+ *
152
+ */
153
+
154
+ function dcomInit(local manifest) {
155
+ manifest = `(DebugCommand, dcomInit)
156
+
157
+ Naan.module.build(module.id, "debugcom", function(modobj, compobj) {
158
+ require("./running.nlg")
159
+ compobj.manifest = manifest
160
+ modobj.exports.DebugCommand = DebugCommand
161
+ require("./debugutil.nlg")
162
+ })
163
+ } ();