feat: publish api-client to npm (#6016)

* feat: publish api-client to npm

* feat: change hosting wording + examples

* GPL -> LGPL

* fix: remove manual publishing + git url

* fix: lint

* fix: lint
This commit is contained in:
Calum H.
2026-05-06 23:39:06 +01:00
committed by GitHub
parent de07bcff7d
commit c69f24f94d
14 changed files with 469 additions and 772 deletions

View File

@@ -1,9 +1,41 @@
{
"name": "@modrinth/api-client",
"version": "0.1.0",
"version": "0.0.0",
"description": "An API client for Modrinth's API for use in nuxt, tauri and plain node/browser environments.",
"main": "./src/index.ts",
"license": "LGPL-3.0-only",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"files": [
"dist",
"README.md",
"LICENSE"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/modrinth/code.git",
"directory": "packages/api-client"
},
"bugs": {
"url": "https://github.com/modrinth/code/issues"
},
"homepage": "https://github.com/modrinth/code/tree/main/packages/api-client#readme",
"publishConfig": {
"access": "public"
},
"scripts": {
"clean": "node --eval \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
"build": "pnpm run clean && esbuild src/index.ts --bundle --format=esm --platform=neutral --target=es2020 --minify --legal-comments=none --outfile=dist/index.js --external:ofetch --external:mitt --external:@tauri-apps/plugin-http && tsc -p tsconfig.build.json",
"prepare": "pnpm run build",
"lint": "eslint . && prettier --check .",
"fix": "eslint . --fix && prettier --write ."
},
@@ -12,7 +44,10 @@
"ofetch": "^1.4.1"
},
"devDependencies": {
"@modrinth/tooling-config": "workspace:*"
"@modrinth/tooling-config": "workspace:*",
"@tauri-apps/plugin-http": "^2.0.0",
"esbuild": "0.27.2",
"typescript": "^5.9.3"
},
"peerDependencies": {
"@tauri-apps/plugin-http": "^2.0.0"