Compare commits

...

8 Commits

Author SHA1 Message Date
02a8174509 2.4.4 2021-08-12 21:59:29 +02:00
ac570459a3 Added new logo field to serie
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2021-08-12 21:59:11 +02:00
093df107d2 Fixed Link 2021-07-19 15:07:41 +02:00
d166e0f5cf Fixed Changelogs
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:47:47 +02:00
ef102dc433 2.4.3 2021-07-19 14:46:12 +02:00
324be2a410 Updated docs
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:45:41 +02:00
ad4ad553a4 New try with ESM
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:44:58 +02:00
7c253c98d7 Moved to ESBuild
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-07-19 14:44:42 +02:00
8 changed files with 106 additions and 1358 deletions

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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"

View File

@ -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 {

View File

@ -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

View File

@ -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,

View File

@ -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'
}
}
}]
}
}