From 4df9ee4106254493576c5a996d3f90c486b56d37 Mon Sep 17 00:00:00 2001 From: Alexandre Pereira Date: Sun, 8 Sep 2024 15:22:21 +0100 Subject: [PATCH 1/4] chore: bump husky and clean up scripts --- .husky/install.mjs | 1 + .husky/pre-commit | 2 +- package-lock.json | 14 ++++++++------ package.json | 12 ++++++------ packages/libsql-client/package.json | 2 -- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.husky/install.mjs b/.husky/install.mjs index 941d817e..9d775787 100644 --- a/.husky/install.mjs +++ b/.husky/install.mjs @@ -1,3 +1,4 @@ +// See https://typicode.github.io/husky/how-to.html#ci-server-and-docker // Skip Husky install in production and CI if (process.env.NODE_ENV === "production" || process.env.CI === "true") { process.exit(0); diff --git a/.husky/pre-commit b/.husky/pre-commit index 0100eae1..af5adff9 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -npm run lint-staged +lint-staged \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e18bd8aa..f7281748 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,10 @@ "packages/libsql-client-wasm" ], "dependencies": { - "husky": "^9.0.11", "lint-staged": "^15.2.2" + }, + "devDependencies": { + "husky": "^9.1.5" } }, "node_modules/@ampproject/remapping": { @@ -2270,11 +2272,12 @@ } }, "node_modules/husky": { - "version": "9.0.11", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", - "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.5.tgz", + "integrity": "sha512-rowAVRUBfI0b4+niA4SJMhfQwc107VLkBUgEYYAOQAbqDCnra1nYh83hF/MDmhYs9t9n1E3DuKOrs2LYNC+0Ag==", + "dev": true, "bin": { - "husky": "bin.mjs" + "husky": "bin.js" }, "engines": { "node": ">=18" @@ -4837,7 +4840,6 @@ "devDependencies": { "@types/jest": "^29.2.5", "@types/node": "^18.15.5", - "husky": "^9.0.11", "jest": "^29.3.1", "lint-staged": "^15.2.2", "msw": "^2.3.0", diff --git a/package.json b/package.json index 32decbbe..39354360 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "packages/libsql-client", "packages/libsql-client-wasm" ], - "dependencies": { - "husky": "^9.0.11", - "lint-staged": "^15.2.2" - }, + "dependencies": {}, "scripts": { - "prepare": "node .husky/install.mjs", - "lint-staged": "lint-staged" + "prepare": "node .husky/install.mjs" + }, + "devDependencies": { + "lint-staged": "^15.2.2", + "husky": "^9.1.5" } } diff --git a/packages/libsql-client/package.json b/packages/libsql-client/package.json index e8dea9cf..fc0954b0 100644 --- a/packages/libsql-client/package.json +++ b/packages/libsql-client/package.json @@ -98,7 +98,6 @@ "test": "jest --runInBand", "typecheck": "tsc --noEmit", "typedoc": "rm -rf ./docs && typedoc", - "prepare": "husky install", "lint-staged": "lint-staged" }, "dependencies": { @@ -111,7 +110,6 @@ "devDependencies": { "@types/jest": "^29.2.5", "@types/node": "^18.15.5", - "husky": "^9.0.11", "jest": "^29.3.1", "lint-staged": "^15.2.2", "msw": "^2.3.0", From 4bcdcff7cc6ae90aa57e8a48007cceff9e9bf03c Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 6 Nov 2024 09:03:18 -0300 Subject: [PATCH 2/4] Update package.json Add missing comma to package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ded05f7..8fe6088d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "lint-staged": "^15.2.2", - "husky": "^9.1.5" + "husky": "^9.1.5", "build": "npm run build --workspaces", "typecheck": "npm run typecheck --workspaces", "format:check": "npm run format:check --workspaces", From f8bddfa49300d7ba5bf9a4ed1b3048a0e1515e55 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 6 Nov 2024 09:12:14 -0300 Subject: [PATCH 3/4] Fix package.json --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8fe6088d..1dbcb509 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,15 @@ ], "dependencies": {}, "scripts": { - "prepare": "node .husky/install.mjs" - }, - "devDependencies": { - "lint-staged": "^15.2.2", - "husky": "^9.1.5", + "prepare": "node .husky/install.mjs", "build": "npm run build --workspaces", "typecheck": "npm run typecheck --workspaces", "format:check": "npm run format:check --workspaces", "prepare": "node .husky/install.mjs", "lint-staged": "lint-staged" + }, + "devDependencies": { + "lint-staged": "^15.2.2", + "husky": "^9.1.5" } } From 9331a4322fe998b01ae5011eb4003bce24eb6dbc Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 6 Nov 2024 09:14:44 -0300 Subject: [PATCH 4/4] Run prettier on all files --- packages/libsql-client/src/http.ts | 4 ++-- packages/libsql-client/src/ws.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/libsql-client/src/http.ts b/packages/libsql-client/src/http.ts index cac4abac..22b7cfec 100644 --- a/packages/libsql-client/src/http.ts +++ b/packages/libsql-client/src/http.ts @@ -140,11 +140,11 @@ export class HttpClient implements Client { ): Promise> { return this.limit>(async () => { try { - const normalizedStmts = stmts.map(stmt => { + const normalizedStmts = stmts.map((stmt) => { if (Array.isArray(stmt)) { return { sql: stmt[0], - args: stmt[1] || [] + args: stmt[1] || [], }; } return stmt; diff --git a/packages/libsql-client/src/ws.ts b/packages/libsql-client/src/ws.ts index 03e95d9d..d1405cd4 100644 --- a/packages/libsql-client/src/ws.ts +++ b/packages/libsql-client/src/ws.ts @@ -198,11 +198,11 @@ export class WsClient implements Client { return this.limit>(async () => { const streamState = await this.#openStream(); try { - const normalizedStmts = stmts.map(stmt => { + const normalizedStmts = stmts.map((stmt) => { if (Array.isArray(stmt)) { return { sql: stmt[0], - args: stmt[1] || [] + args: stmt[1] || [], }; } return stmt;