Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(cli): dynamically load extraneous dependency #3601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bodinsamuel
Copy link
Collaborator

Changes

Fixes https://linear.app/nango/issue/NAN-2807/investigate-soap-in-cli

  • Dynamically load extraneous dependency
    We don't want the CLI to end up installing the whole world. Until we figure out bundling, it's going to be this solution, so at least make it less impactful on install.

  • Added new command to run the project as headless
    Got tired of running the UI when not needed, it's too heavy when debugging/using backend

Tests

Testing is a bit annoying.

  • npm uninstall -w @nangohq/nango-runner soap (desinstall in the project so it's not mistakenly loaded)
# soap.ts
import type { NangoSync } from "../../models";
import soap from "soap";

export default async function fetchData(nango: NangoSync): Promise<void> {
  console.log("soap", { soap });
  await soap.createClientAsync(
    `https://community.workday.com/sites/default/files/file-hosting/productionapi/top/vtop/top.wsdl`,
    {},
  );

  await nango.log("top");
}
  • npm run dwh
  • node nango/packages/cli/dist/index.js dryrun soap 025d9a38-f31c-4a64-b034-57a425761a90

When not installed locally it will yield this
Screenshot 2025-02-28 at 11 56 35

Copy link

linear bot commented Feb 28, 2025

@bodinsamuel bodinsamuel requested a review from a team February 28, 2025 11:46
@bodinsamuel bodinsamuel self-assigned this Feb 28, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant