mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-07-24 07:19:51 +00:00
Compare commits
1 Commits
v2.5.1
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
06e6f7639d |
30
CHANGELOG.md
30
CHANGELOG.md
@ -7,36 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## 2.4.6 - 2022-01-28
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -82,11 +82,8 @@ _in Browser_
|
|||||||
_in NodeJS (in an async context)_
|
_in NodeJS (in an async context)_
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// Import the SDK in Typescript or moduleJS
|
// Import the SDK in Typescript
|
||||||
import TCGdex from '@tcgdex/sdk'
|
import TCGdex from '@tcgdex/sdk';
|
||||||
|
|
||||||
// import the SDK in commonJS
|
|
||||||
const TCGdex = require('@tcgdex/sdk').default
|
|
||||||
|
|
||||||
// Instantiate the SDK
|
// Instantiate the SDK
|
||||||
const tcgdex = new TCGdex('en');
|
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,22 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "@tcgdex/sdk",
|
"name": "@tcgdex/sdk",
|
||||||
"version": "2.5.1",
|
"version": "2.4.9",
|
||||||
"main": "./dist/tcgdex.node.js",
|
"main": "./dist/cjs/tcgdex.node.js",
|
||||||
"module": "./dist/tcgdex.node.mjs",
|
"module": "./dist/modules/tcgdex.node.js",
|
||||||
"types": "./dist/tcgdex.node.d.ts",
|
"types": "./dist/types/tcgdex.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",
|
"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",
|
||||||
"homepage": "https://github.com/tcgdex/javascript-sdk",
|
"homepage": "https://github.com/tcgdex/javascript-sdk",
|
||||||
@ -31,9 +18,7 @@
|
|||||||
"api",
|
"api",
|
||||||
"typescript",
|
"typescript",
|
||||||
"javascript",
|
"javascript",
|
||||||
"typing",
|
"typing"
|
||||||
"browser",
|
|
||||||
"node"
|
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -44,10 +29,10 @@
|
|||||||
"@types/node-fetch": "^2",
|
"@types/node-fetch": "^2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5",
|
"@typescript-eslint/eslint-plugin": "^5",
|
||||||
"@typescript-eslint/parser": "^5",
|
"@typescript-eslint/parser": "^5",
|
||||||
|
"esbuild": "^0.16.3",
|
||||||
"eslint": "^8",
|
"eslint": "^8",
|
||||||
"jest": "^29",
|
"jest": "^29",
|
||||||
"tsup": "^7",
|
"typescript": "^4"
|
||||||
"typescript": "^5"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
@ -58,7 +43,10 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node scripts/export-version-number.js",
|
"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 --global-name TCGdex --sourcemap",
|
"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",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"test": "jest --coverage"
|
"test": "jest --coverage"
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import unfetch from 'unfetch'
|
|
||||||
import TCGdex from './tcgdex'
|
import TCGdex from './tcgdex'
|
||||||
|
import unfetch from 'unfetch'
|
||||||
|
|
||||||
TCGdex.fetch = window.fetch ?? unfetch as any
|
TCGdex.fetch = window.fetch ?? unfetch as any
|
||||||
|
|
||||||
export default TCGdex
|
if (typeof global !== 'undefined') {
|
||||||
|
global.TCGdex = TCGdex
|
||||||
|
}
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
(window as any).TCGdex = TCGdex
|
||||||
|
}
|
||||||
|
11
tsconfig.es2015.json
Normal file
11
tsconfig.es2015.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"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,7 +2,14 @@
|
|||||||
"extends": "./node_modules/@dzeio/config/tsconfig.base",
|
"extends": "./node_modules/@dzeio/config/tsconfig.base",
|
||||||
"include": ["./src/tcgdex.node.ts"],
|
"include": ["./src/tcgdex.node.ts"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
|
||||||
"target": "ES2015",
|
"target": "ES2015",
|
||||||
|
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "./dist/types",
|
||||||
|
|
||||||
|
"outDir": "./dist/cjs",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user