dcp-client 4.4.23 → 4.4.24

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.
@@ -0,0 +1,163 @@
1
+ #! /usr/bin/env node
2
+ /**
3
+ * @file dcp-config-value
4
+ * Utility to query values from dcpConfig. Useful for shell/os-level interfaces for
5
+ * DCP tasks. Based on the scheduler's get-config-value program as of Feb 2025.
6
+ *
7
+ * @author Wes Garland, wes@distributive.network
8
+ * @date Nov 2018, Feb 2025
9
+ */
10
+ 'use strict';
11
+
12
+ const path = require('path')
13
+ const process = require('process')
14
+ const dcpClientOptions = {
15
+ bundleLocation: false,
16
+ dcpConfig: {
17
+ scheduler: {},
18
+ },
19
+ };
20
+
21
+ function usage()
22
+ {
23
+ var progName = path.basename(process.argv[1])
24
+
25
+ console.log(`
26
+ ${progName} - Query values from dcpConfig
27
+ Copyright (c) 2018-2025 Distributive Corp., All Rights Reserved.
28
+
29
+ Usage: ${progName} [--keys] [--to-string] [--json]
30
+ [--programName=string]
31
+ [--scheduler=URL] [--bundle-location[=URL]]
32
+ [--no-remote-config] [--remote-config=URL]
33
+ <--all | path.to.config.variable [path.to.config.variable...]>
34
+ Example: ${progName} scheduler.location.href
35
+ `)
36
+ process.exit(1);
37
+ }
38
+
39
+ if (process.argv.length < 3 || process.argv[2] === '--help')
40
+ usage();
41
+
42
+ function stringModFn(el)
43
+ {
44
+ var ret;
45
+
46
+ if (typeof el === 'undefined')
47
+ ret = '';
48
+ else if (Array.isArray(el))
49
+ ret = el.join('\n');
50
+ else
51
+ ret = el.toString();
52
+
53
+ return new String(ret);
54
+ }
55
+
56
+ function keyModFn(arg)
57
+ {
58
+ return Object.keys(arg);
59
+ }
60
+
61
+ const mods = [];
62
+ function doMods(el)
63
+ {
64
+ for (let i=0; i < mods.length; i++)
65
+ el = mods[i](el);
66
+
67
+ return el;
68
+ }
69
+
70
+ function outFn(el)
71
+ {
72
+ var tty = process.env.FORCE_TTY || process.stdout.isTTY;
73
+
74
+ if (el instanceof String)
75
+ process.stdout.write(el.toString() + '\n', 'utf-8');
76
+ else
77
+ console.log(require('util').inspect(el, {
78
+ colors: tty || process.env.FORCE_COLOR,
79
+ compact: !tty,
80
+ breakLength: tty ? process.stdout.columns || Number(process.env.COLUMNS) || 80 : Infinity,
81
+ depth: Infinity,
82
+ maxArrayLength: Infinity,
83
+ maxStringLength: Infinity,
84
+ }));
85
+ }
86
+
87
+ let allMode = false;
88
+
89
+ for (let i=2; i < process.argv.length; i++)
90
+ {
91
+ while (process.argv[i].match(/^--/))
92
+ {
93
+ const [ option, optarg ] = process.argv[i].replace(/([A-Z])/g, '-$1').toLowerCase().split('=');
94
+ switch(option)
95
+ {
96
+ case '--help':
97
+ usage();
98
+ break;
99
+ case '--all':
100
+ allMode = true
101
+ break;
102
+ case '--keys':
103
+ mods.push(keyModFn);
104
+ break;
105
+ case '--to-string':
106
+ mods.push(stringModFn);
107
+ break;
108
+ case '--json':
109
+ mods.push(JSON.stringify);
110
+ mods.push(stringModFn);
111
+ break;
112
+ case '--programName':
113
+ dcpClientOptions.programName = optarg;
114
+ break;
115
+ case '--scheduler':
116
+ dcpClientOptions.scheduler = optarg;
117
+ break;
118
+ case '--no-remote-config':
119
+ dcpClientOptions.dcpConfig.scheduler.configLocation = false;
120
+ break;
121
+ case '--remote-config':
122
+ dcpClientOptions.dcpConfig.scheduler.configLocation = new URL(optarg);
123
+ break;
124
+ case '--remote-bundle':
125
+ dcpClientOptions.autoUpdate = true;
126
+ if (optarg)
127
+ dcpClientOptions.bundleLocation = optarg;
128
+ break;
129
+ default:
130
+ throw new Error(`unrecognized option ${process.argv[i]}`);
131
+ }
132
+ process.argv.splice(i--, 1);
133
+ }
134
+ }
135
+
136
+ async function show()
137
+ {
138
+ if (allMode)
139
+ outFn(doMods(dcpConfig))
140
+ else
141
+ {
142
+ for (let i=2; i < process.argv.length; i++)
143
+ {
144
+ let entries = process.argv[i].split('.');
145
+ let entry;
146
+ for (entry = dcpConfig; entries.length; entry = entry[entries.shift()])
147
+ {
148
+ if (entry instanceof Promise)
149
+ entry = await entry;
150
+ else if (!entry)
151
+ {
152
+ entry = undefined;
153
+ break;
154
+ }
155
+ }
156
+ if (entry instanceof Promise)
157
+ entry = await entry;
158
+ outFn(doMods(entry));
159
+ }
160
+ }
161
+ }
162
+
163
+ require('..').init(dcpClientOptions).then(show);
package/build/bundle CHANGED
@@ -188,16 +188,7 @@ cd "${myDir}/.."
188
188
  [ "$?" = "0" ] || exit 4
189
189
  [ "${DEBUG}" ] || [ "${DEBUG_BUNDLE}" ] && find "${BUNDLE_TMP}" -ls
190
190
 
191
- # Copy all generated files tracked by the repo into this repo
192
- git ls-tree --full-tree -r --name-only HEAD dist |\
193
- (cd "${BUNDLE_TMP}" && while read file;
194
- do
195
- ls "$file" 2>/dev/null
196
- done) > "${BUNDLE_TMP}/flist"
197
-
198
- [ "$DEBUG_BUNDLE" ] && echo "Files to copy:" && cat "${BUNDLE_TMP}/flist" | sed 's/^/ - /'
199
-
200
- (cd "${BUNDLE_TMP}" && tar -T ./flist -cf -) | tar -xvf - | sed 's/^/ - /'
191
+ (cd "${BUNDLE_TMP}" && tar -cf - ./dist) | tar -xvf - | sed 's/^/ - /'
201
192
  STATUS=$?
202
193
  echo "Done."
203
194
  exit $STATUS
@@ -1,3 +1,3 @@
1
- DCP_SRC="/home/wes/git2/dcp-for-dcp-client"
1
+ DCP_SRC="/home/wes/git-releases/dcp"
2
2
  DCP_INSTALL_FLAGS=""
3
- DCP_BUILD="debug"
3
+ DCP_BUILD="release"
@@ -27,6 +27,8 @@ const base = [
27
27
  'lift-wasm',
28
28
  'lift-webgpu',
29
29
  'worktimes',
30
+ 'url',
31
+ 'polyfills',
30
32
  'access-lists',
31
33
  'bravojs-init',
32
34
  'bravojs/bravo.js',