Compare commits

..

1 Commits

Author SHA1 Message Date
06e6f7639d build: bump esbuild from 0.16.16 to 0.16.17
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.16.16 to 0.16.17.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.16.16...v0.16.17)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-12 07:03:18 +00:00
7 changed files with 622 additions and 1312 deletions

View File

@ -7,36 +7,6 @@ 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,11 +82,8 @@ _in Browser_
_in NodeJS (in an async context)_
```typescript
// Import the SDK in Typescript or moduleJS
import TCGdex from '@tcgdex/sdk'
// import the SDK in commonJS
const TCGdex = require('@tcgdex/sdk').default
// Import the SDK in Typescript
import TCGdex from '@tcgdex/sdk';
// Instantiate the SDK
const tcgdex = new TCGdex('en');

1836
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,9 @@
{
"name": "@tcgdex/sdk",
"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"
}
}
},
"version": "2.4.9",
"main": "./dist/cjs/tcgdex.node.js",
"module": "./dist/modules/tcgdex.node.js",
"types": "./dist/types/tcgdex.d.ts",
"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",
@ -31,9 +18,7 @@
"api",
"typescript",
"javascript",
"typing",
"browser",
"node"
"typing"
],
"license": "MIT",
"devDependencies": {
@ -44,10 +29,10 @@
"@types/node-fetch": "^2",
"@typescript-eslint/eslint-plugin": "^5",
"@typescript-eslint/parser": "^5",
"esbuild": "^0.16.3",
"eslint": "^8",
"jest": "^29",
"tsup": "^7",
"typescript": "^5"
"typescript": "^4"
},
"engines": {
"node": ">=12"
@ -58,7 +43,10 @@
},
"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 --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",
"lint": "eslint",
"test": "jest --coverage"

View File

@ -1,6 +1,11 @@
import unfetch from 'unfetch'
import TCGdex from './tcgdex'
import unfetch from 'unfetch'
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
View 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. */
}
}

View File

@ -2,7 +2,14 @@
"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",
}
}