Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.0-beta1 #190

Merged
merged 5 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .build/build_and_prepare.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { execSync } from 'child_process'
import fs from 'fs'
import * as process from 'process'
;(() => {
const [tag] = process.argv.slice(2)
if (!tag) {
console.error(`Expected a tag as an argument`)
process.exit(1)
}

let packageName = ''
if (tag.endsWith('-browser')) {
packageName = 'client-browser'
} else if (tag.endsWith('-node')) {
packageName = 'client-node'
} else if (tag.endsWith('-common')) {
packageName = 'client-common'
} else {
console.error(`Provided tag ${tag} does not match any packages`)
process.exit(1)
}

fs.copyFileSync(`./packages/${packageName}/package.json`, './package.json')

const packageJson = require('../package.json')
const version = require(`../packages/${packageName}/src/version.ts`).default
console.log(`Current ${packageName} package version is: ${version}`)
packageJson.version = version

if (packageJson['dependencies']['@clickhouse/client-common']) {
const commonVersion =
require(`../packages/client-common/src/version.ts`).default
console.log(`Updating client-common dependency to ${commonVersion}`)
packageJson['dependencies']['@clickhouse/client-common'] = commonVersion
}

console.log('Updated package json:')
console.log(packageJson)

try {
execSync(`./.scripts/build.sh ${packageName}`, { cwd: process.cwd() })
} catch (err) {
console.error(err)
process.exit(1)
}

try {
fs.writeFileSync(
'./package.json',
JSON.stringify(packageJson, null, 2) + '\n',
'utf-8'
)
} catch (err) {
console.error(err)
process.exit(1)
}
process.exit(0)
})()
20 changes: 0 additions & 20 deletions .build/update_version.ts

This file was deleted.

19 changes: 19 additions & 0 deletions .docker/clickhouse/single_node/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,23 @@
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
</query_log>

<http_options_response>
<header>
<name>Access-Control-Allow-Origin</name>
<value>*</value>
</header>
<header>
<name>Access-Control-Allow-Headers</name>
<value>origin, x-requested-with, content-type, authorization</value>
</header>
<header>
<name>Access-Control-Allow-Methods</name>
<value>POST, GET, OPTIONS</value>
</header>
<header>
<name>Access-Control-Max-Age</name>
<value>86400</value>
</header>
</http_options_response>

</clickhouse>
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
webpack
8 changes: 5 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"project": ["./tsconfig.dev.json"]
"project": ["./tsconfig.all.json"]
},
"env": {
"node": true
Expand All @@ -25,10 +25,12 @@
},
"overrides": [
{
"files": ["./__tests__/**/*.ts"],
"files": ["./**/__tests__/**/*.ts"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off"
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-constant-condition": "off"
}
}
]
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
name: release
on:
workflow_dispatch:
release:
types: [created]
inputs:
version:
type: string
required: true
description: 'Version to release. Released package is based on the version suffix: -browser, -common, -node'
# TODO: trigger on release, currently it's just manual dispatch
# release:
# types: [created]
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -15,9 +21,8 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm i --ignore-scripts
- name: Update package.json version
run: NODE_OPTIONS="-r ts-node/register" node .build/update_version.ts
- run: npm run build
- run: npm publish
- name: Build package and prepare package.json
run: NODE_OPTIONS="-r ts-node/register" node .build/build_and_prepare.ts ${{ github.event.inputs.version }}
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading