dcp-worker 3.2.33 → 3.2.34
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/.eslintrc.js +26 -112
- package/.gitlab-ci.yml +85 -4
- package/.trunk/trunk.yaml +29 -0
- package/bin/dcp-worker +0 -9
- package/bin/publish-docs.sh +2 -2
- package/package.json +8 -4
package/.eslintrc.js
CHANGED
|
@@ -1,117 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file .eslintrc.js - ESLint configuration file, following the Core Team's JS Style Guide.
|
|
3
|
+
*
|
|
4
|
+
* @author Wes Garland <wes@distributive.network>
|
|
5
|
+
* @author Bryan Hoang <bryan@distributive.network>
|
|
6
|
+
* @date Mar. 2022, Sep. 2023
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @see {@link https://eslint.org/docs/latest/use/configure/}
|
|
13
|
+
* @type {import('eslint').Linter.Config}
|
|
14
|
+
*/
|
|
1
15
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'extends': 'eslint:recommended',
|
|
9
|
-
'parserOptions': {
|
|
10
|
-
'ecmaVersion': 13
|
|
16
|
+
root: true,
|
|
17
|
+
reportUnusedDisableDirectives: true,
|
|
18
|
+
extends: ['eslint:recommended', '@distributive'],
|
|
19
|
+
env: {
|
|
20
|
+
node: true,
|
|
21
|
+
es2022: true,
|
|
11
22
|
},
|
|
12
23
|
globals: {
|
|
13
|
-
dcpConfig: true
|
|
24
|
+
dcpConfig: true,
|
|
25
|
+
},
|
|
26
|
+
parserOptions: {
|
|
27
|
+
ecmaVersion: 'latest',
|
|
28
|
+
sourceType: 'script',
|
|
14
29
|
},
|
|
15
|
-
|
|
16
|
-
'indent': [
|
|
17
|
-
'warn',
|
|
18
|
-
2,
|
|
19
|
-
{
|
|
20
|
-
'SwitchCase': 1,
|
|
21
|
-
'ignoredNodes': ['CallExpression', 'ForStatement'],
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
'linebreak-style': [
|
|
25
|
-
'error',
|
|
26
|
-
'unix'
|
|
27
|
-
],
|
|
28
|
-
'quotes': [
|
|
29
|
-
'warn',
|
|
30
|
-
'single'
|
|
31
|
-
],
|
|
32
|
-
'func-call-spacing': [
|
|
33
|
-
'off', 'never'
|
|
34
|
-
],
|
|
35
|
-
'no-prototype-builtins': 'off',
|
|
36
|
-
'quotes': ['warn', 'single', 'avoid-escape'],
|
|
37
|
-
'no-unused-vars': ['warn', { 'vars': 'all', 'args': 'none', 'ignoreRestSiblings': false }],
|
|
38
|
-
'no-empty': [ 'warn' ],
|
|
39
|
-
'no-trailing-spaces': [
|
|
40
|
-
'off', {
|
|
41
|
-
skipBlankLines: true,
|
|
42
|
-
ignoreComments: true
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
'no-multi-spaces': [
|
|
46
|
-
'off',
|
|
47
|
-
],
|
|
48
|
-
'prettier/prettier': [
|
|
49
|
-
'off',
|
|
50
|
-
],
|
|
51
|
-
'vars-on-top': [
|
|
52
|
-
'error',
|
|
53
|
-
],
|
|
54
|
-
'no-var': [
|
|
55
|
-
'off',
|
|
56
|
-
],
|
|
57
|
-
'spaced-comment': [
|
|
58
|
-
'warn',
|
|
59
|
-
],
|
|
60
|
-
'brace-style': [
|
|
61
|
-
/* 'warn', 'allman', { 'allowSingleLine': true } */
|
|
62
|
-
'off'
|
|
63
|
-
],
|
|
64
|
-
'no-eval': [
|
|
65
|
-
'error',
|
|
66
|
-
],
|
|
67
|
-
'object-curly-spacing': [
|
|
68
|
-
'warn',
|
|
69
|
-
'always'
|
|
70
|
-
],
|
|
71
|
-
'no-dupe-keys': [ 'warn' ],
|
|
72
|
-
'no-constant-condition': [ 'warn' ],
|
|
73
|
-
'no-extra-boolean-cast': [ 'warn' ],
|
|
74
|
-
'no-sparse-arrays': [ 'off' ],
|
|
75
|
-
'no-inner-declarations': [ 'off' ],
|
|
76
|
-
'no-loss-of-precision': [ 'warn' ],
|
|
77
|
-
'require-atomic-updates': [ 'warn' ], /* watch for false positives, remove if (m)any */
|
|
78
|
-
'eqeqeq': [ 'warn', 'always' ],
|
|
79
|
-
'no-dupe-keys': [ 'warn' ],
|
|
80
|
-
'no-dupe-class-members': [ 'warn' ],
|
|
81
|
-
'no-fallthrough': [ 'warn', { commentPattern: 'fall[ -]*through' }],
|
|
82
|
-
'no-invalid-this': [ 'error' ],
|
|
83
|
-
'no-return-assign': [ 'error' ],
|
|
84
|
-
'no-return-await': [ 'warn' ],
|
|
85
|
-
'no-unused-expressions': [ 'warn', { allowShortCircuit: true, allowTernary: true } ],
|
|
86
|
-
'prefer-promise-reject-errors': [ 'error' ],
|
|
87
|
-
'no-throw-literal': [ 'error' ],
|
|
88
|
-
'semi': [ 'off', { omitLastInOneLineBlock: true }], /* does not work right with exports.X = function allmanStyle */
|
|
89
|
-
'semi-style': [ 'warn', 'last' ],
|
|
90
|
-
'semi-spacing': [ 'error', {'before': false, 'after': true}],
|
|
91
|
-
'no-extra-semi': [ 'warn' ],
|
|
92
|
-
'no-tabs': [ 'error' ],
|
|
93
|
-
'symbol-description': [ 'error' ],
|
|
94
|
-
'operator-linebreak': [ 'warn', 'before' ],
|
|
95
|
-
'new-cap': [ 'warn' ],
|
|
96
|
-
'consistent-this': [ 'error', 'that' ],
|
|
97
|
-
'no-use-before-define': [ 'error', { functions: false, classes: false } ],
|
|
98
|
-
'no-shadow': [ 'error' ],
|
|
99
|
-
'no-label-var': [ 'error' ],
|
|
100
|
-
'radix': [ 'error' ],
|
|
101
|
-
'no-self-compare': [ 'error' ],
|
|
102
|
-
'require-await': [ 'error' ],
|
|
103
|
-
'require-yield': [ 'error' ],
|
|
104
|
-
'no-promise-executor-return': [ 'off' ],
|
|
105
|
-
'no-template-curly-in-string': [ 'warn' ],
|
|
106
|
-
'no-unmodified-loop-condition': [ 'warn' ],
|
|
107
|
-
'no-unused-private-class-members': [ 'warn' ],
|
|
108
|
-
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
|
|
109
|
-
"no-implicit-coercion": [1, {
|
|
110
|
-
disallowTemplateShorthand: false,
|
|
111
|
-
boolean: true,
|
|
112
|
-
number: true,
|
|
113
|
-
string: true,
|
|
114
|
-
allow: ['!!'] /* really only want to allow if(x) and if(!x) but not if(!!x) */
|
|
115
|
-
}],
|
|
116
|
-
}
|
|
30
|
+
rules: {},
|
|
117
31
|
};
|
package/.gitlab-ci.yml
CHANGED
|
@@ -1,17 +1,59 @@
|
|
|
1
1
|
# @file .gitlab-ci.yml - GitLab CI configuration file.
|
|
2
2
|
# @author Eddie Roosenmallen <eddie@distributive.network>
|
|
3
|
+
# @author Bryan Hoang <bryan@distributive.network>
|
|
3
4
|
# @date September 2022
|
|
4
5
|
|
|
6
|
+
variables:
|
|
7
|
+
# Can't cache `~/.npm/`.
|
|
8
|
+
npm_config_cache: '.cache/npm/'
|
|
9
|
+
npm_config_prefer_offline: 'true'
|
|
10
|
+
npm_config_fund: 'false'
|
|
11
|
+
|
|
5
12
|
default:
|
|
6
13
|
# Use in-house GitLab runners.
|
|
7
14
|
tags:
|
|
8
15
|
- dcp-core
|
|
9
16
|
- linux
|
|
17
|
+
image: node:lts
|
|
18
|
+
before_script:
|
|
19
|
+
- npm add --global npm@latest
|
|
20
|
+
# Access private deps. e.g., `dcp-client` from GitLab.
|
|
21
|
+
- git config --global
|
|
22
|
+
url."${CI_SERVER_PROTOCOL}://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}".insteadOf
|
|
23
|
+
"${CI_SERVER_URL}"
|
|
24
|
+
|
|
25
|
+
workflow:
|
|
26
|
+
rules:
|
|
27
|
+
# Only run branch pipelines for `develop`, or merge request pipelines.
|
|
28
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
29
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
10
30
|
|
|
11
31
|
stages:
|
|
12
32
|
- build
|
|
33
|
+
- test
|
|
13
34
|
- deploy
|
|
14
35
|
|
|
36
|
+
# Installs npm dependencies to be cached for subsequent jobs. Also checks that
|
|
37
|
+
# the lock file is synced with the manifest file.
|
|
38
|
+
build:
|
|
39
|
+
stage: build
|
|
40
|
+
script:
|
|
41
|
+
- npm clean-install
|
|
42
|
+
cache:
|
|
43
|
+
- key:
|
|
44
|
+
prefix: $CI_JOB_NAME_SLUG
|
|
45
|
+
files:
|
|
46
|
+
- package-lock.json
|
|
47
|
+
paths:
|
|
48
|
+
- $npm_config_cache
|
|
49
|
+
- key:
|
|
50
|
+
prefix: node-modules
|
|
51
|
+
files:
|
|
52
|
+
- package-lock.json
|
|
53
|
+
paths:
|
|
54
|
+
- node_modules/
|
|
55
|
+
policy: push
|
|
56
|
+
|
|
15
57
|
tidelift:
|
|
16
58
|
stage: build
|
|
17
59
|
rules:
|
|
@@ -20,6 +62,9 @@ tidelift:
|
|
|
20
62
|
# This should be kept in a GitLab Variable. Read more:
|
|
21
63
|
# https://docs.gitlab.com/ee/ci/variables/#create-a-custom-variable-in-the-ui
|
|
22
64
|
TIDELIFT_API_KEY: $TIDELIFT_API_KEY
|
|
65
|
+
inherit:
|
|
66
|
+
default:
|
|
67
|
+
- tags
|
|
23
68
|
# The CLI only requires `glibc`.
|
|
24
69
|
image: frolvlad/alpine-glibc
|
|
25
70
|
before_script:
|
|
@@ -32,9 +77,39 @@ tidelift:
|
|
|
32
77
|
- echo "Running alignment and saving to Tidelift"
|
|
33
78
|
- ./tidelift alignment save --wait
|
|
34
79
|
allow_failure: true
|
|
35
|
-
|
|
80
|
+
|
|
81
|
+
# Run `trunk check` on the project to hightlight newly introduced lint issues
|
|
82
|
+
# when compared to the target branch.
|
|
83
|
+
check:
|
|
84
|
+
variables:
|
|
85
|
+
# Can't cache `~/.cache/trunk/`.
|
|
86
|
+
TRUNK_CACHE: ${CI_PROJECT_DIR}/.cache/trunk/
|
|
87
|
+
stage: test
|
|
88
|
+
script:
|
|
89
|
+
- UPSTREAM_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-$CI_DEFAULT_BRANCH}
|
|
90
|
+
# Fetch the branch so that `trunk` has the proper information needed to
|
|
91
|
+
# determine the upstream changes to compare lint results against.
|
|
92
|
+
- git fetch origin $UPSTREAM_BRANCH
|
|
93
|
+
- npm run check -- --ci --upstream origin/$UPSTREAM_BRANCH
|
|
94
|
+
cache:
|
|
95
|
+
- key:
|
|
96
|
+
prefix: $CI_JOB_NAME_SLUG
|
|
97
|
+
files:
|
|
98
|
+
- .trunk/trunk.yaml
|
|
99
|
+
paths:
|
|
100
|
+
- $TRUNK_CACHE
|
|
101
|
+
- key:
|
|
102
|
+
prefix: node-modules
|
|
103
|
+
files:
|
|
104
|
+
- package-lock.json
|
|
105
|
+
paths:
|
|
106
|
+
- node_modules/
|
|
107
|
+
policy: pull
|
|
36
108
|
|
|
37
109
|
publish_docs:
|
|
110
|
+
stage: deploy
|
|
111
|
+
needs:
|
|
112
|
+
- build
|
|
38
113
|
rules:
|
|
39
114
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
|
40
115
|
changes:
|
|
@@ -53,8 +128,14 @@ publish_docs:
|
|
|
53
128
|
ENTITY_NAMESPACE: 'default'
|
|
54
129
|
stage: deploy
|
|
55
130
|
needs: []
|
|
56
|
-
image: registry.gitlab.com/distributed-compute-protocol/
|
|
131
|
+
image: registry.gitlab.com/distributed-compute-protocol/backstage-ci-image:latest
|
|
57
132
|
script:
|
|
58
|
-
- npm clean-install
|
|
59
|
-
- python3 -m pip install mkdocs mkdocs-techdocs-core==1.* mkdocs-same-dir
|
|
60
133
|
- bin/publish-docs.sh
|
|
134
|
+
cache:
|
|
135
|
+
- key:
|
|
136
|
+
prefix: node-modules
|
|
137
|
+
files:
|
|
138
|
+
- package-lock.json
|
|
139
|
+
paths:
|
|
140
|
+
- node_modules/
|
|
141
|
+
policy: pull
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @file trunk.yaml - This file controls the behavior of Trunk:
|
|
2
|
+
# https://docs.trunk.io/cli
|
|
3
|
+
#
|
|
4
|
+
# To learn more about the format of this file, see
|
|
5
|
+
# https://docs.trunk.io/reference/trunk-yaml
|
|
6
|
+
#
|
|
7
|
+
# Initially autogenerated by `npm exec -- trunk init --lock`
|
|
8
|
+
#
|
|
9
|
+
# @author Bryan Hoang <bryan@distributive.network>
|
|
10
|
+
# @date Oct. 2023
|
|
11
|
+
|
|
12
|
+
version: 0.1
|
|
13
|
+
cli:
|
|
14
|
+
version: 1.17.1
|
|
15
|
+
sha256:
|
|
16
|
+
darwin_arm64: 707359316ea1f972cbad8a77cb076449155c19d42933cecfe5b70cfefc38d085
|
|
17
|
+
darwin_x86_64: d5e5928a24a4eb9931eaed1d5899be12ab2556f17ce5cd89ef73fa42b2293c88
|
|
18
|
+
linux_x86_64: f2bbf8de19e7961390633fe23599b8890f617a6e8b2563ac6741a0514e7d16e6
|
|
19
|
+
plugins:
|
|
20
|
+
sources:
|
|
21
|
+
- id: trunk
|
|
22
|
+
ref: v1.2.6
|
|
23
|
+
uri: https://github.com/trunk-io/plugins
|
|
24
|
+
runtimes:
|
|
25
|
+
enabled:
|
|
26
|
+
- node@18.12.1
|
|
27
|
+
lint:
|
|
28
|
+
enabled:
|
|
29
|
+
- eslint@8.52.0
|
package/bin/dcp-worker
CHANGED
|
@@ -155,10 +155,6 @@ function parseCliArgs()
|
|
|
155
155
|
type: 'number',
|
|
156
156
|
group: 'Output options',
|
|
157
157
|
},
|
|
158
|
-
eventDebug: {
|
|
159
|
-
hidden: true,
|
|
160
|
-
describe: 'If set, dump all sandbox and worker events',
|
|
161
|
-
},
|
|
162
158
|
|
|
163
159
|
showConfig: {
|
|
164
160
|
hide: false,
|
|
@@ -402,9 +398,6 @@ async function main()
|
|
|
402
398
|
else
|
|
403
399
|
worker.on('end', () => setTimeout(processExit, getCleanupTimeoutMs()).unref());
|
|
404
400
|
|
|
405
|
-
if (cliArgs.eventDebug)
|
|
406
|
-
worker.enableDebugEvents = true;
|
|
407
|
-
|
|
408
401
|
if (dcpWorkerOptions.publicGroupFallback)
|
|
409
402
|
{
|
|
410
403
|
if (dcpWorkerOptions.leavePublicGroup)
|
|
@@ -460,8 +453,6 @@ async function main()
|
|
|
460
453
|
introBanner += ` . Target core density: ${JSON.stringify(dcpWorkerOptions.defaultCoreDensity)}\n`;
|
|
461
454
|
if (cliArgs.verbose)
|
|
462
455
|
introBanner += ` + Verbosity level: ${cliArgs.verbose}` + '\n';
|
|
463
|
-
if (cliArgs.eventDebug)
|
|
464
|
-
introBanner += ' + Event debug on' + '\n';
|
|
465
456
|
if (telnetd.hasOwnProperty('port'))
|
|
466
457
|
introBanner += ` ! telnetd listening on port ${telnetd.port}\n`;
|
|
467
458
|
|
package/bin/publish-docs.sh
CHANGED
|
@@ -67,8 +67,8 @@ npx techdocs-cli publish \
|
|
|
67
67
|
--publisher-type awsS3 \
|
|
68
68
|
--storage-name "$TECHDOCS_S3_BUCKET_NAME" \
|
|
69
69
|
--entity "$ENTITY_NAMESPACE"/"$ENTITY_KIND"/"$ENTITY_NAME" \
|
|
70
|
-
--directory "$
|
|
70
|
+
--directory "$DOCS_DIR"/site
|
|
71
71
|
|
|
72
|
-
rm -r "$
|
|
72
|
+
rm -r "$DOCS_DIR"/site
|
|
73
73
|
|
|
74
74
|
echo "View generated component: https://backstage.overwatch.distributive.network/docs/default/component/$ENTITY_NAME"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcp-worker",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.34",
|
|
4
4
|
"description": "JavaScript portion of DCP Workers for Node.js",
|
|
5
5
|
"main": "bin/dcp-worker",
|
|
6
6
|
"keywords": [
|
|
@@ -26,9 +26,11 @@
|
|
|
26
26
|
"etc": "etc"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
|
+
"check": "trunk check",
|
|
29
30
|
"start": "node bin/dcp-worker start",
|
|
30
31
|
"start-evaluator": "node bin/dcp-evaluator-start",
|
|
31
32
|
"hook": "PATH=npm-hooks:$PATH &&",
|
|
33
|
+
"lint": "eslint --cache --cache-strategy=content --cache-location=.cache/eslint/ --ignore-path=.gitignore --ext=js .",
|
|
32
34
|
"test": "peter tests",
|
|
33
35
|
"prepack": "node npm-hooks/prepack",
|
|
34
36
|
"postpublish": "npm-hooks/postpublish",
|
|
@@ -38,7 +40,7 @@
|
|
|
38
40
|
"blessed": "^0.1.81",
|
|
39
41
|
"blessed-contrib": "^4.11.0",
|
|
40
42
|
"chalk": "^4.1.0",
|
|
41
|
-
"dcp-client": "4.3.
|
|
43
|
+
"dcp-client": "4.3.4",
|
|
42
44
|
"kvin": "^1.2.7",
|
|
43
45
|
"posix-getopt": "^1.2.1",
|
|
44
46
|
"semver": "^7.3.8",
|
|
@@ -49,9 +51,11 @@
|
|
|
49
51
|
"telnet-console": "^1.0.4"
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
54
|
+
"@distributive/eslint-plugin": "1.0.2",
|
|
52
55
|
"@kingsds/eslint-config": "^1.0.1",
|
|
53
|
-
"@
|
|
54
|
-
"eslint": ">=8"
|
|
56
|
+
"@trunkio/launcher": "1.2.7",
|
|
57
|
+
"eslint": ">=8",
|
|
58
|
+
"eslint-plugin-jsdoc": "46.8.2"
|
|
55
59
|
},
|
|
56
60
|
"peerDependencies": {
|
|
57
61
|
"node-eventlog": "https://gitpkg.now.sh/Distributive-Network/node-eventlog/package?dcp/0.0.1"
|