From 3a20e9558b775159309ba758a2627fd6e201c70b Mon Sep 17 00:00:00 2001 From: hyper Date: Thu, 9 Jul 2026 16:15:09 +0800 Subject: [PATCH] chore: Prepare package for npm publication --- LICENSE | 21 +++++++++++++++++++++ package.json | 28 ++++++++++++++++++---------- tsconfig.json | 2 +- 3 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fd0f5dd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 TTTK contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index 5941976..2c6afbb 100644 --- a/package.json +++ b/package.json @@ -6,24 +6,32 @@ "bin": { "tttk": "./dist/cli/index.js" }, - "main": "./dist/index.js", - "module": "./dist/index.js", - "exports": { - ".": "./dist/index.js", - "./components": "./dist/components/index.js", - "./markdown": "./dist/markdown/index.js" + "files": [ + "dist", + "LICENSE", + "README.md" + ], + "repository": { + "type": "git", + "url": "https://github.com/hypercross/ttrpg-tools" + }, + "engines": { + "node": ">=18" }, "scripts": { "dev": "rsbuild dev", - "build": "rsbuild build", + "build": "npm run build:web && npm run build:cli", + "build:web": "rsbuild build", + "build:cli": "tsc -p tsconfig.cli.json", "preview": "rsbuild preview", "analyze": "cross-env ANALYZE=true rsbuild build", "cli:dev": "tsc -p tsconfig.cli.json --watch", - "cli:build": "tsc -p tsconfig.cli.json", + "cli:build": "npm run build:cli", "ttrpg": "node --loader ts-node/esm ./src/cli/index.ts", "tttk": "node --loader ts-node/esm ./src/cli/index.ts", "test": "jest", - "prepare": "npx husky" + "prepare": "npx husky", + "prepublishOnly": "npm run build" }, "keywords": [ "ttrpg", @@ -31,7 +39,7 @@ "markdown", "toolbox" ], - "author": "", + "author": "hypercross", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^0.5.0", diff --git a/tsconfig.json b/tsconfig.json index d961dbf..34edc76 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,5 +18,5 @@ "types": ["node", "jest"], }, "include": ["src/**/*"], - "exclude": ["node_modules", "dist"], + "exclude": ["node_modules", "dist", "src/cli"], }