nx icon indicating copy to clipboard operation
nx copied to clipboard

Not possible to use Angular builders from local nx-plugin

Open minijus opened this issue 3 years ago • 0 comments

Current Behavior

It is not possible to use Angular builder from workspace local nx-plugin:

  • Defining builder (without "cli": "nx") fails with Cannot find module '@builder-repro/nx-plugin/package.json'
  • Using executor (with "cli": "nx") with scheduleTarget fails with Cannot find module '@builder-repro/nx-plugin/package.json'
  • Using executor to invoke builder directly is not possible because of lack of interoperability between nx ExecutorContext and Angular BuilderContext.

Expected Behavior

It would be great having possibility to invoke/execute Angular builders from local nx-plugin.

Steps to Reproduce

I've created fresh repository with all 3 scenarios reproduced: https://github.com/minijus/builder-repro. 3 executor targets are defined on test-app: https://github.com/minijus/builder-repro/blob/main/apps/test-app/project.json#L53-L88

Failure Logs

image

Environment

   Node : 16.16.0
   OS   : darwin x64
   npm  : 8.16.0
   
   nx : 14.5.4
   @nrwl/angular : 14.5.4
   @nrwl/cypress : 14.5.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.5.4
   @nrwl/eslint-plugin-nx : 14.5.4
   @nrwl/express : Not Found
   @nrwl/jest : 14.5.4
   @nrwl/js : 14.5.4
   @nrwl/linter : 14.5.4
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : 14.5.4
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.5.4
   @nrwl/web : 14.5.4
   @nrwl/workspace : 14.5.4
   typescript : 4.7.4
   ---------------------------------------
   Community plugins:

minijus avatar Aug 05 '22 06:08 minijus

It would be nice if the @nrwl/* executors consistently used the same context (Executor or Builder) for all tasks, rather than using ExecutorContext for most and BuilderContext for Angular tasks (even the nrwl/angular custom ones).

bridzius avatar Aug 23 '22 05:08 bridzius