node-red-contrib-s7-rust 0.0.0-stage → 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.
- package/CHANGELOG.md +30 -0
- package/COPYING +674 -0
- package/LICENSE +165 -0
- package/NOTICE +22 -0
- package/README.md +309 -2
- package/bin/linux-x64-gnu/s7napi.node +0 -0
- package/bin/linux-x64-musl/s7napi.node +0 -0
- package/examples/01 - Read and write (S7comm).json +180 -0
- package/examples/02 - Watch with conditional rate.json +71 -0
- package/examples/03 - S7CommPlus symbolic access.json +153 -0
- package/examples/04 - PLC diagnostics.json +180 -0
- package/lib/common.js +78 -0
- package/lib/napi-bridge.js +182 -0
- package/nodes/icons/s7rs-plc.svg +14 -0
- package/nodes/locales/en-US/s7rs-endpoint.html +24 -0
- package/nodes/locales/en-US/s7rs-endpoint.json +51 -0
- package/nodes/locales/en-US/s7rs-info.html +38 -0
- package/nodes/locales/en-US/s7rs-info.json +18 -0
- package/nodes/locales/en-US/s7rs-read.html +33 -0
- package/nodes/locales/en-US/s7rs-read.json +27 -0
- package/nodes/locales/en-US/s7rs-watch.html +24 -0
- package/nodes/locales/en-US/s7rs-watch.json +32 -0
- package/nodes/locales/en-US/s7rs-write.html +21 -0
- package/nodes/locales/en-US/s7rs-write.json +17 -0
- package/nodes/s7rs-endpoint.html +150 -0
- package/nodes/s7rs-endpoint.js +122 -0
- package/nodes/s7rs-info.html +72 -0
- package/nodes/s7rs-info.js +38 -0
- package/nodes/s7rs-read.html +50 -0
- package/nodes/s7rs-read.js +46 -0
- package/nodes/s7rs-watch.html +69 -0
- package/nodes/s7rs-watch.js +73 -0
- package/nodes/s7rs-write.html +34 -0
- package/nodes/s7rs-write.js +38 -0
- package/package.json +77 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType('s7rs-read', {
|
|
3
|
+
category: 'network',
|
|
4
|
+
color: '#3FADB5',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: { value: '' },
|
|
7
|
+
endpoint: { value: '', type: 's7rs-endpoint', required: true },
|
|
8
|
+
tags: { value: '' },
|
|
9
|
+
output: { value: 'auto' },
|
|
10
|
+
},
|
|
11
|
+
inputs: 1,
|
|
12
|
+
outputs: 1,
|
|
13
|
+
icon: 'font-awesome/fa-download',
|
|
14
|
+
paletteLabel: 's7 read',
|
|
15
|
+
label: function () {
|
|
16
|
+
const n = (this.tags || '').split('\n').filter((s) => s.trim()).length;
|
|
17
|
+
return this.name || (n === 1 ? this.tags.trim() : n ? `s7 read (${n})` : 's7 read');
|
|
18
|
+
},
|
|
19
|
+
inputLabels: function () {
|
|
20
|
+
return this._('s7rs-read.portLabel.in');
|
|
21
|
+
},
|
|
22
|
+
outputLabels: function () {
|
|
23
|
+
return this._('s7rs-read.portLabel.out');
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script type="text/html" data-template-name="s7rs-read">
|
|
29
|
+
<div class="form-row">
|
|
30
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="s7rs-read.label.name"></span></label>
|
|
31
|
+
<input type="text" id="node-input-name" />
|
|
32
|
+
</div>
|
|
33
|
+
<div class="form-row">
|
|
34
|
+
<label for="node-input-endpoint"><i class="fa fa-plug"></i> <span data-i18n="s7rs-read.label.endpoint"></span></label>
|
|
35
|
+
<input type="text" id="node-input-endpoint" />
|
|
36
|
+
</div>
|
|
37
|
+
<div class="form-row">
|
|
38
|
+
<label for="node-input-tags"><i class="fa fa-list"></i> <span data-i18n="s7rs-read.label.tags"></span></label>
|
|
39
|
+
<textarea id="node-input-tags" rows="6" style="width: 70%; font-family: monospace"
|
|
40
|
+
data-i18n="[placeholder]s7rs-read.placeholder.tags"></textarea>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="form-row">
|
|
43
|
+
<label for="node-input-output" data-i18n="s7rs-read.label.output"></label>
|
|
44
|
+
<select id="node-input-output">
|
|
45
|
+
<option value="auto" data-i18n="s7rs-read.output.auto"></option>
|
|
46
|
+
<option value="object" data-i18n="s7rs-read.output.object"></option>
|
|
47
|
+
<option value="array" data-i18n="s7rs-read.output.array"></option>
|
|
48
|
+
</select>
|
|
49
|
+
</div>
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// s7rs-read: reads S7 tags when a message arrives.
|
|
3
|
+
|
|
4
|
+
const { text, parseTags, elapsedMs, getEndpoint } = require('../lib/common');
|
|
5
|
+
|
|
6
|
+
module.exports = function (RED) {
|
|
7
|
+
function S7rsRead(config) {
|
|
8
|
+
RED.nodes.createNode(this, config);
|
|
9
|
+
const node = this;
|
|
10
|
+
const ep = getEndpoint(RED, node, config);
|
|
11
|
+
const cfgTags = parseTags(config.tags);
|
|
12
|
+
const output = config.output || 'auto'; // auto | object | array
|
|
13
|
+
|
|
14
|
+
node.on('input', async (msg, send, done) => {
|
|
15
|
+
if (!ep) return done(new Error(text(RED, 's7rs-read.errors.noEndpoint')));
|
|
16
|
+
let tags = cfgTags;
|
|
17
|
+
if (!tags.length) {
|
|
18
|
+
if (Array.isArray(msg.tags)) tags = msg.tags.map(String);
|
|
19
|
+
else if (Array.isArray(msg.payload)) tags = msg.payload.map(String);
|
|
20
|
+
else if (typeof msg.topic === 'string' && msg.topic) tags = [msg.topic];
|
|
21
|
+
}
|
|
22
|
+
if (!tags.length) return done(new Error(text(RED, 's7rs-read.errors.noTags')));
|
|
23
|
+
try {
|
|
24
|
+
await ep.ready;
|
|
25
|
+
const t0 = process.hrtime.bigint();
|
|
26
|
+
const { values } = await ep.bridge.read(ep.id, tags);
|
|
27
|
+
msg.s7 = { values, ms: elapsedMs(t0) };
|
|
28
|
+
if (output === 'array') msg.payload = values.map((v) => v.value ?? null);
|
|
29
|
+
else if (output === 'auto' && tags.length === 1) {
|
|
30
|
+
msg.payload = values[0].value ?? null;
|
|
31
|
+
msg.topic = msg.topic || tags[0];
|
|
32
|
+
} else msg.payload = Object.fromEntries(values.map((v) => [v.tag, v.value ?? null]));
|
|
33
|
+
const bad = values.filter((v) => v.quality !== 'good');
|
|
34
|
+
if (bad.length) {
|
|
35
|
+
msg.s7.errors = Object.fromEntries(bad.map((v) => [v.tag, v.error]));
|
|
36
|
+
node.warn(text(RED, 's7rs-read.errors.badTags', { tags: bad.map((v) => `${v.tag}: ${v.error}`).join('; ') }));
|
|
37
|
+
}
|
|
38
|
+
send(msg);
|
|
39
|
+
done();
|
|
40
|
+
} catch (err) {
|
|
41
|
+
done(err);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
RED.nodes.registerType('s7rs-read', S7rsRead);
|
|
46
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType('s7rs-watch', {
|
|
3
|
+
category: 'network',
|
|
4
|
+
color: '#3FADB5',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: { value: '' },
|
|
7
|
+
endpoint: { value: '', type: 's7rs-endpoint', required: true },
|
|
8
|
+
tags: { value: '', required: true },
|
|
9
|
+
interval: { value: 1000, required: true, validate: RED.validators.number() },
|
|
10
|
+
onChange: { value: true },
|
|
11
|
+
output: { value: 'each' },
|
|
12
|
+
topic: { value: '' },
|
|
13
|
+
condTag: { value: '' },
|
|
14
|
+
condInterval: { value: 100, validate: RED.validators.number(true) },
|
|
15
|
+
},
|
|
16
|
+
inputs: 0,
|
|
17
|
+
outputs: 1,
|
|
18
|
+
icon: 'font-awesome/fa-eye',
|
|
19
|
+
paletteLabel: 's7 watch',
|
|
20
|
+
label: function () {
|
|
21
|
+
const n = (this.tags || '').split('\n').filter((s) => s.trim()).length;
|
|
22
|
+
return this.name || `s7 watch (${n} @ ${this.interval} ms)`;
|
|
23
|
+
},
|
|
24
|
+
outputLabels: function () {
|
|
25
|
+
return this._('s7rs-watch.portLabel.out');
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<script type="text/html" data-template-name="s7rs-watch">
|
|
31
|
+
<div class="form-row">
|
|
32
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="s7rs-watch.label.name"></span></label>
|
|
33
|
+
<input type="text" id="node-input-name" />
|
|
34
|
+
</div>
|
|
35
|
+
<div class="form-row">
|
|
36
|
+
<label for="node-input-endpoint"><i class="fa fa-plug"></i> <span data-i18n="s7rs-watch.label.endpoint"></span></label>
|
|
37
|
+
<input type="text" id="node-input-endpoint" />
|
|
38
|
+
</div>
|
|
39
|
+
<div class="form-row">
|
|
40
|
+
<label for="node-input-tags"><i class="fa fa-list"></i> <span data-i18n="s7rs-watch.label.tags"></span></label>
|
|
41
|
+
<textarea id="node-input-tags" rows="8" style="width: 70%; font-family: monospace"
|
|
42
|
+
data-i18n="[placeholder]s7rs-watch.placeholder.tags"></textarea>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="form-row">
|
|
45
|
+
<label for="node-input-interval"><i class="fa fa-clock-o"></i> <span data-i18n="s7rs-watch.label.interval"></span></label>
|
|
46
|
+
<input type="text" id="node-input-interval" style="width: 80px" />
|
|
47
|
+
</div>
|
|
48
|
+
<div class="form-row">
|
|
49
|
+
<label for="node-input-condTag"><i class="fa fa-bolt"></i> <span data-i18n="s7rs-watch.label.condTag"></span></label>
|
|
50
|
+
<input type="text" id="node-input-condTag" data-i18n="[placeholder]s7rs-watch.placeholder.condTag" style="width: 45%; font-family: monospace" />
|
|
51
|
+
<input type="text" id="node-input-condInterval" style="width: 60px" /> ms
|
|
52
|
+
</div>
|
|
53
|
+
<div class="form-row">
|
|
54
|
+
<label for="node-input-onChange"> </label>
|
|
55
|
+
<input type="checkbox" id="node-input-onChange" style="width: auto; display: inline-block" />
|
|
56
|
+
<span data-i18n="s7rs-watch.label.onChange"></span>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="form-row">
|
|
59
|
+
<label for="node-input-output" data-i18n="s7rs-watch.label.output"></label>
|
|
60
|
+
<select id="node-input-output">
|
|
61
|
+
<option value="each" data-i18n="s7rs-watch.output.each"></option>
|
|
62
|
+
<option value="object" data-i18n="s7rs-watch.output.object"></option>
|
|
63
|
+
</select>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="form-row">
|
|
66
|
+
<label for="node-input-topic" data-i18n="s7rs-watch.label.topic"></label>
|
|
67
|
+
<input type="text" id="node-input-topic" data-i18n="[placeholder]s7rs-watch.placeholder.topic" />
|
|
68
|
+
</div>
|
|
69
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// s7rs-watch: a Rust thread reads the tags at a fixed (or conditional) rate and
|
|
3
|
+
// the node sends only the values that changed.
|
|
4
|
+
|
|
5
|
+
const { text, parseTags, getEndpoint } = require('../lib/common');
|
|
6
|
+
|
|
7
|
+
module.exports = function (RED) {
|
|
8
|
+
function S7rsWatch(config) {
|
|
9
|
+
RED.nodes.createNode(this, config);
|
|
10
|
+
const node = this;
|
|
11
|
+
const ep = getEndpoint(RED, node, config);
|
|
12
|
+
const tags = parseTags(config.tags);
|
|
13
|
+
const mode = config.output || 'each'; // each | object
|
|
14
|
+
const last = {};
|
|
15
|
+
const quality = {};
|
|
16
|
+
if (!ep) return;
|
|
17
|
+
if (!tags.length) {
|
|
18
|
+
node.status({ fill: 'red', shape: 'ring', text: text(RED, 's7rs-watch.status.noTags') });
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const onData = (ev) => {
|
|
23
|
+
if (ev.sub !== node.id) return;
|
|
24
|
+
if (mode === 'each') {
|
|
25
|
+
for (const v of ev.values) {
|
|
26
|
+
const m = { topic: v.tag, payload: v.value ?? null, quality: v.quality, ts: ev.ts };
|
|
27
|
+
if (v.error) m.error = v.error;
|
|
28
|
+
node.send(m);
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (const v of ev.values) {
|
|
33
|
+
last[v.tag] = v.value ?? null;
|
|
34
|
+
quality[v.tag] = v.quality;
|
|
35
|
+
}
|
|
36
|
+
node.send({
|
|
37
|
+
topic: config.topic || config.name || 's7',
|
|
38
|
+
payload: { ...last },
|
|
39
|
+
changed: ev.values.map((v) => v.tag),
|
|
40
|
+
quality: { ...quality },
|
|
41
|
+
s7: { values: ev.values, ms: ev.ms },
|
|
42
|
+
ts: ev.ts,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
ep.bridge.on('data', onData);
|
|
46
|
+
|
|
47
|
+
const params = {
|
|
48
|
+
conn: ep.id,
|
|
49
|
+
sub: node.id,
|
|
50
|
+
tags,
|
|
51
|
+
intervalMs: Number(config.interval) || 1000,
|
|
52
|
+
onChange: config.onChange !== false,
|
|
53
|
+
// conditional rate: while condTag is true (or non-zero), read every condInterval ms
|
|
54
|
+
condTag: String(config.condTag || '').trim() || undefined,
|
|
55
|
+
condIntervalMs: Number(config.condInterval) || 100,
|
|
56
|
+
};
|
|
57
|
+
ep.ready
|
|
58
|
+
.then(() => ep.bridge.subscribe(params))
|
|
59
|
+
.then((res) => {
|
|
60
|
+
for (const b of res.invalid || []) node.warn(`${b.tag}: ${b.error}`);
|
|
61
|
+
})
|
|
62
|
+
.catch((err) => node.error(text(RED, 's7rs-watch.errors.subscribe', { error: err.message })));
|
|
63
|
+
|
|
64
|
+
node.on('close', (removed, done) => {
|
|
65
|
+
ep.bridge.off('data', onData);
|
|
66
|
+
ep.bridge
|
|
67
|
+
.unsubscribe(node.id)
|
|
68
|
+
.catch(() => {})
|
|
69
|
+
.finally(() => done());
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
RED.nodes.registerType('s7rs-watch', S7rsWatch);
|
|
73
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType('s7rs-write', {
|
|
3
|
+
category: 'network',
|
|
4
|
+
color: '#3FADB5',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: { value: '' },
|
|
7
|
+
endpoint: { value: '', type: 's7rs-endpoint', required: true },
|
|
8
|
+
tag: { value: '' },
|
|
9
|
+
},
|
|
10
|
+
inputs: 1,
|
|
11
|
+
outputs: 1,
|
|
12
|
+
icon: 'font-awesome/fa-upload',
|
|
13
|
+
align: 'right',
|
|
14
|
+
paletteLabel: 's7 write',
|
|
15
|
+
label: function () {
|
|
16
|
+
return this.name || this.tag || 's7 write';
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script type="text/html" data-template-name="s7rs-write">
|
|
22
|
+
<div class="form-row">
|
|
23
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="s7rs-write.label.name"></span></label>
|
|
24
|
+
<input type="text" id="node-input-name" />
|
|
25
|
+
</div>
|
|
26
|
+
<div class="form-row">
|
|
27
|
+
<label for="node-input-endpoint"><i class="fa fa-plug"></i> <span data-i18n="s7rs-write.label.endpoint"></span></label>
|
|
28
|
+
<input type="text" id="node-input-endpoint" />
|
|
29
|
+
</div>
|
|
30
|
+
<div class="form-row">
|
|
31
|
+
<label for="node-input-tag"><i class="fa fa-crosshairs"></i> <span data-i18n="s7rs-write.label.tag"></span></label>
|
|
32
|
+
<input type="text" id="node-input-tag" data-i18n="[placeholder]s7rs-write.placeholder.tag" style="font-family: monospace" />
|
|
33
|
+
</div>
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// s7rs-write: writes S7 tags (one tag, or {tag: value} in one request).
|
|
3
|
+
|
|
4
|
+
const { text, toWireValue, isPlainObject, elapsedMs, getEndpoint } = require('../lib/common');
|
|
5
|
+
|
|
6
|
+
module.exports = function (RED) {
|
|
7
|
+
function S7rsWrite(config) {
|
|
8
|
+
RED.nodes.createNode(this, config);
|
|
9
|
+
const node = this;
|
|
10
|
+
const ep = getEndpoint(RED, node, config);
|
|
11
|
+
const cfgTag = String(config.tag || '').trim();
|
|
12
|
+
|
|
13
|
+
node.on('input', async (msg, send, done) => {
|
|
14
|
+
if (!ep) return done(new Error(text(RED, 's7rs-write.errors.noEndpoint')));
|
|
15
|
+
const p = msg.payload;
|
|
16
|
+
let items;
|
|
17
|
+
if (cfgTag) items = [{ tag: cfgTag, value: toWireValue(p) }];
|
|
18
|
+
else if (isPlainObject(p)) items = Object.entries(p).map(([tag, value]) => ({ tag, value: toWireValue(value) }));
|
|
19
|
+
else if (typeof msg.topic === 'string' && msg.topic) items = [{ tag: msg.topic, value: toWireValue(p) }];
|
|
20
|
+
if (!items || !items.length) return done(new Error(text(RED, 's7rs-write.errors.nothing')));
|
|
21
|
+
try {
|
|
22
|
+
await ep.ready;
|
|
23
|
+
const t0 = process.hrtime.bigint();
|
|
24
|
+
const { results } = await ep.bridge.write(ep.id, items);
|
|
25
|
+
msg.s7 = { results, ms: elapsedMs(t0) };
|
|
26
|
+
const bad = results.filter((r) => r.error);
|
|
27
|
+
if (bad.length) {
|
|
28
|
+
return done(new Error(text(RED, 's7rs-write.errors.failed', { tags: bad.map((r) => (r.error.startsWith(`${r.tag}: `) ? r.error : `${r.tag}: ${r.error}`)).join('; ') })));
|
|
29
|
+
}
|
|
30
|
+
send(msg);
|
|
31
|
+
done();
|
|
32
|
+
} catch (err) {
|
|
33
|
+
done(err);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
RED.nodes.registerType('s7rs-write', S7rsWrite);
|
|
38
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-s7-rust",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Siemens S7 nodes for Node-RED: S7comm and S7CommPlus (S7-1200/1500 symbolic access) clients written in Rust, running in-process (Node-API). Linux x64.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"node-red",
|
|
7
|
+
"siemens",
|
|
8
|
+
"s7",
|
|
9
|
+
"s7comm",
|
|
10
|
+
"s7commplus",
|
|
11
|
+
"s7-1200",
|
|
12
|
+
"s7-1500",
|
|
13
|
+
"s7-300",
|
|
14
|
+
"logo",
|
|
15
|
+
"plc",
|
|
16
|
+
"industrial",
|
|
17
|
+
"iiot",
|
|
18
|
+
"rust",
|
|
19
|
+
"napi"
|
|
20
|
+
],
|
|
21
|
+
"homepage": "https://github.com/oriolrius/node-red-contrib-s7-rust#readme",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/oriolrius/node-red-contrib-s7-rust/issues"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/oriolrius/node-red-contrib-s7-rust.git"
|
|
28
|
+
},
|
|
29
|
+
"license": "LGPL-3.0-only",
|
|
30
|
+
"author": "Oriol Rius",
|
|
31
|
+
"main": "lib/napi-bridge.js",
|
|
32
|
+
"files": [
|
|
33
|
+
"lib/",
|
|
34
|
+
"nodes/",
|
|
35
|
+
"bin/linux-x64-gnu/s7napi.node",
|
|
36
|
+
"bin/linux-x64-musl/s7napi.node",
|
|
37
|
+
"examples/",
|
|
38
|
+
"NOTICE",
|
|
39
|
+
"COPYING",
|
|
40
|
+
"CHANGELOG.md"
|
|
41
|
+
],
|
|
42
|
+
"os": [
|
|
43
|
+
"linux"
|
|
44
|
+
],
|
|
45
|
+
"cpu": [
|
|
46
|
+
"x64"
|
|
47
|
+
],
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18"
|
|
50
|
+
},
|
|
51
|
+
"node-red": {
|
|
52
|
+
"version": ">=4.0.0",
|
|
53
|
+
"nodes": {
|
|
54
|
+
"s7rs-endpoint": "nodes/s7rs-endpoint.js",
|
|
55
|
+
"s7rs-read": "nodes/s7rs-read.js",
|
|
56
|
+
"s7rs-write": "nodes/s7rs-write.js",
|
|
57
|
+
"s7rs-watch": "nodes/s7rs-watch.js",
|
|
58
|
+
"s7rs-info": "nodes/s7rs-info.js"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "sh scripts/build.sh dev",
|
|
63
|
+
"build:release": "sh scripts/build.sh release",
|
|
64
|
+
"test": "npm run test:rust && npm run test:node",
|
|
65
|
+
"test:rust": "cargo test --workspace --features s7plus/fake",
|
|
66
|
+
"test:node": "sh scripts/build.sh test-addon && node --test test/*.test.js",
|
|
67
|
+
"lint": "cargo fmt --all --check && cargo clippy --workspace --all-targets --features s7plus/fake,s7/fakecpu,s7napi/fake -- -D warnings",
|
|
68
|
+
"validate": "npx --yes node-red-dev@latest validate",
|
|
69
|
+
"prepack": "node scripts/check-pack.js"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"node-red": "^5.0.0",
|
|
73
|
+
"node-red-node-test-helper": "^0.3.6"
|
|
74
|
+
},
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"access": "public",
|
|
77
|
+
"provenance": true
|
|
78
|
+
}
|
|
79
|
+
}
|