nrwl / nx-labs

A collection of Nx plugins
MIT License
140 stars 51 forks source link

fix(nx-ignore): support plugin object in nx.json #374

Closed jaysoo closed 7 months ago

jaysoo commented 7 months ago

When using crystal-compat plugins, nx-ignore will fail with an error like this:

TypeError: plugin.startsWith is not a function
--
14:54:43.692 | at /vercel/.npm/_npx/f3975d057d897afd/node_modules/nx-ignore/src/index.js:83:133
14:54:43.692 | at Array.filter (<anonymous>)
14:54:43.692 | at findThirdPartyPlugins (/vercel/.npm/_npx/f3975d057d897afd/node_modules/nx-ignore/src/index.js:83:108)
14:54:43.692 | at main (/vercel/.npm/_npx/f3975d057d897afd/node_modules/nx-ignore/src/index.js:39:71)
14:54:43.692 | at Object.<anonymous> (/vercel/.npm/_npx/f3975d057d897afd/node_modules/nx-ignore/src/index.js:27:1)
14:54:43.693 | at Module._compile (node:internal/modules/cjs/loader:1256:14)
14:54:43.693 | at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
14:54:43.693 | at Module.load (node:internal/modules/cjs/loader:1119:32)
14:54:43.693 | at Module._load (node:internal/modules/cjs/loader:960:12)
14:54:43.693 | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)

This is because the plugins as in object notation (e.g. { "plugin": "@nx/next/plugin" }) rather than a string.

This PR fixes this issue so we can use crystal-compat plugins in our workspaces.

nx-cloud[bot] commented 7 months ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 80a0f85390d1f84e47d813888fceea2624f1efb6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 4 targets - [`nx affected --target=e2e --parallel --max-parallel=1 --exclude=nx-ignore-e2e`](https://cloud.nx.app/runs/Oqo1j6dcFY?utm_source=pull-request&utm_medium=comment) - [`nx affected --target=test --parallel --max-parallel=2`](https://cloud.nx.app/runs/qqTaEbUtgG?utm_source=pull-request&utm_medium=comment) - [`nx affected --target=build --parallel --max-parallel=3`](https://cloud.nx.app/runs/x1LAFMgvpu?utm_source=pull-request&utm_medium=comment) - [`nx affected --target=lint --parallel --max-parallel=3`](https://cloud.nx.app/runs/SpVJ4Ay1dl?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.