nrwl / nx-labs

A collection of Nx plugins
MIT License
144 stars 50 forks source link

remix generator with `--directory` option generates companion e2e app in wrong directory #323

Open firxworx opened 1 year ago

firxworx commented 1 year ago

Current Behavior

With @nx/remix if you run nx generate and specify the --directory argument for the app, the app itself will get generated where you specify but its companion e2e app will be generated in the root of the apps folder.

I previously experienced this issue with other generators however those issues may now be fixed (I gave a quick check with the react generator using --dry-run). This is a new issue with @nx/remix.

Example reproduction:

You can also add --dry-run and the list of files will also show the wrong path.

pnpm exec nx generate @nx/remix:application --directory=example--name=remix-ui --tags=example --no-interactive

Expected Behavior

I expect the generator to respect the --directory flag and put both the app and its e2e companion app where I specify.

GitHub Repo

No response

Steps to Reproduce

The following steps assume your Nx workspace is configured to use apps/ as your apps directory per the workspaceLayout configuration option in nx.json.

  1. Generate a new app with the --directory flag and set it to a sub-directory of your workspace's apps/ folder, e.g. --directory example
  2. Watch the app get generated at apps/example and the e2e get generated under apps even you'd think the generator would respect the --directory flag

Previous misbehavior of other generators may have been fixed in the latest version of Nx however it still impacts the remix generator.

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 18.17.0
   OS     : linux-x64
   pnpm   : 8.6.11

   nx                 : 16.6.0
   @nx/js             : 16.6.0
   @nx/jest           : 16.6.0
   @nx/linter         : 16.6.0
   @nx/workspace      : 16.6.0
   @nx/cypress        : 16.6.0
   @nx/devkit         : 16.6.0
   @nx/esbuild        : 16.6.0
   @nx/eslint-plugin  : 16.6.0
   @nx/express        : 16.6.0
   @nx/next           : 16.6.0
   @nx/node           : 16.6.0
   @nx/plugin         : 16.6.0
   @nx/react          : 16.6.0
   @nx/storybook      : 16.6.0
   @nrwl/tao          : 16.6.0
   @nx/vite           : 16.6.0
   @nx/web            : 16.6.0
   nx-cloud           : 16.2.0
   typescript         : 5.1.6
   ---------------------------------------
   Community plugins:
   @nx/remix : 16.4.0
   ---------------------------------------

Failure Logs

No response

Operating System

Additional Information

No response