Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ spec contexts.
- URL: `https://w3id.org/vc/render-method/v2rc1`
- Short name: `v2rc1`
- Status: under development
- VC Render Method v2rc2 context
- URL: `https://w3id.org/vc/render-method/v2rc2`
- Short name: `v2rc2`
- Status: under development

## Developing

Expand Down
42 changes: 42 additions & 0 deletions contexts/v2rc2.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"TemplateRenderMethod": {
"@id": "https://w3id.org/vc/render-method#TemplateRenderMethod",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"description": "https://schema.org/description",
"name": "https://schema.org/name",
"renderSuite": "https://w3id.org/vc/render-method#renderSuite",
"renderProperty": {
"@id": "https://w3id.org/vc/render-method#renderProperty",
"@container": "@set"
},
"outputPreference": {
"@id": "https://w3id.org/vc/render-method#outputPreference",
"@context": {
"@protected": true,
"id": "@id",
"mode": {
"@id": "https://w3id.org/vc/render-method#mode",
"@container": "@set"
},
"mediaType": "https://schema.org/encodingFormat",
"style": {
"@id": "https://w3id.org/vc/render-method#style",
"@type": "@json"
}
}
},
"template": {
"@id": "https://w3id.org/vc/render-method#template",
"@type": "@id"
}
}
}
}
}
11 changes: 11 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import v1Context from './v1.js';
import v2rc1Context from './v2rc1.js';
import v2rc2Context from './v2rc2.js';

// map of context id to context
export const contexts = new Map();
Expand Down Expand Up @@ -39,3 +40,13 @@ setExportsFromMetadata({
context: v2rc1Context
}
});
setExportsFromMetadata({
contextsMap: contexts, metadataMap: metadata, namedMap: named,
metadata: {
id: 'https://w3id.org/vc/render-method/v2rc2',
type: 'ContextMetadata',
shortName: 'v2rc2',
fileUrl: new URL('../contexts/v2rc2.jsonld', import.meta.url),
context: v2rc2Context
}
});
54 changes: 54 additions & 0 deletions lib/v2rc2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*!
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
// Use JSON style for context
/* eslint quotes: ['error', 'double'] */
/* eslint quote-props: ['error', 'always'] */
/* eslint-disable max-len */

export default
/* context-url: https://w3id.org/vc/render-method/v2rc2 */
/* context-begin */
{
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"TemplateRenderMethod": {
"@id": "https://w3id.org/vc/render-method#TemplateRenderMethod",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"description": "https://schema.org/description",
"name": "https://schema.org/name",
"renderSuite": "https://w3id.org/vc/render-method#renderSuite",
"renderProperty": {
"@id": "https://w3id.org/vc/render-method#renderProperty",
"@container": "@set"
},
"outputPreference": {
"@id": "https://w3id.org/vc/render-method#outputPreference",
"@context": {
"@protected": true,
"id": "@id",
"mode": {
"@id": "https://w3id.org/vc/render-method#mode",
"@container": "@set"
},
"mediaType": "https://schema.org/encodingFormat",
"style": {
"@id": "https://w3id.org/vc/render-method#style",
"@type": "@json"
}
}
},
"template": {
"@id": "https://w3id.org/vc/render-method#template",
"@type": "@id"
}
}
}
}
}
/* context-end */;
10 changes: 7 additions & 3 deletions test/context.common.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
module.exports.tests = function({contexts, metadata, named, expect}) {
it('contexts', async () => {
expect(metadata).to.exist;
expect(metadata.size).to.equal(2);
expect(metadata.size).to.equal(3);
});

it('metadata', async () => {
expect(metadata).to.exist;
expect(metadata.size).to.equal(2);
expect(metadata.size).to.equal(3);
});

it('named', async () => {
expect(named).to.exist;
expect(named.size).to.equal(2);
expect(named.size).to.equal(3);
});

it('contents', async () => {
Expand All @@ -26,6 +26,10 @@ module.exports.tests = function({contexts, metadata, named, expect}) {
{
id: 'https://w3id.org/vc/render-method/v2rc1',
name: 'v2rc1'
},
{
id: 'https://w3id.org/vc/render-method/v2rc2',
name: 'v2rc2'
}
];

Expand Down