Does anyone know of a wa…

less than 1 minute read

Does anyone know of a way to run nx print-affected without installing all of the workspace dependencies?

We have all of our node_modules cached into a docker image that we use when testing/building/linting in parallel, but pulling that image just to run the print-affected command is pretty heavy weight (read as slower than we’d like). It’d be nice if there were a minimal set of dependencies (or just nx/cli ) that we could use to get the affected apps in order to kick off our tets/builds/etc.

Responses:

also curious about this.

I got it down to @nrwl/workspace, tslib and typescript. With those It seems like affected works as expected

nice. wrapped up in a little docker image out of interest?

Right now it’s a hacky little script while I test things out: ```#!/usr/bin/env sh

set -xeuo pipefail

cp -f tools/ci-affected/package.json . cp -f tools/ci-affected/yarn.lock .

yarn

git checkout package.json yarn.lock where `package.json` in that folder looks like: { “name”: “ci-affected”, “version”: “1.0.0”, “description”: “Packages for running affected in CI”, “main”: “index.js”, “license”: “UNLICENSED”, “dependencies”: { “@nrwl/workspace”: “9.5.0”, “tslib”: “^2.0.0”, “typescript”: “^3.9.6” } }```

Updated: