Skip to content

Commit

Permalink
Bump dev dependencies, update internal module resolution (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
slvrtrn authored Mar 25, 2024
1 parent 8604382 commit b740afe
Show file tree
Hide file tree
Showing 102 changed files with 472 additions and 428 deletions.
2 changes: 1 addition & 1 deletion benchmarks/leaks/memory_leak_arrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const program = async () => {
console.log()
console.log(
`Batch size: ${BATCH_SIZE}, iterations count: ${ITERATIONS}, ` +
`logging memory usage every ${LOG_INTERVAL} iterations`
`logging memory usage every ${LOG_INTERVAL} iterations`,
)

console.log()
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/leaks/memory_leak_brown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const program = async () => {
console.time('insert')
const filename = Path.resolve(
process.cwd(),
'benchmarks/leaks/input/mgbench1.csv'
'benchmarks/leaks/input/mgbench1.csv',
)
await client.insert({
table: tableName,
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/leaks/memory_leak_random_integers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const program = async () => {
console.log()
console.log(
`Batch size: ${BATCH_SIZE}, iterations count: ${ITERATIONS}, ` +
`logging memory usage every ${LOG_INTERVAL} iterations`
`logging memory usage every ${LOG_INTERVAL} iterations`,
)

console.log()
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/leaks/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function logMemoryUsageDiff({
const k = key as keyof MemoryUsage
const diff = current[k] - previous[k]
console.log(
`${k}: ${diff > 0 ? `+${diff.toFixed(2)}` : diff.toFixed(2)} MB`
`${k}: ${diff > 0 ? `+${diff.toFixed(2)}` : diff.toFixed(2)} MB`,
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/async_insert_without_waiting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ void (async () => {
'Rows inserted so far:',
`${rowsInserted};`,
'written to the table:',
count
count,
)
} catch (err) {
console.error(
'Failed to get the number of rows written to the table:',
err
err,
)
}
}, 1000)
Expand Down
2 changes: 1 addition & 1 deletion examples/node/basic_tls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void (async () => {
url: 'https://server.clickhouseconnect.test:8443',
tls: {
ca_cert: fs.readFileSync(
'../.docker/clickhouse/single_node_tls/certificates/ca.crt'
'../.docker/clickhouse/single_node_tls/certificates/ca.crt',
),
},
})
Expand Down
4 changes: 4 additions & 0 deletions examples/node/insert_file_stream_csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ void (async () => {
table: tableName,
values: Fs.createReadStream(filename),
format: 'CSV',
clickhouse_settings: {
/** See also: https://clickhouse.com/docs/en/interfaces/formats#csv-format-settings.
* You could specify these (and other settings) here. */
},
})

const rs = await client.query({
Expand Down
2 changes: 1 addition & 1 deletion examples/node/insert_file_stream_ndjson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void (async () => {
await client.insert({
table: tableName,
values: Fs.createReadStream(filename).pipe(
split((row: string) => JSON.parse(row))
split((row: string) => JSON.parse(row)),
),
format: 'JSONCompactEachRow',
})
Expand Down
5 changes: 5 additions & 0 deletions examples/node/insert_file_stream_parquet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Fs from 'fs'
import { cwd } from 'node:process'
import Path from 'path'

/** See also: https://clickhouse.com/docs/en/interfaces/formats#parquet-format-settings */
void (async () => {
const client = createClient()
const tableName = 'insert_file_stream_parquet'
Expand Down Expand Up @@ -39,6 +40,10 @@ void (async () => {
table: tableName,
values: Fs.createReadStream(filename),
format: 'Parquet',
clickhouse_settings: {
/** See also https://clickhouse.com/docs/en/interfaces/formats#parquet-format-settings.
* You could specify these (and other settings) here. */
},
})

const rs = await client.query({
Expand Down
4 changes: 4 additions & 0 deletions examples/node/select_parquet_as_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ void (async () => {

const { stream } = await client.exec({
query: `SELECT * from system.numbers LIMIT 10 FORMAT Parquet`,
clickhouse_settings: {
/** See also https://clickhouse.com/docs/en/interfaces/formats#parquet-format-settings.
* You could specify these (and other settings) here. */
},
})

const filename = Path.resolve(cwd(), './node/out.parquet')
Expand Down
10 changes: 5 additions & 5 deletions examples/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function existingHostPing() {
} else {
console.error(
'[ExistingHostPing] Ping expected to succeed, but got:',
pingResult
pingResult,
)
}
await client.close()
Expand All @@ -46,7 +46,7 @@ async function nonExistingHostPing() {
} else {
console.error(
'[NonExistingHostPing] Ping expected to fail with ECONNREFUSED, but got:',
pingResult
pingResult,
)
}
await client.close()
Expand All @@ -70,7 +70,7 @@ async function timeoutPing() {
} else {
console.error(
'[TimeoutPing] Ping expected to fail with a timeout error, but got:',
pingResult
pingResult,
)
}
await client.close()
Expand All @@ -87,7 +87,7 @@ function startSlowHTTPServer() {
}

function hasConnectionRefusedError(
pingResult: PingResult
pingResult: PingResult,
): pingResult is PingResult & { error: { code: 'ECONNREFUSED' } } {
return (
!pingResult.success &&
Expand All @@ -97,7 +97,7 @@ function hasConnectionRefusedError(
}

function hasTimeoutError(
pingResult: PingResult
pingResult: PingResult,
): pingResult is PingResult & { error: Error } {
return (
!pingResult.success &&
Expand Down
10 changes: 5 additions & 5 deletions examples/read_only_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void (async () => {
})
}
console.log(
`Created user ${readOnlyUsername} with restricted access to the system database`
`Created user ${readOnlyUsername} with restricted access to the system database`,
)
printSeparator()

Expand Down Expand Up @@ -79,7 +79,7 @@ void (async () => {
.catch((err) => {
console.error(
'[Expected error] Readonly user cannot insert the data into the table. Cause:\n',
err
err,
)
})
printSeparator()
Expand All @@ -93,7 +93,7 @@ void (async () => {
.catch((err) => {
console.error(
'[Expected error] Cannot query system.users cause it was not granted. Cause:\n',
err
err,
)
})
printSeparator()
Expand Down Expand Up @@ -125,7 +125,7 @@ void (async () => {
.catch((err) => {
console.error(
`[Expected error] Cannot modify 'send_progress_in_http_headers' setting in readonly mode. Cause:\n`,
err
err,
)
})
printSeparator()
Expand All @@ -137,6 +137,6 @@ void (async () => {

function printSeparator() {
console.log(
'------------------------------------------------------------------------'
'------------------------------------------------------------------------',
)
}
2 changes: 1 addition & 1 deletion karma.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const webpackConfig = require('./webpack.dev.js')

const TEST_TIMEOUT_MS = 120_000
const TEST_TIMEOUT_MS = 300_000

module.exports = function (config) {
config.set({
Expand Down
66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,49 +39,49 @@
"test:web:integration:local_cluster": "CLICKHOUSE_TEST_ENVIRONMENT=local_cluster npm run test:web",
"test:web:integration:cloud": "CLICKHOUSE_TEST_ENVIRONMENT=cloud npm run test:web",
"test:web:integration:cloud_smt": "CLICKHOUSE_TEST_ENVIRONMENT=cloud_smt npm run test:web",
"prepare": "husky install"
"prepare": "husky"
},
"devDependencies": {
"@faker-js/faker": "^8.2.0",
"@types/jasmine": "^4.3.2",
"@types/node": "^18.11.18",
"@types/sinon": "^10.0.15",
"@types/split2": "^3.2.1",
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"apache-arrow": "^14.0.1",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"jasmine": "^5.0.0",
"jasmine-core": "^5.0.0",
"@faker-js/faker": "^8.4.1",
"@types/jasmine": "^5.1.4",
"@types/node": "^20.11.30",
"@types/sinon": "^17.0.3",
"@types/split2": "^4.2.3",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"apache-arrow": "^15.0.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"jasmine": "^5.1.0",
"jasmine-core": "^5.1.2",
"jasmine-expect": "^5.0.0",
"karma": "^6.4.2",
"karma": "^6.4.3",
"karma-chrome-launcher": "^3.2.0",
"karma-firefox-launcher": "^2.1.2",
"karma-firefox-launcher": "^2.1.3",
"karma-jasmine": "^5.1.0",
"karma-mocha-reporter": "^2.2.5",
"karma-sourcemap-loader": "^0.4.0",
"karma-typescript": "^5.5.4",
"karma-webpack": "^5.0.0",
"lint-staged": "^13.1.0",
"parquet-wasm": "0.6.0-beta.1",
"prettier": "2.8.3",
"sinon": "^15.2.0",
"split2": "^4.1.0",
"terser-webpack-plugin": "^5.3.9",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"karma-webpack": "^5.0.1",
"lint-staged": "^15.2.2",
"parquet-wasm": "0.6.0-beta.2",
"prettier": "3.2.5",
"sinon": "^17.0.1",
"split2": "^4.2.0",
"terser-webpack-plugin": "^5.3.10",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsconfig-paths-webpack-plugin": "^4.0.1",
"typescript": "^4.9.4",
"uuid": "^9.0.0",
"webpack": "^5.84.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.4.3",
"uuid": "^9.0.1",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-merge": "^5.9.0"
"webpack-merge": "^5.10.0"
},
"workspaces": [
"./packages/*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function createReadOnlyUser(client: ClickHouseClient) {
}
console.log(
`Created user ${username} with default database ${database} ` +
'and restricted access to the system database'
'and restricted access to the system database',
)

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-common/__tests__/fixtures/simple_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createTable, TestEnv } from '../utils'
export function createSimpleTable<Stream = unknown>(
client: ClickHouseClient<Stream>,
tableName: string,
settings: MergeTreeSettings = {}
settings: MergeTreeSettings = {},
) {
return createTable(client, (env) => {
const filteredSettings = filterSettingsBasedOnEnv(settings, env)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createTable, guid, TestEnv } from '../utils'
export async function createTableWithFields(
client: ClickHouseClient,
fields: string,
clickhouse_settings?: ClickHouseSettings
clickhouse_settings?: ClickHouseSettings,
): Promise<string> {
const tableName = `test_table__${guid()}`
await createTable(
Expand Down Expand Up @@ -42,7 +42,7 @@ export async function createTableWithFields(
`
}
},
clickhouse_settings
clickhouse_settings,
)
return tableName
}
2 changes: 1 addition & 1 deletion packages/client-common/__tests__/fixtures/test_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const jsonValues = [

export async function assertJsonValues(
client: ClickHouseClient,
tableName: string
tableName: string,
) {
const result = await client
.query({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('abort request', () => {
await expectAsync(selectPromise).toBeRejectedWith(
jasmine.objectContaining({
message: jasmine.stringMatching('The user aborted a request'),
})
}),
)
})

Expand All @@ -47,7 +47,7 @@ describe('abort request', () => {
await expectAsync(selectPromise).toBeRejectedWith(
jasmine.objectContaining({
message: jasmine.stringMatching('The user aborted a request'),
})
}),
)
})

Expand All @@ -71,7 +71,7 @@ describe('abort request', () => {
await expectAsync(selectPromise).toBeRejectedWith(
jasmine.objectContaining({
message: jasmine.stringMatching('The user aborted a request'),
})
}),
)
})

Expand Down Expand Up @@ -106,7 +106,7 @@ describe('abort request', () => {
queries.every((q) => {
console.log(`${q.query} VS ${longRunningQuery}`)
return !q.query.includes(longRunningQuery)
})
}),
)
})

Expand Down Expand Up @@ -136,7 +136,7 @@ describe('abort request', () => {
})
}
return requestPromise
})
}),
)

controller.abort()
Expand All @@ -149,7 +149,7 @@ describe('abort request', () => {

async function assertActiveQueries(
client: ClickHouseClient,
assertQueries: (queries: Array<{ query: string }>) => boolean
assertQueries: (queries: Array<{ query: string }>) => boolean,
) {
let isRunning = true
while (isRunning) {
Expand Down
Loading

0 comments on commit b740afe

Please sign in to comment.