GithubHelp home page GithubHelp logo

jasongwartz / bazel_rules_nodejs_contrib Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 6.0 817 KB

Ecosia specific JS Bazel rules to be used with the NodeJS rules

License: Apache License 2.0

Python 53.44% JavaScript 9.01% Go 37.55%

bazel_rules_nodejs_contrib's People

Contributors

dohe avatar globegitter avatar jasongwartz avatar purkhusid avatar zoidyzoidzoid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bazel_rules_nodejs_contrib's Issues

node_jest_test: Couldn't find preset "es2015" relative to directory

I'm trying to use node_jest_test (from the jest_rules branch) to run our test suite. Here's the rule in our BUILD file (some names changed to protect the innocent):

nodejs_jest_test(
    name="testsuite",
    srcs=[
      "//my_project/frontend:tests",
    ],
    data=[
        "//my_project/frontend:frontend",
        ":.babelrc",
        ":jest-test-env.js",
        ":package.json",
        ":webpack.babel.js",
    ],
    config=":jest.json",
    deps=[
        "@npm_my_project//node_modules/babel-jest:babel-jest__pkg",
        "@npm_my_project//node_modules/babel-preset-es2015:babel-preset-es2015__pkg",
        "@npm_my_project//node_modules/fs-extra:fs-extra__pkg",
        "@npm_my_project//node_modules/jest-cli:jest-cli__pkg",
    ],
)

where //my_project/frontend:tests is a glob for all *.test.js files and //my_project/frontend:frontend is a glob for all files. Here's my jest.json:

{
  "bail": false,
  "globals": {
    "window": true,
    "App": true
  },
  "setupFiles": [
    "<rootDir>/jest-test-env.js"
  ],
  "moduleFileExtensions": [
    "js",
    "json"
  ],
  "moduleDirectories": [
    "<rootDir>/../../external/npm_my_project/node_modules",
    "<rootDir>/external/npm_my_project/node_modules",
    "<rootDir>/my_project/frontend/modules",
    "my_project/frontend/modules",
    "<rootDir>/frontend/modules",
    "frontend/modules",
    "<rootDir>"
  ],
  "moduleNameMapper": {
    "\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.js",
    "\\.(gif|ttf|eot|svg|png)$": "<rootDir>/__mocks__/fileMock.js"
  }
}

It tries to run the tests, but every test fails with the following trace:

FAIL frontend/modules/ncex_redux/reducers/tests/theme-reducer.test.js
  â Test suite failed to run

    Couldn't find preset "es2015" relative to directory ".../my_project"

      at ../../../../../../../../../../../../../../external/npm_my_project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19

I've tried a bunch of different version of jest and babel-jest (20.0.3 and 23.2.0), but no luck. Any suggestions? :|

Support for transitive npm dependencies

Given the following rule, it seems like anything that depends on my-interface has to also add the transitive @npm//lib-used-by-my-interface dep. Is that expected and is there any way to get around it?

js_library(
    name = "my-interface",
    deps = ["@npm//lib-used-by-my-interface"],
    ...
)

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.