Skip to content

Commit de632e4

Browse files
committed
chore: migrate to vite-plus and task cache, modernize codebase
stuff stuff WIP k k
1 parent ad15c5a commit de632e4

151 files changed

Lines changed: 3519 additions & 3380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/vite-plus

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../node_modules/vite-plus/skills/vite-plus

.cargo/clippy.toml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Be strict but not masochistic
2-
warn = [
3-
"clippy::all",
4-
"clippy::pedantic",
5-
]
2+
warn = ["clippy::all", "clippy::pedantic"]
63

74
# Allow a few pedantic lints that are mostly noise in real code
85
allow = [
@@ -12,14 +9,14 @@ allow = [
129
"clippy::must_use_candidate",
1310
"clippy::similar_names",
1411
"clippy::too_many_lines",
15-
"clippy::struct_excessive_bools",
12+
"clippy::struct_excessive_bools"
1613
]
1714

1815
# Performance matters
1916
deny = [
2017
"clippy::inefficient_to_string",
2118
"clippy::unnecessary_collect",
22-
"clippy::large_enum_variant",
19+
"clippy::large_enum_variant"
2320
]
2421

2522
# Style and readability tuning
@@ -39,11 +36,4 @@ allow-unwrap-in-tests = true
3936
allow-expect-in-tests = true
4037

4138
# Docs
42-
doc-valid-idents = [
43-
"GitHub",
44-
"GitLab",
45-
"PostgreSQL",
46-
"TypeScript",
47-
"JavaScript",
48-
"WebAssembly",
49-
]
39+
doc-valid-idents = ["GitHub", "GitLab", "PostgreSQL", "TypeScript", "JavaScript", "WebAssembly"]

.dprint.json

Lines changed: 0 additions & 39 deletions
This file was deleted.

.vite-hooks/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vp staged

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"recommendations": [
33
"rust-lang.rust-analyzer",
44
"fill-labs.dependi",
5-
"gplane.dprint2",
5+
"VoidZero.vite-plus-extension-pack",
66
"vue.volar"
77
]
88
}

.vscode/settings.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"editor.formatOnSave": true,
3-
"[typescript,javascript,typescriptreact,javascriptreact,json,jsonc,toml]": {
4-
"editor.defaultFormatter": "gplane.dprint2"
5-
},
62
"rust-analyzer.files.exclude": [
73
"trash",
84
"**/trash",
@@ -17,5 +13,11 @@
1713
"**/target/**": true,
1814
"**/node_modules/**": true,
1915
"**/trash/**": true
16+
},
17+
"editor.defaultFormatter": "oxc.oxc-vscode",
18+
"editor.formatOnSave": true,
19+
"editor.formatOnSaveMode": "file",
20+
"editor.codeActionsOnSave": {
21+
"source.fixAll.oxc": "explicit"
2022
}
2123
}

AGENTS.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,80 @@ Before committing or submitting PR:
422422
4. `cargo test` (all tests pass)
423423
5. `pnpm test` (SDK tests pass, if applicable)
424424
6. Verify no secrets in changed files (`.env`, credentials)
425+
426+
<!--VITE PLUS START-->
427+
428+
# Using Vite+, the Unified Toolchain for the Web
429+
430+
This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, but it invokes Vite through `vp dev` and `vp build`.
431+
432+
## Vite+ Workflow
433+
434+
`vp` is a global binary that handles the full development lifecycle. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command.
435+
436+
### Start
437+
438+
- create - Create a new project from a template
439+
- migrate - Migrate an existing project to Vite+
440+
- config - Configure hooks and agent integration
441+
- staged - Run linters on staged files
442+
- install (`i`) - Install dependencies
443+
- env - Manage Node.js versions
444+
445+
### Develop
446+
447+
- dev - Run the development server
448+
- check - Run format, lint, and TypeScript type checks
449+
- lint - Lint code
450+
- fmt - Format code
451+
- test - Run tests
452+
453+
### Execute
454+
455+
- run - Run monorepo tasks
456+
- exec - Execute a command from local `node_modules/.bin`
457+
- dlx - Execute a package binary without installing it as a dependency
458+
- cache - Manage the task cache
459+
460+
### Build
461+
462+
- build - Build for production
463+
- pack - Build libraries
464+
- preview - Preview production build
465+
466+
### Manage Dependencies
467+
468+
Vite+ automatically detects and wraps the underlying package manager such as pnpm, npm, or Yarn through the `packageManager` field in `package.json` or package manager-specific lockfiles.
469+
470+
- add - Add packages to dependencies
471+
- remove (`rm`, `un`, `uninstall`) - Remove packages from dependencies
472+
- update (`up`) - Update packages to latest versions
473+
- dedupe - Deduplicate dependencies
474+
- outdated - Check for outdated packages
475+
- list (`ls`) - List installed packages
476+
- why (`explain`) - Show why a package is installed
477+
- info (`view`, `show`) - View package information from the registry
478+
- link (`ln`) / unlink - Manage local package links
479+
- pm - Forward a command to the package manager
480+
481+
### Maintain
482+
483+
- upgrade - Update `vp` itself to the latest version
484+
485+
These commands map to their corresponding tools. For example, `vp dev --port 3000` runs Vite's dev server and works the same as Vite. `vp test` runs JavaScript tests through the bundled Vitest. The version of all tools can be checked using `vp --version`. This is useful when researching documentation, features, and bugs.
486+
487+
## Common Pitfalls
488+
489+
- **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations.
490+
- **Always use Vite commands to run tools:** Don't attempt to run `vp vitest` or `vp oxlint`. They do not exist. Use `vp test` and `vp lint` instead.
491+
- **Running scripts:** Vite+ commands take precedence over `package.json` scripts. If there is a `test` script defined in `scripts` that conflicts with the built-in `vp test` command, run it using `vp run test`.
492+
- **Do not install Vitest, Oxlint, Oxfmt, or tsdown directly:** Vite+ wraps these tools. They must not be installed directly. You cannot upgrade these tools by installing their latest versions. Always use Vite+ commands.
493+
- **Use Vite+ wrappers for one-off binaries:** Use `vp dlx` instead of package-manager-specific `dlx`/`npx` commands.
494+
- **Import JavaScript modules from `vite-plus`:** Instead of importing from `vite` or `vitest`, all modules should be imported from the project's `vite-plus` dependency. For example, `import { defineConfig } from 'vite-plus';` or `import { expect, test, vi } from 'vite-plus/test';`. You must not install `vitest` to import test utilities.
495+
- **Type-Aware Linting:** There is no need to install `oxlint-tsgolint`, `vp lint --type-aware` works out of the box.
496+
497+
## Review Checklist for Agents
498+
499+
- [ ] Run `vp install` after pulling remote changes and before getting started.
500+
- [ ] Run `vp check` and `vp test` to validate changes.
501+
<!--VITE PLUS END-->

Cargo.toml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ confique = { version = "0.4.0", features = ["toml"] }
1818
cookie = "0.18"
1919
croner = "3.0"
2020
dashmap = "6.1.0"
21-
deno_core = { git = "file:///home/tasky/flora/submodules/deno_core", branch = "flora-locker-compat", default-features = false, features = ["v8_use_custom_libcxx"] }
21+
deno_core = { git = "file:///home/tasky/flora/submodules/deno_core", branch = "flora-locker-compat", default-features = false, features = [
22+
"v8_use_custom_libcxx"
23+
] }
2224
deno_error = "0.7.1"
2325
deno_fetch = "0.249.0"
2426
deno_net = "0.217.0"
@@ -37,7 +39,12 @@ hmac = "0.12"
3739
http = "1"
3840
num_cpus = "1.16"
3941
openssl = { version = "0.10.75", features = ["vendored"] }
40-
oxc = { version = "0.101.0", features = ["full", "oxc_regular_expression", "semantic", "transformer"] }
42+
oxc = { version = "0.101.0", features = [
43+
"full",
44+
"oxc_regular_expression",
45+
"semantic",
46+
"transformer"
47+
] }
4148
oxc_sourcemap = "6.0.2"
4249
parking_lot = "0.12"
4350
proc-macro2 = "1.0.106"
@@ -46,10 +53,22 @@ rand = "0.8"
4653
reqwest = { version = "0.12.25", features = ["json", "multipart", "stream"] }
4754
serde = { version = "1", features = ["derive"] }
4855
serde_json = "1.0.149"
49-
serenity = { git = "https://github.com/serenity-rs/serenity", default-features = false, branch = "next", features = ["typesize", "temp_cache", "tokio_task_builder", "transport_compression_zstd", "rustls_backend"] }
56+
serenity = { git = "https://github.com/serenity-rs/serenity", default-features = false, branch = "next", features = [
57+
"typesize",
58+
"temp_cache",
59+
"tokio_task_builder",
60+
"transport_compression_zstd",
61+
"rustls_backend"
62+
] }
5063
sha2 = "0.10"
5164
sled = "0.34"
52-
sqlx = { version = "0.8.6", features = ["chrono", "macros", "postgres", "runtime-tokio-rustls", "uuid"] }
65+
sqlx = { version = "0.8.6", features = [
66+
"chrono",
67+
"macros",
68+
"postgres",
69+
"runtime-tokio-rustls",
70+
"uuid"
71+
] }
5372
syn = { version = "2.0.117", features = ["full", "extra-traits", "parsing"] }
5473
sys_traits = { version = "0.1.17", features = ["libc", "real"] }
5574
t0x = { version = "0.1.8", features = ["serde-json-impl"] }
@@ -66,7 +85,15 @@ tracing-error = "0.2.1"
6685
tracing-subscriber = { version = "0.3.22", features = ["chrono", "env-filter", "serde", "time"] }
6786
url = "2.5.8"
6887
urlencoding = "2.1"
69-
utoipa = { version = "5.4.0", features = ["auto_into_responses", "axum_extras", "chrono", "config", "debug", "url", "uuid"] }
88+
utoipa = { version = "5.4.0", features = [
89+
"auto_into_responses",
90+
"axum_extras",
91+
"chrono",
92+
"config",
93+
"debug",
94+
"url",
95+
"uuid"
96+
] }
7097
utoipa-scalar = { version = "0.3.0", features = ["axum"] }
7198
uuid = { version = "1.21.0", features = ["v4"] }
7299

apps/build-service/package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
{
2-
"name": "@uwu/flora-build-service",
2+
"name": "@flora-internal/build-service",
33
"version": "0.0.0",
44
"private": true,
55
"description": "flora server-side build service",
66
"type": "module",
77
"scripts": {
8-
"dev": "tsx --watch src/index.ts",
8+
"build": "vp pack",
9+
"dev": "vp pack --watch",
910
"start": "node dist/index.mjs",
10-
"build": "tsdown",
1111
"typecheck": "tsgo --noEmit"
1212
},
1313
"dependencies": {
14-
"h3": "2.0.1-rc.14",
15-
"rolldown": "^1.0.0-beta.43",
1614
"consola": "^3.4.2",
17-
"fflate": "^0.8.2"
15+
"fflate": "^0.8.2",
16+
"h3": "2.0.1-rc.14",
17+
"rolldown": "^1.0.0-beta.43"
1818
},
1919
"devDependencies": {
20-
"@types/node": "^24.3.0",
20+
"@types/node": "catalog:",
2121
"@typescript/native-preview": "catalog:",
22-
"tsdown": "^0.20.3",
23-
"tsx": "^4.20.6",
24-
"typescript": "^5.9.3"
22+
"vite-plus": "catalog:"
2523
}
2624
}

apps/build-service/src/index.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,10 @@ app.get('/health', () => ({ status: 'ok' }))
4949

5050
serve(app, { port, hostname: getHost() })
5151

52-
function formatRequestLog(
53-
method: string,
54-
path: string,
55-
status: number,
56-
elapsedMs: number
57-
): string {
58-
return `${colorMethod(method)} ${colors.white(path)} -> ${colorStatus(status)} ${
59-
colors.gray(`(${elapsedMs}ms)`)
60-
}`
52+
function formatRequestLog(method: string, path: string, status: number, elapsedMs: number): string {
53+
return `${colorMethod(method)} ${colors.white(path)} -> ${colorStatus(status)} ${colors.gray(
54+
`(${elapsedMs}ms)`
55+
)}`
6156
}
6257

6358
function colorMethod(method: string): string {

0 commit comments

Comments
 (0)