Skip to content

Commit

Permalink
Large refactoring of original lib (#2)
Browse files Browse the repository at this point in the history
* Initial commit. Earlier versions are not in Git.

* 0.1.1

* 0.2.0

* 0.2.1

* 0.3.0

* Exposed request queue functions in util

* Unit tests

* 0.3.2

* 0.3.3

* Added URL to User-Agent header

* Dynamic User-Agent URL

* 0.3.4

* Strict mode + preparing for required authentication for database().search()

* Authentication requirement for search has been postponed to 2014-10-14

* 0.4.0

* 0.4.1 fixes #1 and resolves #2

* 0.4.2

* 0.5.0

* allow default options to be modified in constructor

* first parameter of _request should be an object rather than a string

* don't pollute

* 0.5.1

* Fixed incorrect reference to this within a callback

* Updated oauth status values to better represent the actual state

* 0.5.2

* Fixed fetching a single order by its ID

* Discogs Auth implemented

* 0.6.0

* 0.6.1

* Fixed crash if discogs servers respond with html

Checks if the data string begins with <! from html doctype declaration
before running JSON.parse()

* 0.6.4

* 0.6.5

* 0.6.6

* 0.6.7

* 0.6.8

* 0.7.0

* added api for label releases

* 0.7.2

* 0.8.0

* 0.9.0

* 0.9.1

* 1.0.0

* 1.0.1

* 1.1.0

* Fix database.search with different arguments combinations

- Allow the database.search method to work with either just query, params, or both
- Add tests for the new combinations

* 1.2.0

* 1.2.1

* Fix outputFormat (#67)

* Fix request headers for outputFormat

* Update client.js

* convert to ESM and use ES6 classes

* ESM is always in strict mode

* get rid of remaining require() calls

* start converting tests

* fix error classes

* fix lib exports

* work around package.json import for now

* call Queue with new

* fix queue export

* dont shadow escape during import

* change import of https module

* read package.json again

* start rewriting tests with ava & msw

* delete old test grouping file

* fix error tests and error implementation

* add prettier, run on entire git history for js files

* convert oauth to class

* fix some JSDoc formatting

* fix util test

* format

* add github action for CI

* run prettier before tests in ci

* fix the rest of the tests

* old node version, meaning no optional chaining and no top level await

* better type hints

* var -> let

* change dummy function

* setup mock api outside of test files

* collection: folder tests

* missing semicolon

* get release with currency

* test: release rating by user

* tests: set and remove rating

* test, impl: community ratings

* test, impl: release stats

* test: get master release

* test: get master versions

* send empty response

* send empty object

* test, docs: get artist

* test: get artist releases

* allow string ids

* test: get label

* test: get label releases

* test: get user's lists

* impl: get list items doesn't accept pagination

* test: get list items

* test: get releases in wantlist

* test, docs: add to wantlist

* fix, tests, docs: edit notes for release in wantlist

* test: remove release from wantlist

* generate types

* Convert callbacks to Promises (#1)

* generate types

* collection: remove callbacks

* database: remove callbacks

* list: remove callbacks

* marketplace: remove callbacks

* user: remove callbacks

* wantlist: remove callbacks

* database.getImage: remove callback

* client: remove most callbacks

* database: remove old parameter

* user: remove old variable

* @return -> @returns

* use string templates

* test: user identity, profile and submissions

* whitespace

* pagination & sort parameters

* test: user contributions

* use proper types for parameters, add examples, simplify tests

* proper quotes

* simplify

* use ts-check

* import types, use them

* add example

* ts-check

* add example

* add ts-check

* add ts-check

* clean up types

* move type import to top of file

* test: getReleaseInstances

* test: collection items by folder

* add example

* test: add release to folder

* test, docs: edit release

* no more default export, bundle with esbuild to commonjs

* format README

* format HISTORY

* format package.json

* format with prettier

* also use prettier for json and md files

* parse url using whatwg url

* test, docs: remove release from collection

* test, docs: get collection fields

* test, impl, docs: edit instance note

* impl, test: get collection value

* export as DiscogsClient

* dont use auth in database test

* dont use auth in collection tests

* in tests, use auth only where required

* no assertion on result

* plan for 1 assertion

* more refactoring, better internal typing

* prettier

* more tests

* no calling class as function

* test coverage

* test, docs: getInventory

* prettier

* ignore coverage from prettier

* add links to docs

* prettier

* run prettier on commit

* test: collection, cap rating at 5

* test, docs: get images

* fix var name in docs

* fix typings a little bit

* fix typings a little bit

* more type checks

* bump dependencies

* some response typing

* more type defs

* complete collection response typing

* getArtist types

* getArtistReleases types

* getRelease types

* getReleaseRating types

* setReleaseRating types

* getReleaseCommunityRating types

* getReleaseStats types

* getMaster types & grouping of same types

* getMasterVersions types

* getLabel types

* getLabelReleases types

* getImage types

* search types

* getProfile types

* editProfile types

* getInventory types

* addParams type

* remove querystring in favor or URLSearchParams

* remove import

* test more node versions

* guard node-specific code

* more types

* rewrite request to use node-fetch

* ava doesnt like node 15

* no ?.

* mswjs doesnt like node 17.3

* build for browser?

* getListing test + docs

* run everything as build step

* editListing docs + test

* correct status code

* deleteListing docs + tests

* addListing docs + tests

* getOrder docs + tests

* scope lib to my username

* add publish files

* add npmignore

* 2.0.0-alpha.0

* public package

* add missing release in HISTORY

* more marketplace tests, docs and types

* fee

* price suggestion

* add missing marketplace:release stats

* add missing example

* add missing example

* get submissions response

* update license

* fix error message

* complete type

* add list types

* more elaborate build step

* ignore .DS_Store

* fix test

* 2.0.0-alpha.1

* complete wantlist typing

* 2.0.0-alpha.2

* update links

* 2.0.0-alpha.3

* rewrite to typescript

* 2.0.0-alpha.4

* user module: fix optional types

* marketplace module: fix optional types

* error: fix optional types

* fix database types

* fix collection optional types

* 2.0.0-alpha.5

* format readme

* rename

* rename, increase test concurrency

* new ava config
  • Loading branch information
lionralfs authored Feb 18, 2022
1 parent 56d89e1 commit 4894f27
Show file tree
Hide file tree
Showing 61 changed files with 11,160 additions and 2,106 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 17.2]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run prettier
- run: npm test
- run: npm run build
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
node_modules/
*.log
*.log
types/
commonjs/index.js
browser/index.js
node-esm/index.js
coverage/
.DS_Store
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
commonjs/**/*.js
coverage/
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "avoid"
}
Loading

0 comments on commit 4894f27

Please sign in to comment.