Skip to content

Commit bbf70fc

Browse files
authored
perf(info): migrate from clipboardy to copy-paste (#1087)
1 parent 1848fa9 commit bbf70fc

File tree

5 files changed

+56
-339
lines changed

5 files changed

+56
-339
lines changed

knip.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626
],
2727
"ignoreDependencies": [
2828
"c12",
29-
"clipboardy",
3029
"confbox",
3130
"consola",
31+
"copy-paste",
3232
"defu",
3333
"exsolve",
3434
"fuse.js",
3535
"giget",
36-
"h3",
3736
"jiti",
3837
"nypm",
3938
"ofetch",
@@ -45,7 +44,6 @@
4544
"semver",
4645
"srvx",
4746
"ufo",
48-
"undici",
4947
"youch"
5048
]
5149
}

packages/nuxi/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
"@nuxt/kit": "^4.1.3",
3636
"@nuxt/schema": "^4.1.3",
3737
"@nuxt/test-utils": "^3.19.2",
38+
"@types/copy-paste": "^2.1.0",
3839
"@types/node": "^22.18.12",
3940
"@types/semver": "^7.7.1",
4041
"c12": "^3.3.1",
4142
"citty": "^0.1.6",
42-
"clipboardy": "^5.0.0",
4343
"confbox": "^0.2.2",
4444
"consola": "^3.4.2",
45+
"copy-paste": "^2.2.0",
4546
"defu": "^6.1.4",
4647
"exsolve": "^1.0.7",
4748
"fuse.js": "^7.1.0",

packages/nuxi/src/commands/info.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import os from 'node:os'
55
import process from 'node:process'
66

77
import { defineCommand } from 'citty'
8-
import clipboardy from 'clipboardy'
8+
import { copy as copyToClipboard } from 'copy-paste'
99
import { detectPackageManager } from 'nypm'
1010
import { resolve } from 'pathe'
1111
import { readPackageJSON } from 'pkg-types'
@@ -120,10 +120,7 @@ export default defineCommand({
120120
}\n`
121121
}
122122

123-
const copied = !isMinimal && await clipboardy
124-
.write(infoStr)
125-
.then(() => true)
126-
.catch(() => false)
123+
const copied = !isMinimal && await new Promise(resolve => copyToClipboard(infoStr, err => resolve(!err)))
127124

128125
const isNuxt3 = !isLegacy
129126
const isBridge = !isNuxt3 && infoObj.BuildModules.includes('bridge')

packages/nuxt-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"dependencies": {
3636
"c12": "^3.3.1",
3737
"citty": "^0.1.6",
38-
"clipboardy": "^5.0.0",
3938
"confbox": "^0.2.2",
4039
"consola": "^3.4.2",
40+
"copy-paste": "^2.2.0",
4141
"defu": "^6.1.4",
4242
"exsolve": "^1.0.7",
4343
"fuse.js": "^7.1.0",

0 commit comments

Comments
 (0)