From 6020518fc7261ed07e3b97199de720fbba8d2c5d Mon Sep 17 00:00:00 2001 From: David Ibia Date: Mon, 12 Jan 2026 14:04:23 +0100 Subject: [PATCH] chore: prepare npm package for publish --- .gitignore | 1 + README.md | 2 +- package.json | 39 +++++++++++++++++++++++++++++---------- tsconfig.build.json | 11 +++++++++++ 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 tsconfig.build.json diff --git a/.gitignore b/.gitignore index f7ae81a..22739f1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ node_modules/ !.env.example # build artifacts +/dist/ /dist-test/ # misc diff --git a/README.md b/README.md index 04223e1..a573db0 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ npm ci npm run typecheck ``` -There are currently no lint or test scripts in this repo. +There are currently no lint scripts in this repo. Run tests with `npm test`. ## License diff --git a/package.json b/package.json index f15bd07..7d2da0b 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,40 @@ { "name": "envsitter-guard", "version": "0.0.1", - "private": true, + "description": "OpenCode plugin that prevents agents/tools from reading or editing sensitive .env* files, while still allowing safe inspection via EnvSitter.", + "license": "MIT", "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist/", + "README.md", + "LICENSE" + ], + "scripts": { + "build": "tsc -p tsconfig.build.json", + "typecheck": "tsc -p tsconfig.json", + "build:test": "tsc -p tsconfig.test.json", + "test": "npm run build:test && node --test dist-test/test/*.test.js", + "prepack": "npm run build", + "prepublishOnly": "npm run typecheck && npm test && npm run build" + }, + "dependencies": { + "@opencode-ai/plugin": "^1.1.14", + "envsitter": "^0.0.1" + }, "devDependencies": { - "@opencode-ai/plugin": "*", "@types/node": "*", "husky": "^9.1.7", "typescript": "*" }, - "dependencies": { - "envsitter": "*" - }, - "scripts": { - "typecheck": "tsc -p tsconfig.json", - "build:test": "tsc -p tsconfig.test.json", - "test": "npm run build:test && node --test dist-test/test/*.test.js", - "prepare": "husky" + "publishConfig": { + "access": "public" } } diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..5d8f23a --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "outDir": "./dist", + "declaration": true, + "declarationMap": true, + "sourceMap": true + }, + "include": ["index.ts"] +}