Skip to content

Commit e21e19a

Browse files
florian-lefebvretay1orjonesmaradwan26
authored
perf: migrate to tinyclip from clipboardy (#21975)
* perf: migrate to tinyclip from clipboardy * feedback * chore: dedupe --------- Co-authored-by: Taylor Jones <taylor.jones826@gmail.com> Co-authored-by: Mahmoud <maradwan26@gmail.com> Co-authored-by: Mahmoud <132728978+maradwan26@users.noreply.github.com>
1 parent 8efebca commit e21e19a

5 files changed

Lines changed: 26 additions & 77 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"chalk": "^5.4.1",
3838
"change-case-all": "^2.1.0",
3939
"child-process-promise": "^2.2.1",
40-
"clipboardy": "^4.0.0",
4140
"enquirer": "^2.4.1",
4241
"fast-glob": "^3.3.3",
4342
"fs-extra": "^11.2.0",
@@ -50,6 +49,7 @@
5049
"remark": "^15.0.1",
5150
"replace-in-file": "^8.3.0",
5251
"sass": "^1.77.7",
52+
"tinyclip": "^0.1.12",
5353
"tsdown": "^0.21.0",
5454
"typescript": "^5.7.3",
5555
"yargs": "^17.7.2"

packages/cli/src/commands/changelog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import clipboard from 'clipboardy';
8+
import { writeText } from 'tinyclip';
99
import inquirer from 'inquirer';
1010
import { generate } from '../changelog.js';
1111
import { fetchLatestFromUpstream } from '../git.js';
@@ -60,7 +60,7 @@ async function changelog({ range, noPrompt = false }) {
6060
}
6161

6262
if (response?.copy) {
63-
clipboard.writeSync(changelog);
63+
await writeText(changelog);
6464
console.log('Done!');
6565
} else {
6666
console.log(changelog);

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
"babel-preset-carbon": "^0.8.0",
9595
"browserify-zlib": "^0.2.0",
9696
"browserslist-config-carbon": "^11.2.0",
97-
"clipboardy": "^4.0.0",
9897
"enquirer": "^2.3.6",
9998
"fast-glob": "^3.3.3",
10099
"fs-extra": "^11.0.0",
@@ -109,6 +108,7 @@
109108
"storybook": "^10.3.5",
110109
"storybook-addon-accessibility-checker": ">=9.2.0-rc.4",
111110
"stream-browserify": "^3.0.0",
111+
"tinyclip": "^0.1.12",
112112
"tsdown": "^0.21.0",
113113
"typescript-config-carbon": "workspace:^0.9.0",
114114
"use-sync-external-store": "^1.5.0",

packages/react/tasks/build-test-rtl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
'use strict';
99

10-
const clipboard = require('clipboardy');
10+
const { writeText } = require('tinyclip');
1111
const prettier = require('prettier');
1212
const CarbonComponents = require('@carbon/react');
1313
const enquirer = require('enquirer');
@@ -234,7 +234,7 @@ async function main() {
234234
]);
235235

236236
if (copy) {
237-
clipboard.writeSync(testFile);
237+
await writeText(testFile);
238238
}
239239
return;
240240
}

yarn.lock

Lines changed: 20 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,6 @@ __metadata:
17061706
chalk: "npm:^5.4.1"
17071707
change-case-all: "npm:^2.1.0"
17081708
child-process-promise: "npm:^2.2.1"
1709-
clipboardy: "npm:^4.0.0"
17101709
enquirer: "npm:^2.4.1"
17111710
fast-glob: "npm:^3.3.3"
17121711
fs-extra: "npm:^11.2.0"
@@ -1719,6 +1718,7 @@ __metadata:
17191718
remark: "npm:^15.0.1"
17201719
replace-in-file: "npm:^8.3.0"
17211720
sass: "npm:^1.77.7"
1721+
tinyclip: "npm:^0.1.12"
17221722
tsdown: "npm:^0.21.0"
17231723
typescript: "npm:^5.7.3"
17241724
yargs: "npm:^17.7.2"
@@ -1968,7 +1968,6 @@ __metadata:
19681968
browserify-zlib: "npm:^0.2.0"
19691969
browserslist-config-carbon: "npm:^11.2.0"
19701970
classnames: "npm:2.5.1"
1971-
clipboardy: "npm:^4.0.0"
19721971
copy-to-clipboard: "npm:^3.3.1"
19731972
downshift: "npm:9.0.10"
19741973
enquirer: "npm:^2.3.6"
@@ -1990,6 +1989,7 @@ __metadata:
19901989
storybook-addon-accessibility-checker: "npm:>=9.2.0-rc.4"
19911990
stream-browserify: "npm:^3.0.0"
19921991
tabbable: "npm:^6.2.0"
1992+
tinyclip: "npm:^0.1.12"
19931993
tsdown: "npm:^0.21.0"
19941994
typescript-config-carbon: "workspace:^0.9.0"
19951995
use-sync-external-store: "npm:^1.5.0"
@@ -8270,11 +8270,11 @@ __metadata:
82708270
linkType: hard
82718271

82728272
"axios@npm:^0.21.1":
8273-
version: 0.21.4
8274-
resolution: "axios@npm:0.21.4"
8273+
version: 0.21.1
8274+
resolution: "axios@npm:0.21.1"
82758275
dependencies:
8276-
follow-redirects: "npm:^1.14.0"
8277-
checksum: 10/da644592cb6f8f9f8c64fdabd7e1396d6769d7a4c1ea5f8ae8beb5c2eb90a823e3a574352b0b934ac62edc762c0f52647753dc54f7d07279127a7e5c4cd20272
8276+
follow-redirects: "npm:^1.10.0"
8277+
checksum: 10/271afc61381d285c688f0579eec170b66dc4177219a3f31e67d1fe485be7a2dae4af2c366fdee703a8ec887c52778fdc7f5fec30650a97f61f68c1a7696648b0
82788278
languageName: node
82798279
linkType: hard
82808280

@@ -8457,9 +8457,9 @@ __metadata:
84578457
linkType: hard
84588458

84598459
"balanced-match@npm:^1.0.0":
8460-
version: 1.0.2
8461-
resolution: "balanced-match@npm:1.0.2"
8462-
checksum: 10/9706c088a283058a8a99e0bf91b0a2f75497f185980d9ffa8b304de1d9e58ebda7c72c07ebf01dadedaac5b2907b2c6f566f660d62bd336c3468e960403b9d65
8460+
version: 1.0.0
8461+
resolution: "balanced-match@npm:1.0.0"
8462+
checksum: 10/9b67bfe558772f40cf743a3469b48b286aecec2ea9fe80c48d74845e53aab1cef524fafedf123a63019b49ac397760573ef5f173f539423061f7217cbb5fbd40
84638463
languageName: node
84648464
linkType: hard
84658465

@@ -8529,9 +8529,9 @@ __metadata:
85298529
linkType: hard
85308530

85318531
"basic-ftp@npm:^5.0.2":
8532-
version: 5.2.2
8533-
resolution: "basic-ftp@npm:5.2.2"
8534-
checksum: 10/2bb208276bafbc3549992734b67247d78bfe6546e2eb1e9513c2761364c47e88b94171666359200279a738b36b152d2bbba0953d4f83f4677f1fd5b68aea3e29
8532+
version: 5.0.5
8533+
resolution: "basic-ftp@npm:5.0.5"
8534+
checksum: 10/3dc56b2092b10d67e84621f5b9bbb0430469499178e857869194184d46fbdd367a9aa9fad660084388744b074b5f540e6ac8c22c0826ebba4fcc86a9d1c324e2
85358535
languageName: node
85368536
linkType: hard
85378537

@@ -9491,17 +9491,6 @@ __metadata:
94919491
languageName: node
94929492
linkType: hard
94939493

9494-
"clipboardy@npm:^4.0.0":
9495-
version: 4.0.0
9496-
resolution: "clipboardy@npm:4.0.0"
9497-
dependencies:
9498-
execa: "npm:^8.0.1"
9499-
is-wsl: "npm:^3.1.0"
9500-
is64bit: "npm:^2.0.0"
9501-
checksum: 10/ec4ebe7e5c81d9c9cb994637e7b0e068c1c8fc272167ecd5519f967427271ec66e0e64da7268a2630b860eff42933aeabe25ba5e42bb80dbf1fae6362df059ed
9502-
languageName: node
9503-
linkType: hard
9504-
95059494
"cliui@npm:^6.0.0":
95069495
version: 6.0.0
95079496
resolution: "cliui@npm:6.0.0"
@@ -12286,23 +12275,6 @@ __metadata:
1228612275
languageName: node
1228712276
linkType: hard
1228812277

12289-
"execa@npm:^8.0.1":
12290-
version: 8.0.1
12291-
resolution: "execa@npm:8.0.1"
12292-
dependencies:
12293-
cross-spawn: "npm:^7.0.3"
12294-
get-stream: "npm:^8.0.1"
12295-
human-signals: "npm:^5.0.0"
12296-
is-stream: "npm:^3.0.0"
12297-
merge-stream: "npm:^2.0.0"
12298-
npm-run-path: "npm:^5.1.0"
12299-
onetime: "npm:^6.0.0"
12300-
signal-exit: "npm:^4.1.0"
12301-
strip-final-newline: "npm:^3.0.0"
12302-
checksum: 10/d2ab5fe1e2bb92b9788864d0713f1fce9a07c4594e272c0c97bc18c90569897ab262e4ea58d27a694d288227a2e24f16f5e2575b44224ad9983b799dc7f1098d
12303-
languageName: node
12304-
linkType: hard
12305-
1230612278
"execa@npm:^9.6.0":
1230712279
version: 9.6.0
1230812280
resolution: "execa@npm:9.6.0"
@@ -12717,7 +12689,7 @@ __metadata:
1271712689
languageName: node
1271812690
linkType: hard
1271912691

12720-
"follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.15.6":
12692+
"follow-redirects@npm:^1.10.0, follow-redirects@npm:^1.15.6":
1272112693
version: 1.16.0
1272212694
resolution: "follow-redirects@npm:1.16.0"
1272312695
peerDependenciesMeta:
@@ -13044,13 +13016,6 @@ __metadata:
1304413016
languageName: node
1304513017
linkType: hard
1304613018

13047-
"get-stream@npm:^8.0.1":
13048-
version: 8.0.1
13049-
resolution: "get-stream@npm:8.0.1"
13050-
checksum: 10/dde5511e2e65a48e9af80fea64aff11b4921b14b6e874c6f8294c50975095af08f41bfb0b680c887f28b566dd6ec2cb2f960f9d36a323359be324ce98b766e9e
13051-
languageName: node
13052-
linkType: hard
13053-
1305413019
"get-stream@npm:^9.0.0, get-stream@npm:^9.0.1":
1305513020
version: 9.0.1
1305613021
resolution: "get-stream@npm:9.0.1"
@@ -13812,13 +13777,6 @@ __metadata:
1381213777
languageName: node
1381313778
linkType: hard
1381413779

13815-
"human-signals@npm:^5.0.0":
13816-
version: 5.0.0
13817-
resolution: "human-signals@npm:5.0.0"
13818-
checksum: 10/30f8870d831cdcd2d6ec0486a7d35d49384996742052cee792854273fa9dd9e7d5db06bb7985d4953e337e10714e994e0302e90dc6848069171b05ec836d65b0
13819-
languageName: node
13820-
linkType: hard
13821-
1382213780
"human-signals@npm:^8.0.1":
1382313781
version: 8.0.1
1382413782
resolution: "human-signals@npm:8.0.1"
@@ -14762,15 +14720,6 @@ __metadata:
1476214720
languageName: node
1476314721
linkType: hard
1476414722

14765-
"is64bit@npm:^2.0.0":
14766-
version: 2.0.0
14767-
resolution: "is64bit@npm:2.0.0"
14768-
dependencies:
14769-
system-architecture: "npm:^0.1.0"
14770-
checksum: 10/94dafd5f29bfb96c542e89ef8c33e811159ca7d07a2890ab83026fa87706612af4101308d9392e9ee68e046e8604a6b59a8f41091f8556f6235efbcfd9c5574c
14771-
languageName: node
14772-
linkType: hard
14773-
1477414723
"isarray@npm:0.0.1":
1477514724
version: 0.0.1
1477614725
resolution: "isarray@npm:0.0.1"
@@ -22379,13 +22328,6 @@ __metadata:
2237922328
languageName: node
2238022329
linkType: hard
2238122330

22382-
"system-architecture@npm:^0.1.0":
22383-
version: 0.1.0
22384-
resolution: "system-architecture@npm:0.1.0"
22385-
checksum: 10/ca0dd793c45c354ab57dd7fc8ce7dc9923a6e07382bd3b22eb5b08f55ddb0217c390d00767549c5155fd4ce7ef23ffdd8cfb33dd4344cbbd37837d085a50f6f0
22386-
languageName: node
22387-
linkType: hard
22388-
2238922331
"tabbable@npm:^6.0.0, tabbable@npm:^6.2.0":
2239022332
version: 6.2.0
2239122333
resolution: "tabbable@npm:6.2.0"
@@ -22585,6 +22527,13 @@ __metadata:
2258522527
languageName: node
2258622528
linkType: hard
2258722529

22530+
"tinyclip@npm:^0.1.12":
22531+
version: 0.1.12
22532+
resolution: "tinyclip@npm:0.1.12"
22533+
checksum: 10/9652b136dff13a295c3d826e428684f414570d630e6035da6e2b24dd1aeab005277136f53056ae7959b1c08fa43568b714ac43045c14c961d0c9331cbdbf632a
22534+
languageName: node
22535+
linkType: hard
22536+
2258822537
"tinyexec@npm:^1.0.0, tinyexec@npm:^1.1.1":
2258922538
version: 1.1.1
2259022539
resolution: "tinyexec@npm:1.1.1"

0 commit comments

Comments
 (0)