Files
jackwener__opencli/package.json
T

71 lines
1.8 KiB
JSON
Raw Normal View History

{
"name": "@jackwener/opencli",
"version": "1.4.0",
"publishConfig": {
"access": "public"
},
"description": "Make any website your CLI. AI-powered.",
"engines": {
"node": ">=20.0.0"
},
"type": "module",
"main": "dist/main.js",
"bin": {
"opencli": "dist/main.js"
},
feat: plugin system (Stage 0-2) * feat: plugin system (Stage 0-2) - Stage 0: discoverPlugins() scans ~/.opencli/plugins/ at startup - Stage 1: demo plugin repos (github-trending, hot-digest) - Stage 2: opencli plugin install/uninstall/list commands - package.json exports ./registry for TS plugin peerDep support - 17 new/updated tests, tsc --noEmit clean * fix: CDPBridge connect timeout unit mismatch (seconds vs ms) opts.timeout is passed in seconds from runtime.ts but CDPBridge was using it as milliseconds, causing instant timeout (30ms). * feat: add registry-api public entry point for TS plugin peerDep support - Add src/registry-api.ts: re-exports core registration API (cli, Strategy, getRegistry) without transitive side-effects, safe for plugin imports - Update package.json exports: './registry' -> './dist/registry-api.js' - Update src/registry.ts: use globalThis shared registry to ensure single instance across npm-linked plugin modules - Update .gitignore for plugin-related artifacts * fix: symlink host opencli into plugin node_modules on install After npm install, replace the npm-installed @jackwener/opencli with a symlink to the running host's package root. This ensures TS plugins always resolve '@jackwener/opencli/registry' against the host installation, avoiding version mismatches when the published npm package lags behind. * fix: transpile TS plugins to JS on install, deduplicate .ts/.js discovery - installPlugin: after symlinking host opencli, transpile any .ts files to .js using esbuild from the host's node_modules/.bin/ - discoverPluginDir: skip .ts files when a .js sibling exists (production node cannot load .ts directly) - scanPluginCommands: deduplicate basenames via Set to avoid showing 'aggregate, aggregate' when both .ts and .js exist * docs: add plugin system user guide - New docs/guide/plugins.md covering: - Installation/uninstallation commands - Creating YAML plugins (zero-dep) - Creating TS plugins (with peerDep) - TS plugin install lifecycle (clone → deps → symlink → transpile) - Example plugins and troubleshooting - Add Plugins to VitePress sidebar (EN + ZH) - Link from getting-started.md Next Steps * fix: address review issues in plugin system - Security: replace execSync with execFileSync to prevent shell injection - Replace deprecated npm --production with --omit=dev - Tighten parseSource regex to [\w.-]+ to reject special chars - Fix ZH sidebar plugin link (/guide/plugins → /zh/guide/plugins) - Return plugin name from installPlugin() to avoid duplicated logic - Use execFileSync for esbuild transpilation - Fix misleading comment in linkHostOpencli --------- Co-authored-by: jackwener <jakevingoo@gmail.com>
2026-03-21 19:41:15 +08:00
"exports": {
".": "./dist/main.js",
"./registry": "./dist/registry-api.js"
},
"scripts": {
"dev": "tsx src/main.ts",
2026-03-22 04:14:07 +08:00
"build": "npm run clean-dist && tsc && npm run clean-yaml && npm run copy-yaml && npm run build-manifest",
"build-manifest": "node dist/build-manifest.js",
2026-03-22 04:14:07 +08:00
"clean-dist": "node scripts/clean-dist.cjs",
"clean-yaml": "node scripts/clean-yaml.cjs",
"copy-yaml": "node scripts/copy-yaml.cjs",
"start": "node dist/main.js",
"postinstall": "node scripts/postinstall.js || true",
"typecheck": "tsc --noEmit",
"lint": "tsc --noEmit",
"prepublishOnly": "npm run build",
"test": "vitest run --project unit",
"test:adapter": "vitest run --project adapter",
"test:all": "vitest run",
"test:e2e": "vitest run --project e2e",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
2026-03-15 06:32:01 +08:00
"keywords": [
"cli",
"browser",
"web",
"ai"
2026-03-15 06:32:01 +08:00
],
"author": "jackwener",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/jackwener/opencli.git"
},
"dependencies": {
"chalk": "^5.3.0",
"cli-table3": "^0.6.5",
"commander": "^14.0.3",
"js-yaml": "^4.1.0",
"turndown": "^7.2.2",
"ws": "^8.18.0"
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.13.10",
"@types/turndown": "^5.0.6",
"@types/ws": "^8.5.13",
"tsx": "^4.19.3",
"typescript": "^6.0.2",
"vitepress": "^1.6.4",
"vitest": "^4.1.0"
}
}