Compare commits

..

3 Commits

Author SHA1 Message Date
0f2ad36e8c bump: 2.5.1
Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
2023-07-18 12:59:21 +02:00
74de8961ef fix: update README
Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
2023-07-18 12:54:06 +02:00
98c80fcd20 fix: module exports not working
Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
2023-07-18 12:46:39 +02:00
4 changed files with 45 additions and 14 deletions

View File

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

View File

@ -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');

View File

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

View File

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