Skip to content

Commit 63c05eb

Browse files
v5.0.0 (#42)
* fix zeroturnaround#152, Add + in scientific notation regex * fix zeroturnaround#159, Add token override for SET datatype * add common operators to Tokenizer, dedupe * update missing operators * use exhaustive list of monad operators * fix .. operator for PlSQL * fix handling for braces (zeroturnaround #155), add test for braces & backticks * move all operator handling into formatOperator * fix handling of backticks (zeroturnaround#139) * update isToken * fix zeroturnaround#123, add hex string type * fix zeroturnaround#166, add negative lookahead for specialWordChar for reserved words * fix zeroturnaround#162, add handling for prefix/suffix only specialWordChars * Fix zeroturnaround#137, add @@ system variables * add support for array and map accessors * print help when no arguments passed * convert cli tool to cladd * rename bin file * add ts export for module * update cjs build with typescript * add ts-loader for umd build * update badges and GH Actions names * Update issue templates * add enhancement template * add feature request title * update package.json * move index.html to static dir * make parenOptions Partial type * split into css and js files * ♻️ * remove local script * move options to left menu * add new options to demo * add icon * add comments for token overrides * fix prefixed operators * add link to bug reports * update TokenizerOptions.specialWordChars.any to Optional Type * update CHANGELOG * update README badges * update README with vscode * add CONTRIBUTING.md * fix formatting for reservedDependentClauses * update release-it json
1 parent 9d30c4b commit 63c05eb

Some content is hidden

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

46 files changed

+1638
-1856
lines changed

.eslintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"parserOptions": { "project": "./tsconfig.json", "ecmaVersion": 6, "sourceType": "module" },
44
"extends": ["airbnb-base", "airbnb-typescript/base", "plugin:import/typescript", "prettier"],
55
"plugins": ["@typescript-eslint", "prettier"],
6+
"globals": {
7+
"document": true,
8+
"prettierSql": true
9+
},
610
"rules": {
711
"class-methods-use-this": "off",
812
"curly": ["error", "all"],
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Formatting Bug Report
3+
about: Raise an issue about the FORMATTING output
4+
title: '[FORMATTING] Issue Title Here'
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**Expected Output**
13+
Please provide a code snippet of the expected SQL output.
14+
15+
**Actual Output**
16+
Please provide a code snippet of the SQL output produced by the tool.
17+
18+
**Usage**
19+
20+
- How are you calling / using the script? (Please provide a code snippet)
21+
- What SQL language(s) does this apply to?
22+
- What Node version? (If applicable)
23+
24+
**Additional context**
25+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/new-feature.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Suggest Improvement/Feature
3+
about: Suggest new features or improvements to existing ones
4+
title: 'Feature Request: Title Here'
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Describe the Feature**
10+
A clear and concise description of what the feature is.
11+
12+
**Why do you want this feature?**
13+
Your reasoning behind suggesting this feature.
14+
15+
**Info**
16+
17+
- How would you be calling / using the script?
18+
- What SQL language(s) does this apply to?
19+
- What Node version? (If applicable)
20+
21+
**Additional context**
22+
Add any other context about the feature here.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Script Bug Report
3+
about: Raise an issue with the SCRIPT that occurred during runtime
4+
title: '[SCRIPT] Issue Title Here'
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Usage**
27+
28+
- How are you calling / using the script? (Please provide a code snippet)
29+
- What SQL language(s) does this apply to?
30+
- What Node version? (If applicable)
31+
32+
**Additional context**
33+
Add any other context about the problem here.

.github/workflows/coveralls.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Coveralls
1+
name: coveralls
22

33
on:
44
push:

.github/workflows/webpack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: NodeJS with Webpack
1+
name: webpack
22

33
on:
44
pull_request:

.prettierrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"bracketSpacing": true,
77
"useTabs": true,
88
"tabWidth": 2,
9-
"endOfLine": "auto"
9+
"endOfLine": "auto",
10+
"quoteProps": "consistent"
1011
}

.release-it.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"requireUpstream": true,
88
"requireCommits": false,
99
"addUntrackedFiles": false,
10-
"commit": false,
10+
"commit": true,
11+
"commitMessage": "Release ${version}",
1112
"tag": true,
1213
"tagAnnotation": "${version}",
1314
"push": true,
14-
"pushArgs": ["--follow-tags"],
15-
"pushRepo": ""
15+
"pushArgs": ["--follow-tags"]
1616
},
1717
"npm": {
1818
"publish": true,
@@ -28,7 +28,7 @@
2828
"release": true,
2929
"releaseName": "${version}",
3030
"releaseNotes": "git log --pretty=format:\"* %s (%h)\" ${latestTag}...HEAD",
31-
"preRelease": true,
31+
"preRelease": false,
3232
"draft": false,
3333
"skipChecks": false,
3434
"web": true

CHANGELOG.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
11
# CHANGELOG
22

3-
## NEXT [5.0.0] : 2021-11-03
3+
## NEXT [5.0.0] : 2021-11-22
44

55
### Added
66

7-
New Features:
7+
Source:
8+
9+
- added support for ES6 module exports with TypeScript
10+
- updated webpack with ts-loader for module types
11+
- added tsc to babel commonjs build command
12+
- added index.ts pass-through export
13+
14+
Other:
15+
16+
- added GH Actions for CI build
17+
- added issue templates
18+
19+
### Updated
20+
21+
Source:
22+
23+
- updated demo page for all new options
24+
25+
Other:
26+
27+
- renamed library to `prettier-sql`
28+
29+
### Fixed
30+
31+
- fixed bugs related to operator tokens
32+
33+
### Removed
34+
35+
- removed Travis CI (replaced by GH Actions)
36+
37+
## [5.0.0-beta] : 2021-11-03
38+
39+
### Added
40+
41+
Source:
842

943
- added option `aliasAs` to toggle use of AS in column, table, query aliases
1044
- modes: always (SELECT and table), select (SELECT only), never
@@ -45,22 +79,12 @@ Files Added:
4579
- test/newline.js (tests for newline modes)
4680
- test/parenthesis.js (tests for paren positions)
4781

48-
### Removed
49-
50-
Files Removed:
51-
52-
- tokenTypes.ts (token types moved to TokenType enum in token.ts)
53-
- sqlFormatter.d.ts (converted to TypeScript)
54-
5582
### Updated
5683

57-
Major changes:
84+
Source:
5885

5986
- converted repo to Typescript
6087
- overhauled Keyword lists for all languages
61-
62-
Other:
63-
6488
- added default options for all configs
6589
- updated CLI to use config file
6690
- renamed Keyword categories to semantic Keyword types
@@ -70,3 +94,8 @@ Other:
7094
- reservedWord → reservedKeyword
7195
- added reservedFunctions
7296
- updated Tokenizer class and token.ts to be more DRY
97+
98+
### Removed
99+
100+
- tokenTypes.ts (token types moved to TokenType enum in token.ts)
101+
- sqlFormatter.d.ts (converted to TypeScript)

CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
## Bugs
2+
3+
Please submit bugs and issues here: https://github.com/inferrinizzard/prettier-sql/issues \
4+
There are issue templates available for FORMATTING or SCRIPT related bugs.
5+
6+
# Development
7+
8+
## Setup
9+
10+
This project uses `yarn` as its package manager, please download it here if you don't already have it:
11+
12+
- yarn: https://yarnpkg.com/getting-started
13+
14+
Once you have `yarn` installed, you can run `yarn` in the root directory to install all dependencies and devDependencies from package.json.
15+
16+
You're now ready to get started !
17+
18+
## Branch Guidelines
19+
20+
New branches: Please branch off of the `develop` branch.
21+
22+
### Naming
23+
24+
Please use one of the following prefixes: (ie. feature/new-feature)
25+
26+
- feature/ - development towards a new feature
27+
- dev/ - misc development not tied to a key feature / refactoring
28+
- issue/ - fix specifically for a issue #
29+
- bug/ - misc bug fixes not tied to a public issue
30+
- repo/ - meta dev related changes (ie. typescript, CI/CD, dependencies)
31+
32+
## Testing
33+
34+
Tests should be run before pushing commits to a remote branch, please do so with the `test` command in package.json \
35+
It can be invoked via:
36+
37+
- `yarn test`
38+
- `npm run test`
39+
- `jest`
40+
41+
## New Tests
42+
43+
Please add new tests for any new features and bug fixes. \
44+
Language-specific tests should be included in their respective Test files, tests that apply to all languages should be in `behavesLikeSqlFormatter.js`
45+
46+
# Contributors
47+
48+
## `prettier-sql`
49+
50+
- Sean Song <[email protected]>
51+
52+
## `sql-formatter`
53+
54+
- Adrien Pyke <[email protected]>
55+
- Andrew
56+
- Benjamin Bellamy
57+
- bingou
58+
- Damon Davison <[email protected]>
59+
- Davut Can Abacigil <[email protected]>
60+
- Erik Hirmo <[email protected]>
61+
- George Leslie-Waksman <[email protected]>
62+
- Ian Campbell <[email protected]>
63+
- ivan baktsheev
64+
- João Pimentel Ferreira
65+
- Martin Nowak <[email protected]>
66+
- Matheus Salmi <[email protected]>
67+
- Matheus Teixeira <[email protected]>
68+
- Nicolas Dermine <[email protected]>
69+
- Offir Baron <[email protected]>
70+
- Olexandr Sydorchuk <[email protected]>
71+
- Rafael Pinto <[email protected]>
72+
- Rahel Rjadnev-Meristo <[email protected]>
73+
- Rene Saarsoo <[email protected]>
74+
- Rodrigo Stuchi
75+
- Sasha Aliashkevich <[email protected]>
76+
- Sergei Egorov <[email protected]>
77+
- Tyler Jones <[email protected]>
78+
- Uku Pattak <[email protected]>

0 commit comments

Comments
 (0)