Skip to content

Development

dweller long gone edited this page May 21, 2026 · 1 revision

Development

This page summarizes local development and package conventions for PkiStudioJS.

Project Shape

Key files:

  • app/static/pkistudio-core.js: parser, serializer, encoder, OID helpers, and package Core entry point.
  • app/static/pkistudio.js: browser viewer UI, script-tag API, and @pkistudio/pkistudiojs/viewer export.
  • app/static/oid-resolver.js: bundled OID resolver API.
  • app/server.js: local static server.
  • test/core-api.test.js: Node test coverage for public API and documentation contracts.

The project intentionally stays build-free. It uses plain JavaScript and CommonJS-compatible package exports.

Local Checks

Run these before handing normal code changes back:

npm test
npm run check

For package or release-related changes, also run:

npm pack --dry-run

Local Server

node app/server.js

Then open:

http://localhost:8080/

In VS Code, the Start pkistudio server task starts the same server.

Wiki Preview in Codespaces

The repository devcontainer can prepare Gollum and clone the GitHub Wiki repository into:

/workspaces/pkistudiojs.wiki

Start the local Wiki preview with the VS Code task:

Start pkistudio wiki

Gollum listens on port 4567.

Package Entry Points

The npm package is @pkistudio/pkistudiojs.

Exports:

  • @pkistudio/pkistudiojs: app/static/pkistudio-core.js.
  • @pkistudio/pkistudiojs/core: app/static/pkistudio-core.js.
  • @pkistudio/pkistudiojs/oid-resolver: app/static/oid-resolver.js.
  • @pkistudio/pkistudiojs/viewer: app/static/pkistudio.js.

Direct script-tag usage must continue to expose:

  • window.PkiStudioCore
  • window.PkiStudio
  • window.PkiStudioOidResolver

Version Metadata

When bumping versions, keep version metadata synchronized across:

  • package.json
  • app/static/pkistudio-core.js
  • app/static/pkistudio.js
  • README.md

Release Announcements

GitHub releases can be announced on Bluesky by .github/workflows/post-release-to-bluesky.yml.

Required repository secrets:

  • BLUESKY_HANDLE
  • BLUESKY_APP_PASSWORD

The workflow runs when a GitHub release is published and can also be tested manually from the Actions tab.

Local HTTPS Notes

Clipboard reads usually require HTTPS except on localhost. For local HTTPS-like deployment, put nginx in front of the Node.js static server and terminate TLS at nginx.

The README includes a Docker Compose and nginx example for this setup.

Clone this wiki locally