mirror of https://github.com/buster-so/buster.git
Merge pull request #1273 from buster-so/nate/upgrade-core-biome2
Upgrade core biome2
This commit is contained in:
commit
20014a84a3
|
@ -78,6 +78,9 @@
|
||||||
"correctness": {
|
"correctness": {
|
||||||
"noUnusedFunctionParameters": "off",
|
"noUnusedFunctionParameters": "off",
|
||||||
"noUnusedVariables": "off"
|
"noUnusedVariables": "off"
|
||||||
|
},
|
||||||
|
"performance": {
|
||||||
|
"noDelete": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
|
||||||
"extends": ["../../biome.json"],
|
"extends": ["../../biome2.json"],
|
||||||
"files": {
|
"files": {
|
||||||
"include": ["src/**/*"]
|
"includes": ["src/**/*"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,4 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
"@buster/env-utils": "workspace:*",
|
"@buster/env-utils": "workspace:*",
|
||||||
"@buster/typescript-config": "workspace:*",
|
"@buster/typescript-config": "workspace:*",
|
||||||
"@buster/vitest-config": "workspace:*",
|
"@buster/vitest-config": "workspace:*",
|
||||||
|
"@biomejs/biome": "2.2.5",
|
||||||
"uuid": "catalog:"
|
"uuid": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
export * from './createTestChat';
|
|
||||||
export * from './cleanupTestChats';
|
export * from './cleanupTestChats';
|
||||||
|
export * from './createTestChat';
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
|
export * from './cleanupTestMessages';
|
||||||
export * from './createTestMessage';
|
export * from './createTestMessage';
|
||||||
export * from './createTestMessageWithContext';
|
export * from './createTestMessageWithContext';
|
||||||
export * from './cleanupTestMessages';
|
|
||||||
|
|
|
@ -7,9 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||||
* @param params - Optional parameters to override defaults
|
* @param params - Optional parameters to override defaults
|
||||||
* @returns The organization ID
|
* @returns The organization ID
|
||||||
*/
|
*/
|
||||||
export async function createTestOrganization(params?: {
|
export async function createTestOrganization(params?: { name?: string }): Promise<string> {
|
||||||
name?: string;
|
|
||||||
}): Promise<string> {
|
|
||||||
try {
|
try {
|
||||||
const organizationId = uuidv4();
|
const organizationId = uuidv4();
|
||||||
const name = params?.name || `Test Organization ${uuidv4()}`;
|
const name = params?.name || `Test Organization ${uuidv4()}`;
|
||||||
|
|
|
@ -7,10 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||||
* @param params - Optional parameters to override defaults
|
* @param params - Optional parameters to override defaults
|
||||||
* @returns The user ID
|
* @returns The user ID
|
||||||
*/
|
*/
|
||||||
export async function createTestUser(params?: {
|
export async function createTestUser(params?: { email?: string; name?: string }): Promise<string> {
|
||||||
email?: string;
|
|
||||||
name?: string;
|
|
||||||
}): Promise<string> {
|
|
||||||
try {
|
try {
|
||||||
const userId = uuidv4();
|
const userId = uuidv4();
|
||||||
const email = params?.email || `test-${uuidv4()}@example.com`;
|
const email = params?.email || `test-${uuidv4()}@example.com`;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { describe, expect, it, vi } from 'vitest';
|
import { describe, expect, it, vi } from 'vitest';
|
||||||
import {
|
import {
|
||||||
type TestEnvironment,
|
|
||||||
cleanupTestEnvironment,
|
cleanupTestEnvironment,
|
||||||
setupTestEnvironment,
|
setupTestEnvironment,
|
||||||
|
type TestEnvironment,
|
||||||
withTestEnv,
|
withTestEnv,
|
||||||
} from './env-helpers';
|
} from './env-helpers';
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ describe('env-helpers.ts - Unit Tests', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (originalCustomVar === undefined) {
|
if (originalCustomVar === undefined) {
|
||||||
delete process.env.CUSTOM_VAR;
|
process.env.CUSTOM_VAR = undefined;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,7 @@ export function withTestEnv<T>(testFn: () => Promise<T>): () => Promise<T> {
|
||||||
return async () => {
|
return async () => {
|
||||||
const originalEnv = { ...process.env };
|
const originalEnv = { ...process.env };
|
||||||
|
|
||||||
// biome-ignore lint/correctness/noUnusedVariables:
|
await setupTestEnvironment();
|
||||||
const env = await setupTestEnvironment();
|
|
||||||
try {
|
try {
|
||||||
return await testFn();
|
return await testFn();
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
// Database test helpers
|
// Database test helpers
|
||||||
|
|
||||||
|
export * from './database/chats';
|
||||||
|
export * from './database/dataSources';
|
||||||
|
export * from './database/messages';
|
||||||
export * from './database/organizations';
|
export * from './database/organizations';
|
||||||
export * from './database/users';
|
export * from './database/users';
|
||||||
export * from './database/chats';
|
|
||||||
export * from './database/messages';
|
|
||||||
export * from './database/dataSources';
|
|
||||||
|
|
||||||
export * from './envHelpers';
|
export * from './envHelpers';
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ export function createMockDate(fixedDate: string | Date) {
|
||||||
const mockDate = new Date(fixedDate);
|
const mockDate = new Date(fixedDate);
|
||||||
const originalDate = Date;
|
const originalDate = Date;
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
global.Date = vi.fn(() => mockDate);
|
global.Date = vi.fn(() => mockDate);
|
||||||
global.Date.now = vi.fn(() => mockDate.getTime());
|
global.Date.now = vi.fn(() => mockDate.getTime());
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
|
||||||
|
"extends": ["../../biome2.json"],
|
||||||
|
"files": {
|
||||||
|
"includes": ["src/**/*", "scripts/**/*", "configs/**/*"]
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"rules": {
|
||||||
|
"suspicious": {
|
||||||
|
"noConsole": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
import { loadEnv } from 'vite';
|
import { loadEnv } from 'vite';
|
||||||
import { defineConfig } from 'vitest/config';
|
|
||||||
import type { Plugin, ViteUserConfig } from 'vitest/config';
|
import type { Plugin, ViteUserConfig } from 'vitest/config';
|
||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
export const baseConfig = defineConfig(async () => {
|
export const baseConfig = defineConfig(async () => {
|
||||||
const { default: tsconfigPaths } = await import('vite-tsconfig-paths');
|
const { default: tsconfigPaths } = await import('vite-tsconfig-paths');
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { loadEnv } from 'vite';
|
import { loadEnv } from 'vite';
|
||||||
import { defineConfig } from 'vitest/config';
|
|
||||||
import type { Plugin, ViteUserConfig } from 'vitest/config';
|
import type { Plugin, ViteUserConfig } from 'vitest/config';
|
||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
export const uiConfig = defineConfig(async () => {
|
export const uiConfig = defineConfig(async () => {
|
||||||
const { default: tsconfigPaths } = await import('vite-tsconfig-paths');
|
const { default: tsconfigPaths } = await import('vite-tsconfig-paths');
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc --build",
|
"build": "tsc --build",
|
||||||
|
"lint": "biome check --write",
|
||||||
"collect-json-reports": "node dist/scripts/collect-json-outputs.js",
|
"collect-json-reports": "node dist/scripts/collect-json-outputs.js",
|
||||||
"merge-json-reports": "nyc merge coverage/raw coverage/merged/merged-coverage.json",
|
"merge-json-reports": "nyc merge coverage/raw coverage/merged/merged-coverage.json",
|
||||||
"report": "nyc report -t coverage/merged --report-dir coverage/report --reporter=html --exclude-after-remap false",
|
"report": "nyc report -t coverage/merged --report-dir coverage/report --reporter=html --exclude-after-remap false",
|
||||||
|
@ -35,6 +36,7 @@
|
||||||
"@buster/typescript-config": "workspace:*",
|
"@buster/typescript-config": "workspace:*",
|
||||||
"@vitest/coverage-v8": "^3.2.4",
|
"@vitest/coverage-v8": "^3.2.4",
|
||||||
"@vitest/ui": "^3.2.4",
|
"@vitest/ui": "^3.2.4",
|
||||||
|
"@biomejs/biome": "2.2.5",
|
||||||
"glob": "^11.0.3",
|
"glob": "^11.0.3",
|
||||||
"jsdom": "^26.1.0",
|
"jsdom": "^26.1.0",
|
||||||
"nyc": "^17.1.0",
|
"nyc": "^17.1.0",
|
||||||
|
|
|
@ -44,7 +44,6 @@ async function collectCoverageFiles() {
|
||||||
await fs.copyFile(coverageFilePath, destinationFile);
|
await fs.copyFile(coverageFilePath, destinationFile);
|
||||||
} catch (_err) {
|
} catch (_err) {
|
||||||
// File doesn't exist in this directory, skip
|
// File doesn't exist in this directory, skip
|
||||||
// biome-ignore lint/suspicious/noConsoleLog: <explanation>
|
|
||||||
console.log(`No coverage.json found in ${match}`);
|
console.log(`No coverage.json found in ${match}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,13 +54,11 @@ async function collectCoverageFiles() {
|
||||||
const replaceDotPatterns = (str: string) => str.replace(/\.\.\//g, '');
|
const replaceDotPatterns = (str: string) => str.replace(/\.\.\//g, '');
|
||||||
|
|
||||||
if (directoriesWithCoverage.length > 0) {
|
if (directoriesWithCoverage.length > 0) {
|
||||||
// biome-ignore lint/suspicious/noConsoleLog: This is a log
|
|
||||||
console.log(
|
console.log(
|
||||||
`Found coverage.json in: ${directoriesWithCoverage.map(replaceDotPatterns).join(', ')}`
|
`Found coverage.json in: ${directoriesWithCoverage.map(replaceDotPatterns).join(', ')}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noConsoleLog: This is a log
|
|
||||||
console.log(`Coverage collected into: ${path.join(process.cwd())}`);
|
console.log(`Coverage collected into: ${path.join(process.cwd())}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error collecting coverage files:', error);
|
console.error('Error collecting coverage files:', error);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
|
||||||
"extends": ["../../biome.json"],
|
"extends": ["../../biome2.json"],
|
||||||
"files": {
|
"files": {
|
||||||
"include": ["src/**/*"]
|
"includes": ["src/**/*"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@buster/typescript-config": "workspace:*",
|
"@buster/typescript-config": "workspace:*",
|
||||||
"@buster/vitest-config": "workspace:*",
|
"@buster/vitest-config": "workspace:*",
|
||||||
"@mendable/firecrawl-js": "^1.29.1"
|
"@mendable/firecrawl-js": "^1.29.1",
|
||||||
|
"@biomejs/biome": "2.2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
// Main exports for the web-tools package
|
// Main exports for the web-tools package
|
||||||
export { researchCompany } from './deep-research/company-research';
|
export { researchCompany } from './deep-research/company-research';
|
||||||
export { FirecrawlService } from './services/firecrawl';
|
|
||||||
export { pollJobStatus } from './utils/polling';
|
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
export type {
|
export type {
|
||||||
CompanyResearch,
|
CompanyResearch,
|
||||||
CompanyResearchOptions,
|
|
||||||
CompanyResearchError,
|
CompanyResearchError,
|
||||||
|
CompanyResearchOptions,
|
||||||
} from './deep-research/types';
|
} from './deep-research/types';
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
FirecrawlConfig,
|
FirecrawlConfig,
|
||||||
WebSearchOptions,
|
WebSearchOptions,
|
||||||
WebSearchResult,
|
|
||||||
WebSearchResponse,
|
WebSearchResponse,
|
||||||
|
WebSearchResult,
|
||||||
} from './services/firecrawl';
|
} from './services/firecrawl';
|
||||||
|
export { FirecrawlService } from './services/firecrawl';
|
||||||
export type { PollingOptions } from './utils/polling';
|
export type { PollingOptions } from './utils/polling';
|
||||||
|
export { pollJobStatus } from './utils/polling';
|
||||||
|
|
|
@ -1395,6 +1395,9 @@ importers:
|
||||||
|
|
||||||
packages/test-utils:
|
packages/test-utils:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@biomejs/biome':
|
||||||
|
specifier: 2.2.5
|
||||||
|
version: 2.2.5
|
||||||
'@buster/database':
|
'@buster/database':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../database
|
version: link:../database
|
||||||
|
@ -1415,6 +1418,9 @@ importers:
|
||||||
|
|
||||||
packages/vitest-config:
|
packages/vitest-config:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@biomejs/biome':
|
||||||
|
specifier: 2.2.5
|
||||||
|
version: 2.2.5
|
||||||
'@buster/typescript-config':
|
'@buster/typescript-config':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../typescript-config
|
version: link:../typescript-config
|
||||||
|
@ -1445,6 +1451,9 @@ importers:
|
||||||
|
|
||||||
packages/web-tools:
|
packages/web-tools:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@biomejs/biome':
|
||||||
|
specifier: 2.2.5
|
||||||
|
version: 2.2.5
|
||||||
'@buster/typescript-config':
|
'@buster/typescript-config':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../typescript-config
|
version: link:../typescript-config
|
||||||
|
|
Loading…
Reference in New Issue