From 878c6f3890f8a85e00882ca137499f616570abfb Mon Sep 17 00:00:00 2001 From: Keenan Zhou Date: Fri, 26 Jun 2026 16:29:12 -0700 Subject: [PATCH] Make package publishable to npm under @github scope with a dist build --- package.json | 21 ++++++++++++++++++--- tsconfig.build.json | 13 +++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 tsconfig.build.json diff --git a/package.json b/package.json index 146e1d5..2cbf500 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,26 @@ { - "name": "accessibility-scanner-alt-text-plugin", - "version": "0.0.0", - "private": true, + "name": "@github/accessibility-scanner-alt-text-plugin", + "version": "0.1.0", "description": "Alt-text validation plugin for github/accessibility-scanner", "license": "MIT", "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, "scripts": { + "build": "tsc -p tsconfig.build.json", + "prepack": "npm run build", "test": "vitest run --passWithNoTests", "test:watch": "vitest", "typecheck": "tsc --noEmit", diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..b260ff4 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "dist", + "rootDir": "." + }, + "include": ["index.ts", "src/**/*.ts"], + "exclude": ["tests", "scripts", "dist"] +}