Migrate to Vite+ unified toolchain (#428)

This commit is contained in:
Gregory Schier
2026-03-13 09:27:56 -07:00
committed by GitHub
parent aed7bd12ea
commit 45262edfbd
166 changed files with 1762 additions and 1519 deletions

View File

@@ -12,7 +12,7 @@
"scripts": {
"build": "yaakcli build",
"dev": "yaakcli dev",
"test": "vitest --run tests"
"test": "vp test --run tests"
},
"dependencies": {
"jsonwebtoken": "^9.0.2"

View File

@@ -71,7 +71,7 @@ export async function fetchAccessToken(
throw new Error(`Failed to fetch access token with status=${resp.status} and body=${body}`);
}
// biome-ignore lint/suspicious/noExplicitAny: none
// oxlint-disable-next-line no-explicit-any
let response: any;
try {
response = JSON.parse(body);

View File

@@ -91,7 +91,7 @@ export async function getOrRefreshAccessToken(
throw new Error(`Failed to refresh access token with status=${resp.status} and body=${body}`);
}
// biome-ignore lint/suspicious/noExplicitAny: none
// oxlint-disable-next-line no-explicit-any
let response: any;
try {
response = JSON.parse(body);

View File

@@ -148,7 +148,7 @@ async function getCodeViaEmbeddedBrowser(
const authorizationUrlStr = authorizationUrl.toString();
console.log('[oauth2] Authorizing via embedded browser', authorizationUrlStr);
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: Required for this pattern
// oxlint-disable-next-line no-async-promise-executor -- Required for this pattern
return new Promise<string>(async (resolve, reject) => {
let foundCode = false;
const { close } = await ctx.window.openUrl({

View File

@@ -53,6 +53,7 @@ function buildClientAssertionJwt(params: {
signingKey = secret;
} else if (trimmed.startsWith('{')) {
// Looks like JSON - treat as JWK. There is surely a better way to detect JWK vs a raw secret, but this should work in most cases.
// oxlint-disable-next-line no-explicit-any
let jwk: any;
try {
jwk = JSON.parse(trimmed);

View File

@@ -105,7 +105,7 @@ async function getTokenViaEmbeddedBrowser(
const authorizationUrlStr = authorizationUrl.toString();
console.log('[oauth2] Authorizing via embedded browser (implicit)', authorizationUrlStr);
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: Required for this pattern
// oxlint-disable-next-line no-async-promise-executor -- Required for this pattern
return new Promise<AccessToken>(async (resolve, reject) => {
let foundAccessToken = false;
const { close } = await ctx.window.openUrl({

View File

@@ -590,11 +590,11 @@ export const plugin: PluginDefinition = {
credentialsInBody,
});
} else {
throw new Error(`Invalid grant type ${grantType}`);
throw new Error(`Invalid grant type ${String(grantType)}`);
}
const headerName = stringArg(values, 'headerName') || 'Authorization';
const headerValue = `${headerPrefix} ${token.response[tokenName]}`.trim();
const headerValue = `${headerPrefix} ${token.response[tokenName] ?? ''}`.trim();
return { setHeaders: [{ name: headerName, value: headerValue }] };
},
},

View File

@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from 'vite-plus/test';
import { extractCode } from '../src/util';
describe('extractCode', () => {