GithubHelp home page GithubHelp logo

Comments (4)

haikalpribadi avatar haikalpribadi commented on May 28, 2024

Is this even possible? 🤔

from typedb-driver-nodejs.

haikalpribadi avatar haikalpribadi commented on May 28, 2024

@vmax ?

from typedb-driver-nodejs.

lolski avatar lolski commented on May 28, 2024

Is this even possible?

we'll first need to do the research on whether it is possible. @haikalpribadi

from typedb-driver-nodejs.

alexjpwalker avatar alexjpwalker commented on May 28, 2024

@lolski This is technically possible, but not recommended. (Almost) all JavaScript and TypeScript projects use the package.json format for declaring dependencies. There are alternatives - a couple of Medium articles discuss this, including https://blog.bitsrc.io/4-npm-alternatives-best-js-package-managers-and-publishing-tools-fe6779937ee9 - but they are not well-known and it would not be beneficial for us to use a package manager with very low adoption in a secondary language in our ecosystem.

We will surely continue to use Bazel, and so it makes sense for us to use the prebuilt Bazel npm rules that we already use:

# Load package.json
node_repositories(
    package_json = ["//:package.json"]
)
yarn_install(
    name = "npm",
    package_json = "//:package.json",
    yarn_lock = "//:yarn.lock",
)

Note that this then allows our yarn-installed packages to be referenced as Bazel targets, akin to our usage of Maven inside Bazel:

ts_project(
    name = "client-nodejs",
    srcs = glob([
        "*.ts",
        "api/**/*.ts",
        "common/**/*.ts",
        "connection/**/*.ts",
        "concept/**/*.ts",
        "logic/**/*.ts",
        "query/**/*.ts",
        "stream/**/*.ts",
    ]),
    tsconfig = "tsconfig.json",
    declaration = True,
    deps = [
        "@npm//@grpc/grpc-js",
        "@npm//@types/node",
        "@npm//@types/uuid",
        "@npm//typedb-protocol",
        "@npm//typescript",
        "@npm//uuid",
    ],
)

I will close this issue - feel free to reopen if there is anything I'm missing that would cause our current behaviour to be incorrect.

from typedb-driver-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.