Skip to content

Commit 77f8619

Browse files
perf: use tinyclip instead of copy-paste (#1238)
1 parent 70b8c23 commit 77f8619

5 files changed

Lines changed: 17 additions & 42 deletions

File tree

knip.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"@clack/prompts",
3434
"c12",
3535
"confbox",
36-
"copy-paste",
3736
"debug",
3837
"defu",
3938
"exsolve",
@@ -53,6 +52,7 @@
5352
"scule",
5453
"semver",
5554
"srvx",
55+
"tinyclip",
5656
"ufo",
5757
"youch"
5858
]

packages/nuxi/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@
3838
"@nuxt/kit": "^4.3.1",
3939
"@nuxt/schema": "^4.3.1",
4040
"@nuxt/test-utils": "^4.0.0",
41-
"@types/copy-paste": "^2.1.0",
4241
"@types/debug": "^4.1.12",
4342
"@types/node": "^24.10.12",
4443
"@types/semver": "^7.7.1",
4544
"c12": "^3.3.3",
4645
"citty": "^0.2.0",
4746
"confbox": "^0.2.4",
4847
"consola": "^3.4.2",
49-
"copy-paste": "^2.2.0",
5048
"debug": "^4.4.3",
5149
"defu": "^6.1.4",
5250
"exsolve": "^1.0.8",
@@ -72,6 +70,7 @@
7270
"semver": "^7.7.4",
7371
"srvx": "^0.11.2",
7472
"std-env": "^3.10.0",
73+
"tinyclip": "^0.1.10",
7574
"tinyexec": "^1.0.2",
7675
"tsdown": "^0.20.3",
7776
"typescript": "^5.9.3",

packages/nuxi/src/commands/info.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import process from 'node:process'
77
import { box } from '@clack/prompts'
88
import { defineCommand } from 'citty'
99
import { colors } from 'consola/utils'
10-
import { copy as copyToClipboard } from 'copy-paste'
1110
import { detectPackageManager } from 'nypm'
1211
import { resolve } from 'pathe'
1312
import { readPackageJSON } from 'pkg-types'
14-
1513
import { isBun, isDeno, isMinimal } from 'std-env'
14+
import { writeText } from 'tinyclip'
1615

1716
import { version as nuxiVersion } from '../../package.json'
1817
import { getBuilder } from '../utils/banner'
@@ -143,7 +142,7 @@ export default defineCommand({
143142
}
144143
}
145144

146-
const copied = !isMinimal && await new Promise(resolve => copyToClipboard(copyStr, err => resolve(!err)))
145+
const copied = !isMinimal && await writeText(copyStr).then(() => true).catch(() => false)
147146

148147
if (copied) {
149148
box(

packages/nuxt-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dist"
2626
],
2727
"engines": {
28-
"node": "^16.10.0 || >=18.0.0"
28+
"node": "^16.14.0 || >=18.0.0"
2929
},
3030
"scripts": {
3131
"build": "tsdown",
@@ -47,7 +47,6 @@
4747
"citty": "^0.2.0",
4848
"confbox": "^0.2.4",
4949
"consola": "^3.4.2",
50-
"copy-paste": "^2.2.0",
5150
"debug": "^4.4.3",
5251
"defu": "^6.1.4",
5352
"exsolve": "^1.0.8",
@@ -66,6 +65,7 @@
6665
"semver": "^7.7.4",
6766
"srvx": "^0.11.2",
6867
"std-env": "^3.10.0",
68+
"tinyclip": "^0.1.10",
6969
"tinyexec": "^1.0.2",
7070
"ufo": "^1.6.3",
7171
"youch": "^4.1.0-beta.13"

pnpm-lock.yaml

Lines changed: 11 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)