From 99c076b6db83ac8150e97f215c609bb4b8adca51 Mon Sep 17 00:00:00 2001 From: vilicvane Date: Tue, 7 Nov 2023 11:37:41 +0800 Subject: [PATCH] Fix missing cjs usage in examples --- packages/matter-node-ble.js/package.json | 1 + packages/matter-node-ble.js/require/package.json | 4 ---- packages/matter-node.js-examples/package.json | 14 +++++++------- 3 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 packages/matter-node-ble.js/require/package.json diff --git a/packages/matter-node-ble.js/package.json b/packages/matter-node-ble.js/package.json index 5c7ba99b95..a2ee1dfde1 100644 --- a/packages/matter-node-ble.js/package.json +++ b/packages/matter-node-ble.js/package.json @@ -66,6 +66,7 @@ }, "./require": { "types": "./require/require.d.ts", + "esbuild": "./require/require.cjs", "import": "./require/require.mjs", "require": "./require/require.cjs" } diff --git a/packages/matter-node-ble.js/require/package.json b/packages/matter-node-ble.js/require/package.json deleted file mode 100644 index 0ffb6113fb..0000000000 --- a/packages/matter-node-ble.js/require/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./require.cjs", - "module": "./require.mjs" -} diff --git a/packages/matter-node.js-examples/package.json b/packages/matter-node.js-examples/package.json index 1c48e98c61..7886ff2f1e 100644 --- a/packages/matter-node.js-examples/package.json +++ b/packages/matter-node.js-examples/package.json @@ -32,15 +32,15 @@ "matter-composeddevice": "run src/examples/ComposedDeviceNode.ts", "matter-multidevice": "run src/examples/MultiDeviceNode.ts", "matter-controller": "run src/examples/ControllerNode.ts", - "bundle-device": "esbuild dist/cjs/examples/DeviceNode.js --bundle --platform=node --external:@abandonware/bleno --external:@abandonware/bluetooth-hci-socket --sourcemap --minify --outfile=build/bundle/DeviceNode.js", - "matter-device-bundled": "node --enable-source-maps dist/cjs/examples/DeviceNode.js" + "bundle-device": "esbuild src/examples/DeviceNode.ts --bundle --platform=node --conditions=esbuild --external:@abandonware/bleno --external:@abandonware/bluetooth-hci-socket --sourcemap --minify --outfile=build/bundle/DeviceNode.cjs", + "matter-device-bundled": "node --enable-source-maps build/bundle/DeviceNode.cjs" }, "bin": { - "matter-device": "./dist/cjs/examples/DeviceNode.js", - "matter-bridge": "./dist/cjs/examples/BridgedDevicesNode.js", - "matter-composeddevice": "./dist/cjs/examples/ComposedDeviceNode.js", - "matter-multidevice": "./dist/cjs/examples/MultiDeviceNode.js", - "matter-controller": "./dist/cjs/examples/ControllerNode.js" + "matter-device": "./dist/esm/examples/DeviceNode.js", + "matter-bridge": "./dist/esm/examples/BridgedDevicesNode.js", + "matter-composeddevice": "./dist/esm/examples/ComposedDeviceNode.js", + "matter-multidevice": "./dist/esm/examples/MultiDeviceNode.js", + "matter-controller": "./dist/esm/examples/ControllerNode.js" }, "devDependencies": { "@project-chip/matter.js-tools": "0.6.1-alpha.0-20231107-8ef79b7",