Skip to content

Commit 163073e

Browse files
Fix packaging issues
- Use .js extension for imports consistently - Fix typo in exports for types (also on main, but at least VS Code seems to cope)
1 parent fa96588 commit 163073e

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

lib/device-information-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { BleClient } from "@capacitor-community/bluetooth-le";
2-
import { BoardVersion } from "./device";
3-
import { profile } from "./bluetooth-profile";
2+
import { BoardVersion } from "./device.js";
3+
import { profile } from "./bluetooth-profile.js";
44

55
export class DeviceInformationService {
66
constructor(private deviceId: string) {}

lib/dfu-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
BleClient,
33
numbersToDataView,
44
} from "@capacitor-community/bluetooth-le";
5-
import { profile } from "./bluetooth-profile";
5+
import { profile } from "./bluetooth-profile.js";
66

77
// This is the service that should be available on V1 after the reboot.
88
// We don't use it directly (the Nordic DFU library does) but we check it's there.

lib/flashing/flashing-full.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import {
55
FlashDataError,
66
ProgressCallback,
77
ProgressStage,
8-
} from "../device";
9-
import { DfuService, NORDIC_DFU_SERVICE } from "../dfu-service";
10-
import { refreshServicesForV1IfDesiredServiceMissing } from "./flashing-v1";
11-
import { flashDfu } from "./nordic-dfu";
12-
import { BluetoothDeviceWrapper } from "../bluetooth-device-wrapper";
13-
import { delay } from "../async-util";
8+
} from "../device.js";
9+
import { DfuService, NORDIC_DFU_SERVICE } from "../dfu-service.js";
10+
import { refreshServicesForV1IfDesiredServiceMissing } from "./flashing-v1.js";
11+
import { flashDfu } from "./nordic-dfu.js";
12+
import { BluetoothDeviceWrapper } from "../bluetooth-device-wrapper.js";
13+
import { delay } from "../async-util.js";
1414

1515
/**
1616
* Perform a full flash via Nordic's DFU service.

lib/flashing/flashing-partial.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import MemoryMap from "nrf-intel-hex";
2-
import { BluetoothDeviceWrapper } from "../bluetooth-device-wrapper";
2+
import { BluetoothDeviceWrapper } from "../bluetooth-device-wrapper.js";
33
import {
44
PacketState,
55
PartialFlashingService,
66
RegionId,
7-
} from "../partial-flashing-service";
8-
import { findMakeCodeRegionInMemoryMap } from "./flashing-makecode";
9-
import { delay, DisconnectError } from "../async-util";
10-
import { DeviceError, ProgressCallback, ProgressStage } from "../device";
7+
} from "../partial-flashing-service.js";
8+
import { findMakeCodeRegionInMemoryMap } from "./flashing-makecode.js";
9+
import { delay, DisconnectError } from "../async-util.js";
10+
import { DeviceError, ProgressCallback, ProgressStage } from "../device.js";
1111

1212
export enum PartialFlashResult {
1313
Success = "Success",

lib/flashing/nordic-dfu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Capacitor, PluginListenerHandle } from "@capacitor/core";
22
import { Directory, Filesystem, WriteFileOptions } from "@capacitor/filesystem";
33
import { DfuState, NordicDfu } from "@microbit/capacitor-community-nordic-dfu";
4-
import { BluetoothDeviceWrapper } from "../bluetooth-device-wrapper";
5-
import { createZip } from "./zip";
4+
import { BluetoothDeviceWrapper } from "../bluetooth-device-wrapper.js";
5+
import { createZip } from "./zip.js";
66
import {
77
BoardVersion,
88
DeviceError,

lib/flashing/zip.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { mkdtempSync, writeFileSync, readFileSync, rmSync } from "fs";
33
import { tmpdir } from "os";
44
import { join } from "path";
55
import { describe, it, expect, beforeEach, afterEach } from "vitest";
6-
import { createZip } from "./zip";
6+
import { createZip } from "./zip.js";
77

88
const isWindows = process.platform === "win32";
99

lib/partial-flashing-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
TimeoutOptions,
66
} from "@capacitor-community/bluetooth-le";
77
import MemoryMap from "nrf-intel-hex";
8-
import { BluetoothDeviceWrapper } from "./bluetooth-device-wrapper";
9-
import { profile } from "./bluetooth-profile";
8+
import { BluetoothDeviceWrapper } from "./bluetooth-device-wrapper.js";
9+
import { profile } from "./bluetooth-profile.js";
1010

1111
const MICROBIT_RESET_COMMAND = 0xff;
1212
const REGION_INFO_COMMAND = 0x0;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"exports": {
88
".": {
99
"import": {
10-
"types": "./build/esm/index.d.js",
10+
"types": "./build/esm/index.d.ts",
1111
"default": "./build/esm/index.js"
1212
},
1313
"require": {
14-
"types": "./build/cjs/index.d.js",
14+
"types": "./build/cjs/index.d.ts",
1515
"default": "./build/cjs/index.js"
1616
}
1717
}

0 commit comments

Comments
 (0)