nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.62k stars 2.36k forks source link

Cannot specify externalDependencies #21411

Open kirkobyte opened 9 months ago

kirkobyte commented 9 months ago

Current Behavior

Specifying an inputs entry with {"externalDependencies": ["@swc/core", "@swc/jest"]} does not result in adding these external dependencies as a task input.

Expected Behavior

Any dependencies in the array should be added to the list of external dependencies

GitHub Repo

No response

Steps to Reproduce

This is the configuration I would like to work. However, I have also tried moving the externalDependencies definition into the package's project.json file without any luck.

In a package's project.json:

{
  "name": "@pacman/ab-cost-management-app",
  "$schema": "../../../node_modules/nx/schemas/project-schema.json",
  "targets": {
    "test": {
      "jestConfig": "{projectRoot}/jest.config.ts"
    }
  },
  "tags": ["app"]
}

In nx.json:

{
  "targetDefaults": {
    "test": {
      "executor": "@nx/jest:jest",
      "cache": true,
      "inputs": [
        "default",
        "^default",
        "{projectRoot}/jest.config.ts",
        "{workspaceRoot}/.swcrc",
        "{workspaceRoot}/jest.preset.js",
        "{workspaceRoot}/jest/*",
        "{workspaceRoot}/node_modules/@swc/jest/package.json",
        "{workspaceRoot}/node_modules/@swc/core/package.json",
        // The line I'm having trouble with:
        {"externalDependencies": ["@swc/core", "@swc/jest"]}
      ],
      "outputs": ["{workspaceRoot}/coverage/{projectRoot}", "{projectRoot}/junit.xml"],
      "options": {
        "jestConfig": "{projectRoot}/jest.config.ts",
        "forceExit": true,
        "passWithNoTests": true,
        "coverage": true,
        "color": true
      },
      "configurations": {
        "ci": {
          "ci": true,
          "codeCoverage": true,
          "options": {
            "runInBand": true,
            "parallel": 1
          }
        }
      }
    }
  },
  "tasksRunnerOptions": {
    "default": {
      "runner": "nx/tasks-runners/default",
      "options": {
        "cacheableOperations": []
      }
    }
  },
  "pluginsConfig": {
    "@nx/js": {
      "analyzeSourceFiles": true
    }
  },
  "plugins": ["nx/plugins/package-json"],
  "affected": {
    "defaultBase": "master"
  },
  "neverConnectToCloud": "true"
}

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 18.14.2
   OS     : darwin-arm64
   yarn   : 1.22.21

   nx                 : 17.2.8
   @nx/js             : 17.2.8
   @nx/jest           : 17.2.8
   @nx/linter         : 17.2.8
   @nx/eslint         : 17.2.8
   @nx/workspace      : 17.2.8
   @nx/devkit         : 17.2.8
   @nx/eslint-plugin  : 17.2.8
   @nx/react          : 17.2.8
   @nrwl/tao          : 17.2.8
   @nx/web            : 17.2.8
   typescript         : 5.2.2

Failure Logs

No response

Package Manager Version

yarn 1.22.21

Operating System

Additional Information

No response

LuminusDev commented 8 months ago

We've encountered the same problem. It seems to be a regression with the rewriting from Typescript to Rust.

github-actions[bot] commented 9 hours ago

This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏