From 9fd88001f92d447dcec54ececfa1567aa9878651 Mon Sep 17 00:00:00 2001 From: Tierney Cyren Date: Tue, 24 Jun 2025 14:11:22 -0400 Subject: [PATCH 1/4] deps: update biome Signed-off-by: Tierney Cyren --- package-lock.json | 75 +++++++++++++++++++++++------------------------ package.json | 10 +++++-- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50eae01..cb67ae9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,14 +6,14 @@ "packages": { "": { "name": "@twilio-labs/plugin-token", - "version": "6.1.1", + "version": "6.1.2", "license": "MIT", "dependencies": { "@oclif/core": "1.16.0", "@twilio/cli-core": "^7.27.2" }, "devDependencies": { - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "^2.0.5", "chai": "^5.2.0", "mocha": "^11.1.0", "nyc": "^17.1.0", @@ -1276,11 +1276,10 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.0.5.tgz", + "integrity": "sha512-MztFGhE6cVjf3QmomWu83GpTFyWY8KIcskgRf2AqVEMSH4qI4rNdBLdpAQ11TNK9pUfLGz3IIOC1ZYwgBePtig==", "dev": true, - "hasInstallScript": true, "license": "MIT OR Apache-2.0", "bin": { "biome": "bin/biome" @@ -1293,20 +1292,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.0.5", + "@biomejs/cli-darwin-x64": "2.0.5", + "@biomejs/cli-linux-arm64": "2.0.5", + "@biomejs/cli-linux-arm64-musl": "2.0.5", + "@biomejs/cli-linux-x64": "2.0.5", + "@biomejs/cli-linux-x64-musl": "2.0.5", + "@biomejs/cli-win32-arm64": "2.0.5", + "@biomejs/cli-win32-x64": "2.0.5" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.0.5.tgz", + "integrity": "sha512-VIIWQv9Rcj9XresjCf3isBFfWjFStsdGZvm8SmwJzKs/22YQj167ge7DkxuaaZbNf2kmYif0AcjAKvtNedEoEw==", "cpu": [ "arm64" ], @@ -1321,9 +1320,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.0.5.tgz", + "integrity": "sha512-DRpGxBgf5Z7HUFcNUB6n66UiD4VlBlMpngNf32wPraxX8vYU6N9cb3xQWOXIQVBBQ64QfsSLJnjNu79i/LNmSg==", "cpu": [ "x64" ], @@ -1338,9 +1337,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.0.5.tgz", + "integrity": "sha512-FQTfDNMXOknf8+g9Eede2daaduRjTC2SNbfWPNFMadN9K3UKjeZ62jwiYxztPaz9zQQsZU8VbddQIaeQY5CmIA==", "cpu": [ "arm64" ], @@ -1355,9 +1354,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.5.tgz", + "integrity": "sha512-OpflTCOw/ElEs7QZqN/HFaSViPHjAsAPxFJ22LhWUWvuJgcy/Z8+hRV0/3mk/ZRWy5A6fCDKHZqAxU+xB6W4mA==", "cpu": [ "arm64" ], @@ -1372,9 +1371,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.0.5.tgz", + "integrity": "sha512-znpfydUDPuDkyBTulnODrQVK2FaG/4hIOPcQSsF2GeauQOYrBAOplj0etGB0NUrr0dFsvaQ15nzDXYb60ACoiw==", "cpu": [ "x64" ], @@ -1389,9 +1388,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.5.tgz", + "integrity": "sha512-9lmjCnajAzpZXbav2P6D87ugkhnaDpJtDvOH5uQbY2RXeW6Rq18uOUltxgacGBP+d8GusTr+s3IFOu7SN0Ok8g==", "cpu": [ "x64" ], @@ -1406,9 +1405,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.0.5.tgz", + "integrity": "sha512-CP2wKQB+gh8HdJTFKYRFETqReAjxlcN9AlYDEoye8v2eQp+L9v+PUeDql/wsbaUhSsLR0sjj3PtbBtt+02AN3A==", "cpu": [ "arm64" ], @@ -1423,9 +1422,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.0.5.tgz", + "integrity": "sha512-Sw3rz2m6bBADeQpr3+MD7Ch4E1l15DTt/+dfqKnwkm3cn4BrYwnArmvKeZdVsFRDjMyjlKIP88bw1r7o+9aqzw==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index f7c90ca..7ed7804 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@twilio/cli-core": "^7.27.2" }, "devDependencies": { - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "^2.0.5", "chai": "^5.2.0", "mocha": "^11.1.0", "nyc": "^17.1.0", @@ -29,13 +29,17 @@ "/yarn.lock" ], "homepage": "https://github.com/twilio-labs/plugin-token", - "keywords": ["oclif-plugin"], + "keywords": [ + "oclif-plugin" + ], "license": "MIT", "oclif": { "name": "token", "commands": "./src/commands", "bin": "twilio", - "devPlugins": ["@oclif/plugin-help"], + "devPlugins": [ + "@oclif/plugin-help" + ], "topics": { "token": { "description": "Generate a temporary token for use in test applications" From 43601443a04edf601f8db8cfc60540c08beca578 Mon Sep 17 00:00:00 2001 From: Tierney Cyren Date: Tue, 24 Jun 2025 14:11:40 -0400 Subject: [PATCH 2/4] fix: update biome schema to biome@2 Signed-off-by: Tierney Cyren --- biome.json | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/biome.json b/biome.json index fdd844e..333ebfa 100644 --- a/biome.json +++ b/biome.json @@ -1,8 +1,6 @@ { - "$schema": "https://biomejs.dev/schemas/1.6.1/schema.json", - "organizeImports": { - "enabled": true - }, + "$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", + "assist": { "actions": { "source": { "organizeImports": "on" } } }, "javascript": { "formatter": { "quoteStyle": "single" @@ -14,7 +12,19 @@ "recommended": true, "performance": { "noDelete": "warn" + }, + "style": { + "noParameterAssign": "error", + "useAsConstAssertion": "error", + "useDefaultParameterLast": "error", + "useEnumInitializers": "error", + "useSelfClosingElements": "error", + "useSingleVarDeclarator": "error", + "noUnusedTemplateLiteral": "error", + "useNumberNamespace": "error", + "noInferrableTypes": "error", + "noUselessElse": "error" } } } -} +} \ No newline at end of file From 5d8fa1cca261a416ea1c464a481e2b08b0a2c035 Mon Sep 17 00:00:00 2001 From: Tierney Cyren Date: Tue, 24 Jun 2025 14:11:59 -0400 Subject: [PATCH 3/4] fix: remove unused dependency from flex command Signed-off-by: Tierney Cyren --- src/commands/token/flex.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/commands/token/flex.js b/src/commands/token/flex.js index 929f081..ba1ba9f 100644 --- a/src/commands/token/flex.js +++ b/src/commands/token/flex.js @@ -1,5 +1,4 @@ const { TwilioClientCommand } = require('@twilio/cli-core').baseCommands; -const { TwilioCliError } = require('@twilio/cli-core').services.error; const Twilio = require('twilio'); const createToken = require('../../helpers/accessToken.js'); const globalFlags = require('../../helpers/globalFlags.js'); From 0d7646699c8fd508ae6dc8bfcc9195f03283f731 Mon Sep 17 00:00:00 2001 From: Tierney Cyren Date: Tue, 24 Jun 2025 14:12:39 -0400 Subject: [PATCH 4/4] fix: clean up beforeEach variables Signed-off-by: Tierney Cyren --- test/helpers/accessToken.test.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/helpers/accessToken.test.js b/test/helpers/accessToken.test.js index e54bb73..5c14d3f 100644 --- a/test/helpers/accessToken.test.js +++ b/test/helpers/accessToken.test.js @@ -7,16 +7,11 @@ const createToken = require('../../src/helpers/accessToken.js'); const expect = chai.expect; describe('createToken', () => { - let sandbox; - let tokenGeneratorStub; - let exitStub; - let envStub; - beforeEach(() => { - sandbox = sinon.createSandbox(); - envStub = sandbox.stub(process, 'env').value({}); - exitStub = sandbox.stub(process, 'exit'); - tokenGeneratorStub = { + const _sandbox = sinon.createSandbox(); + const _envStub = _sandbox.stub(process, 'env').value({}); + const _exitStub = _sandbox.stub(process, 'exit'); + const _tokenGeneratorStub = { twilioClient: { accountSid: 'ACxxxx', username: 'test',