build: added some meta in package.json

This commit is contained in:
alina 🌸 2024-06-28 00:38:42 +03:00
parent 28b2efbb08
commit 8df4c1a6b5
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 24 additions and 0 deletions

View file

@ -5,6 +5,21 @@
"description": "Type-safe library for MTProto (Telegram API) for browser and NodeJS", "description": "Type-safe library for MTProto (Telegram API) for browser and NodeJS",
"license": "MIT", "license": "MIT",
"author": "alina sireneva <alina@tei.su>", "author": "alina sireneva <alina@tei.su>",
"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": [ "workspaces": [
"packages/*" "packages/*"
], ],

View file

@ -5,6 +5,8 @@ const fs = require('fs')
const glob = require('glob') const glob = require('glob')
const ts = require('typescript') const ts = require('typescript')
const stc = require('@teidesu/slow-types-compiler') const stc = require('@teidesu/slow-types-compiler')
// @ts-ignore
const rootPackageJson = require('../package.json')
if (process.argv.length < 3) { if (process.argv.length < 3) {
console.log('Usage: build-package.js <package name>') console.log('Usage: build-package.js <package name>')
@ -78,6 +80,13 @@ function buildPackageJson() {
pkgJson.module = 'esm/index.js' 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 = {} const newScripts = {}
if (pkgJson.keepScripts) { if (pkgJson.keepScripts) {