From 89f4e0a2cfc01f76998e6467b90202dde4d541b2 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 12 Mar 2026 17:46:26 +0000 Subject: [PATCH] fix: replace clipboardy with tinyclip --- package.json | 2 +- pnpm-lock.yaml | 56 ++++++++++---------------------------------------- source/main.ts | 4 ++-- 3 files changed, 14 insertions(+), 48 deletions(-) diff --git a/package.json b/package.json index cd0d0b97..f7ddd3b4 100644 --- a/package.json +++ b/package.json @@ -44,10 +44,10 @@ "boxen": "7.0.0", "chalk": "5.0.1", "chalk-template": "0.4.0", - "clipboardy": "3.0.0", "compression": "1.8.1", "is-port-reachable": "4.0.0", "serve-handler": "6.1.7", + "tinyclip": "^0.1.12", "update-check": "1.5.4" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c14bee02..4505fcc9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,9 +25,6 @@ importers: chalk-template: specifier: 0.4.0 version: 0.4.0 - clipboardy: - specifier: 3.0.0 - version: 3.0.0 compression: specifier: 1.8.1 version: 1.8.1 @@ -37,6 +34,9 @@ importers: serve-handler: specifier: 6.1.7 version: 6.1.7 + tinyclip: + specifier: ^0.1.12 + version: 0.1.12 update-check: specifier: 1.5.4 version: 1.5.4 @@ -1515,12 +1515,6 @@ packages: } engines: { node: '>= 8' } - arch@2.2.0: - resolution: - { - integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==, - } - arg@5.0.2: resolution: { @@ -1864,13 +1858,6 @@ packages: } engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } - clipboardy@3.0.0: - resolution: - { - integrity: sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==, - } - engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } - clone-response@1.0.3: resolution: { @@ -3037,14 +3024,6 @@ packages: } engines: { node: '>= 0.4' } - is-docker@2.2.1: - resolution: - { - integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==, - } - engines: { node: '>=8' } - hasBin: true - is-extglob@2.1.1: resolution: { @@ -3170,13 +3149,6 @@ packages: } engines: { node: '>=0.10.0' } - is-wsl@2.2.0: - resolution: - { - integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==, - } - engines: { node: '>=8' } - isarray@2.0.5: resolution: { @@ -4649,6 +4621,12 @@ packages: integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==, } + tinyclip@0.1.12: + resolution: + { + integrity: sha512-Ae3OVUqifDw0wBriIBS7yVaW44Dp6eSHQcyq4Igc7eN2TJH/2YsicswaW+J/OuMvhpDPOKEgpAZCjkb4hpoyeA==, + } + tinyglobby@0.2.9: resolution: { @@ -6004,8 +5982,6 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 - arch@2.2.0: {} - arg@5.0.2: {} argparse@1.0.10: @@ -6217,12 +6193,6 @@ snapshots: slice-ansi: 5.0.0 string-width: 5.1.2 - clipboardy@3.0.0: - dependencies: - arch: 2.2.0 - execa: 5.1.1 - is-wsl: 2.2.0 - clone-response@1.0.3: dependencies: mimic-response: 1.0.1 @@ -7066,8 +7036,6 @@ snapshots: dependencies: has-tostringtag: 1.0.2 - is-docker@2.2.1: {} - is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -7123,10 +7091,6 @@ snapshots: is-windows@1.0.2: {} - is-wsl@2.2.0: - dependencies: - is-docker: 2.2.1 - isarray@2.0.5: {} isexe@2.0.0: {} @@ -7933,6 +7897,8 @@ snapshots: tinybench@2.9.0: {} + tinyclip@0.1.12: {} + tinyexec@0.3.0: {} tinyglobby@0.2.9: diff --git a/source/main.ts b/source/main.ts index 8a375f1e..332b19c7 100755 --- a/source/main.ts +++ b/source/main.ts @@ -7,7 +7,7 @@ import { cwd as getPwd, exit, env, stdout } from 'node:process'; import path from 'node:path'; import chalk from 'chalk'; import boxen from 'boxen'; -import clipboard from 'clipboardy'; +import * as clipboard from 'tinyclip'; import manifest from '../package.json'; import { resolve } from './utilities/promise.js'; import { startServer } from './utilities/server.js'; @@ -130,7 +130,7 @@ for (const endpoint of args['--listen']) { if (copyAddress && local) { try { // eslint-disable-next-line no-await-in-loop - await clipboard.write(local); + await clipboard.writeText(local); message += `\n\n${chalk.grey('Copied local address to clipboard!')}`; } catch (error: unknown) { logger.error(