Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add portable bindings for the filesystem #7428

Merged
merged 21 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2e1fe8b
refactor: add portable bindings for the filesystem
AlCalzone Nov 21, 2024
ee3c587
refactor: split FileSystem interface into traits
AlCalzone Nov 22, 2024
7a7b868
refactor: do not use file-based locking for installConfigUpdate
AlCalzone Dec 10, 2024
8e89e47
refactor: migrate file streaming to portable bindings
AlCalzone Dec 10, 2024
a41cd9a
refactor: add temp directory management to fs bindings
AlCalzone Dec 11, 2024
e539598
refactor: move traits to core package
AlCalzone Dec 11, 2024
cac2280
refactor: move more traits to core package
AlCalzone Dec 11, 2024
d293cb5
refactor: move more traits to config package
AlCalzone Dec 11, 2024
ca0c51b
refactor: move HostIDs trait to core package
AlCalzone Dec 11, 2024
fc1d03c
refactor: move LookupManufacturer trait to config package
AlCalzone Dec 11, 2024
3baa2fa
refactor: move GetValueDB trait to core package
AlCalzone Dec 11, 2024
798a85c
refactor: move SchedulePoll trait to cc package
AlCalzone Dec 11, 2024
806f46a
refactor: dissolve ZWaveHostOptions interface
AlCalzone Dec 11, 2024
248af8e
refactor: move CC[Parsing|Encoding]Context to cc package
AlCalzone Dec 11, 2024
ed0a439
refactor: move SendCommand trait to cc package
AlCalzone Dec 11, 2024
42ce16f
refactor: move LogNode trait to core package
AlCalzone Dec 11, 2024
b9c7247
refactor: rename bindings to host
AlCalzone Dec 11, 2024
f6d447c
refactor: move listing ports into serial host binding
AlCalzone Dec 11, 2024
d31ada5
test: fix tests
AlCalzone Dec 11, 2024
ae3131e
test: use local path for testing again
AlCalzone Dec 11, 2024
1b0556a
fix: do not test host/safe entrypoint
AlCalzone Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ jobs:
node -e '(async () => { await import("@zwave-js/cc/safe") })()'
node -e '(async () => { await import("@zwave-js/config/safe") })()'
node -e '(async () => { await import("@zwave-js/core/safe") })()'
node -e '(async () => { await import("@zwave-js/host/safe") })()'
node -e '(async () => { await import("@zwave-js/nvmedit/safe") })()'
node -e '(async () => { await import("@zwave-js/serial/safe") })()'
node -e '(async () => { await import("@zwave-js/shared/safe") })()'
Expand All @@ -130,7 +129,6 @@ jobs:
node -e 'require("@zwave-js/cc/safe")'
node -e 'require("@zwave-js/config/safe")'
node -e 'require("@zwave-js/core/safe")'
node -e 'require("@zwave-js/host/safe")'
node -e 'require("@zwave-js/nvmedit/safe")'
node -e 'require("@zwave-js/serial/safe")'
node -e 'require("@zwave-js/shared/safe")'
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/AlarmSensorCC.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type EndpointId,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
MessagePriority,
Expand All @@ -12,11 +14,6 @@ import {
parseBitMask,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { getEnumMemberName, isEnumMember, pick } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
9 changes: 3 additions & 6 deletions packages/cc/src/cc/AssociationCC.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import { type GetDeviceConfig } from "@zwave-js/config";
import type {
EndpointId,
GetValueDB,
MaybeNotKnown,
MessageRecord,
SupervisionResult,
Expand All @@ -14,12 +17,6 @@ import {
ZWaveErrorCodes,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetDeviceConfig,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
import { distinct } from "alcalzone-shared/arrays";
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/AssociationGroupInfoCC.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type EndpointId,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
MessagePriority,
Expand All @@ -12,11 +14,6 @@ import {
parseCCId,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { cpp2js, getEnumMemberName, num2hex } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/BarrierOperatorCC.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type GetValueDB,
type MaybeNotKnown,
type MaybeUnknown,
type MessageOrCCLogEntry,
Expand All @@ -15,11 +17,6 @@ import {
parseBitMask,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import {
getEnumMemberName,
Expand Down
13 changes: 5 additions & 8 deletions packages/cc/src/cc/BasicCC.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import { type GetDeviceConfig } from "@zwave-js/config";
import {
CommandClasses,
type ControlsCC,
Duration,
type EndpointId,
type GetEndpoint,
type GetNode,
type GetSupportedCCVersion,
type GetValueDB,
type MaybeNotKnown,
type MaybeUnknown,
type MessageOrCCLogEntry,
Expand All @@ -19,14 +24,6 @@ import {
parseMaybeNumber,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetDeviceConfig,
GetNode,
GetSupportedCCVersion,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { pick } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
18 changes: 9 additions & 9 deletions packages/cc/src/cc/BatteryCC.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { type WithAddress, timespan } from "@zwave-js/core";
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import { type GetDeviceConfig } from "@zwave-js/config";
import {
type GetNode,
type GetSupportedCCVersion,
type GetValueDB,
type WithAddress,
timespan,
} from "@zwave-js/core";
import type {
ControlsCC,
EndpointId,
Expand All @@ -18,14 +26,6 @@ import {
parseFloatWithScale,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetDeviceConfig,
GetNode,
GetSupportedCCVersion,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { type AllOrNone, getEnumMemberName, pick } from "@zwave-js/shared/safe";
import {
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/BinarySensorCC.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type EndpointId,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
MessagePriority,
Expand All @@ -11,11 +13,6 @@ import {
parseBitMask,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { getEnumMemberName, isEnumMember } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/BinarySwitchCC.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
Duration,
type GetValueDB,
type MaybeNotKnown,
type MaybeUnknown,
type MessageOrCCLogEntry,
Expand All @@ -15,11 +17,6 @@ import {
parseMaybeBoolean,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
import {
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/CRC16CC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import {
CRC16_CCITT,
CommandClasses,
EncapsulationFlags,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
type WithAddress,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { CCAPI } from "../lib/API.js";
import { type CCRaw, CommandClass } from "../lib/CommandClass.js";
import {
Expand All @@ -22,6 +18,7 @@ import {
implementedVersion,
} from "../lib/CommandClassDecorators.js";

import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import { Bytes } from "@zwave-js/shared/safe";
import { CRC16Command } from "../lib/_Types.js";

Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/CentralSceneCC.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
MessagePriority,
Expand All @@ -15,11 +17,6 @@ import {
parseBitMask,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/ClimateControlScheduleCC.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
type SupervisionResult,
Expand All @@ -10,11 +12,6 @@ import {
enumValuesToMetadataStates,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { getEnumMemberName } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/ClockCC.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import type {
GetValueDB,
MessageOrCCLogEntry,
SupervisionResult,
WithAddress,
Expand All @@ -11,11 +13,6 @@ import {
ZWaveErrorCodes,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/ColorSwitchCC.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
Duration,
type GetValueDB,
type MessageOrCCLogEntry,
MessagePriority,
type MessageRecord,
Expand All @@ -17,11 +19,6 @@ import {
validatePayload,
} from "@zwave-js/core";
import { type MaybeNotKnown, encodeBitMask } from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import {
getEnumMemberName,
Expand Down
14 changes: 5 additions & 9 deletions packages/cc/src/cc/ConfigurationCC.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import type { ParamInfoMap } from "@zwave-js/config";
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import type { GetDeviceConfig, ParamInfoMap } from "@zwave-js/config";
import {
CommandClasses,
ConfigValueFormat,
type ConfigurationMetadata,
type ControlsCC,
type EndpointId,
type GetEndpoint,
type GetNode,
type GetSupportedCCVersion,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
MessagePriority,
Expand All @@ -30,14 +34,6 @@ import {
supervisedCommandSucceeded,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetDeviceConfig,
GetNode,
GetSupportedCCVersion,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
2 changes: 1 addition & 1 deletion packages/cc/src/cc/DeviceResetLocallyCC.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type MaybeNotKnown,
TransmitOptions,
validatePayload,
} from "@zwave-js/core/safe";
import { type CCParsingContext } from "@zwave-js/host";
import { CCAPI } from "../lib/API.js";
import { type CCRaw, CommandClass } from "../lib/CommandClass.js";
import {
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/DoorLockCC.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
Duration,
type EndpointId,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
MessagePriority,
Expand All @@ -16,11 +18,6 @@ import {
supervisedCommandSucceeded,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
7 changes: 2 additions & 5 deletions packages/cc/src/cc/DoorLockLoggingCC.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
import {
CommandClasses,
type GetValueDB,
type MaybeNotKnown,
type MessageOrCCLogEntry,
MessagePriority,
Expand All @@ -9,11 +11,6 @@ import {
ZWaveErrorCodes,
validatePayload,
} from "@zwave-js/core/safe";
import type {
CCEncodingContext,
CCParsingContext,
GetValueDB,
} from "@zwave-js/host/safe";
import { Bytes } from "@zwave-js/shared/safe";
import { isPrintableASCII, num2hex } from "@zwave-js/shared/safe";
import { validateArgs } from "@zwave-js/transformers";
Expand Down
Loading
Loading