Bump napcat-types version to 0.0.2

Updated the package version in package.public.json from 0.0.1 to 0.0.2.

Update napcat-types package metadata and dependencies

Set package as public by changing 'private' to false. Move 'napcat-core' and 'napcat-onebot' from dependencies to devDependencies, and remove 'compressing' from dependencies.

Add public packaging and build script for napcat-types

Introduces package.public.json and a copy-dist.mjs script to automate copying metadata and README into the dist folder for publishing. Updates build script in package.json to use the new copy step. Adds initial package.json and README for napcat-types.

Update scripts in napcat-types package configs

Added a publish script to package.json and removed scripts from package.public.json to streamline configuration and avoid duplication.
This commit is contained in:
手瓜一十雪 2026-01-26 18:43:50 +08:00
parent aa9fe60dfd
commit 01da490d92
5 changed files with 72 additions and 7 deletions

24
package/package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "napcat-types",
"version": "0.0.1",
"type": "module",
"types": "./napcat-types/index.d.ts",
"files": [
"**/*"
],
"dependencies": {
"@types/node": "^22.10.7",
"@types/express": "^4.17.21",
"@types/ws": "^8.5.12",
"@types/cors": "^2.8.17",
"@types/multer": "^1.4.12",
"@types/winston": "^2.4.4",
"@types/yaml": "^1.9.7",
"@types/ip": "^1.1.3"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public",
"tag": "latest"
}
}

View File

@ -0,0 +1,3 @@
# NapCat-Types
NapCat 类型定义包,包含 NapCat 及其插件开发所需的所有类型定义。

View File

@ -1,19 +1,18 @@
{
"name": "napcat-types",
"version": "0.0.1",
"private": true,
"private": false,
"type": "module",
"types": "./dist/napcat-types/index.d.ts",
"files": [
"dist/**/*"
],
"scripts": {
"build": "tsc --project tsconfig.json && tsc-alias --project tsconfig.json --outDir dist",
"test": "pnpm -s exec tsc --project tsconfig.json --noEmit"
"build": "tsc --project tsconfig.json && tsc-alias --project tsconfig.json --outDir dist && node ./scripts/copy-dist.mjs",
"test": "pnpm -s exec tsc --project tsconfig.json --noEmit",
"publish": "pnpm publish --filter napcat-types"
},
"dependencies": {
"napcat-core": "workspace:*",
"napcat-onebot": "workspace:*",
"@types/node": "^22.10.7",
"@types/express": "^4.17.21",
"@types/ws": "^8.5.12",
@ -21,10 +20,11 @@
"@types/multer": "^1.4.12",
"@types/winston": "^2.4.4",
"@types/yaml": "^1.9.7",
"@types/ip": "^1.1.3",
"compressing": "^1.10.3"
"@types/ip": "^1.1.3"
},
"devDependencies": {
"napcat-core": "workspace:*",
"napcat-onebot": "workspace:*",
"tsc-alias": "^1.8.16"
}
}

View File

@ -0,0 +1,25 @@
{
"name": "napcat-types",
"version": "0.0.2",
"private": false,
"type": "module",
"types": "./napcat-types/index.d.ts",
"files": [
"./**/*"
],
"dependencies": {
"@types/node": "^22.10.7",
"@types/express": "^4.17.21",
"@types/ws": "^8.5.12",
"@types/cors": "^2.8.17",
"@types/multer": "^1.4.12",
"@types/winston": "^2.4.4",
"@types/yaml": "^1.9.7",
"@types/ip": "^1.1.3"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public",
"tag": "latest"
}
}

View File

@ -0,0 +1,13 @@
// 复制 cp README.md dist/ && cp package.public.json dist/package.json
import { copyFile } from 'node:fs/promises';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = fileURLToPath(new URL('../', import.meta.url));
await copyFile(
join(__dirname, 'package.public.json'),
join(__dirname, 'dist', 'package.json')
);
await copyFile(
join(__dirname, 'README.md'),
join(__dirname, 'dist', 'README.md')
);