tlms_esd 0.1.0 → 0.6.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 (71) hide show
  1. package/.git-blame-ignore-revs +5 -0
  2. package/.gitattributes +9 -0
  3. package/.gitignore +41 -0
  4. package/.local/TODO.md +90 -0
  5. package/.local/data_structure2025.xlsx +0 -0
  6. package/.local/data_structure2026.xlsx +0 -0
  7. package/.local/issues/a6d39veq-actuator-emulator.md +75 -0
  8. package/.local/issues/v9xg9fxn-config-compile-entry.md +86 -0
  9. package/.local/issues/yqq38rn8-adapt-layout-data-emulator.md +74 -0
  10. package/.npmignore +18 -0
  11. package/AGENTS.md +153 -0
  12. package/CHANGELOG.md +192 -0
  13. package/cli.js +185 -263
  14. package/doc/design.md +691 -0
  15. package/doc/design.zh-cn.md +690 -0
  16. package/doc/spec-modbus.md +263 -0
  17. package/doc/spec-modbus.zh-cn.md +261 -0
  18. package/doc/spec.md +310 -0
  19. package/doc/spec.zh-cn.md +308 -0
  20. package/eslint.config.js +58 -0
  21. package/issues/yqq38rn8-adapt-layout-data-emulator.md +71 -0
  22. package/layouts.yaml +208 -0
  23. package/logs/error_2024-10-11.log +2 -0
  24. package/logs/error_2026-10-09.log +36 -0
  25. package/logs/error_2026-10-10.log +1 -0
  26. package/logs/error_2026-10-11.log +0 -0
  27. package/logs/error_2026-10-12.log +0 -0
  28. package/logs/error_2026-10-13.log +0 -0
  29. package/logs/error_2026-10-15.log +0 -0
  30. package/logs/error_2026-10-16.log +0 -0
  31. package/logs/error_2026-10-17.log +0 -0
  32. package/logs/error_2026-10-23.log +0 -0
  33. package/logs/error_2026-10-25.log +3 -0
  34. package/logs/error_2026-10-27.log +0 -0
  35. package/logs/error_2026-10-28.log +0 -0
  36. package/logs/error_2026-10-30.log +0 -0
  37. package/logs/error_2026-11-05.log +0 -0
  38. package/logs/error_2026-11-07.log +0 -0
  39. package/logs/error_2026-11-14.log +1 -0
  40. package/logs/error_2026-11-15.log +0 -0
  41. package/logs/error_2026-11-17.log +0 -0
  42. package/logs/error_2026-11-18.log +0 -0
  43. package/logs/error_2026-11-22.log +0 -0
  44. package/logs/info_2024-10-11.log +2 -0
  45. package/logs/info_2026-10-09.log +36 -0
  46. package/logs/info_2026-10-10.log +1 -0
  47. package/logs/info_2026-10-11.log +0 -0
  48. package/logs/info_2026-10-12.log +0 -0
  49. package/logs/info_2026-10-13.log +0 -0
  50. package/logs/info_2026-10-15.log +0 -0
  51. package/logs/info_2026-10-16.log +0 -0
  52. package/logs/info_2026-10-17.log +0 -0
  53. package/logs/info_2026-10-23.log +0 -0
  54. package/logs/info_2026-10-25.log +3 -0
  55. package/logs/info_2026-10-27.log +0 -0
  56. package/logs/info_2026-10-28.log +0 -0
  57. package/logs/info_2026-10-30.log +0 -0
  58. package/logs/info_2026-11-05.log +0 -0
  59. package/logs/info_2026-11-07.log +0 -0
  60. package/logs/info_2026-11-14.log +1 -0
  61. package/logs/info_2026-11-15.log +0 -0
  62. package/logs/info_2026-11-17.log +0 -0
  63. package/logs/info_2026-11-18.log +0 -0
  64. package/logs/info_2026-11-22.log +0 -0
  65. package/main.js +27852 -8191
  66. package/nodemon.json +9 -11
  67. package/package.json +24 -25
  68. package/rolldown.config.js +35 -0
  69. package/dev.js +0 -5
  70. package/emulator.js +0 -7768
  71. package/rollup.config.js +0 -41
package/nodemon.json CHANGED
@@ -1,13 +1,11 @@
1
1
  {
2
- "restartable": "rs",
3
- "verbose": true,
4
- "watch": [
5
- "src/"
6
- ],
7
- "ext": "js,yaml",
8
- "ignore": [
9
- "src/emulators/"
10
- ],
11
- "delay": "3",
12
- "execMap": {}
2
+ "restartable": "rs",
3
+ "verbose": true,
4
+ "watch": [
5
+ "src/"
6
+ ],
7
+ "ext": "js,yaml",
8
+ "ignore": [],
9
+ "delay": "3",
10
+ "execMap": {}
13
11
  }
package/package.json CHANGED
@@ -1,37 +1,33 @@
1
1
  {
2
2
  "name": "tlms_esd",
3
- "version": "0.1.0",
4
- "description": "管道泄漏紧急关断系统",
3
+ "version": "0.6.0",
4
+ "description": "Pipeline Leakage Emergency Shutdown System",
5
5
  "type": "module",
6
- "main": "index.js",
7
6
  "exports": {
8
7
  "cli": "./cli.js",
9
- "default": "./main.js",
10
- "emu": "./emulator.js"
11
- },
12
- "dependencies": {
13
- "modbus-serial": "^8.0.17"
8
+ "default": "./main.js"
14
9
  },
15
10
  "peerDependencies": {
16
- "pm2": "^5.4.1"
11
+ "pm2": "^7.1.2"
17
12
  },
18
13
  "devDependencies": {
19
- "@rollup/plugin-commonjs": "^26.0.1",
20
- "@rollup/plugin-json": "^6.1.0",
21
- "@rollup/plugin-node-resolve": "^15.2.3",
22
- "eslint": "^8.57.0",
23
- "globby": "^13.2.2",
24
- "iconv-lite": "^0.6.3",
14
+ "@eslint/js": "10.0.1",
15
+ "@st-one-io/nodes7": "^1.1.3",
16
+ "@stylistic/eslint-plugin": "6.0.1",
17
+ "csv-parser": "^3.2.1",
18
+ "es-modbus": "^0.3.2",
19
+ "eslint": "10.15.0",
20
+ "globals": "17.14.0",
21
+ "layout-data": "0.10.1",
22
+ "log4js": "^6.9.1",
23
+ "modbus-emulator": "^0.4.0",
25
24
  "mri": "^1.2.0",
26
- "nodemon": "^3.1.4",
27
- "nodes7": "^0.3.18",
28
- "rimraf": "^3.0.2",
29
- "rollup": "^4.18.0",
30
- "yaml": "^2.4.5"
25
+ "nodemon": "^3.1.14",
26
+ "rolldown": "^1.3.3",
27
+ "yaml": "^2.9.1"
31
28
  },
32
29
  "directories": {
33
- "conf": "example",
34
- "lib": "lib"
30
+ "conf": "example"
35
31
  },
36
32
  "bin": {
37
33
  "tlms": "./cli.js"
@@ -44,8 +40,11 @@
44
40
  "author": "",
45
41
  "license": "ISC",
46
42
  "scripts": {
47
- "build": "rollup -c",
48
- "dev": "node ./dev.js JSC",
49
- "watch": "nodemon ./dev.js JSC"
43
+ "build": "rolldown -c",
44
+ "dev": "cd example && node ../src/main.js TC",
45
+ "watch": "cd example && nodemon ../src/main.js TC --watch ../src --ext js",
46
+ "test": "node --test",
47
+ "lint": "eslint .",
48
+ "gen:types": "layout-types src/layouts.yaml --scope tlms -o src/layout_types.d.ts"
50
49
  }
51
50
  }
@@ -0,0 +1,35 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { defineConfig } from "rolldown";
3
+ import pkg from "./package.json" with { type: "json" };
4
+
5
+ // src/layouts.js reads layouts.yaml from its own directory, which is the
6
+ // directory of main.js once bundled: copy the layout file next to the bundle.
7
+ // It is emitted as a separate asset, not bundled into main.js.
8
+ const copy_layouts = {
9
+ name: "copy-layouts",
10
+ generateBundle() {
11
+ this.emitFile({
12
+ type: "asset",
13
+ fileName: "layouts.yaml",
14
+ source: readFileSync("src/layouts.yaml"),
15
+ });
16
+ },
17
+ };
18
+
19
+ export default defineConfig([{
20
+ input: "src/main.js",
21
+ platform: "node",
22
+ plugins: [copy_layouts],
23
+ output: {
24
+ file: pkg.exports.default,
25
+ format: "es",
26
+ },
27
+ }, {
28
+ input: "src/cli.js",
29
+ platform: "node",
30
+ output: {
31
+ file: pkg.exports.cli,
32
+ format: "es",
33
+ },
34
+ external: ["./main.js"],
35
+ }]);
package/dev.js DELETED
@@ -1,5 +0,0 @@
1
- import { run } from './src/index.js';
2
-
3
- process.chdir('./example');
4
- const controller_name = process.argv[2];
5
- run(controller_name);