Skip to content

Commit b386138

Browse files
slvrtrnmshustov
andauthored
0.2.0-beta1 (ClickHouse#190)
Co-authored-by: slvrtrn <[email protected]> Co-authored-by: Mikhail Shustov <[email protected]>
1 parent 06c4401 commit b386138

File tree

201 files changed

+5089
-4924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+5089
-4924
lines changed

.build/build_and_prepare.ts

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { execSync } from 'child_process'
2+
import fs from 'fs'
3+
import * as process from 'process'
4+
;(() => {
5+
const [tag] = process.argv.slice(2)
6+
if (!tag) {
7+
console.error(`Expected a tag as an argument`)
8+
process.exit(1)
9+
}
10+
11+
let packageName = ''
12+
if (tag.endsWith('-browser')) {
13+
packageName = 'client-browser'
14+
} else if (tag.endsWith('-node')) {
15+
packageName = 'client-node'
16+
} else if (tag.endsWith('-common')) {
17+
packageName = 'client-common'
18+
} else {
19+
console.error(`Provided tag ${tag} does not match any packages`)
20+
process.exit(1)
21+
}
22+
23+
fs.copyFileSync(`./packages/${packageName}/package.json`, './package.json')
24+
25+
const packageJson = require('../package.json')
26+
const version = require(`../packages/${packageName}/src/version.ts`).default
27+
console.log(`Current ${packageName} package version is: ${version}`)
28+
packageJson.version = version
29+
30+
if (packageJson['dependencies']['@clickhouse/client-common']) {
31+
const commonVersion =
32+
require(`../packages/client-common/src/version.ts`).default
33+
console.log(`Updating client-common dependency to ${commonVersion}`)
34+
packageJson['dependencies']['@clickhouse/client-common'] = commonVersion
35+
}
36+
37+
console.log('Updated package json:')
38+
console.log(packageJson)
39+
40+
try {
41+
execSync(`./.scripts/build.sh ${packageName}`, { cwd: process.cwd() })
42+
} catch (err) {
43+
console.error(err)
44+
process.exit(1)
45+
}
46+
47+
try {
48+
fs.writeFileSync(
49+
'./package.json',
50+
JSON.stringify(packageJson, null, 2) + '\n',
51+
'utf-8'
52+
)
53+
} catch (err) {
54+
console.error(err)
55+
process.exit(1)
56+
}
57+
process.exit(0)
58+
})()

.build/update_version.ts

-20
This file was deleted.

.docker/clickhouse/single_node/config.xml

+19
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,23 @@
3232
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
3333
</query_log>
3434

35+
<http_options_response>
36+
<header>
37+
<name>Access-Control-Allow-Origin</name>
38+
<value>*</value>
39+
</header>
40+
<header>
41+
<name>Access-Control-Allow-Headers</name>
42+
<value>origin, x-requested-with, content-type, authorization</value>
43+
</header>
44+
<header>
45+
<name>Access-Control-Allow-Methods</name>
46+
<value>POST, GET, OPTIONS</value>
47+
</header>
48+
<header>
49+
<name>Access-Control-Max-Age</name>
50+
<value>86400</value>
51+
</header>
52+
</http_options_response>
53+
3554
</clickhouse>

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
webpack

.eslintrc.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"parser": "@typescript-eslint/parser",
44
"parserOptions": {
55
"sourceType": "module",
6-
"project": ["./tsconfig.dev.json"]
6+
"project": ["./tsconfig.all.json"]
77
},
88
"env": {
99
"node": true
@@ -25,10 +25,12 @@
2525
},
2626
"overrides": [
2727
{
28-
"files": ["./__tests__/**/*.ts"],
28+
"files": ["./**/__tests__/**/*.ts"],
2929
"rules": {
3030
"@typescript-eslint/no-explicit-any": "off",
31-
"@typescript-eslint/no-non-null-assertion": "off"
31+
"@typescript-eslint/no-non-null-assertion": "off",
32+
"@typescript-eslint/ban-ts-comment": "off",
33+
"no-constant-condition": "off"
3234
}
3335
}
3436
]

.github/workflows/release.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
name: release
33
on:
44
workflow_dispatch:
5-
release:
6-
types: [created]
5+
inputs:
6+
version:
7+
type: string
8+
required: true
9+
description: 'Version to release. Released package is based on the version suffix: -browser, -common, -node'
10+
# TODO: trigger on release, currently it's just manual dispatch
11+
# release:
12+
# types: [created]
713
jobs:
814
build:
915
runs-on: ubuntu-latest
@@ -15,9 +21,8 @@ jobs:
1521
node-version: '16.x'
1622
registry-url: 'https://registry.npmjs.org'
1723
- run: npm i --ignore-scripts
18-
- name: Update package.json version
19-
run: NODE_OPTIONS="-r ts-node/register" node .build/update_version.ts
20-
- run: npm run build
21-
- run: npm publish
24+
- name: Build package and prepare package.json
25+
run: NODE_OPTIONS="-r ts-node/register" node .build/build_and_prepare.ts ${{ github.event.inputs.version }}
26+
- run: npm publish --dry-run
2227
env:
2328
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)