Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "opencode-pty",
"module": "index.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"version": "0.2.3",
"description": "OpenCode plugin for interactive PTY management - run background processes, send input, read output with regex filtering",
"author": "shekohex",
Expand All @@ -26,27 +28,33 @@
},
"homepage": "https://github.com/shekohex/opencode-pty#readme",
"files": [
"index.ts",
"src",
"dist"
],
"license": "MIT",
"type": "module",
"exports": {
"./*": "./src/*.ts",
"./*/*": "./src/*/*.ts",
"./*/*/*": "./src/*/*/*.ts",
"./*/*/*/*": "./src/*/*/*/*.ts",
"./*/*/*/*/*": "./src/*/*/*/*/*.ts"
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./*": {
"types": "./dist/src/*.d.ts",
"default": "./dist/src/*.js"
},
"./*/*": {
"types": "./dist/src/*/*.d.ts",
"default": "./dist/src/*/*.js"
}
},
"scripts": {
"typecheck": "tsc --noEmit",
"unittest": "bun test",
"test:e2e": "PW_DISABLE_TS_ESM=1 NODE_ENV=test bun --bun playwright test",
"test:all": "bun unittest && bun test:e2e",
"build:dev": "bun clean && vite build --mode development",
"build:prod": "bun clean && vite build --mode production",
"prepack": "bun build:prod",
"build:plugin": "tsc -p tsconfig.build.json && bun x copyfiles -u 0 \"src/**/*.txt\" dist",
"build:dev": "bun clean && bun build:plugin && vite build --mode development",
"build:prod": "bun clean && bun build:plugin && vite build --mode production",
"prepublishOnly": "bun build:prod",
"clean": "rm -rf dist playwright-report test-results",
"lint": "biome lint .",
"lint:fix": "biome lint --write .",
Expand Down
7 changes: 4 additions & 3 deletions src/web/server/handlers/static.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { resolve } from 'node:path'
import { readdirSync, statSync } from 'node:fs'
import { join, extname } from 'node:path'
import { extname, join, resolve } from 'node:path'
import { ASSET_CONTENT_TYPES } from '../../shared/constants.ts'

// ----- MODULE-SCOPE CONSTANTS -----
const PROJECT_ROOT = resolve(import.meta.dir, '../../../..')
// Resolve project root regardless of whether we're running from source or dist/
const MODULE_DIR = resolve(import.meta.dir, '../../../..')
const PROJECT_ROOT = MODULE_DIR.replace(/[\\/]dist$/, '')
const SECURITY_HEADERS = {
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'DENY',
Expand Down
16 changes: 16 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"rootDir": ".",
"outDir": "dist",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"allowImportingTsExtensions": false,
"rewriteRelativeImportExtensions": true
},
"include": ["index.ts", "src/**/*.ts"],
"exclude": ["src/web/client/**", "**/*.test.ts", "**/*.spec.ts"]
}
Loading