mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-07-13 18:45:09 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
0f2ad36e8c | |||
74de8961ef | |||
98c80fcd20 |
30
CHANGELOG.md
30
CHANGELOG.md
@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## 2.5.1 - 2023-07-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- ModuleJS exports not working as intended
|
||||
|
||||
## 2.5.0 - 2023-06-28
|
||||
|
||||
### Added
|
||||
|
||||
- Support for both ModuleJS and CommonJS
|
||||
|
||||
## 2.4.9 - 2022-09-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- package not loading on browser
|
||||
|
||||
## 2.4.8 - 2022-09-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix version number not correctly exposting
|
||||
|
||||
## 2.4.7 - 2022-09-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Compatibility with Angular
|
||||
|
||||
## 2.4.6 - 2022-01-28
|
||||
|
||||
### Fixed
|
||||
|
@ -82,8 +82,11 @@ _in Browser_
|
||||
_in NodeJS (in an async context)_
|
||||
|
||||
```typescript
|
||||
// Import the SDK in Typescript
|
||||
import TCGdex from '@tcgdex/sdk';
|
||||
// Import the SDK in Typescript or moduleJS
|
||||
import TCGdex from '@tcgdex/sdk'
|
||||
|
||||
// import the SDK in commonJS
|
||||
const TCGdex = require('@tcgdex/sdk').default
|
||||
|
||||
// Instantiate the SDK
|
||||
const tcgdex = new TCGdex('en');
|
||||
|
13
package.json
13
package.json
@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "@tcgdex/sdk",
|
||||
"version": "2.5.0",
|
||||
"version": "2.5.1",
|
||||
"main": "./dist/tcgdex.node.js",
|
||||
"module": "./dist/tcgdex.node.mjs",
|
||||
"types": "./dist/tcgdex.node.d.ts",
|
||||
"browser": "./dist/tcgdex.browser.global.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": {
|
||||
@ -11,8 +12,8 @@
|
||||
"default": "./dist/tcgdex.node.js"
|
||||
},
|
||||
"import": {
|
||||
"default": "./dist/tcgdex.node.mjs",
|
||||
"types": "./dist/tcgdex.node.d.mts"
|
||||
"types": "./dist/tcgdex.node.d.mts",
|
||||
"default": "./dist/tcgdex.node.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -30,7 +31,9 @@
|
||||
"api",
|
||||
"typescript",
|
||||
"javascript",
|
||||
"typing"
|
||||
"typing",
|
||||
"browser",
|
||||
"node"
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
@ -55,7 +58,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "node scripts/export-version-number.js",
|
||||
"build": "tsup ./src/tcgdex.node.ts --format cjs,esm --dts --clean && tsup ./src/tcgdex.browser.ts --format iife --minify --sourcemap",
|
||||
"build": "tsup ./src/tcgdex.node.ts --format cjs,esm --dts --clean && tsup ./src/tcgdex.browser.ts --format iife --global-name TCGdex --sourcemap",
|
||||
"prepublishOnly": "npm run build",
|
||||
"lint": "eslint",
|
||||
"test": "jest --coverage"
|
||||
|
@ -1,11 +1,6 @@
|
||||
import TCGdex from './tcgdex'
|
||||
import unfetch from 'unfetch'
|
||||
import TCGdex from './tcgdex'
|
||||
|
||||
TCGdex.fetch = window.fetch ?? unfetch as any
|
||||
|
||||
if (typeof global !== 'undefined') {
|
||||
global.TCGdex = TCGdex
|
||||
}
|
||||
if (typeof window !== 'undefined') {
|
||||
(window as any).TCGdex = TCGdex
|
||||
}
|
||||
export default TCGdex
|
||||
|
Reference in New Issue
Block a user