Skip to content

Commit

Permalink
V1 (#80)
Browse files Browse the repository at this point in the history
* v1

* fixes

* v1

* fix prettier

* awesome code style

* Changesets, GHA

* Changeset

* Scripts

* Copy changelog

---------

Co-authored-by: John Gozde <[email protected]>
  • Loading branch information
vogievetsky and jgoz authored Nov 20, 2024
1 parent 3bfc66c commit 6704028
Show file tree
Hide file tree
Showing 111 changed files with 12,503 additions and 4,409 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
51 changes: 51 additions & 0 deletions .changeset/fuzzy-suits-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
'druid-query-toolkit': major
---

Promote to version 1.0.0

Changes since 0.19.1:

- Time relative pattern filter now accepts an origin and correctly handles timezones
- Added docs and cleaned up names
- Fixed handling of null values in values filter patterns
- Added licenses
- Added author to pachage.json
- Added aggregator to segment metadata decoding
- Fix package.json main/module/types fields
- Make @druid-toolkit/query CJS only again
- Improve indentation in formatting
- Fix default spaces around EXTEND
- Added support for IS NOT DISTINCT FROM
- Mark spacing and keywords as readonly
- Allow join clause to accept join conditions with either USING or ON syntax
- Add support for array types
- Added isArray and parsing
- Fix type-o in the word double
- Expanded addSelect
- Better group by column detection
- Switch to peggy+ts-pegjs to generate parser
- fix location of UNION ALL in query stringification
- Added `alwaysUseCurrentTimestamp` to WhereTimeClauseEditor and `inlineMaxDataTime` to SqlQuery
- Don't try to convert nulls into dates
- Rolled back prettier
- better parsing of groupby clause
- Allow anchor timestamp as part of a relative pattern
- allow anchorTimestamp in filter pattern
- Added startBound and endBound to time-relative filter patterns
- Make it so that ROW does not show up in IN
- support for flipped time ranges
- Allow parsing of INSERT INTO EXTERN
- Allow addWhere and addHaving to be called empty
- Fixed issue with get by lobel
- Parsing for JSON_VALUE(... RETURNING ...)
- Parse PARTITION BY in window functions
- Added setAlias route method
- Better error message for truncated results
- Make addWhere not change WHERE to TRUE
- Add support for NATURAL keyword
- Parse RANGE/ROWS in window functions
- COUNT(\*) could have a window also
- Added defaultQueryContext
- Fix first table finder
- Handle Infinity in changeLimitValue
30 changes: 0 additions & 30 deletions .eslintrc.js

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
node-version-file: 'package.json'
cache: 'npm'
- run: npm install --prefer-offline --no-audit
- name: Test
run: npm test
- name: Check for changes requiring a changeset
if: github.event_name == 'pull_request'
run: npx changeset status --since=origin/master
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
branches: [master]

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
CI: 'true'

jobs:
release:
# prevents this action from running on forks
if: github.repository == 'implydata/druid-query-toolkit'
name: Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- run: npm install --prefer-offline --no-audit

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npx changeset publish --otp=1
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# https://github.com/changesets/action/issues/132
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
/build/
/dist/
/types/
/src/sql/parser/index.js
/src/sql/parser/index.ts
/src/sql/parser/.DS_Store

# TypeScript cache
*.tsbuildinfo

_old/
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.tsbuildinfo
*.spec.*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/sql/parser/index.ts
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

58 changes: 58 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import awesomeCodeStyle, { configs } from '@awesome-code-style/eslint-config';
import notice from 'eslint-plugin-notice';
import globals from 'globals';

const HEADER_TEMPLATE = `
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
`.trimStart();

const TYPESCRIPT_FILES = ['**/*.ts', '**/*.tsx'];

export default [
...awesomeCodeStyle,
...configs.typeChecked.map(config => ({ ...config, files: TYPESCRIPT_FILES })),
{
plugins: {
notice,
},
rules: {
'notice/notice': [2, { template: HEADER_TEMPLATE }],
},
},
{
files: ['*.js', 'script/*.js'],
languageOptions: {
globals: globals.node,
},
rules: {
'@typescript-eslint/no-require-imports': [0],
},
},
];
Loading

0 comments on commit 6704028

Please sign in to comment.