nx icon indicating copy to clipboard operation
nx copied to clipboard

Improve type conversion for executor overrides passed via CLI

Open Phault opened this issue 3 years ago • 0 comments

Current Behavior

If an executor has an option of type string and you want to provide it with a string containing a number such '123', then the schema validation currently stops you:

$ nx run my-app:deploy --otp='123'

> nx run my-app:deploy --otp=123

Property 'otp' does not match the schema. '123' should be a 'string'.

Expected Behavior

Nx should not convert the number-looking string to a number. It should first look at the executor's schema and then decide whether converting the type makes sense. The same goes for boolean-looking strings.

Steps to Reproduce

Failure Logs

Environment

   Node : 16.16.0
   OS   : darwin x64
   pnpm : 7.9.0

   nx : 14.3.6
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.3.6
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.3.6
   @nrwl/eslint-plugin-nx : 14.3.6
   @nrwl/express : Not Found
   @nrwl/jest : 14.3.6
   @nrwl/js : 14.3.6
   @nrwl/linter : 14.3.6
   @nrwl/nest : Not Found
   @nrwl/next : 14.3.6
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 14.3.0
   @nrwl/nx-plugin : 14.3.6
   @nrwl/react : 14.3.6
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.3.6
   @nrwl/web : 14.3.6
   @nrwl/workspace : 14.3.6
   typescript : 4.7.4
   ---------------------------------------
   Community plugins:
   	 @jscutlery/semver: 2.25.2
   	 ngx-deploy-npm: 4.1.2

Phault avatar Aug 09 '22 15:08 Phault