Skip to content

Harden napp init validation and docs build#139

Merged
dskvr merged 1 commit into
feat/napp-supportfrom
review/pr137-napp-hardening
Jun 20, 2026
Merged

Harden napp init validation and docs build#139
dskvr merged 1 commit into
feat/napp-supportfrom
review/pr137-napp-hardening

Conversation

@dskvr

@dskvr dskvr commented Jun 18, 2026

Copy link
Copy Markdown

Review findings fixed

  • Reject malformed napp.indexerRelays in structural validation so nsyte napp init --indexer-relay nope cannot write a config that later fails schema loading.
  • Escape GitHub Actions expressions in docs/RELEASING.md with v-pre so VitePress SSR does not evaluate secrets.RELEASE_TOKEN.

Verification

  • deno test --allow-all --no-check tests/unit/napp/detect_test.ts tests/unit/napp/schema_test.ts tests/unit/napp/napp_init_command_test.ts
  • Invalid napp init --indexer-relay nope repro exits 1 and leaves config unchanged
  • deno task test
  • deno task check-doc-drift
  • deno lint src/lib/napp/detect.ts tests/unit/napp/detect_test.ts tests/unit/napp/schema_test.ts
  • deno fmt --check src/lib/napp/detect.ts tests/unit/napp/detect_test.ts tests/unit/napp/schema_test.ts
  • deno task site:build
  • deno task compile
  • git diff --check

Notes

  • Live relay publish of kind 37348/39108 was not tested.

The PR added scriptable NIP-5B setup, but the command-level structural
validator did not cover indexerRelays. That let `nsyte napp init
--indexer-relay nope` write a config that later failed schema loading.
This aligns structural validation with the JSON schema and keeps the
docs build green by marking GitHub Actions expressions as literal Vue
content.

Constraint: `napp init` validates with validateNappConfig before writeProjectFile, not a full AJV schema pass
Rejected: Validate indexer relays only in the CLI action | would leave isNapp and other structural callers inconsistent
Confidence: high
Scope-risk: narrow
Directive: Keep validateNappConfig and config.schema.json aligned for every field writeProjectFile can persist
Tested: deno test --allow-all --no-check tests/unit/napp/detect_test.ts tests/unit/napp/schema_test.ts tests/unit/napp/napp_init_command_test.ts
Tested: invalid napp init --indexer-relay nope exits 1 and leaves config unchanged
Tested: deno task test
Tested: deno task check-doc-drift
Tested: deno lint src/lib/napp/detect.ts tests/unit/napp/detect_test.ts tests/unit/napp/schema_test.ts
Tested: deno fmt --check src/lib/napp/detect.ts tests/unit/napp/detect_test.ts tests/unit/napp/schema_test.ts
Tested: deno task site:build
Tested: deno task compile
Tested: git diff --check
Not-tested: Live relay publish of kind 37348/39108
@dskvr dskvr merged commit 8ed7851 into feat/napp-support Jun 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant