Migrates a self-contained subset of bridge/proto/longmsg.ts to the new
@snowluma/proton compile-time DSL form and verifies wire-format parity
against the legacy runtime ProtoSchema encoder. End-to-end proof that
the toolchain works in core's vitest pipeline.
What's covered:
- LongMsgUid / LongMsgSettings / SendLongMsgInfo / SendLongMsgReq /
SendLongMsgResp / SendLongMsgRespResult / RecvLongMsgInfo /
RecvLongMsgReq / RecvLongMsgResp / RecvLongMsgRespResult
- The three schemas that pull in PushMsgBody (LongMsgContent /
LongMsgAction / LongMsgResult) stay on the legacy API for now, since
migrating them requires also migrating message.ts and element.ts.
Toolchain changes:
- @snowluma/proton gets a tsup build step. The ./vite subpath now
points at the built dist/index.js so it is loadable as plain Node
ESM from vite.config.ts / vitest.config.ts (the source-only .ts
layout can't be consumed from outside the Vite transform pipeline).
The . (runtime) subpath stays at TS source — it's only ever
imported from user code, which IS Vite-transformed.
- prepare script ensures dist/ exists after pnpm install.
- @snowluma/core depends on @snowluma/proton (workspace:*) and adds
protobufVitePlugin() to its vitest config so test files get
transformed.
Documented divergence:
proton follows proto3 semantics: fields equal to their default value
(0 / false / "" / empty bytes) are NOT emitted on the wire. The legacy
runtime encoder always emits them. Both forms are round-trippable
through a conforming proto3 reader. The parity test pins this
behaviour explicitly.
8/8 parity tests pass.
33 lines
860 B
JSON
33 lines
860 B
JSON
{
|
|
"name": "@snowluma/core",
|
|
"version": "1.8.5",
|
|
"description": "SnowLuma core - NTQQ packet sniffer with Node.js native addon",
|
|
"private": true,
|
|
"type": "module",
|
|
"main": "../../dist/index.mjs",
|
|
"scripts": {
|
|
"build": "vite build",
|
|
"build:all": "cross-env BUILD_WEBUI=true vite build",
|
|
"dev": "tsx src/index.ts",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"@snowluma/proton": "workspace:*",
|
|
"@snowluma/websocket": "workspace:*"
|
|
},
|
|
"devDependencies": {
|
|
"@hono/node-server": "^1.19.14",
|
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
"@types/node": "^24.12.2",
|
|
"cross-env": "^10.1.0",
|
|
"hono": "^4.12.14",
|
|
"tsx": "^4.21.0",
|
|
"typescript": "catalog:",
|
|
"vite": "catalog:",
|
|
"vite-plugin-cp": "^6.0.3",
|
|
"vitest": "^4.1.4"
|
|
}
|
|
}
|