Skip to content
This repository was archived by the owner on Dec 30, 2021. It is now read-only.

Commit 5832e62

Browse files
authored
Merge pull request #164 from kaimallea/next-dev
Ship latest dev work
2 parents f794588 + ea895bb commit 5832e62

20 files changed

+14348
-15100
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib/
2+
src/coverage/

.eslintrc.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
module.exports = {
22
root: true,
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
sourceType: 'module',
6+
},
37
env: {
4-
es2021: true,
8+
es2020: true,
59
node: true,
610
jest: true,
711
},
8-
parser: '@typescript-eslint/parser',
912
plugins: ['@typescript-eslint'],
1013
extends: [
1114
'eslint:recommended',
1215
'plugin:@typescript-eslint/recommended',
1316
'prettier',
1417
],
15-
parserOptions: {
16-
ecmaVersion: 12,
17-
sourceType: 'module',
18-
},
19-
rules: {},
2018
};

.github/workflows/test.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
- name: Run linters
2828
run: npm run lint
2929
- name: Run tests
30-
run: npm test
30+
uses: mattallty/jest-github-action@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
test-command: "npm run test:ci"
3135
- name: Build
3236
run: npm run build --if-present

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules
22
lib
3+
src/coverage
4+
*.code-workspace

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
.github
77

88
jest.*.js
9-
babel.config.json
109
tsconfig.json
1110

1211
src
1312

1413
CODE_OF_CONDUCT.md
1514
CONTRIBUTING.md
15+
16+
*.code-workspace

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2-
lib
2+
lib/
33
package-lock.json
44
.github
5+
src/coverage/

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,31 @@ client.getSubredditGallery({
226226
| `sort` | optional | `time` \| `top` - defaults to time |
227227
| `page` | optional | `number` - the data paging number |
228228
| `window` | optional | Change the date range of the request if the section is `top`. Accepted values are `day` \| `week` \| `month` \| `year` \| `all`. Defaults to `week` |
229+
230+
### Search the gallery
231+
232+
```ts
233+
client.searchGallery({
234+
query: 'title: memes',
235+
});
236+
```
237+
238+
`searchGallery()` accepts an object of type `SearchGalleryOptions`. The follow options are available:
239+
240+
| Key | Required | Description |
241+
| -------------- | -------- | --------------------------------------------------------------------- | ------ | ------- | ------ | ------------------------- |
242+
| `query` or `q` | required | Query string |
243+
| `sort` | optional | `time` \| `viral` \| `top` - defaults to time |
244+
| `page` | optional | `number` - the data paging number |
245+
| `window` | optional | Change the date range of the request if the sort is `top` -- to `day` | `week` | `month` | `year` | `all`, defaults to `all`. |
246+
247+
Additionally, the following advanced search query options can be set (NOTE: if any of the below are set in the options, the `query` option is ignored and these will take precedent):
248+
249+
| Key | Required | Description |
250+
| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
251+
| `q_all` | optional | Search for all of these words (and) |
252+
| `q_any` | optional | Search for any of these words (or) |
253+
| `q_exactly` | optional | Search for exactly this word or phrase |
254+
| `q_not` | optional | Exclude results matching this string |
255+
| `q_type` | optional | Show results for any file type, `jpg` \| `png` \| `gif` \| `anigif` (animated gif) \| `album` |
256+
| `q_size_px` | optional | Size ranges, `small` (500 pixels square or less) \| `med` (500 to 2,000 pixels square) \| `big` (2,000 to 5,000 pixels square) \| `lrg` (5,000 to 10,000 pixels square) \| `huge` (10,000 square pixels and above) |

babel.config.json

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

jest.config.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
module.exports = {
2-
setupFilesAfterEnv: ['<rootDir>/src/mocks/jest.setup.ts'],
3-
testPathIgnorePatterns: [
4-
'<rootDir>/build/',
5-
'<rootDir>/node_modules/',
6-
'<rootDir>/src/mocks/',
7-
],
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
rootDir: './src',
5+
setupFilesAfterEnv: ['<rootDir>/mocks/jest.setup.ts'],
6+
coveragePathIgnorePatterns: ['<rootDir>/mocks'],
7+
coverageDirectory: '<rootDir>/coverage/',
8+
coverageThreshold: {
9+
global: {
10+
branches: 20,
11+
functions: 30,
12+
lines: 50,
13+
statements: 50,
14+
},
15+
},
16+
verbose: true,
817
};

0 commit comments

Comments
 (0)