mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 17:41:51 +00:00
chore(plugin-sdk): make it npm-publishable so npx resolves for authors
The docs told authors to run `npx create-trek-plugin` / `npx trek-plugin`, but nothing published under those names, so npx couldn't resolve them. - Ship one package, `trek-plugin-sdk`, with a bin that matches the package name (`trek-plugin-sdk`) so `npx trek-plugin-sdk <command>` resolves with zero install. The dispatcher gained a `create` subcommand, so every step (create/validate/pack/entry/release) runs through that one entry point. The short `trek-plugin` / `create-trek-plugin` bins still work once installed. - Package hardening for publish: repository+directory (monorepo subdir), homepage/bugs/author/engines, publishConfig public, a prepublishOnly that builds + tests, and a LICENSE file. - A publish workflow: pushing a `plugin-sdk-v*` tag builds and publishes with the NPM_TOKEN repo secret. - Docs (SDK README + the four wiki pages) now use `npx trek-plugin-sdk <cmd>`, the invocation that actually resolves.
This commit is contained in:
+11
-3
@@ -4,6 +4,12 @@
|
||||
"description": "SDK for building TREK plugins: types, definePlugin, a mock host, manifest validation, and the create-trek-plugin / trek-plugin CLIs.",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "mauriceboe",
|
||||
"homepage": "https://github.com/mauriceboe/TREK/wiki/Plugin-Development",
|
||||
"repository": { "type": "git", "url": "git+https://github.com/mauriceboe/TREK.git", "directory": "plugin-sdk" },
|
||||
"bugs": { "url": "https://github.com/mauriceboe/TREK/issues" },
|
||||
"engines": { "node": ">=18" },
|
||||
"publishConfig": { "access": "public" },
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
@@ -11,14 +17,16 @@
|
||||
"./testing": { "types": "./dist/mock-host.d.ts", "import": "./dist/mock-host.js" }
|
||||
},
|
||||
"bin": {
|
||||
"create-trek-plugin": "./dist/cli/create.js",
|
||||
"trek-plugin": "./dist/cli/trek-plugin.js"
|
||||
"trek-plugin-sdk": "./dist/cli/trek-plugin.js",
|
||||
"trek-plugin": "./dist/cli/trek-plugin.js",
|
||||
"create-trek-plugin": "./dist/cli/create.js"
|
||||
},
|
||||
"files": ["dist"],
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||||
"test": "vitest run"
|
||||
"test": "vitest run",
|
||||
"prepublishOnly": "npm run build && npm test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.0.0",
|
||||
|
||||
Reference in New Issue
Block a user