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

feat: add "browser" condition to main entrypoint for bundlers #7374

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
fix: imports in tests
AlCalzone committed Nov 6, 2024
commit 7edd1b8cd92316903865d82c25ba5068a94f0614
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isArray } from "alcalzone-shared/typeguards/index.js";
import { isArray } from "alcalzone-shared/typeguards";
import { test } from "vitest";
import { ConditionalDeviceConfig } from "./DeviceConfig.js";

2 changes: 1 addition & 1 deletion packages/serial/src/serialport/ZWaveSerialPort.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Bytes } from "@zwave-js/shared/safe";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { PassThrough } from "node:stream";
import sinon from "sinon";
import { afterEach, beforeEach, test } from "vitest";
2 changes: 1 addition & 1 deletion packages/shared/src/AsyncQueue.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { test } from "vitest";
import { AsyncQueue } from "./AsyncQueue.js";

4 changes: 2 additions & 2 deletions packages/zwave-js/src/lib/driver/Task.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ZWaveError, ZWaveErrorCodes, assertZWaveError } from "@zwave-js/core";
import { noop } from "@zwave-js/shared";
import { wait } from "alcalzone-shared/async/index.js";
import { createDeferredPromise } from "alcalzone-shared/deferred-promise/index.js";
import { wait } from "alcalzone-shared/async";
import { createDeferredPromise } from "alcalzone-shared/deferred-promise";
import { test } from "vitest";
import {
type TaskBuilder,
2 changes: 1 addition & 1 deletion packages/zwave-js/src/lib/log/Driver.test.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import {
assertMessage,
} from "@zwave-js/core/test";
import { FunctionType, Message, MessageType } from "@zwave-js/serial";
import { createDeferredPromise } from "alcalzone-shared/deferred-promise/index.js";
import { createDeferredPromise } from "alcalzone-shared/deferred-promise";
import colors from "ansi-colors";
import MockDate from "mockdate";
import { beforeEach, test as baseTest } from "vitest";
2 changes: 1 addition & 1 deletion packages/zwave-js/src/lib/node/VirtualEndpoint.test.ts
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ import {
MockNode,
getDefaultSupportedFunctionTypes,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { test as baseTest } from "vitest";
import {
createDefaultMockControllerBehaviors,
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import {
RateType,
} from "@zwave-js/cc";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { DoorLockMode } from "@zwave-js/cc";
import { DoorLockCCValues } from "@zwave-js/cc/DoorLockCC";
import { NotificationCCReport } from "@zwave-js/cc/NotificationCC";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import {
} from "@zwave-js/cc/NotificationCC";
import { CommandClasses, type ValueMetadataNumeric } from "@zwave-js/core";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import {
NotificationCCValues,
} from "@zwave-js/cc/NotificationCC";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import {
NotificationCCValues,
} from "@zwave-js/cc/NotificationCC";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import {
} from "@zwave-js/cc/BinarySwitchCC";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";

import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import {
} from "@zwave-js/cc/NotificationCC";
import { ValueMetadata } from "@zwave-js/core";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import {
} from "@zwave-js/cc/NotificationCC";
import { CommandClasses } from "@zwave-js/core";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import sinon from "sinon";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ZWaveProtocolCCNodeInformationFrame } from "@zwave-js/cc";
import { CommandClasses } from "@zwave-js/core";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import {
MockZWaveFrameType,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { randomBytes } from "node:crypto";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import {
type MockNodeBehavior,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Bytes } from "@zwave-js/shared";
import { type MockControllerBehavior } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import {
getDefaultMockControllerCapabilities,
getDefaultSupportedFunctionTypes,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import sinon from "sinon";
import {
MockControllerCommunicationState,
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BatteryCCReport, BatteryCCValues } from "@zwave-js/cc";
import { CommandClasses } from "@zwave-js/core";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import {
type MockControllerBehavior,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ import {
MockZWaveFrameType,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

// Repro for https://github.com/zwave-js/node-zwave-js/issues/6305
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import {
getDefaultMockControllerCapabilities,
getDefaultSupportedFunctionTypes,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

const spyTransport = new SpyTransport();
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import {
type MockNodeBehavior,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import {
getDefaultMockControllerCapabilities,
getDefaultSupportedFunctionTypes,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuiteMulti.js";

// Regression test for #5844
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import {
MockZWaveFrameType,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import {
MockZWaveFrameType,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuiteMulti.js";

Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { BasicCCGet, BasicCCSet } from "@zwave-js/cc";
import { MessagePriority, NodeStatus } from "@zwave-js/core";
import { type SendDataRequest } from "@zwave-js/serial/serialapi";
import { MOCK_FRAME_ACK_TIMEOUT, MockZWaveFrameType } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeStatus } from "@zwave-js/core";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BasicCCGet, BasicCCSet } from "@zwave-js/cc";
import { NodeStatus, ZWaveErrorCodes, assertZWaveError } from "@zwave-js/core";
import { MockZWaveFrameType } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import {
type MockNodeBehavior,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WakeUpCCWakeUpNotification } from "@zwave-js/cc";
import { CommandClasses } from "@zwave-js/core";
import { createMockZWaveRequestFrame } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest("Assume a node to be awake at the start of a re-interview", {
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import {
ZWaveErrorCodes,
} from "@zwave-js/core";
import { type MockNodeBehavior, MockZWaveFrameType } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import {
MockZWaveFrameType,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuiteMulti.js";

integrationTest(
2 changes: 1 addition & 1 deletion packages/zwave-js/src/lib/test/driver/s2Collisions.test.ts
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ import {
type MockZWaveRequestFrame,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { CommandClasses, TransactionState } from "@zwave-js/core";
import sinon from "sinon";

import { getEnumMemberName } from "@zwave-js/shared";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import path from "node:path";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import {
getDefaultMockControllerCapabilities,
getDefaultSupportedFunctionTypes,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import {
MockControllerCommunicationState,
MockControllerStateKeys,
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import {
getDefaultMockControllerCapabilities,
getDefaultSupportedFunctionTypes,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import {
MockControllerCommunicationState,
MockControllerStateKeys,
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import {
} from "@zwave-js/cc";
import { CommandClasses, SupervisionStatus } from "@zwave-js/core";
import { type MockNodeBehavior, MockZWaveFrameType } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import {
} from "@zwave-js/cc";
import { CommandClasses } from "@zwave-js/core";
import { type MockNodeBehavior, MockZWaveFrameType } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest("setValue without supervision: expect validation GET", {
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import {
MOCK_FRAME_ACK_TIMEOUT,
type MockNodeBehavior,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

// Repro for https://github.com/home-assistant/core/issues/98491
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import {
} from "@zwave-js/cc";
import { CommandClasses, SupervisionStatus } from "@zwave-js/core";
import { type MockNodeBehavior, MockZWaveFrameType } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import sinon from "sinon";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import {
MockZWaveFrameType,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import {
} from "@zwave-js/cc";
import { CommandClasses, SupervisionStatus } from "@zwave-js/core";
import { type MockNodeBehavior } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import sinon from "sinon";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import {
ccCaps,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ import {
ccCaps,
createMockZWaveRequestFrame,
} from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(`Basic Reports with the UNKNOWN state are correctly handled`, {
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import {
} from "@zwave-js/serial/serialapi";
import { SoftResetRequest } from "@zwave-js/serial/serialapi";
import { type MockControllerBehavior } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import Sinon from "sinon";
import { integrationTest } from "../integrationTestSuite.js";

Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import {
} from "@zwave-js/core";
import type { ThrowingMap } from "@zwave-js/shared";
import { MockController } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { test as baseTest } from "vitest";
import { createDefaultMockControllerBehaviors } from "../../../Utils.js";
import type { Driver } from "../../driver/Driver.js";
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import {
import { CommandClasses } from "@zwave-js/core";
import { ApplicationUpdateRequestNodeInfoReceived } from "@zwave-js/serial/serialapi";
import { type MockNodeBehavior, MockZWaveFrameType } from "@zwave-js/testing";
import { wait } from "alcalzone-shared/async/index.js";
import { wait } from "alcalzone-shared/async";
import { integrationTest } from "../integrationTestSuite.js";

integrationTest(