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

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

View File

@@ -30,7 +30,7 @@ export function deleteUndefinedAttrs<T>(obj: T): T {
/** Recursively render all nested object properties */
export function convertTemplateSyntax<T>(obj: T): T {
if (typeof obj === 'string') {
// biome-ignore lint/suspicious/noTemplateCurlyInString: Yaak template syntax
// oxlint-disable-next-line no-template-curly-in-string -- Yaak template syntax
return obj.replaceAll(/{{\s*(_\.)?([^}]+)\s*}}/g, '${[$2]}') as T;
}
if (Array.isArray(obj) && obj != null) {

View File

@@ -1,4 +1,4 @@
// biome-ignore-all lint/suspicious/noExplicitAny: too flexible for strict types
/* oxlint-disable no-explicit-any */
import type { PartialImportResources } from '@yaakapp/api';
import { convertId, convertTemplateSyntax, isJSObject } from './common';
@@ -203,7 +203,7 @@ function importEnvironment(
variables: Object.entries(e.data).map(([name, value]) => ({
enabled: true,
name,
value: `${value}`,
value: String(value),
})),
};
}

View File

@@ -1,4 +1,4 @@
// biome-ignore-all lint/suspicious/noExplicitAny: too flexible for strict types
/* oxlint-disable no-explicit-any */
import type { PartialImportResources } from '@yaakapp/api';
import { convertId, convertTemplateSyntax, isJSObject } from './common';
@@ -261,7 +261,7 @@ function importFolder(
variables: Object.entries(f.environment ?? {}).map(([name, value]) => ({
enabled: true,
name,
value: `${value}`,
value: String(value),
})),
};
}
@@ -308,7 +308,7 @@ function importEnvironment(
variables: Object.entries(e.data ?? {}).map(([name, value]) => ({
enabled: true,
name,
value: `${value}`,
value: String(value),
})),
};
}

View File

@@ -1,6 +1,6 @@
import * as fs from 'node:fs';
import * as path from 'node:path';
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from 'vite-plus/test';
import YAML from 'yaml';
import { convertInsomnia } from '../src';