mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-07-14 19:05:11 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
02a8174509
|
|||
ac570459a3
|
|||
093df107d2 | |||
d166e0f5cf | |||
ef102dc433 | |||
324be2a410 | |||
ad4ad553a4 | |||
7c253c98d7 |
21
CHANGELOG.md
21
CHANGELOG.md
@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## 2.4.3 - 2021-07-19
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- ESM exports are back
|
||||||
|
|
||||||
|
## 2.4.2 2021-07-11
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Downgraded to ES2015 to have better suport browsers
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Moved browser export from `Webpack` to `esbuild`
|
||||||
|
|
||||||
## 2.4.1 - 2021-07-11
|
## 2.4.1 - 2021-07-11
|
||||||
|
|
||||||
## Deprecated
|
## Deprecated
|
||||||
@ -211,8 +227,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Constructor arg support for multiple langs
|
- Constructor arg support for multiple langs
|
||||||
- TranslationUtil to go from the SDK value to a text value
|
- TranslationUtil to go from the SDK value to a text value
|
||||||
|
|
||||||
[Unreleased]: https://github.com/tcgdex/javascript-sdk/compare/v2.3.1...HEAD
|
[Unreleased]: https://github.com/tcgdex/javascript-sdk/compare/v2.4.3...HEAD
|
||||||
|
|
||||||
|
[2.4.3]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.3
|
||||||
|
[2.4.2]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.2
|
||||||
|
[2.4.1]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.1
|
||||||
[2.4.0]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.0
|
[2.4.0]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.4.0
|
||||||
[2.3.1]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.3.1
|
[2.3.1]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.3.1
|
||||||
[2.3.0]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.3.0
|
[2.3.0]: https://github.com/tcgdex/javascript-sdk/releases/tag/v2.3.0
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<a href="https://github.com/tcgdex/javascript-sdk/blob/master/LICENSE.md">
|
<a href="https://github.com/tcgdex/javascript-sdk/blob/master/LICENSE.md">
|
||||||
<img src="https://img.shields.io/github/license/tcgdex/javascript-sdk?style=flat-square" alt="the TCGdex JAvascript SDK is released under the MIT license." />
|
<img src="https://img.shields.io/github/license/tcgdex/javascript-sdk?style=flat-square" alt="the TCGdex JAvascript SDK is released under the MIT license." />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/tcgdex/javascript-sdk/blob/master/LICENSE.md">
|
<a href="https://github.com/tcgdex/javascript-sdk/actions/workflows/build.yml">
|
||||||
<img src="https://img.shields.io/github/workflow/status/tcgdex/javascript-sdk/Build%20&%20Test?style=flat-square" alt="the TCGdex JAvascript SDK is released under the MIT license." />
|
<img src="https://img.shields.io/github/workflow/status/tcgdex/javascript-sdk/Build%20&%20Test?style=flat-square" alt="the TCGdex JAvascript SDK is released under the MIT license." />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://discord.gg/NehYTAhsZE">
|
<a href="https://discord.gg/NehYTAhsZE">
|
||||||
@ -34,11 +34,17 @@ yarn add @tcgdex/sdk
|
|||||||
npm install @tcgdex/sdk
|
npm install @tcgdex/sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or in the web browser
|
||||||
|
```html
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@tcgdex/sdk@2/dist/tcgdex.browser.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
_Note: a complete documentation is in progress_
|
_Note: a complete documentation is in progress_
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
// only if using with NPM/Yarn
|
||||||
import TCGdex from '@tcgdex/sdk'
|
import TCGdex from '@tcgdex/sdk'
|
||||||
|
|
||||||
// initialize the SDK
|
// initialize the SDK
|
||||||
|
1277
package-lock.json
generated
1277
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "@tcgdex/sdk",
|
"name": "@tcgdex/sdk",
|
||||||
"version": "2.4.2",
|
"version": "2.4.4",
|
||||||
"main": "./dist/cjs/tcgdex.node.js",
|
"main": "./dist/cjs/tcgdex.node.js",
|
||||||
|
"module": "./dist/modules/tcgdex.node.js",
|
||||||
"types": "./dist/types/tcgdex.d.ts",
|
"types": "./dist/types/tcgdex.d.ts",
|
||||||
"description": "Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK",
|
"description": "Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK",
|
||||||
"repository": "https://github.com/tcgdex/javascript-sdk.git",
|
"repository": "https://github.com/tcgdex/javascript-sdk.git",
|
||||||
@ -28,13 +29,11 @@
|
|||||||
"@types/node-fetch": "^2.5.10",
|
"@types/node-fetch": "^2.5.10",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.28.0",
|
"@typescript-eslint/eslint-plugin": "^4.28.0",
|
||||||
"@typescript-eslint/parser": "^4.28.0",
|
"@typescript-eslint/parser": "^4.28.0",
|
||||||
|
"esbuild": "^0.12.15",
|
||||||
"eslint": "^7.29.0",
|
"eslint": "^7.29.0",
|
||||||
"jest": "^27.0.5",
|
"jest": "^27.0.5",
|
||||||
"ts-loader": "^9.2.3",
|
|
||||||
"ts-node": "^10.0.0",
|
"ts-node": "^10.0.0",
|
||||||
"typescript": "^4.1.3",
|
"typescript": "^4.1.3"
|
||||||
"webpack": "^5.40.0",
|
|
||||||
"webpack-nano": "^1.1.1"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
@ -48,7 +47,7 @@
|
|||||||
"build": "npm run prebuild && npm run build:cjs && npm run build:browser && npm run build:es2015",
|
"build": "npm run prebuild && npm run build:cjs && npm run build:browser && npm run build:es2015",
|
||||||
"build:cjs": "tsc --project tsconfig.json",
|
"build:cjs": "tsc --project tsconfig.json",
|
||||||
"build:es2015": "tsc --project tsconfig.es2015.json",
|
"build:es2015": "tsc --project tsconfig.es2015.json",
|
||||||
"build:browser": "wp --config webpack.config.js",
|
"build:browser": "esbuild ./src/tcgdex.browser.ts --bundle --minify --sourcemap --target=es2016,chrome90,firefox78,safari14,ios13,edge90 --outfile=dist/tcgdex.browser.js",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"test": "jest --coverage"
|
"test": "jest --coverage"
|
||||||
|
@ -8,6 +8,7 @@ export type Languages<T = string> = Partial<Record<SupportedLanguages, T>>
|
|||||||
export interface SerieResume {
|
export interface SerieResume {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
logo?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Serie extends SerieResume {
|
export interface Serie extends SerieResume {
|
||||||
|
@ -3,4 +3,4 @@ import unfetch from 'unfetch'
|
|||||||
|
|
||||||
TCGdex.fetch = window.fetch ?? unfetch as any
|
TCGdex.fetch = window.fetch ?? unfetch as any
|
||||||
|
|
||||||
module.exports = TCGdex
|
(global ?? window).TCGdex = TCGdex
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": ["./src/tcgdex.node.ts"],
|
"include": ["./src/tcgdex.node.ts"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
"target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||||
"module": "ES2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"module": "ES2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||||
"declaration": false, /* Generates corresponding '.d.ts' file. */
|
"declaration": false, /* Generates corresponding '.d.ts' file. */
|
||||||
"declarationDir": null,
|
"declarationDir": null,
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
const path = require('path')
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
mode: 'production',
|
|
||||||
entry: './src/tcgdex.browser.ts',
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, 'dist'),
|
|
||||||
filename: 'tcgdex.browser.js',
|
|
||||||
libraryTarget: 'umd',
|
|
||||||
library: 'TCGdex',
|
|
||||||
umdNamedDefine: true
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.ts']
|
|
||||||
},
|
|
||||||
optimization: {
|
|
||||||
minimize: true
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [{
|
|
||||||
test: /\.ts$/,
|
|
||||||
loader: 'ts-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
options: {
|
|
||||||
compilerOptions: {
|
|
||||||
sourceMap: false,
|
|
||||||
declaration: false,
|
|
||||||
declarationDir: null,
|
|
||||||
target: 'ES2016'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user