@totemsdk/edge-modbus 0.1.0 → 0.2.2

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/package.json CHANGED
@@ -1,43 +1,71 @@
1
1
  {
2
2
  "name": "@totemsdk/edge-modbus",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "description": "Edge runtime adapter for Modbus — PLCs, RTUs, industrial sensors over serial/TCP",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "main": "dist/cjs/index.js",
6
+ "types": "dist/cjs/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
- "types": "./dist/index.d.ts",
10
- "require": "./dist/index.js",
11
- "import": "./dist/index.js"
9
+ "import": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "require": {
14
+ "types": "./dist/cjs/index.d.ts",
15
+ "default": "./dist/cjs/index.js"
16
+ }
12
17
  }
13
18
  },
14
- "scripts": {
15
- "build": "tsc",
16
- "prepare": "tsc",
17
- "clean": "rm -rf dist",
18
- "test": "jest --passWithNoTests"
19
- },
20
- "files": ["dist", "README.md", "LICENSE"],
19
+ "files": [
20
+ "dist",
21
+ "sidecar.json",
22
+ "README.md",
23
+ "LICENSE",
24
+ "NOTICE"
25
+ ],
21
26
  "dependencies": {
22
- "@totemsdk/edge": "^0.1.3"
27
+ "@totemsdk/edge": "^1.5.1"
23
28
  },
24
29
  "devDependencies": {
25
- "@types/jest": "^30.0.0",
26
30
  "@types/node": "^20.0.0",
27
- "jest": "^30.4.2",
28
- "ts-jest": "^29.0.0",
29
31
  "typescript": "^7.0.2"
30
32
  },
31
- "engines": { "node": ">=18.0.0" },
32
- "publishConfig": { "access": "public" },
33
- "license": "MIT",
33
+ "engines": {
34
+ "node": ">=18.0.0"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "license": "Apache-2.0",
34
40
  "author": "Totem SDK",
35
- "homepage": "https://totem.ing",
41
+ "homepage": "https://docs.totem.ing",
36
42
  "repository": {
37
43
  "type": "git",
38
- "url": "git+https://github.com/totem-sdk/totem-sdk.git",
39
- "directory": "packages/totem-sdk/packages/edge-modbus"
44
+ "url": "git+https://github.com/Totem-Edge/totem-sdk.git",
45
+ "directory": "packages/edge-modbus"
46
+ },
47
+ "keywords": [
48
+ "totem",
49
+ "totemsdk",
50
+ "minima",
51
+ "blockchain",
52
+ "edge",
53
+ "modbus",
54
+ "transport"
55
+ ],
56
+ "bugs": {
57
+ "url": "https://github.com/Totem-Edge/totem-sdk/issues"
40
58
  },
41
- "keywords": ["totem", "totemsdk", "minima", "blockchain", "edge", "modbus", "transport"],
42
- "bugs": { "url": "https://github.com/totem-sdk/totem-sdk/issues" }
43
- }
59
+ "type": "module",
60
+ "scripts": {
61
+ "build": "tsc && tsc -p tsconfig.cjs.json && node -e \"require('fs').writeFileSync('dist/cjs/package.json', JSON.stringify({type:'commonjs'})+'\\n')\"",
62
+ "build:go": "cd go && go build -o ../bin/edge-modbus .",
63
+ "clean": "rm -rf dist bin",
64
+ "test": "jest --config ../../tests/jest/edge-modbus.cjs",
65
+ "test:go": "cd go && go test -race ./... && go vet ./...",
66
+ "test:integration": "node --test ../../tests/qualification/edge-modbus/test/sidecar.integration.mjs",
67
+ "test:conformance": "cd go && go test -race ./...",
68
+ "test:recovery": "node --test ../../tests/qualification/edge-modbus/test/sidecar.integration.mjs",
69
+ "test:consumer": "node --test ../../tests/qualification/edge-modbus/test/packed-consumer.test.mjs"
70
+ }
71
+ }
package/sidecar.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "edge-modbus-sidecar",
3
+ "protocolVersion": 1,
4
+ "distribution": {
5
+ "mode": "source-build",
6
+ "bundledInNpmPackage": false,
7
+ "binary": "bin/edge-modbus",
8
+ "build": "pnpm --filter @totemsdk/edge-modbus build:go",
9
+ "autoDownload": false
10
+ },
11
+ "compatibility": {
12
+ "protocolMajor": 1,
13
+ "healthCheck": "edge-modbus --version",
14
+ "rule": "Rebuild the sidecar from the matching package source. The npm package does not bundle platform binaries."
15
+ },
16
+ "configuration": {
17
+ "mode": "MODBUS_MODE=tcp|rtu",
18
+ "listen": "MODBUS_LISTEN_ADDR=127.0.0.1:15002",
19
+ "tcpTarget": "MODBUS_TCP_ADDR=host:502",
20
+ "serial": "MODBUS_SERIAL_PORT=/dev/ttyUSB0",
21
+ "timeout": "MODBUS_TIMEOUT_MS=2000"
22
+ },
23
+ "qualified": [
24
+ "darwin-arm64 source build",
25
+ "loopback Modbus TCP simulator",
26
+ "RTU codec/CRC unit coverage"
27
+ ],
28
+ "unqualified": [
29
+ "modbus serial hardware",
30
+ "Windows and Linux prebuilt binaries",
31
+ "broker/PLC vendor matrix",
32
+ "hot upgrade or rolling sidecar replacement"
33
+ ]
34
+ }