Migrate to Vite+ (vite-plus) unified toolchain

Replace Vite/Vitest with vite-plus, update WASM loading to native Vite 8
?init pattern, switch React compiler to @rolldown/plugin-babel, and
migrate git hooks from husky to vite-hooks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-03-13 07:23:11 -07:00
parent aed7bd12ea
commit 49659a3da9
44 changed files with 1470 additions and 1085 deletions

View File

@@ -1,5 +1,6 @@
import * as wasm from "./yaak_templates_bg.wasm"; import init from "./yaak_templates_bg.wasm?init";
export * from "./yaak_templates_bg.js"; export * from "./yaak_templates_bg.js";
import { __wbg_set_wasm } from "./yaak_templates_bg.js"; import * as bg from "./yaak_templates_bg.js";
__wbg_set_wasm(wasm); const instance = await init({ "./yaak_templates_bg.js": bg });
wasm.__wbindgen_start(); bg.__wbg_set_wasm(instance.exports);
instance.exports.__wbindgen_start();

2412
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -63,7 +63,7 @@
"src-web" "src-web"
], ],
"scripts": { "scripts": {
"prepare": "husky", "prepare": "vp config",
"init": "npm install && npm run bootstrap", "init": "npm install && npm run bootstrap",
"start": "npm run app-dev", "start": "npm run app-dev",
"app-build": "tauri build", "app-build": "tauri build",
@@ -92,18 +92,20 @@
"tauri-before-dev": "node scripts/run-workspaces-dev.mjs" "tauri-before-dev": "node scripts/run-workspaces-dev.mjs"
}, },
"overrides": { "overrides": {
"js-yaml": "^4.1.1" "js-yaml": "^4.1.1",
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.3.13", "@biomejs/biome": "^2.3.13",
"@tauri-apps/cli": "^2.9.6", "@tauri-apps/cli": "^2.9.6",
"@yaakapp/cli": "^0.5.1", "@yaakapp/cli": "^0.5.1",
"dotenv-cli": "^11.0.0", "dotenv-cli": "^11.0.0",
"husky": "^9.1.7",
"nodejs-file-downloader": "^4.13.0", "nodejs-file-downloader": "^4.13.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vitest": "^3.2.4" "vitest": "npm:@voidzero-dev/vite-plus-test@latest",
"vite-plus": "latest"
}, },
"dependencies": { "dependencies": {
"@codemirror/lang-go": "^6.0.1", "@codemirror/lang-go": "^6.0.1",
@@ -111,5 +113,6 @@
"@codemirror/lang-php": "^6.0.2", "@codemirror/lang-php": "^6.0.2",
"@codemirror/lang-python": "^6.2.1", "@codemirror/lang-python": "^6.2.1",
"@codemirror/legacy-modes": "^6.5.2" "@codemirror/legacy-modes": "^6.5.2"
} },
"packageManager": "npm@11.11.1"
} }

View File

@@ -1,7 +1,7 @@
import { applyFormInputDefaults } from '@yaakapp-internal/lib/templateFunction'; import { applyFormInputDefaults } from '@yaakapp-internal/lib/templateFunction';
import type { CallTemplateFunctionArgs } from '@yaakapp-internal/plugins'; import type { CallTemplateFunctionArgs } from '@yaakapp-internal/plugins';
import type { Context, DynamicTemplateFunctionArg } from '@yaakapp/api'; import type { Context, DynamicTemplateFunctionArg } from '@yaakapp/api';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { applyDynamicFormInput } from '../src/common'; import { applyDynamicFormInput } from '../src/common';
describe('applyFormInputDefaults', () => { describe('applyFormInputDefaults', () => {

View File

@@ -12,7 +12,7 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
}, },
"dependencies": { "dependencies": {
"@faker-js/faker": "^10.1.0" "@faker-js/faker": "^10.1.0"

View File

@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vite-plus/test';
describe('template-function-faker', () => { describe('template-function-faker', () => {
it('exports all expected template functions', async () => { it('exports all expected template functions', async () => {

View File

@@ -12,6 +12,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

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

View File

@@ -12,6 +12,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

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

View File

@@ -12,6 +12,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

@@ -1,5 +1,5 @@
import type { Context } from '@yaakapp/api'; import type { Context } from '@yaakapp/api';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { plugin } from '../src'; import { plugin } from '../src';
const ctx = {} as Context; const ctx = {} as Context;

View File

@@ -12,6 +12,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

@@ -1,5 +1,5 @@
import type { Context } from '@yaakapp/api'; import type { Context } from '@yaakapp/api';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { plugin } from '../src'; import { plugin } from '../src';
const ctx = {} as Context; const ctx = {} as Context;

View File

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

View File

@@ -1,5 +1,5 @@
import type { Context } from '@yaakapp/api'; import type { Context } from '@yaakapp/api';
import { beforeEach, describe, expect, test, vi } from 'vitest'; import { beforeEach, describe, expect, test, vi } from 'vite-plus/test';
const ntlmMock = vi.hoisted(() => ({ const ntlmMock = vi.hoisted(() => ({
createType1Message: vi.fn(), createType1Message: vi.fn(),

View File

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

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'; import { extractCode } from '../src/util';
describe('extractCode', () => { describe('extractCode', () => {

View File

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

View File

@@ -1,5 +1,5 @@
import type { HttpRequest, Workspace } from '@yaakapp/api'; import type { HttpRequest, Workspace } from '@yaakapp/api';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { convertCurl } from '../src'; import { convertCurl } from '../src';
describe('importer-curl', () => { describe('importer-curl', () => {

View File

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

View File

@@ -1,6 +1,6 @@
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as path from 'node:path'; 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 YAML from 'yaml';
import { convertInsomnia } from '../src'; import { convertInsomnia } from '../src';

View File

@@ -7,7 +7,7 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
}, },
"dependencies": { "dependencies": {
"openapi-to-postmanv2": "^5.8.0", "openapi-to-postmanv2": "^5.8.0",

View File

@@ -1,6 +1,6 @@
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as path from 'node:path'; import * as path from 'node:path';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { convertOpenApi } from '../src'; import { convertOpenApi } from '../src';
describe('importer-openapi', () => { describe('importer-openapi', () => {

View File

@@ -8,6 +8,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

@@ -1,6 +1,6 @@
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as path from 'node:path'; import * as path from 'node:path';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { convertPostmanEnvironment } from '../src'; import { convertPostmanEnvironment } from '../src';
describe('importer-postman-environment', () => { describe('importer-postman-environment', () => {

View File

@@ -8,6 +8,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

@@ -1,6 +1,6 @@
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as path from 'node:path'; import * as path from 'node:path';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { convertPostman } from '../src'; import { convertPostman } from '../src';
describe('importer-postman', () => { describe('importer-postman', () => {

View File

@@ -7,6 +7,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

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

View File

@@ -7,6 +7,6 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
} }
} }

View File

@@ -1,5 +1,5 @@
import type { Context } from '@yaakapp/api'; import type { Context } from '@yaakapp/api';
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vite-plus/test';
import { plugin } from '../src'; import { plugin } from '../src';
describe('regex.match', () => { describe('regex.match', () => {

View File

@@ -7,7 +7,7 @@
"scripts": { "scripts": {
"build": "yaakcli build", "build": "yaakcli build",
"dev": "yaakcli dev", "dev": "yaakcli dev",
"test": "vitest --run tests" "test": "vp test --run tests"
}, },
"dependencies": { "dependencies": {
"@date-fns/tz": "^1.4.1", "@date-fns/tz": "^1.4.1",

View File

@@ -1,5 +1,5 @@
import { tz } from '@date-fns/tz'; import { tz } from '@date-fns/tz';
import { describe, expect, it } from 'vitest'; import { describe, expect, it } from 'vite-plus/test';
import { calculateDatetime, formatDatetime } from '../src'; import { calculateDatetime, formatDatetime } from '../src';
describe('formatDatetime', () => { describe('formatDatetime', () => {

View File

@@ -1,6 +1,6 @@
// biome-ignore-all lint/suspicious/noTemplateCurlyInString: We're testing this, specifically // biome-ignore-all lint/suspicious/noTemplateCurlyInString: We're testing this, specifically
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { parser } from './twig'; import { parser } from './twig';
function getNodeNames(input: string): string[] { function getNodeNames(input: string): string[] {

View File

@@ -1,5 +1,5 @@
import type { HttpResponseEvent } from '@yaakapp-internal/models'; import type { HttpResponseEvent } from '@yaakapp-internal/models';
import { describe, expect, test } from 'vitest'; import { describe, expect, test } from 'vite-plus/test';
import { getCookieCounts } from './model_util'; import { getCookieCounts } from './model_util';
function makeEvent( function makeEvent(

View File

@@ -4,8 +4,8 @@
"version": "1.0.0", "version": "1.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite dev --force", "dev": "vp dev --force",
"build": "vite build", "build": "vp build",
"lint": "tsc --noEmit" "lint": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
@@ -77,9 +77,11 @@
}, },
"devDependencies": { "devDependencies": {
"@lezer/generator": "^1.8.0", "@lezer/generator": "^1.8.0",
"@rolldown/plugin-babel": "^0.2.1",
"@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e", "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
"@tanstack/router-plugin": "^1.127.5", "@tanstack/router-plugin": "^1.127.5",
"@types/babel__core": "^7.20.5",
"@types/node": "^24.0.13", "@types/node": "^24.0.13",
"@types/papaparse": "^5.3.16", "@types/papaparse": "^5.3.16",
"@types/parse-color": "^1.0.3", "@types/parse-color": "^1.0.3",
@@ -88,18 +90,17 @@
"@types/react-syntax-highlighter": "^15.5.13", "@types/react-syntax-highlighter": "^15.5.13",
"@types/uuid": "^10.0.0", "@types/uuid": "^10.0.0",
"@types/whatwg-mimetype": "^3.0.2", "@types/whatwg-mimetype": "^3.0.2",
"babel-plugin-react-compiler": "^1.0.0",
"@vitejs/plugin-react": "^6.0.0", "@vitejs/plugin-react": "^6.0.0",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"babel-plugin-react-compiler": "^1.0.0",
"decompress": "^4.2.1", "decompress": "^4.2.1",
"internal-ip": "^8.0.0", "internal-ip": "^8.0.0",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"postcss-nesting": "^13.0.2", "postcss-nesting": "^13.0.2",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"vite": "^8.0.0", "vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vite-plugin-static-copy": "^3.3.0", "vite-plugin-static-copy": "^3.3.0",
"vite-plugin-svgr": "^4.5.0", "vite-plugin-svgr": "^4.5.0",
"vite-plugin-top-level-await": "^1.6.0", "vite-plus": "latest"
"vite-plugin-wasm": "^3.5.0"
} }
} }

View File

@@ -11,7 +11,7 @@
"noUncheckedIndexedAccess": true, "noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,

View File

@@ -2,9 +2,10 @@
"compilerOptions": { "compilerOptions": {
"composite": true, "composite": true,
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node", "moduleResolution": "bundler",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"noUncheckedIndexedAccess": true "noUncheckedIndexedAccess": true,
"skipLibCheck": true
}, },
"include": ["vite.config.ts"] "include": ["vite.config.ts"]
} }

View File

@@ -1 +1 @@
/// <reference types="vite/client" /> /// <reference types="vite-plus/client" />

View File

@@ -1,13 +1,12 @@
// @ts-ignore // @ts-ignore
import { tanstackRouter } from '@tanstack/router-plugin/vite'; import { tanstackRouter } from '@tanstack/router-plugin/vite';
import react from '@vitejs/plugin-react'; import babel from '@rolldown/plugin-babel';
import react, { reactCompilerPreset } from '@vitejs/plugin-react';
import { createRequire } from 'node:module'; import { createRequire } from 'node:module';
import path from 'node:path'; import path from 'node:path';
import { defineConfig, normalizePath } from 'vite'; import { defineConfig, normalizePath } from 'vite-plus';
import { viteStaticCopy } from 'vite-plugin-static-copy'; import { viteStaticCopy } from 'vite-plugin-static-copy';
import svgr from 'vite-plugin-svgr'; import svgr from 'vite-plugin-svgr';
import topLevelAwait from 'vite-plugin-top-level-await';
import wasm from 'vite-plugin-wasm';
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
const cMapsDir = normalizePath( const cMapsDir = normalizePath(
@@ -18,10 +17,9 @@ const standardFontsDir = normalizePath(
); );
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(async () => { export default defineConfig(
return { {
plugins: [ plugins: [
wasm(),
tanstackRouter({ tanstackRouter({
target: 'react', target: 'react',
routesDirectory: './routes', routesDirectory: './routes',
@@ -29,12 +27,10 @@ export default defineConfig(async () => {
autoCodeSplitting: true, autoCodeSplitting: true,
}), }),
svgr(), svgr(),
react({ react(),
babel: { babel({
plugins: ['babel-plugin-react-compiler'], presets: [reactCompilerPreset()],
},
}), }),
topLevelAwait(),
viteStaticCopy({ viteStaticCopy({
targets: [ targets: [
{ src: cMapsDir, dest: '' }, { src: cMapsDir, dest: '' },
@@ -61,5 +57,4 @@ export default defineConfig(async () => {
strictPort: true, strictPort: true,
}, },
envPrefix: ['VITE_', 'TAURI_'], envPrefix: ['VITE_', 'TAURI_'],
};
}); });

View File

@@ -11,10 +11,11 @@
"noUncheckedIndexedAccess": true, "noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"jsx": "react-jsx" "jsx": "react-jsx",
"types": ["node"]
} }
} }

7
vite.config.ts Normal file
View File

@@ -0,0 +1,7 @@
import { defineConfig } from "vite-plus";
export default defineConfig({
test: {
exclude: ["**/node_modules/**", "**/flatpak/**"],
},
});