Skip to content

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 force-pushed the work-with-esbuild branch from 4b07ab7 to 2909e49 Compare April 18, 2022 14:34
@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

Development

Successfully merging this pull request may close these issues.

2 participants