Skip to content

Commit 45c0f6b

Browse files
authored
feat(emulator): standardize bin build process for consistency (#365)
Make emulator package match the standard CLI package pattern used by cli, device-profiler, and mqtt-bridge packages. This ensures all CLI packages build and handle executable permissions identically. Changes: - Update tsconfig.json to use rootDir "." instead of "src" - Include "bin" directory in tsconfig compilation - Add chmod to build script for dist bin files Closes #361
1 parent aba3316 commit 45c0f6b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/emulator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"access": "public"
3535
},
3636
"scripts": {
37-
"build": "npm run build:esm && npm run build:cjs && npm run build:package-json",
37+
"build": "npm run build:esm && npm run build:cjs && npm run build:package-json && chmod +x dist/esm/bin/ya-modbus-emulator.js dist/cjs/bin/ya-modbus-emulator.js",
3838
"clean": "rm -rf dist",
3939
"test": "jest",
4040
"build:esm": "../../node_modules/.bin/tsc -p tsconfig.esm.json",

packages/emulator/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"rootDir": "src",
5+
"rootDir": ".",
66
"declaration": true,
77
"declarationMap": true,
88
"composite": true,
99
"module": "ESNext",
1010
"moduleResolution": "bundler"
1111
},
12-
"include": ["src"],
12+
"include": ["src", "bin"],
1313
"exclude": ["src/**/*.test.ts"]
1414
}

0 commit comments

Comments
 (0)