Skip to content
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

work with esbuild and adjust tidb sql #1

Merged
merged 6 commits into from
Apr 18, 2022
Merged

work with esbuild and adjust tidb sql #1

merged 6 commits into from
Apr 18, 2022

Conversation

baurine
Copy link
Owner

@baurine baurine commented Apr 18, 2022

What this PR did:

  1. make it works with esbuild

    see related issue: [bug] Can't work with sql-formatter-plus-plus lib evanw/esbuild#2181

    I also tried to fix the upstream regexpu-core in PR require all unicode properties mathiasbynens/regexpu-core#61 and PR eliminate runtime require regexpu-core#1 , but found sql-formatter-plus-plus (aka https://github.com/TennyZhuang/sql-formatter-plus) only works with regexpu-core 4.7.0 , can't work with the latest 5.0.1 . After upgrading the regexpu-core to the latest version, sql-formatter-plus-plus can't pass the test. And when I checkout to 4.7.0, I found it can't pass its test without any changes.

    So I gave up fixing the upstream, just use a workaround, change the lib entry from lib/sqlFormatter.js to bundled dist/sql-formatter.js or dist/sql-formatter.min.js to skip the dynamic require issue.

  2. add TiDB Sql Formatter, this part of code is moved from tidb-dashboard codebase.

  3. add unit test for TiDBSqlFormatter

@baurine baurine changed the title work with esbuild and adjst tidb sql work with esbuild and adjust tidb sql Apr 18, 2022
@baurine baurine merged commit f1d380d into master Apr 18, 2022
@baurine baurine deleted the work-with-esbuild branch April 18, 2022 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant