mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-04-22 10:42:10 +00:00
feat: Full support for ESM modules
Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
This commit is contained in:
parent
09d8b28a66
commit
dc5e41a638
1242
package-lock.json
generated
1242
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
@ -1,9 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "@tcgdex/sdk",
|
"name": "@tcgdex/sdk",
|
||||||
"version": "2.4.9",
|
"version": "2.4.9",
|
||||||
"main": "./dist/cjs/tcgdex.node.js",
|
"main": "./dist/tcgdex.node.js",
|
||||||
"module": "./dist/modules/tcgdex.node.js",
|
"module": "./dist/tcgdex.node.mjs",
|
||||||
"types": "./dist/types/tcgdex.d.ts",
|
"types": "./dist/tcgdex.node.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"require": {
|
||||||
|
"types": "./dist/tcgdex.node.d.ts",
|
||||||
|
"default": "./dist/tcgdex.node.js"
|
||||||
|
},
|
||||||
|
"import": {
|
||||||
|
"default": "./dist/tcgdex.node.mjs",
|
||||||
|
"types": "./dist/tcgdex.node.d.mts"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"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",
|
||||||
@ -29,10 +41,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",
|
||||||
"typescript": "^4"
|
"tsup": "^7",
|
||||||
|
"typescript": "^5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
@ -43,10 +55,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node scripts/export-version-number.js",
|
"prebuild": "node scripts/export-version-number.js",
|
||||||
"build": "npm run build:cjs && npm run build:browser && npm run build:es2015",
|
"build": "tsup ./src/tcgdex.node.ts --format cjs,esm --dts --clean && tsup ./src/tcgdex.browser.ts --format iife --minify --sourcemap",
|
||||||
"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,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",
|
"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",
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user