CultLib/packages/cultnet-ts/package.json

64 lines
2.2 KiB
JSON
Raw Normal View History

{
"name": "cultnet-ts",
"version": "0.2.0",
"description": "CultNet-style typed direct-pipe messaging and state replication for TypeScript runtimes.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"default": "./dist/index.js"
},
"./contracts": {
"types": "./dist/contracts.d.ts",
"require": "./dist/contracts.js",
"default": "./dist/contracts.js"
}
},
"files": [
"dist",
"contracts"
],
"scripts": {
"contracts:generate": "node tools/generate-swarm-contracts.mjs",
"build": "node tools/generate-swarm-contracts.mjs && node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
"prepack": "node tools/generate-swarm-contracts.mjs && node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
"typecheck": "node tools/generate-swarm-contracts.mjs && node ../../node_modules/typescript/bin/tsc -p tsconfig.json --pretty false",
"test": "node tools/generate-swarm-contracts.mjs && node ../../node_modules/typescript/bin/tsc -p tsconfig.json && node ../../node_modules/typescript/bin/tsc -p tsconfig.test.json && node --test dist-test/test/*.test.js",
Stop the interop harness leaking peers and hanging after it passes The suite finished its work in about 60 seconds and then never exited. Four runs were left alive for hours, holding 11 node and 2 dotnet peers, and a stranded peer holding cultnet_interop_peer.exe is what made two unrelated cargo builds fail with LNK1104. In CI this is a job that burns its whole timeout on green tests. Two real defects, found by asking the stuck process what it was waiting on rather than by guessing. process.getActiveResourcesInfo reported four UDPWraps and two PipeWraps still held after the last test. The four UDP sockets: eight tests bind a server socket with bindUdpSocket and close only the transport wrapper in their finally, never the socket itself. Four leaked per run, matching the four Python lanes that fail on a machine without msgpack -- the wrapper is built inside the try, so when the peer's readiness rejects it never exists to be closed, and the raw socket is orphaned. Now closed through a guarded helper that tolerates a transport having adopted it. The teardown registration: t.after was registered after every `await ready`, so a peer whose readiness rejected skipped the registration entirely and stranded every peer already spawned. Moved ahead of the spawns at all four sites. With those fixed the suite still does not drain on its own, so test:interop now passes --test-force-exit. That is safe only because cleanup demonstrably completes first: a forced run now leaves zero peers behind, where before it left nine. Forcing the exit without the fixes above would have guaranteed orphans rather than prevented them. Verified: 65 seconds, exit 1, the expected 15 pass and 12 fail, no surviving processes. The 12 failures are the Python lanes, which cannot run on this machine and are unrelated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 16:32:10 +02:00
"test:interop": "node tools/generate-swarm-contracts.mjs && node ../../node_modules/typescript/bin/tsc -p tsconfig.json && node ../../node_modules/typescript/bin/tsc -p tsconfig.test.json && node --test --test-force-exit dist-test/test/interop/*.test.js"
},
"keywords": [
"messagepack",
"networking",
"pipes",
"cultcache",
"gamecult",
"typescript"
],
"author": "metacratic",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/GameCult/CultLib.git",
"directory": "packages/cultnet-ts"
},
"bugs": {
"url": "https://github.com/GameCult/CultLib/issues"
},
"homepage": "https://github.com/GameCult/CultLib/tree/main/packages/cultnet-ts#readme",
"engines": {
"node": ">=18"
},
"dependencies": {
"@msgpack/msgpack": "^3.1.3",
"ajv": "^8.17.1",
Publish the non-Rust packages and make the licensing uniform Rust consumers pin a CultLib revision through cargo git dependencies, which is how Ghostlight, Epiphany, CodexConnector and Odin already consume the core stack. npm and pip cannot take a package from a subdirectory of a git repo at all, which is why the TypeScript and Python consumers vendored forks instead: there was nothing else to depend on. This gives them a versioned artifact. Tagging cultcache-ts-v* or cultcache-py-v* builds, tests and publishes. The tag version must match the manifest version or the workflow refuses rather than shipping a mislabelled artifact. PyPI uses trusted publishing, so no long-lived token is stored; npm needs an NPM_TOKEN secret. cultcache-ts is now @gamecult/cultcache-ts. The scope is not cosmetic: it makes the package unambiguously org-owned on a public registry, and it is what lets CultLib hold the name rather than racing for an unscoped one. CultLib's own cultmesh-ts and cultnet-ts and their imports move with it; all three packages typecheck and cultcache-ts passes 12 of 13 tests, the exception being the cross-runtime store test that shells out to Python, which cannot run on this machine because its Python has no msgpack. Licensing was inconsistent with the repo. cultcache-py declared itself "Private GameCult infrastructure" and cultcache-rs and cultmesh-rs declared nothing, inside a repo whose LICENSE is MIT and whose every other package says MIT. All three now say MIT. That was load-bearing here: a package that calls itself private is not one to push to a public registry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 04:41:44 +02:00
"@gamecult/cultcache-ts": "^0.13.5"
},
"devDependencies": {
"@types/node": "^24.0.0",
"json-schema-to-typescript": "^15.0.4",
"typescript": "^5.9.0",
"zod": "^3.25.76"
}
}