From 195a435279318975c213a15b03932db4b3cd3761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8D=95?= Date: Tue, 28 Apr 2026 16:04:40 +0800 Subject: [PATCH 1/4] Add tsconfig for testing Adds a dedicated tsconfig file for test files. This configuration is optimized for testing environments, enabling faster builds and improved type checking for test code. --- tsconfig.json | 3 ++- tsconfig.test.json | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tsconfig.test.json diff --git a/tsconfig.json b/tsconfig.json index f6df6c7..6dbe8dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "files": [], "references": [ { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } + { "path": "./tsconfig.node.json" }, + { "path": "./tsconfig.test.json" } ] } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 0000000..c3efa74 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "allowImportingTsExtensions": true, + "erasableSyntaxOnly": true, + "lib": ["ES2023", "DOM"], + "module": "esnext", + "moduleDetection": "force", + "moduleResolution": "bundler", + "noEmit": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "skipLibCheck": true, + "target": "es2023", + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.test.tsbuildinfo", + "types": ["bun"], + "verbatimModuleSyntax": true + }, + "include": ["tests/**/*.ts", "src/**/*.ts"] +} From 0f7d37d1536a041b2471b4661d0c89b6e963a9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8D=95?= Date: Tue, 28 Apr 2026 16:04:50 +0800 Subject: [PATCH 2/4] Remove unused type dependencies Removes several unused `@types` packages from the lockfile and package.json. Also removes the `test` script from `package.json` as it's no longer needed. --- bun.lock | 10 ---------- package.json | 5 +---- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/bun.lock b/bun.lock index e0ae695..15b8a38 100644 --- a/bun.lock +++ b/bun.lock @@ -12,8 +12,6 @@ "@babel/core": "^7.29.0", "@biomejs/biome": "2.4.12", "@rolldown/plugin-babel": "^0.2.3", - "@types/babel__core": "^7.20.5", - "@types/node": "^24.12.2", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^6.0.1", @@ -211,14 +209,6 @@ "@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="], - "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="], - - "@types/babel__generator": ["@types/babel__generator@7.27.0", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="], - - "@types/babel__template": ["@types/babel__template@7.4.4", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="], - - "@types/babel__traverse": ["@types/babel__traverse@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="], - "@types/node": ["@types/node@24.12.2", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-A1sre26ke7HDIuY/M23nd9gfB+nrmhtYyMINbjI1zHJxYteKR6qSMX56FsmjMcDb3SMcjJg5BiRRgOCC/yBD0g=="], "@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="], diff --git a/package.json b/package.json index de5fb3a..852dd40 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,6 @@ "@babel/core": "^7.29.0", "@biomejs/biome": "2.4.12", "@rolldown/plugin-babel": "^0.2.3", - "@types/babel__core": "^7.20.5", - "@types/node": "^24.12.2", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^6.0.1", @@ -41,8 +39,7 @@ "scripts": { "build": "tsc -b && vite build", "dev": "vite", - "lint": "knip && biome check --write . && tsc --noEmit", - "test": "bun test" + "lint": "knip && biome check --write . && tsc --noEmit" }, "type": "module", "version": "0.0.1" From ba7b9bc28b465e5a757486d09088ed2e4b8b8666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8D=95?= Date: Tue, 28 Apr 2026 16:05:00 +0800 Subject: [PATCH 3/4] Fixes multi-row insert splitting logic Ensures that multi-row INSERT statements are correctly split into individual statements, even when apostrophe escaping is used within values and the statement contains a large number of rows. This addresses an issue where the converter might incorrectly split or merge statements due to complex escaping sequences. --- tests/sql-converter.test.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/sql-converter.test.ts b/tests/sql-converter.test.ts index 14dfae3..b68f0b5 100644 --- a/tests/sql-converter.test.ts +++ b/tests/sql-converter.test.ts @@ -73,6 +73,29 @@ describe('convertMariaDbToSqlite', () => { ) }) + test('splits multi-row inserts when semicolon appears many rows after apostrophe escaping', () => { + const middleRows = Array.from( + { length: 150 }, + (_, index) => `('middle row ${index + 1}')`, + ) + const input = [ + "INSERT INTO `rent_item_rents` VALUES ('BIKIN JALAN DI KEBUN PAK MU\\'MIN')", + ...middleRows, + "('PENGANTARAN SOLAR EXCA SANY 01 & EXCA XCMG')", + ].join(',') + + const result = convertMariaDbToSqlite(`${input};`) + const statements = result.sql.trim().split('\n') + + expect(statements).toHaveLength(152) + expect(statements[0]).toBe( + "INSERT INTO \"rent_item_rents\" VALUES ('BIKIN JALAN DI KEBUN PAK MU''MIN');", + ) + expect(statements[151]).toBe( + 'INSERT INTO "rent_item_rents" VALUES (\'PENGANTARAN SOLAR EXCA SANY 01 & EXCA XCMG\');', + ) + }) + test('skips MariaDB database and locking statements', () => { const input = ` CREATE DATABASE \`legacy\`; From 522ea3e862edc9b5402ffb04c9bdfcab67ec319a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8D=95?= Date: Tue, 28 Apr 2026 16:07:37 +0800 Subject: [PATCH 4/4] Update Bun types Updates the Bun types package to version 1.3.13. This change ensures that the project is using the latest definitions for Bun, which can help improve type safety and catch potential issues during development. --- bun.lock | 5 +++++ package.json | 1 + 2 files changed, 6 insertions(+) diff --git a/bun.lock b/bun.lock index 15b8a38..be33cbd 100644 --- a/bun.lock +++ b/bun.lock @@ -12,6 +12,7 @@ "@babel/core": "^7.29.0", "@biomejs/biome": "2.4.12", "@rolldown/plugin-babel": "^0.2.3", + "@types/bun": "^1.3.13", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^6.0.1", @@ -209,6 +210,8 @@ "@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="], + "@types/bun": ["@types/bun@1.3.13", "", { "dependencies": { "bun-types": "1.3.13" } }, "sha512-9fqXWk5YIHGGnUau9TEi+qdlTYDAnOj+xLCmSTwXfAIqXr2x4tytJb43E9uCvt09zJURKXwAtkoH4nLQfzeTXw=="], + "@types/node": ["@types/node@24.12.2", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-A1sre26ke7HDIuY/M23nd9gfB+nrmhtYyMINbjI1zHJxYteKR6qSMX56FsmjMcDb3SMcjJg5BiRRgOCC/yBD0g=="], "@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="], @@ -223,6 +226,8 @@ "browserslist": ["browserslist@4.28.2", "", { "dependencies": { "baseline-browser-mapping": "^2.10.12", "caniuse-lite": "^1.0.30001782", "electron-to-chromium": "^1.5.328", "node-releases": "^2.0.36", "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg=="], + "bun-types": ["bun-types@1.3.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-QXKeHLlOLqQX9LgYaHJfzdBaV21T63HhFJnvuRCcjZiaUDpbs5ED1MgxbMra71CsryN/1dAoXuJJJwIv/2drVA=="], + "caniuse-lite": ["caniuse-lite@1.0.30001791", "", {}, "sha512-yk0l/YSrOnFZk3UROpDLQD9+kC1l4meK/wed583AXrzoarMGJcbRi2Q4RaUYbKxYAsZ8sWmaSa/DsLmdBeI1vQ=="], "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], diff --git a/package.json b/package.json index 852dd40..a0937f5 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@babel/core": "^7.29.0", "@biomejs/biome": "2.4.12", "@rolldown/plugin-babel": "^0.2.3", + "@types/bun": "^1.3.13", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^6.0.1",