From 42b06cd329388fdcaf5b9ec64a8e58141466c134 Mon Sep 17 00:00:00 2001 From: Boris Mann Date: Sat, 4 Jul 2026 17:50:10 -0700 Subject: [PATCH] chore: add npm publishing metadata, MIT license, and CLI version flag --- .gitignore | 1 + LICENSE | 21 +++++++++++++++++++++ README.md | 14 ++++++++++++++ package.json | 31 ++++++++++++++++++++++++++++++- src/config.ts | 5 +++++ src/index.ts | 1 + 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore index 8e48901..a986bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ ghostoff-oauth-state.json # Build artifacts dist/ *.log +*.tgz diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d1d0c6e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Boris Mann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 11ec01c..9f88055 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,20 @@ Export public posts from a [Ghost](https://ghost.org/) CMS and upload them to [O The live test publication is at ****. +## Installation + +Install globally from npm: + +```bash +npm install -g ghostoff +``` + +Or run directly with `npx`: + +```bash +npx ghostoff -- --help +``` + ## What it does - Paginates through Ghost's public Content API for posts. diff --git a/package.json b/package.json index 977236a..7059130 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,41 @@ "version": "0.1.0", "description": "Export Ghost CMS posts to Offprint / Standard.site over AT Protocol", "type": "module", + "author": "Boris Mann ", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://tangled.org/bmann.ca/ghostoff" + }, + "bugs": "https://tangled.org/bmann.ca/ghostoff", + "homepage": "https://ghostoff.offprint.app", + "keywords": [ + "ghost", + "offprint", + "atproto", + "standard-site", + "cms", + "migration" + ], + "bin": { + "ghostoff": "dist/index.js" + }, + "files": [ + "dist", + "src", + "README.md", + "LICENSE" + ], + "engines": { + "node": ">=20" + }, "scripts": { "dev": "tsx src/index.ts", "build": "tsc", "start": "node dist/index.js", "typecheck": "tsc --noEmit", - "lint": "tsc --noEmit" + "lint": "tsc --noEmit", + "prepublishOnly": "npm run build && npm run typecheck" }, "dependencies": { "@atcute/atproto": "^4.0.3", diff --git a/src/config.ts b/src/config.ts index 0bd4ff9..d9b7152 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,9 @@ import 'dotenv/config'; import { program } from 'commander'; +import { createRequire } from 'node:module'; + +const require = createRequire(import.meta.url); +const { version } = require('../package.json'); export interface Config { ghostUrl: string; @@ -30,6 +34,7 @@ export function loadConfig(argv?: string[]): Config { program .name('ghostoff') .description('Export Ghost posts to Offprint via AT Protocol') + .version(version) .option('--ghost-url ', 'Ghost publication URL') .option('--ghost-api-key ', 'Ghost Content API key') .option('--atproto-identifier ', 'atproto handle or DID') diff --git a/src/index.ts b/src/index.ts index 7706540..869109b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +#!/usr/bin/env node import { mkdir } from 'node:fs/promises'; import { loadConfig } from './config.js'; import { createLogger } from './logger.js'; -- 2.51.2