Skip to content

Add very basic Playground to harden contexts.#81

Open
BigBlueHat wants to merge 2 commits into
rubensworks:masterfrom
BigBlueHat:playground
Open

Add very basic Playground to harden contexts.#81
BigBlueHat wants to merge 2 commits into
rubensworks:masterfrom
BigBlueHat:playground

Conversation

@BigBlueHat
Copy link
Copy Markdown

@BigBlueHat BigBlueHat commented Mar 16, 2026

The playground is build with petite-vue with the parser bundled via
esbuild index.ts --format=esm --bundle --outfile=docs/bundle.js

The docs/ folder is intended to be hosted via GitHub Pages.

Here's a demo hosted via GitHub Pages on my fork: https://bigbluehat.github.io/jsonld-context-parser.js/

Relates to w3c/json-ld-bp#19

@BigBlueHat
Copy link
Copy Markdown
Author

@rubensworks I wrote this because I'm finding many projects use a very high number of CURIEs in their context files (presumably primarily for the typing convenience). I found this library extremely helpful to quickly "harden" a context to use full URLs and thereby avoid the "risk" of CURIEs being used in the content.

The risk being that the term space remains wide open, so people using a context that uses them have the "freedom" to mint their own terms beyond what was expected/intended by the context.

This may not be of concern in many scenarios (like the SEO use case where "failing" isn't fatal), but it is a concern in environments where constrained contents are a deliberate design feature--such as Verifiable Credentials, API extensions (ex: ActivityPub), and Web of Things.

Essentially anywhere one might want to use the @protected keyword can benefit from this library, CLI, and now Playground. 😸

Thanks again for building this library!

Cheers,
🎩

@rubensworks
Copy link
Copy Markdown
Owner

Thanks @BigBlueHat, this is very useful!

Would you be open to tweaking the PR so it builds the bundle in a GH workflow and deploys to GH pages?
That way, the bundle.js and out.js won't have to be included in the repo anymore, to reduce repo size.

@BigBlueHat
Copy link
Copy Markdown
Author

Would you be open to tweaking the PR so it builds the bundle in a GH workflow and deploys to GH pages?

Are you OK if they continue to use the docs/ folder? Or do you want a separate branch?

@rubensworks
Copy link
Copy Markdown
Owner

Sure, docs in the master branch for the source files makes sense.
The GH action could then build and deploy the bundled files to a gh-pages branch.

The playground is build with `petite-vue` with the parser bundled via
`esbuild index.ts --format=esm --bundle --outfile=docs/bundle.js` (see
`npm run bundle`).

The `docs/` folder is intended to be hosted via GitHub Pages.
@BigBlueHat
Copy link
Copy Markdown
Author

Sure, docs in the master branch for the source files makes sense. The GH action could then build and deploy the bundled files to a gh-pages branch.

Sorry that took a bit! Hopefully the provide workflow does what you need! Completely untested at this point...just FYI.

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24574374751

Coverage remained the same at 99.85%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 553
Covered Lines: 553
Line Coverage: 100.0%
Relevant Branches: 784
Covered Branches: 782
Branch Coverage: 99.74%
Branches in Coverage %: Yes
Coverage Strength: 573.49 hits per line

💛 - Coveralls

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.

3 participants