Skip to content

Commit

Permalink
fix: Re-export all the generated API package types
Browse files Browse the repository at this point in the history
  • Loading branch information
evrys committed Jul 10, 2024
1 parent 713d033 commit 6ae34a8
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 25 deletions.
1 change: 1 addition & 0 deletions dist/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as _wandelbots_wandelbots_api_client from '@wandelbots/wandelbots-api-client';
import { ControllerInstance, MotionGroupPhysical, MotionGroupState, RobotTcp, MotionGroupSpecification, Configuration, DeviceConfigurationApi, MotionGroupApi, MotionGroupInfosApi, ControllerApi, ProgramApi, ProgramValuesApi, ControllerIOsApi, MotionGroupKinematicApi, MotionApi, CoordinateSystemsApi, MotionGroupJoggingApi, VirtualRobotApi, VirtualRobotSetupApi, VirtualRobotModeApi, VirtualRobotBehaviorApi, LibraryProgramMetadataApi, LibraryProgramApi, LibraryRecipeMetadataApi, LibraryRecipeApi } from '@wandelbots/wandelbots-api-client';
export * from '@wandelbots/wandelbots-api-client';
import ReconnectingWebSocket from 'reconnecting-websocket';

declare class AutoReconnectingWebsocket extends ReconnectingWebSocket {
Expand Down
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as _wandelbots_wandelbots_api_client from '@wandelbots/wandelbots-api-client';
import { ControllerInstance, MotionGroupPhysical, MotionGroupState, RobotTcp, MotionGroupSpecification, Configuration, DeviceConfigurationApi, MotionGroupApi, MotionGroupInfosApi, ControllerApi, ProgramApi, ProgramValuesApi, ControllerIOsApi, MotionGroupKinematicApi, MotionApi, CoordinateSystemsApi, MotionGroupJoggingApi, VirtualRobotApi, VirtualRobotSetupApi, VirtualRobotModeApi, VirtualRobotBehaviorApi, LibraryProgramMetadataApi, LibraryProgramApi, LibraryRecipeMetadataApi, LibraryRecipeApi } from '@wandelbots/wandelbots-api-client';
export * from '@wandelbots/wandelbots-api-client';
import ReconnectingWebSocket from 'reconnecting-websocket';

declare class AutoReconnectingWebsocket extends ReconnectingWebSocket {
Expand Down
12 changes: 6 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10800,7 +10800,7 @@ __export(src_exports, {
});
module.exports = __toCommonJS(src_exports);

// src/util/converters.ts
// src/lib/util/converters.ts
function tryParseJson(json) {
try {
return JSON.parse(json);
Expand All @@ -10809,10 +10809,10 @@ function tryParseJson(json) {
}
}

// src/util/AutoReconnectingWebsocket.ts
// src/lib/util/AutoReconnectingWebsocket.ts
var import_reconnecting_websocket = __toESM(require("reconnecting-websocket"));

// src/util/websocket.ts
// src/lib/util/websocket.ts
function makeURLForWebSocket(path, user, password) {
const url2 = new URL(path, location.href);
url2.protocol = url2.protocol.replace("http", "ws");
Expand All @@ -10824,7 +10824,7 @@ function makeURLForWebSocket(path, user, password) {
return url2.toString();
}

// src/util/AutoReconnectingWebsocket.ts
// src/lib/util/AutoReconnectingWebsocket.ts
var AutoReconnectingWebsocket = class extends import_reconnecting_websocket.default {
receivedFirstMessage;
path;
Expand Down Expand Up @@ -14114,7 +14114,7 @@ var {
mergeConfig: mergeConfig2
} = axios_default;

// src/ConnectedMotionGroup.ts
// src/lib/ConnectedMotionGroup.ts
var ConnectedMotionGroup = class _ConnectedMotionGroup {
constructor(nova, controller, motionGroup, initialMotionState, motionStateSocket, isVirtual, tcps, motionGroupSpecification) {
this.nova = nova;
Expand Down Expand Up @@ -14238,7 +14238,7 @@ var ConnectedMotionGroup = class _ConnectedMotionGroup {
}
};

// src/NovaCellAPIClient.ts
// src/lib/NovaCellAPIClient.ts
var import_wandelbots_api_client = require("@wandelbots/wandelbots-api-client");
var NovaCellAPIClient = class {
constructor(cellId, config) {
Expand Down
12 changes: 6 additions & 6 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10797,7 +10797,7 @@ var require_follow_redirects = __commonJS({
}
});

// src/util/converters.ts
// src/lib/util/converters.ts
function tryParseJson(json) {
try {
return JSON.parse(json);
Expand All @@ -10806,10 +10806,10 @@ function tryParseJson(json) {
}
}

// src/util/AutoReconnectingWebsocket.ts
// src/lib/util/AutoReconnectingWebsocket.ts
import ReconnectingWebSocket from "reconnecting-websocket";

// src/util/websocket.ts
// src/lib/util/websocket.ts
function makeURLForWebSocket(path, user, password) {
const url2 = new URL(path, location.href);
url2.protocol = url2.protocol.replace("http", "ws");
Expand All @@ -10821,7 +10821,7 @@ function makeURLForWebSocket(path, user, password) {
return url2.toString();
}

// src/util/AutoReconnectingWebsocket.ts
// src/lib/util/AutoReconnectingWebsocket.ts
var AutoReconnectingWebsocket = class extends ReconnectingWebSocket {
receivedFirstMessage;
path;
Expand Down Expand Up @@ -14111,7 +14111,7 @@ var {
mergeConfig: mergeConfig2
} = axios_default;

// src/ConnectedMotionGroup.ts
// src/lib/ConnectedMotionGroup.ts
var ConnectedMotionGroup = class _ConnectedMotionGroup {
constructor(nova, controller, motionGroup, initialMotionState, motionStateSocket, isVirtual, tcps, motionGroupSpecification) {
this.nova = nova;
Expand Down Expand Up @@ -14235,7 +14235,7 @@ var ConnectedMotionGroup = class _ConnectedMotionGroup {
}
};

// src/NovaCellAPIClient.ts
// src/lib/NovaCellAPIClient.ts
import {
ControllerApi,
ControllerIOsApi,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"scripts": {
"tsc": "tsc --pretty --noEmit",
"build": "tsup src/index.ts --format esm,cjs --clean --dts",
"test": "vitest"
"test": "vitest run"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/NovaClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Configuration } from "@wandelbots/wandelbots-api-client"
import { ConnectedMotionGroup } from "./ConnectedMotionGroup"
import { NovaCellAPIClient } from "./NovaCellAPIClient"
import { ConnectedMotionGroup } from "./lib/ConnectedMotionGroup"
import { NovaCellAPIClient } from "./lib/NovaCellAPIClient"

export type NovaClientConfig = {
/**
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { NovaClient } from "./NovaClient"
export * from "./NovaClient"
export * from "@wandelbots/wandelbots-api-client"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
RobotTcp,
} from "@wandelbots/wandelbots-api-client"
import { AutoReconnectingWebsocket } from "./util/AutoReconnectingWebsocket"
import { NovaClient } from "./NovaClient"
import { NovaClient } from "../NovaClient"
import { AxiosError } from "axios"

export type MotionGroupOption = {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ProgramRunner.ts → src/lib/ProgramRunner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AxiosError } from "axios"
import { AutoReconnectingWebsocket } from "./util/AutoReconnectingWebsocket"
import { tryParseJson } from "./util/converters"
import type { NovaClient } from "./NovaClient"
import type { NovaClient } from "../NovaClient"
import type { ConnectedMotionGroup } from "./ConnectedMotionGroup"

export type ProgramRunnerLogEntry = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 6 additions & 7 deletions test/jogging.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { expect, test } from 'vitest'
import { NovaClient } from '../src'

import { expect, test } from "vitest"
import { NovaClient } from "../src"
// TODO - jogging test

test('adds 1 + 2 to equal 3', () => {
test("client instantiation", () => {
const nova = new NovaClient({
instanceUrl: 'http://localhost:3000',
cellId: 'cell',
instanceUrl: "http://localhost:3000",
cellId: "cell",
})

expect(sum(1, 2)).toBe(3)
expect(nova).toBeTruthy()
})

0 comments on commit 6ae34a8

Please sign in to comment.