bito-code-review[bot] commented on code in PR #44459:
URL: https://github.com/apache/superset/pull/44459#discussion_r4072602366


##########
superset-frontend/scripts/build.js:
##########
@@ -26,13 +26,22 @@
 
 import { spawnSync } from 'node:child_process';
 import fastGlob from 'fast-glob';
-import yargs from 'yargs';
-import { hideBin } from 'yargs/helpers';
+import { parseArgs } from 'node:util';
 
 process.env.PATH = `./node_modules/.bin:${process.env.PATH}`;
 
-const { globs } = yargs(hideBin(process.argv)).parse();
-const glob = globs?.length > 1 ? `{${globs.join(',')}}` : globs?.[0] || '*';
+const cliOptions = {
+  globs: {
+    type: 'string',
+    multiple: true,
+    default: ['*'],
+  },
+};
+
+const { values } = parseArgs({ options: cliOptions });

Review Comment:
   <!-- Bito Reply -->
   The suggestion provided by the reviewer is correct and should be applied. 
The `parseArgs` function in Node.js defaults to `strict: true`, which causes 
the script to crash if any unexpected arguments or options are passed. Adding 
`strict: false` to the `parseArgs` configuration will maintain the previous 
behavior and prevent these crashes.
   
   **superset-frontend/scripts/build.js**
   ```
   const { values } = parseArgs({ 
     options: cliOptions,
     strict: false
   });
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to