ci: package publish ready
This commit is contained in:
27
.npmignore
Normal file
27
.npmignore
Normal file
@@ -0,0 +1,27 @@
|
||||
# Dependency and build cache directories
|
||||
node_modules/
|
||||
.bun/
|
||||
|
||||
# Source, tests, and local development files
|
||||
src/
|
||||
tests/
|
||||
scripts/
|
||||
coverage/
|
||||
tsconfig.json
|
||||
bun.lock
|
||||
|
||||
# Repository and CI metadata
|
||||
.git/
|
||||
.gitea/
|
||||
.gitignore
|
||||
|
||||
# Local runtime data and secrets
|
||||
.data/
|
||||
.hermes/
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
*.log
|
||||
|
||||
# Package artifacts
|
||||
*.tgz
|
||||
38
package.json
38
package.json
@@ -1,21 +1,51 @@
|
||||
{
|
||||
"name": "boxbrain",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.5",
|
||||
"description": "Human-like persona harness framework powered by LLMs and IdentityDB.",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"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",
|
||||
"src",
|
||||
"README.md"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"llm",
|
||||
"persona",
|
||||
"memory",
|
||||
"identitydb",
|
||||
"agent"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://git.psw.kr/p-sw/BoxBrain.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://git.psw.kr/p-sw/BoxBrain/issues"
|
||||
},
|
||||
"homepage": "https://git.psw.kr/p-sw/BoxBrain",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"check": "tsc --noEmit",
|
||||
"build": "tsup src/index.ts --format esm --dts --sourcemap --clean",
|
||||
"prepare": "bun run build"
|
||||
"clean": "rm -rf dist",
|
||||
"pack:check": "bun scripts/check-package.mjs",
|
||||
"prepack": "bun run build && bun run pack:check",
|
||||
"prepublishOnly": "bun run check && bun run test && bun run build && bun run pack:check"
|
||||
},
|
||||
"dependencies": {
|
||||
"identitydb": "0.2.1"
|
||||
|
||||
41
scripts/check-package.mjs
Normal file
41
scripts/check-package.mjs
Normal file
@@ -0,0 +1,41 @@
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
|
||||
const requiredFiles = [
|
||||
"README.md",
|
||||
"dist/index.js",
|
||||
"dist/index.d.ts",
|
||||
];
|
||||
|
||||
const missingFiles = requiredFiles.filter((path) => !existsSync(path));
|
||||
|
||||
if (missingFiles.length > 0) {
|
||||
console.error(`Missing package artifact(s): ${missingFiles.join(", ")}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(readFileSync("package.json", "utf8"));
|
||||
|
||||
const expectedFields = {
|
||||
main: "dist/index.js",
|
||||
module: "dist/index.js",
|
||||
types: "dist/index.d.ts",
|
||||
};
|
||||
|
||||
for (const [field, expected] of Object.entries(expectedFields)) {
|
||||
if (packageJson[field] !== expected) {
|
||||
console.error(`package.json ${field} must be ${expected}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (packageJson.exports?.["."]?.types !== "./dist/index.d.ts") {
|
||||
console.error("package.json exports[\".\"].types must point to ./dist/index.d.ts");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (packageJson.exports?.["."]?.import !== "./dist/index.js") {
|
||||
console.error("package.json exports[\".\"].import must point to ./dist/index.js");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log("Package metadata and artifacts are publish-ready.");
|
||||
Reference in New Issue
Block a user