Skip to content

Commit

Permalink
chore(actions): publish v0.16.7 to npm (#542)
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
Co-authored-by: dselman <[email protected]>
  • Loading branch information
github-actions[bot] and dselman authored Jun 6, 2023
1 parent a2cab30 commit 701d0b1
Show file tree
Hide file tree
Showing 24 changed files with 81 additions and 77 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"packages": [
"packages/*"
],
"version": "0.16.5",
"version": "0.16.7",
"hoist": true
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"name": "markdown-transform",
"description": "A framework for transforming markdown",
"version": "0.16.5",
"version": "0.16.7",
"private": true,
"scripts": {
"dingus": "lerna exec --scope dingus -- npm run dingus",
Expand Down
2 changes: 1 addition & 1 deletion packages/dingus/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions packages/dingus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dingus",
"version": "0.16.5",
"version": "0.16.7",
"description": "Markdown Transform Dingus",
"keywords": [
"accord-project",
Expand All @@ -19,12 +19,12 @@
},
"files": [],
"devDependencies": {
"@accordproject/markdown-cicero": "0.16.5",
"@accordproject/markdown-common": "0.16.5",
"@accordproject/markdown-it-cicero": "0.16.5",
"@accordproject/markdown-it-template": "0.16.5",
"@accordproject/markdown-pdf": "0.16.5",
"@accordproject/markdown-template": "0.16.5",
"@accordproject/markdown-cicero": "0.16.7",
"@accordproject/markdown-common": "0.16.7",
"@accordproject/markdown-it-cicero": "0.16.7",
"@accordproject/markdown-it-template": "0.16.7",
"@accordproject/markdown-pdf": "0.16.7",
"@accordproject/markdown-template": "0.16.7",
"@babel/core": "7.17.5",
"@babel/plugin-transform-runtime": "7.17.0",
"@babel/preset-env": "7.16.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-cicero/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/markdown-cicero/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-cicero",
"version": "0.16.5",
"version": "0.16.7",
"description": "A framework for transforming markdown",
"engines": {
"node": ">=14",
Expand Down Expand Up @@ -52,8 +52,8 @@
},
"dependencies": {
"@accordproject/concerto-core": "3.7.0",
"@accordproject/markdown-common": "0.16.5",
"@accordproject/markdown-it-cicero": "0.16.5",
"@accordproject/markdown-common": "0.16.7",
"@accordproject/markdown-it-cicero": "0.16.7",
"markdown-it": "^13.0.1",
"winston": "3.2.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/markdown-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-cli",
"version": "0.16.5",
"version": "0.16.7",
"description": "A framework for transforming markdown",
"engines": {
"node": ">=14",
Expand Down Expand Up @@ -55,7 +55,7 @@
},
"dependencies": {
"@accordproject/concerto-util": "3.0.0",
"@accordproject/markdown-transform": "0.16.5",
"@accordproject/markdown-transform": "0.16.7",
"jsome": "2.5.0",
"winston": "3.2.1",
"yargs": "17.3.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-common/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/markdown-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-common",
"version": "0.16.5",
"version": "0.16.7",
"description": "A framework for transforming markdown",
"engines": {
"node": ">=15",
Expand Down
6 changes: 3 additions & 3 deletions packages/markdown-docx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-docx",
"version": "0.16.5",
"version": "0.16.7",
"description": "Transform DOCX to CiceroMark DOM",
"engines": {
"node": ">=14",
Expand Down Expand Up @@ -81,8 +81,8 @@
"webpack-cli": "4.9.1"
},
"dependencies": {
"@accordproject/markdown-cicero": "0.16.5",
"@accordproject/markdown-common": "0.16.5",
"@accordproject/markdown-cicero": "0.16.7",
"@accordproject/markdown-common": "0.16.7",
"mammoth": "^1.4.19"
},
"license-check-and-add-config": {
Expand Down
6 changes: 3 additions & 3 deletions packages/markdown-html/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-html",
"version": "0.16.5",
"version": "0.16.7",
"description": "Transform CiceroDOM to HTML",
"engines": {
"node": ">=14",
Expand Down Expand Up @@ -84,8 +84,8 @@
"webpack-cli": "4.9.1"
},
"dependencies": {
"@accordproject/markdown-cicero": "0.16.5",
"@accordproject/markdown-common": "0.16.5",
"@accordproject/markdown-cicero": "0.16.7",
"@accordproject/markdown-common": "0.16.7",
"jsdom": "^16.7.0",
"type-of": "^2.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-it-cicero/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-it-cicero",
"version": "0.16.5",
"version": "0.16.7",
"description": "Plugin to introduce cicero blocks and inlines for the markdown-it markdown parser",
"engines": {
"node": ">=14",
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-it-template/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/markdown-it-template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-it-template",
"version": "0.16.5",
"version": "0.16.7",
"description": "Plugin to introduce template blocks and inlines for the markdown-it markdown parser",
"engines": {
"node": ">=14",
Expand Down
8 changes: 4 additions & 4 deletions packages/markdown-pdf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-pdf",
"version": "0.16.5",
"version": "0.16.7",
"description": "Transform PDF to/from CiceroMark DOM",
"engines": {
"node": ">=14",
Expand Down Expand Up @@ -81,9 +81,9 @@
"webpack-cli": "4.9.1"
},
"dependencies": {
"@accordproject/markdown-cicero": "0.16.5",
"@accordproject/markdown-common": "0.16.5",
"@accordproject/markdown-template": "0.16.5",
"@accordproject/markdown-cicero": "0.16.7",
"@accordproject/markdown-common": "0.16.7",
"@accordproject/markdown-template": "0.16.7",
"axios": "0.23.0",
"pdfjs-dist": "2.13.216",
"pdfmake": "^0.2.4",
Expand Down
8 changes: 4 additions & 4 deletions packages/markdown-slate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-slate",
"version": "0.16.5",
"version": "0.16.7",
"description": "Transform markdown to/from CommonMark AST",
"engines": {
"node": ">=14",
Expand Down Expand Up @@ -51,9 +51,9 @@
"nyc": "15.1.0"
},
"dependencies": {
"@accordproject/markdown-cicero": "0.16.5",
"@accordproject/markdown-common": "0.16.5",
"@accordproject/markdown-template": "0.16.5"
"@accordproject/markdown-cicero": "0.16.7",
"@accordproject/markdown-common": "0.16.7",
"@accordproject/markdown-template": "0.16.7"
},
"license-check-and-add-config": {
"folder": "./lib",
Expand Down
12 changes: 7 additions & 5 deletions packages/markdown-template/lib/TemplateMarkTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ class TemplateMarkTransformer {
* @param {string} templateKind - either 'clause' or 'contract'
* @param {object} [options] configuration options
* @param {boolean} [options.verbose] verbose output
* @returns {object} the result of parsing
* @param {string} [conceptFullyQualifiedName] - the fully qualified name of the template concept
* @returns {object} the result of parsing
*/
tokensToMarkdownTemplate(tokenStream, modelManager, templateKind, options) {
tokensToMarkdownTemplate(tokenStream, modelManager, templateKind, options, conceptFullyQualifiedName) {
var template = tokensToUntypedTemplateMark(tokenStream, templateKind);
if (options && options.verbose) {
console.log('===== Untyped TemplateMark ');
console.log(JSON.stringify(template, null, 2));
}
var typedTemplate = templateMarkTyping(template, modelManager, templateKind);
var typedTemplate = templateMarkTyping(template, modelManager, templateKind, conceptFullyQualifiedName);
if (options && options.verbose) {
console.log('===== TemplateMark ');
console.log(JSON.stringify(typedTemplate, null, 2));
Expand All @@ -65,9 +66,10 @@ class TemplateMarkTransformer {
* @param {string} templateKind - either 'clause' or 'contract'
* @param {object} [options] configuration options
* @param {boolean} [options.verbose] verbose output
* @param {string} [conceptFullyQualifiedName] - the fully qualified name of the template concept
* @returns {object} the result of parsing
*/
fromMarkdownTemplate(templateInput, modelManager, templateKind, options) {
fromMarkdownTemplate(templateInput, modelManager, templateKind, options, conceptFullyQualifiedName) {
if (!modelManager) {
throw new Error('Cannot parse without template model');
}
Expand All @@ -76,7 +78,7 @@ class TemplateMarkTransformer {
console.log('===== MarkdownIt Tokens ');
console.log(JSON.stringify(tokenStream, null, 2));
}
return this.tokensToMarkdownTemplate(tokenStream, modelManager, templateKind, options);
return this.tokensToMarkdownTemplate(tokenStream, modelManager, templateKind, options, conceptFullyQualifiedName);
}

/**
Expand Down
10 changes: 3 additions & 7 deletions packages/markdown-template/lib/TypeVisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ class TypeVisitor {
* @param {*} [parameters] optional parameters
*/
static visitNodes(visitor, things, parameters) {
try {
things.forEach(node => {
node.accept(visitor, parameters);
});
} catch (err) {
console.log(err);
}
things.forEach(node => {
node.accept(visitor, parameters);
});
}

/**
Expand Down
34 changes: 20 additions & 14 deletions packages/markdown-template/lib/templatemarkutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,27 @@ function mkTemplateMarkManager(options) {
var templateMarkManager = mkTemplateMarkManager();

/**
* Returns the template model for the template
* Returns the concept for the template
* @param {object} introspector - the model introspector for this template
* @param {string} templateKind - either 'clause' or 'contract'
* @param {string} [conceptFullyQualifiedName] - the fully qualified name of the template concept
* @throws {Error} if no template model is found, or multiple template models are found
* @returns {ClassDeclaration} the template model for the template
* @returns {ClassDeclaration} the concept for the template
*/
function findTemplateModel(introspector, templateKind) {
var templateModels = introspector.getClassDeclarations().filter(item => {
return !item.isAbstract() && item.getDecorator('template');
});
if (templateModels.length > 1) {
throw new Error('Found multiple concepts with @template decorator. The model for the template must contain a single concept with the @template decorator.');
} else if (templateModels.length === 0) {
throw new Error('Failed to find a concept with the @template decorator. The model for the template must contain a single concept with the @template decoratpr.');
function findTemplateConcept(introspector, templateKind, conceptFullyQualifiedName) {
if (conceptFullyQualifiedName) {
return introspector.getClassDeclaration();
} else {
return templateModels[0];
var templateModels = introspector.getClassDeclarations().filter(item => {
return !item.isAbstract() && item.getDecorator('template');
});
if (templateModels.length > 1) {
throw new Error('Found multiple concepts with @template decorator. The model for the template must contain a single concept with the @template decorator.');
} else if (templateModels.length === 0) {
throw new Error('Failed to find a concept with the @template decorator. The model for the template must contain a single concept with the @template decoratpr.');
} else {
return templateModels[0];
}
}
}

Expand Down Expand Up @@ -128,11 +133,12 @@ function templateMarkTypingGen(template, introspector, model, templateKind, opti
* @param {object} template the TemplateMark DOM
* @param {object} modelManager - the modelManager for this template
* @param {string} templateKind - either 'clause' or 'contract'
* @param {string} [conceptFullyQualifiedName] - the fully qualified name of the template concept
* @returns {object} the typed TemplateMark DOM
*/
function templateMarkTyping(template, modelManager, templateKind) {
function templateMarkTyping(template, modelManager, templateKind, conceptFullyQualifiedName) {
var introspector = new Introspector(modelManager);
var model = findTemplateModel(introspector, templateKind);
var model = findTemplateConcept(introspector, templateKind, conceptFullyQualifiedName);
return templateMarkTypingGen(template, introspector, model, templateKind);
}

Expand Down Expand Up @@ -233,7 +239,7 @@ function tokensToUntypedTemplateMarkFragment(tokenStream) {
}]
};
}
module.exports.findTemplateModel = findTemplateModel;
module.exports.findTemplateConcept = findTemplateConcept;
module.exports.templateMarkManager = templateMarkManager;
module.exports.templateToTokens = templateToTokens;
module.exports.tokensToUntypedTemplateMarkFragment = tokensToUntypedTemplateMarkFragment;
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-template/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/markdown-template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/markdown-template",
"version": "0.16.5",
"version": "0.16.7",
"description": "A framework for transforming markdown",
"engines": {
"node": ">=14",
Expand Down Expand Up @@ -86,9 +86,9 @@
"dependencies": {
"@accordproject/concerto-core": "3.7.0",
"@accordproject/concerto-cto": "3.7.0",
"@accordproject/markdown-cicero": "0.16.5",
"@accordproject/markdown-common": "0.16.5",
"@accordproject/markdown-it-template": "0.16.5",
"@accordproject/markdown-cicero": "0.16.7",
"@accordproject/markdown-common": "0.16.7",
"@accordproject/markdown-it-template": "0.16.7",
"dayjs": "1.10.8",
"markdown-it": "^13.0.1",
"uuid": "8.3.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-transform/lib/builtinTransforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const transformationGraph = {
templatemark: async (input, parameters, options) => {
const t = new TemplateMarkTransformer();
const modelManager = await ModelLoader.loadModelManager(parameters.model, options);
return t.tokensToMarkdownTemplate(input, modelManager, parameters.templateKind, options);
return t.tokensToMarkdownTemplate(input, modelManager, parameters.templateKind, options, parameters.conceptFullyQualifiedName);
}
},
templatemark: {
Expand Down
Loading

0 comments on commit 701d0b1

Please sign in to comment.