diff --git a/package.json b/package.json index 126770dc..772c23f6 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,21 @@ "description": "Type-safe library for MTProto (Telegram API) for browser and NodeJS", "license": "MIT", "author": "alina sireneva ", + "keywords": [ + "telegram", + "telegram-api", + "telegram-bot", + "telegram-library", + "mtproto", + "tgbot", + "userbot", + "api" + ], + "repository": { + "type": "git", + "url": "https://github.com/mtcute/mtcute" + }, + "homepage": "https://mtcute.dev", "workspaces": [ "packages/*" ], diff --git a/scripts/build-package.js b/scripts/build-package.js index d548f2d4..1db15724 100644 --- a/scripts/build-package.js +++ b/scripts/build-package.js @@ -5,6 +5,8 @@ const fs = require('fs') const glob = require('glob') const ts = require('typescript') const stc = require('@teidesu/slow-types-compiler') +// @ts-ignore +const rootPackageJson = require('../package.json') if (process.argv.length < 3) { console.log('Usage: build-package.js ') @@ -78,6 +80,13 @@ function buildPackageJson() { pkgJson.module = 'esm/index.js' } + // copy common fields from root + for (const field of ['license', 'author', 'contributors', 'homepage', 'repository', 'bugs']) { + if (rootPackageJson[field]) { + pkgJson[field] = rootPackageJson[field] + } + } + const newScripts = {} if (pkgJson.keepScripts) {