mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-07-13 02:25:10 +00:00
Compare commits
5 Commits
dependabot
...
v2.5.1
Author | SHA1 | Date | |
---|---|---|---|
0f2ad36e8c | |||
74de8961ef | |||
98c80fcd20 | |||
c392b27cac | |||
dc5e41a638 |
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');
|
||||
|
1836
package-lock.json
generated
1836
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@ -1,9 +1,22 @@
|
||||
{
|
||||
"name": "@tcgdex/sdk",
|
||||
"version": "2.4.9",
|
||||
"main": "./dist/cjs/tcgdex.node.js",
|
||||
"module": "./dist/modules/tcgdex.node.js",
|
||||
"types": "./dist/types/tcgdex.d.ts",
|
||||
"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": {
|
||||
"types": "./dist/tcgdex.node.d.ts",
|
||||
"default": "./dist/tcgdex.node.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./dist/tcgdex.node.d.mts",
|
||||
"default": "./dist/tcgdex.node.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK",
|
||||
"repository": "https://github.com/tcgdex/javascript-sdk.git",
|
||||
"homepage": "https://github.com/tcgdex/javascript-sdk",
|
||||
@ -18,7 +31,9 @@
|
||||
"api",
|
||||
"typescript",
|
||||
"javascript",
|
||||
"typing"
|
||||
"typing",
|
||||
"browser",
|
||||
"node"
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
@ -29,10 +44,10 @@
|
||||
"@types/node-fetch": "^2",
|
||||
"@typescript-eslint/eslint-plugin": "^5",
|
||||
"@typescript-eslint/parser": "^5",
|
||||
"esbuild": "^0.16.3",
|
||||
"eslint": "^8",
|
||||
"jest": "^29",
|
||||
"typescript": "^4"
|
||||
"tsup": "^7",
|
||||
"typescript": "^5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
@ -43,10 +58,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "node scripts/export-version-number.js",
|
||||
"build": "npm run build:cjs && npm run build:browser && npm run build:es2015",
|
||||
"build:cjs": "tsc --project tsconfig.json",
|
||||
"build:es2015": "tsc --project tsconfig.es2015.json",
|
||||
"build:browser": "esbuild ./src/tcgdex.browser.ts --bundle --minify --sourcemap --target=es2016,chrome90,firefox78,safari14,ios13,edge90 --outfile=dist/tcgdex.browser.js",
|
||||
"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
|
||||
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["./src/tcgdex.node.ts"],
|
||||
"compilerOptions": {
|
||||
"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'. */
|
||||
"declaration": false, /* Generates corresponding '.d.ts' file. */
|
||||
"declarationDir": null,
|
||||
"outDir": "./dist/modules", /* Redirect output structure to the directory. */
|
||||
}
|
||||
}
|
@ -2,14 +2,7 @@
|
||||
"extends": "./node_modules/@dzeio/config/tsconfig.base",
|
||||
"include": ["./src/tcgdex.node.ts"],
|
||||
"compilerOptions": {
|
||||
|
||||
"target": "ES2015",
|
||||
|
||||
"declaration": true,
|
||||
"declarationDir": "./dist/types",
|
||||
|
||||
"outDir": "./dist/cjs",
|
||||
"rootDir": "./src",
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user