logicsrc/packages/validators/package.json
Anthony Ettinger 7eba9efd10
Some checks are pending
CI / build (push) Waiting to run
test / test (push) Waiting to run
Make the @logicsrc packages publishable (#134)
@logicsrc/opencontext could not be installed from npm. Three defects, each of
which alone breaks a published tarball:

1. opencontext depended on "@logicsrc/validators": "file:../validators". A
   file: specifier is unresolvable for anyone installing from the registry, so
   `npm install @logicsrc/opencontext` failed outright.

2. validators imported all 50 schemas by relative path across the repository
   ("../../schemas/schemas/*.json"). That resolves inside the monorepo and
   escapes the package once published, so an installed validators could not
   load a single schema. Now imported through @logicsrc/schemas package
   exports, with a real dependency declared.

3. Three of those schemas — repo, pull-request, openprd-prd — had no entry in
   the schemas exports map, so they were unreachable by package specifier.
   Added; the map is now sorted so it stays readable as it grows.

validators also gained files/publishConfig/license so it publishes the same way
its siblings do.

Verified the way a stranger would: npm pack all three, install the tarballs
into a clean project outside the monorepo, and run the installed binary —
version, init, validate --strict (which exercises schema loading through the
package exports), and resolve --explain all succeed. Full workspace suite green.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 12:03:41 -07:00

32 lines
2 KiB
JSON

{
"name": "@logicsrc/validators",
"version": "0.1.0",
"description": "LogicSRC schema validation helpers.",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"bin": {
"logicsrc-validate": "./dist/cli.js"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"test": "vitest run src",
"validate:fixtures": "node dist/cli.js task ../schemas/fixtures/task.yaml && node dist/cli.js agent ../schemas/fixtures/agent.yaml && node dist/cli.js agentad-ad ../schemas/fixtures/agentad-ad.yaml && node dist/cli.js agentad-placement ../schemas/fixtures/agentad-placement.yaml && node dist/cli.js repo ../schemas/fixtures/repo.yaml && node dist/cli.js pull-request ../schemas/fixtures/pull-request.yaml && node dist/cli.js openontology-manifest ../schemas/fixtures/openontology/valid/manifest.json && node dist/cli.js openontology-claim ../schemas/fixtures/openontology/valid/claim-relationship.json && node dist/cli.js openontology-changeset ../schemas/fixtures/openontology/valid/changeset.json && node dist/cli.js opencontext-manifest ../schemas/fixtures/opencontext/valid/manifest.json && node dist/cli.js opencontext-object ../schemas/fixtures/opencontext/valid/object-policy.json && node dist/cli.js opencontext-bundle ../schemas/fixtures/opencontext/valid/bundle.json && node dist/cli.js opencontext-decision ../schemas/fixtures/opencontext/valid/decision.json && node dist/cli.js opencontext-role ../schemas/fixtures/opencontext/valid/role.json && node dist/cli.js opencontext-provenance ../schemas/fixtures/opencontext/valid/provenance.json && node dist/cli.js opencontext-diagnostic ../schemas/fixtures/opencontext/valid/diagnostic.json && node dist/cli.js opencontext-audit-event ../schemas/fixtures/opencontext/valid/audit-event.json"
},
"dependencies": {
"@logicsrc/schemas": "^0.1.0",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"yaml": "^2.8.1"
},
"devDependencies": {
"vitest": "^4.0.8"
},
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"license": "MIT"
}