-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-34567: [JS] Improve build and do not generate bin/bin
directory
#36607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason we were compiling these separately was because they are run by npm/node directly and aren't typically run with special flags or transpiled in via a bundler. Therefore, we chose to compile the bin files down to code that runs on the lowest-common-denominator node version.
For example, someone may run their app with node --loader ts-node/esm/transpile-only
, but they usually run bin scripts via npm run foo
or npx arrow2csv
.
Transpiling these scripts into <target>/bin/bin/
is definitely a bug/oversight. My guess is this was inadvertently introduced as part of @domoritz's sourcemap/mjs fixes a while back?
Regardless, I'd vote we keep the special casing and just fix the logic to transpile them down to ES5 + CJS. Thoughts @domoritz?
Thank you for your comment. By the way, is it expected that
Or is it this?
|
I have fixed it. What do you think of this patch?
|
Oops. Is #36607 (comment) as expected if I only look at the files in the bin directory? |
@abetomo the list in #36607 (comment) looks close.
|
Thanks for the review.
I ran it.
Help display. (Success.)
Error
Error message.
Currently, About
|
You mean build I would suggest that we either build the bin scripts in a way where they have all dependencies bundled or that we export the |
Thank you for your comment. |
…ctory Signed-off-by: abetomo <abe@enzou.tokyo>
The following error. ``` 0:0 error Parsing error: ESLint was configured to run on `<tsconfigRootDir>/src/bin/arrow2csv.ts` using `parserOptions.project`: /users/abe/work/github/arrow/js/tsconfig.json However, that TSConfig does not include this file. Either: - Change ESLint's list of included files to not include this file - Change that TSConfig to include this file - Create a new TSConfig that includes this file and include it in your parserOptions.project See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file ``` Signed-off-by: abetomo <abe@enzou.tokyo>
Signed-off-by: abetomo <abe@enzou.tokyo>
Signed-off-by: abetomo <abe@enzou.tokyo>
@abetomo thanks for the contribution. I rebased everything on top of main and added a transpiled version to the TS package. I also verified running for x in apache-arrow ts; do
./targets/$x/bin/arrow2csv.js -f test/data/cpp/stream/dictionary.arrow || exit 1;
done
for x in es5 es2015 esnext; do
for y in cjs esm umd; do
./targets/$x/$y/bin/arrow2csv.js -f test/data/cpp/stream/dictionary.arrow || exit 1;
done
done |
Can we merge this? |
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit a446ff7. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
…ctory (apache#36607) ### Rationale for this change `bin/bin` directory is unnecessary and should not be generated. ### What changes are included in this PR? * Add setting to exclude in tsconfig * Correctly set up `bin` out directory ### Are these changes tested? The following files are not generated. ``` targets/apache-arrow/bin/bin/arrow2csv.js targets/apache-arrow/bin/bin/arrow2csv.js.map targets/apache-arrow/bin/bin/arrow2csv.mjs targets/apache-arrow/bin/src/bin/arrow2csv.ts targets/es2015/cjs/bin/bin/arrow2csv.js targets/es2015/cjs/bin/bin/arrow2csv.js.map targets/es2015/cjs/bin/src/bin/arrow2csv.ts targets/es2015/esm/bin/bin/arrow2csv.js targets/es2015/esm/bin/bin/arrow2csv.js.map targets/es2015/esm/bin/src/bin/arrow2csv.ts targets/es2015/umd/bin/bin/arrow2csv.js targets/es2015/umd/bin/bin/arrow2csv.js.map targets/es2015/umd/bin/src/bin/arrow2csv.ts targets/es5/cjs/bin/bin/arrow2csv.js targets/es5/cjs/bin/bin/arrow2csv.js.map targets/es5/cjs/bin/src/bin/arrow2csv.ts targets/es5/esm/bin/bin/arrow2csv.js targets/es5/esm/bin/bin/arrow2csv.js.map targets/es5/esm/bin/src/bin/arrow2csv.ts targets/es5/umd/bin/bin/arrow2csv.js targets/es5/umd/bin/bin/arrow2csv.js.map targets/es5/umd/bin/src/bin/arrow2csv.ts targets/esnext/cjs/bin/bin/arrow2csv.js targets/esnext/cjs/bin/bin/arrow2csv.js.map targets/esnext/cjs/bin/src/bin/arrow2csv.ts targets/esnext/esm/bin/bin/arrow2csv.js targets/esnext/esm/bin/bin/arrow2csv.js.map targets/esnext/esm/bin/src/bin/arrow2csv.ts targets/esnext/umd/bin/bin/arrow2csv.js targets/esnext/umd/bin/bin/arrow2csv.js.map targets/esnext/umd/bin/src/bin/arrow2csv.ts ``` ### Are there any user-facing changes? * Closes: apache#34567 Lead-authored-by: abetomo <abe@enzou.tokyo> Co-authored-by: ptaylor <paul.e.taylor@me.com> Signed-off-by: Dominik Moritz <domoritz@gmail.com>
…ctory (apache#36607) ### Rationale for this change `bin/bin` directory is unnecessary and should not be generated. ### What changes are included in this PR? * Add setting to exclude in tsconfig * Correctly set up `bin` out directory ### Are these changes tested? The following files are not generated. ``` targets/apache-arrow/bin/bin/arrow2csv.js targets/apache-arrow/bin/bin/arrow2csv.js.map targets/apache-arrow/bin/bin/arrow2csv.mjs targets/apache-arrow/bin/src/bin/arrow2csv.ts targets/es2015/cjs/bin/bin/arrow2csv.js targets/es2015/cjs/bin/bin/arrow2csv.js.map targets/es2015/cjs/bin/src/bin/arrow2csv.ts targets/es2015/esm/bin/bin/arrow2csv.js targets/es2015/esm/bin/bin/arrow2csv.js.map targets/es2015/esm/bin/src/bin/arrow2csv.ts targets/es2015/umd/bin/bin/arrow2csv.js targets/es2015/umd/bin/bin/arrow2csv.js.map targets/es2015/umd/bin/src/bin/arrow2csv.ts targets/es5/cjs/bin/bin/arrow2csv.js targets/es5/cjs/bin/bin/arrow2csv.js.map targets/es5/cjs/bin/src/bin/arrow2csv.ts targets/es5/esm/bin/bin/arrow2csv.js targets/es5/esm/bin/bin/arrow2csv.js.map targets/es5/esm/bin/src/bin/arrow2csv.ts targets/es5/umd/bin/bin/arrow2csv.js targets/es5/umd/bin/bin/arrow2csv.js.map targets/es5/umd/bin/src/bin/arrow2csv.ts targets/esnext/cjs/bin/bin/arrow2csv.js targets/esnext/cjs/bin/bin/arrow2csv.js.map targets/esnext/cjs/bin/src/bin/arrow2csv.ts targets/esnext/esm/bin/bin/arrow2csv.js targets/esnext/esm/bin/bin/arrow2csv.js.map targets/esnext/esm/bin/src/bin/arrow2csv.ts targets/esnext/umd/bin/bin/arrow2csv.js targets/esnext/umd/bin/bin/arrow2csv.js.map targets/esnext/umd/bin/src/bin/arrow2csv.ts ``` ### Are there any user-facing changes? * Closes: apache#34567 Lead-authored-by: abetomo <abe@enzou.tokyo> Co-authored-by: ptaylor <paul.e.taylor@me.com> Signed-off-by: Dominik Moritz <domoritz@gmail.com>
Rationale for this change
bin/bin
directory is unnecessary and should not be generated.What changes are included in this PR?
bin
out directoryAre these changes tested?
The following files are not generated.
Are there any user-facing changes?