Skip to content

Commit

Permalink
refactor: add portable bindings for the filesystem (#7428)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Dec 11, 2024
1 parent cbc67fb commit cc460e9
Show file tree
Hide file tree
Showing 152 changed files with 1,665 additions and 1,136 deletions.
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

0 comments on commit cc460e9

Please sign in to comment.