Skip to content

Commit db5b986

Browse files
committed
chore(release): release v2.0.0
2 parents 98629d0 + 77f4739 commit db5b986

Some content is hidden

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

44 files changed

+14651
-6771
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Top-most editor config file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
9+
# Set default charset and tab length
10+
[*.{js, json}]
11+
charset = utf-8
12+
indent_style = tab
13+
tab_width = 2

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If applicable, add screenshots to help explain your problem.
3030

3131
- Dabbu Version: (Current version, seen when server is run) e.g. 1.8.0
3232
- OS Version: (Platform and Version) e.g. macOS 10.15.7 / Windows 10 (20H2) / Ubuntu 20.04.3 x64 / etc
33-
- Provider ID: hard_drive / google_drive / one_drive / gmail / etc
33+
- Provider ID: hard-drive / google-drive / one-drive / gmail / etc
3434

3535
**Additional context**
3636

.github/workflows/ci.yml

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: NodeJS CI
33
# Triggers the workflow on push or pull request events but only for the main branch
44
on: [push, pull_request]
55

6-
# This workflow contains three jobs: check code style, build and release
6+
# This workflow contains three jobs: run tests, build and release
77
jobs:
8-
# Check code style
9-
check-format:
10-
name: Check code style
8+
# Run tests
9+
test:
10+
name: Run tests (node ${{ matrix.node_version }})
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
@@ -22,12 +22,11 @@ jobs:
2222
uses: actions/setup-node@v1
2323
with:
2424
node-version: ${{ matrix.node_version }}
25-
# Check the format
26-
- name: Check format
25+
# Run all tests
26+
- name: Run tests
2727
run: |
2828
npm ci
29-
npm run check-format
30-
29+
npm test
3130
# Build the executable
3231
build:
3332
name: Build executable (alpine, linux, macos, win) (node ${{ matrix.node_version }})
@@ -76,7 +75,7 @@ jobs:
7675
release:
7776
name: Upload release
7877
# Make sure the format and build tasks have succeeded before uploading a release
79-
needs: [check-format, build]
78+
needs: [test, build]
8079
runs-on: ubuntu-latest
8180
steps:
8281
# Checks-out the repository under $GITHUB_WORKSPACE, so we job can access it
@@ -110,31 +109,15 @@ jobs:
110109
echo "::set-output name=version::$version_name"
111110
echo "::set-output name=previous_version::$previous_version_name"
112111
id: check-version
113-
# Get a list of all commits from the previous release till this one, and add it to the changelog
114-
- name: Generate changelog
115-
# Run it only if the version has been changed
116-
if: ${{ steps.check-version.outputs.version != steps.check-version.outputs.previous_version }}
117-
run: |
118-
revision=`git rev-list --tags --max-count=1`
119-
version_name=`cat version`
120-
previous_version_name=`git describe --tags --abbrev=0`
121-
echo "" >> CHANGELOG.md
122-
echo "### Commits since last release:" >> CHANGELOG.md
123-
git log --format="- %s %h" $revision..HEAD >> CHANGELOG.md
124-
echo "" >> CHANGELOG.md
125-
echo "Generated following CHANGELOG:"
126-
cat CHANGELOG.md
127-
echo "::set-output name=version::$version_name"
128-
echo "::set-output name=previous_version::$previous_version_name"
129-
id: generate-changelog
130112
- name: Create release
131113
# Run it only if the version has been changed
132-
if: ${{ steps.generate-changelog.outputs.version != steps.generate-changelog.outputs.previous_version }}
114+
if: ${{ steps.check-version.outputs.version != steps.check-version.outputs.previous_version }}
133115
uses: softprops/action-gh-release@v1
134116
with:
135-
body_path: CHANGELOG.md
136-
tag_name: ${{ steps.generate-changelog.outputs.version }}
137-
name: Dabbu Files API Server ${{ steps.generate-changelog.outputs.version }}
117+
body_path: RELEASE-NOTES.md
118+
tag_name: ${{ steps.check-version.outputs.version }}
119+
prerelease: contains(steps.check-version.outputs.version, '-')
120+
name: Dabbu Files API Server ${{ steps.check-version.outputs.version }}
138121
files: |
139122
files-api-server-alpine
140123
files-api-server-linux

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ creds/
33
dist/
44
_dabbu/
55
.git/
6-
.heroku*
6+
.heroku/

.prettierignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
1-
### Maintenance
1+
### Changes to server
22

3-
- Enable `dependabot`.
4-
- Update the following dependencies:
5-
- `pkg`
6-
- `file-type`
7-
- `archiver`
3+
- Separate server code from argument parsing
4+
5+
### Provider specific changes
6+
7+
#### Hard Drive
8+
9+
**Bug fixes:**
10+
11+
- return 404 instead of 500 if file was not found 73c6d28
12+
- throw error if base_path is missing c210a81
13+
14+
### Code Style
15+
16+
- Add `XO` as linter 0ac7e22
17+
- Run `prettier` through `XO` to format files b11a58c
18+
19+
### Testing
20+
21+
- Add test framework (`ava`) 0c70860
22+
23+
24+
### Builds and CI
25+
26+
- Add support for prereleases from the `develop` branch f707e46
27+
28+
### Documentation
29+
30+
- Add badges to README
31+
- Update CONTRIBUTING instructions

CONTRIBUTING.md

Lines changed: 67 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,72 @@ Once you've built the project locally, you're ready to start making changes!
5151

5252
### Step 3: Branch
5353

54-
To keep your development environment organized, create local branches to hold your work. These should be branched directly off of the `main` branch. While naming branches, try to name it according to the bug it fixes or the feature it adds.
54+
To keep your development environment organized, create local branches to hold your work. These should be branched directly off of the `develop` branch. While naming branches, try to name it according to the bug it fixes or the feature it adds. Also prefix the branch with the type of change it is making. Here is a list of common prefixes:
55+
56+
- `fix/`: A bug fix
57+
- `feature/`: A new feature
58+
- `docs/`: Documentation changes
59+
- `perf/`: A code change that improves performance
60+
- `refactor/`: A code change that neither fixes a bug nor adds a feature
61+
- `test/`: A change to the tests
62+
- `style/`: Changes that do not affect the meaning of the code (linting)
63+
- `build/`: Bumping a dependency like node or express
5564

5665
```sh
57-
$ git checkout -b add-awesome-new-feature -t upstream/main
66+
$ git checkout -b feature/add-awesome-new-feature -t upstream/develop
5867
```
5968

6069
### Step 4: Code
6170

62-
To get a decent idea of how the code is organised and what happens where, the code is heavily commented to allow you to understand exactly what happens. Remember to always format the code using `prettier` once you're done.
71+
To get a decent idea of how the code is organised and what happens where, the code is heavily commented to allow you to understand exactly what happens. Remember to always format the code using `xo` once you're done.
6372

6473
To test a change without building the executables, you can type `npm start` and it will run the server directly. Use an HTTP client like `httpie` or `postman` to test the API.
6574

66-
To check if the code is formatted correctly, run `npm run check-format`. To format the code using prettier, run `npm run format`.
75+
### Step 5: Document
76+
77+
Once your changes are ready to go, begin the process of documenting your code. The code **must** be heavily commented, so future contributors can move around and make changes easily.
78+
79+
Make sure all the changes you make are in accordance with the [Files API Specifications](https://dabbu-knowledge-platform.github.io/files_api/). If you wish to make changes to the API specification itself, drop a message [here](https://github.com/dabbu-knowledge-platform/cli/discussions/categories/general) and we can start discussing the changes.
80+
81+
### Step 6: Test
82+
83+
Please ensure that all changes/additions come with tests. All PRs must have unit tests unless the maintainer says the PR is text-exempt.
84+
85+
If you are adding a new module, add the tests for that module in the `tests/module-tests/<provider id>-test.js`. If you added a utility function, add a test for it in `tests/utils-test.js`. If you modified the handling of an internal method such as the `cache` method, or listing, enabling and disabling providers, add the test to `tests/server-test.js`.
86+
87+
Before submitting your changes, please run the linter (`xo`) and all tests in the `tests/` folder:
88+
89+
```
90+
npm test
91+
```
92+
93+
Please ensure that:
94+
95+
- your code passes all lint checks (`xo`)
96+
- your code passes all format checks (`prettier` run by xo)
97+
- all existing and added tests pass. If the linter points out errors, try fixing them automatically by running:
98+
99+
```
100+
npm run format
101+
```
102+
103+
The linter will try its best to fix all issues, but certain issues require you to fix them manually.
104+
105+
If you need to disable any lint rules, please make sure that it is really necessary and there is absolutely no better way of writing that piece of code. Disable lint checks for a certain line by entering typing the following before that line:
106+
107+
```
108+
// eslint-disable-next-line some-lint-rule-id
109+
```
110+
111+
To disable lint checks for an entire file (not recommended), enter the following at the top of the file:
112+
113+
```
114+
/* eslint some-lint-rule-id: 0 */
115+
```
116+
117+
All existing and added tests **MUST** pass for the PR to land. If existing tests are already failing on the `develop` branch, ensure that no additional tests fail due to your changes. Note that **no PRs will be merged until the tests on the `develop` branch are fixed and all of them pass**.
67118

68-
### Step 5: Commit
119+
### Step 7: Commit
69120

70121
It is recommended to keep your changes grouped logically within individual commits. Many contributors find it easier to review changes that are split across multiple commits. There is no limit to the number of commits in a pull request.
71122

@@ -96,8 +147,9 @@ Common prefixes:
96147
- `docs`: Documentation changes
97148
- `perf`: A code change that improves performance
98149
- `refactor`: A code change that neither fixes a bug nor adds a feature
150+
- `test`: A change to the tests
99151
- `style`: Changes that do not affect the meaning of the code (linting)
100-
- `vendor`: Bumping a dependency like node or express
152+
- `build`: Bumping a dependency like node or express
101153

102154
Other things to keep in mind when writing a commit message:
103155

@@ -113,33 +165,23 @@ A commit that has the text `BREAKING CHANGE:` at the beginning of its optional b
113165

114166
See [conventionalcommits.org](https://conventionalcommits.org) for more details.
115167

116-
### Step 6: Rebase
168+
### Step 8: Rebase
117169

118-
Once you have committed your changes, it is a good idea to use `git rebase` (_NOT `git merge`_) to synchronize your work with the main repository.
170+
Once you have committed your changes, it is a good idea to use `git rebase` (NOT `git merge`) to synchronize your work with the develop branch.
119171

120172
```sh
121173
$ git fetch upstream
122-
$ git rebase upstream/main
174+
$ git rebase upstream/develop
123175
```
124176

125-
This ensures that your working branch has the latest changes from `dabbu-knowledge-platform/files-api-server` main.
126-
127-
### Step 7: Test
128-
129-
Bug fixes and features should always come with tests. Please test your own code adequately. Also, before finally pushing your code, clone it into a fresh environment (different user or maybe a different computer) and make sure it works just as fine. Make sure you test the executables in the `dist/` directory.
130-
131-
### Step 8: Document
132-
133-
Once your commits are ready to go - with adequate testing - begin the process of documenting your code. The code **must** be heavily commented, so future contributors can move around and make changes easily.
134-
135-
Make sure all the changes you make are in accordance with the [Files API Specifications](https://dabbu-knowledge-platform.github.io/files_api/). If you wish to make changes to the API specification itself, drop a message [here](https://github.com/dabbu-knowledge-platform/cli/discussions/categories/general) and we can start discussing the changes.
177+
This ensures that your working branch has the latest changes from `dabbu-knowledge-platform/files-api-server` develop. If any conflicts arise, resolve them and commit the changes again.
136178

137179
### Step 9: Push
138180

139181
Once you have documented your code as required, begin the process of opening a pull request by pushing your working branch to your fork on GitHub.
140182

141183
```sh
142-
$ git push origin add-awesome-new-feature
184+
$ git push origin feature/add-awesome-new-feature
143185
```
144186

145187
### Step 10: Opening the Pull Request
@@ -155,21 +197,21 @@ To make changes to an existing pull request, make the changes to your local bran
155197
```sh
156198
$ git add my/changed/files
157199
$ git commit
158-
$ git push origin add-awesome-new-feature
200+
$ git push origin feature/add-awesome-new-feature
159201
```
160202

161-
There are a number of more advanced mechanisms for managing commits using `git rebase` that can be used, but are beyond the scope of this guide.
203+
There are a number of more advanced mechanisms for managing commits using `git rebase` that can be used, but are beyond the scope of this guide. Also, any branch that is being merged must be merged without fast forward, i.e., `git merge --no-ff ...`.
162204

163205
Feel free to post a comment in the pull request to ping reviewers if you are awaiting an answer on something.
164206

165207
**Approval and Request Changes Workflow**
166208

167-
All pull requests require approval from contributors in order to land. Whenever a maintainer reviews a pull request they may request changes. These may be small, such as fixing a typo, or may involve substantive changes. Such requests are intended to be helpful, but at times may come across as abrupt or unhelpful, especially if they do not include concrete suggestions on _how_ to change them.
209+
All pull requests require approval from at least one maintainer in order to land. Whenever a maintainer reviews a pull request they may request changes. These may be small, such as fixing a typo, or may involve substantive changes. Such requests are intended to be helpful, but at times may come across as abrupt or unhelpful, especially if they do not include concrete suggestions on _how_ to change them.
168210

169211
Try not to be discouraged. Try asking the maintainer for advice on how to implement it. If you feel that a review is unfair, say so or seek the input of another project contributor. Often such comments are the result of a reviewer having taken insufficient time to review and are not ill-intended. Such difficulties can often be resolved with a bit of patience. That said, reviewers should be expected to provide helpful feedback.
170212

171213
### Step 12: Landing
172214

173-
In order to land, a pull request needs to be reviewed and approved by at least one contributor. After that, if there are no objections from other contributors, the pull request can be merged.
215+
In order to land, a pull request needs to be reviewed and approved by at least one maintainer. After that, if there are no objections from other contributors, the pull request can be merged.
174216

175217
**Congratulations and thanks a lot for your contribution!**

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: npm start $PORT google_drive one_drive gmail
1+
web: npm start $PORT google-drive one-drive gmail

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dabbu Files API Server
22

3-
[![NodeJS CI](https://github.com/dabbu-knowledge-platform/files-api-server/actions/workflows/ci.yml/badge.svg)](https://github.comdabbu-knowledge-platform/files-api-server/actions/workflows/ci.yml)
3+
[![NodeJS CI](https://github.com/dabbu-knowledge-platform/files-api-server/actions/workflows/ci.yml/badge.svg)](https://github.com/dabbu-knowledge-platform/files-api-server/actions/workflows/ci.yml) [![Platforms: Alpine Linux MacOS Windows](https://img.shields.io/badge/platforms-alpine%20linux%20macos%20windows-blue)](https://img.shields.io/badge/platforms-windows%20linux%20macos%20alpine-blue) [![Code Style: XO/Prettier](https://img.shields.io/badge/code%20style-xo%2Fprettier-ff69b4)](https://img.shields.io/badge/code%20style-xo%2Fprettier-ff69b4)
44

55
An implementation of the Dabbu Files API that enables you to access your files, folders and emails stored with multiple providers as simple files and folders, all in one place!
66

@@ -34,10 +34,10 @@ Here is a list of clients that use the Dabbu API to interact with your files and
3434

3535
## Supported Providers
3636

37-
- [**Hard drive**](./docs/modules/hard_drive.md)
38-
- [**Google drive**](./docs/modules/google_drive.md)
39-
- [**Gmail**](./docs/modules/gmail.md)
40-
- [**One drive**](./docs/modules/one_drive.md)
37+
- **Hard drive**
38+
- **Google drive**
39+
- **Gmail**
40+
- **One drive**
4141

4242
_And more to come...!_
4343

0 commit comments

Comments
 (0)