Skip to content

Commit f9e51ad

Browse files
authored
fix: restore commonjs build (#4405)
Fixes #4401
1 parent 0d566a1 commit f9e51ad

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

src/lib/SocketEvents.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export const socketEvents = Object.freeze({
2+
init: 'INIT', // automatically sent when a new client connects to the socket
3+
controller: 'CONTROLLER_CMD', // controller status updates
4+
connected: 'CONNECTED', // socket status
5+
nodeFound: 'NODE_FOUND',
6+
nodeAdded: 'NODE_ADDED',
7+
nodeRemoved: 'NODE_REMOVED',
8+
nodeUpdated: 'NODE_UPDATED',
9+
valueUpdated: 'VALUE_UPDATED',
10+
valueRemoved: 'VALUE_REMOVED',
11+
metadataUpdated: 'METADATA_UPDATED',
12+
rebuildRoutesProgress: 'REBUILD_ROUTES_PROGRESS',
13+
healthCheckProgress: 'HEALTH_CHECK_PROGRESS',
14+
info: 'INFO',
15+
api: 'API_RETURN', // api results
16+
debug: 'DEBUG',
17+
statistics: 'STATISTICS',
18+
nodeEvent: 'NODE_EVENT',
19+
grantSecurityClasses: 'GRANT_SECURITY_CLASSES',
20+
validateDSK: 'VALIDATE_DSK',
21+
inclusionAborted: 'INCLUSION_ABORTED',
22+
znifferFrame: 'ZNIFFER_FRAME',
23+
znifferState: 'ZNIFFER_STATE',
24+
linkReliability: 'LINK_RELIABILITY',
25+
otwFirmwareUpdate: 'OTW_FIRMWARE_UPDATE',
26+
})
27+
// events from client ---> server
28+
export const inboundEvents = Object.freeze({
29+
init: 'INITED', // get all nodes
30+
zwave: 'ZWAVE_API', // call a zwave api
31+
hass: 'HASS_API', // call an hass api
32+
mqtt: 'MQTT_API', // call an mqtt api
33+
zniffer: 'ZNIFFER_API', // call a zniffer api
34+
})

src/lib/shared.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { RFRegion } from 'zwave-js'
2+
export function regionSupportsAutoPowerlevel(region) {
3+
return (
4+
region === RFRegion.Europe ||
5+
region === RFRegion['Europe (Long Range)'] ||
6+
region === RFRegion.USA ||
7+
region === RFRegion['USA (Long Range)']
8+
)
9+
}

tsconfig.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"extends": "@tsconfig/node22/tsconfig.json",
33
"compilerOptions": {
4-
"moduleResolution": "bundler",
5-
"module": "ES2022",
64
// Necessary to support yarn portals with the node-modules linker, used by yarn link (berry)
75
"preserveSymlinks": true,
86
"resolveJsonModule": true,

vite.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default defineConfig(({ mode }) => {
125125
},
126126
{
127127
find: /^@server\/(.+)/,
128-
replacement: `${path.resolve(__dirname, 'server')}/$1`,
128+
replacement: `${path.resolve(__dirname, 'src')}/$1`,
129129
},
130130
],
131131
preserveSymlinks: true,

0 commit comments

Comments
 (0)