Skip to content

Conversation

ClayMav
Copy link
Member

@ClayMav ClayMav commented Mar 14, 2025

Uses browser/nodejs compatible packages, switches to using query param auth on the browser

@sfishel18
Copy link
Collaborator

i'm getting some typescript errors from npm run build:

src/connection.ts:357:16 - error TS7006: Parameter 'buffer' implicitly has an 'any' type.

357               (buffer) =>
                   ~~~~~~

src/testing/mockSocketBehaviors.ts:63:6 - error TS7006: Parameter 'call' implicitly has an 'any' type.

63     (call) => call[0] === type,
        ~~~~

src/testing/mockSocketBehaviors.ts:65:22 - error TS7006: Parameter 'call' implicitly has an 'any' type.

65   listeners.forEach((call) => {

@sfishel18
Copy link
Collaborator

could you run these commands to adjust formatting and update the lock file?

npm install
npm run format:fix

const API_URL =
process.env["WHEROBOTS_API_URL"] || "https://api.cloud.wherobots.com";

const PROTOCOL_VERSION = "1.0.0";
const OS_TYPE = `${process.platform};${process.arch}`;
const NODE_VERSION = process.version;
const USER_AGENT = `${packageJson?.name}/${packageJson?.version} os/${OS_TYPE} node/${NODE_VERSION}"`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd rather not lose the package version from the user agent string. is there a way we can inject this as a build-time variable?

package.json Outdated
"description": "TypeScript SDK for Wherobots DB",
"license": "Apache-2.0",
"main": "dist/src/index.js",
"type": "module",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is "type": "module" necessary? it breaks the running of the example scripts (e.g. node -r @swc-node/register examples/connectionWithDefaults.ts)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to use it to be esm compatible for one of the packages. Will see if I can remove it. Also, I recommend we use npx for this so I have now replaced the command with npx tsx examples/connectionWithDefaults.ts (tsx runs ts files)

@ClayMav ClayMav requested a review from sfishel18 March 20, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants