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

Commit

Permalink
Merge pull request #164 from kaimallea/next-dev
Browse files Browse the repository at this point in the history
Ship latest dev work
  • Loading branch information
kaimallea authored Apr 11, 2021
2 parents f794588 + ea895bb commit 5832e62
Show file tree
Hide file tree
Showing 20 changed files with 14,348 additions and 15,100 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/
src/coverage/
12 changes: 5 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
env: {
es2021: true,
es2020: true,
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
rules: {},
};
6 changes: 5 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: Run linters
run: npm run lint
- name: Run tests
run: npm test
uses: mattallty/jest-github-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
test-command: "npm run test:ci"
- name: Build
run: npm run build --if-present
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
lib
src/coverage
*.code-workspace
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
.github

jest.*.js
babel.config.json
tsconfig.json

src

CODE_OF_CONDUCT.md
CONTRIBUTING.md

*.code-workspace
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
lib
lib/
package-lock.json
.github
src/coverage/
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,31 @@ client.getSubredditGallery({
| `sort` | optional | `time` \| `top` - defaults to time |
| `page` | optional | `number` - the data paging number |
| `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` |

### Search the gallery

```ts
client.searchGallery({
query: 'title: memes',
});
```

`searchGallery()` accepts an object of type `SearchGalleryOptions`. The follow options are available:

| Key | Required | Description |
| -------------- | -------- | --------------------------------------------------------------------- | ------ | ------- | ------ | ------------------------- |
| `query` or `q` | required | Query string |
| `sort` | optional | `time` \| `viral` \| `top` - defaults to time |
| `page` | optional | `number` - the data paging number |
| `window` | optional | Change the date range of the request if the sort is `top` -- to `day` | `week` | `month` | `year` | `all`, defaults to `all`. |

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):

| Key | Required | Description |
| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `q_all` | optional | Search for all of these words (and) |
| `q_any` | optional | Search for any of these words (or) |
| `q_exactly` | optional | Search for exactly this word or phrase |
| `q_not` | optional | Exclude results matching this string |
| `q_type` | optional | Show results for any file type, `jpg` \| `png` \| `gif` \| `anigif` (animated gif) \| `album` |
| `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) |
6 changes: 0 additions & 6 deletions babel.config.json

This file was deleted.

21 changes: 15 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
module.exports = {
setupFilesAfterEnv: ['<rootDir>/src/mocks/jest.setup.ts'],
testPathIgnorePatterns: [
'<rootDir>/build/',
'<rootDir>/node_modules/',
'<rootDir>/src/mocks/',
],
preset: 'ts-jest',
testEnvironment: 'node',
rootDir: './src',
setupFilesAfterEnv: ['<rootDir>/mocks/jest.setup.ts'],
coveragePathIgnorePatterns: ['<rootDir>/mocks'],
coverageDirectory: '<rootDir>/coverage/',
coverageThreshold: {
global: {
branches: 20,
functions: 30,
lines: 50,
statements: 50,
},
},
verbose: true,
};
Loading

0 comments on commit 5832e62

Please sign in to comment.