Skip to content
Open
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
684 changes: 607 additions & 77 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"mkdirp": "3.0.1",
"nyc": "17.1.0",
"semver": "^7.6.3",
"traverse": "^0.6.10"
"traverse": "^0.6.10",
"typescript": "^5.4.5"
},
"engines": {
"node": ">=18",
Expand Down
241 changes: 123 additions & 118 deletions packages/markdown-cicero/package.json
Original file line number Diff line number Diff line change
@@ -1,124 +1,129 @@
{
"name": "@accordproject/markdown-cicero",
"version": "0.16.25",
"description": "A framework for transforming markdown",
"engines": {
"node": ">=18",
"npm": ">=9"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib"
],
"main": "index.js",
"scripts": {
"pretest": "npm run lint",
"lint": "eslint .",
"postlint": "npm run licchk",
"licchk": "license-check-and-add",
"test": "jest --timeOut=10000 --silent",
"test:updateSnapshot": "jest --updateSnapshot --silent",
"test:cov": "npm run lint && jest --timeOut=10000 --coverage --silent",
"jsdoc": "jsdoc -c jsdoc.json package.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/accordproject/markdown-transform.git",
"directory": "packages/markdown-cicero"
},
"keywords": [
"accord-project",
"markdown",
"markdown-it",
"commonmark"
],
"author": "accordproject.org",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/accordproject/markdown-transform/issues"
},
"homepage": "https://github.com/accordproject/markdown-transform",
"devDependencies": {
"eslint": "8.57.1",
"jest": "^29.7.0",
"jest-diff": "^29.7.0",
"jsdoc": "4.0.4",
"license-check-and-add": "2.3.6"
},
"dependencies": {
"@accordproject/concerto-core": "3.25.7",
"@accordproject/markdown-common": "*",
"@accordproject/markdown-it-cicero": "*",
"markdown-it": "^14.1.0",
"semver": "7.6.3",
"winston": "3.17.0"
},
"license-check-and-add-config": {
"folder": "./lib",
"license": "header.txt",
"exact_paths_method": "EXCLUDE",
"exact_paths": [
"externalModels/.npmignore",
"externalModels/.gitignore",
"coverage",
"index.d.ts",
"./system",
"LICENSE",
"node_modules",
".nyc-output",
"out",
".tern-project"
"name": "@accordproject/markdown-cicero",
"version": "0.16.25",
"description": "A framework for transforming markdown",
"engines": {
"node": ">=18",
"npm": ">=9"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"types"
],
"file_type_method": "EXCLUDE",
"file_types": [
".yml",
".yaml",
".zip",
".tgz",
".snap"
"types": "types/index.d.ts",
"main": "index.js",
"scripts": {
"build": "npm run build:types",
"build:types": "tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types",
"pretest": "npm run lint",
"lint": "eslint .",
"postlint": "npm run licchk",
"licchk": "license-check-and-add",
"test": "jest --timeOut=10000 --silent",
"test:updateSnapshot": "jest --updateSnapshot --silent",
"test:cov": "npm run lint && jest --timeOut=10000 --coverage --silent",
"jsdoc": "jsdoc -c jsdoc.json package.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/accordproject/markdown-transform.git",
"directory": "packages/markdown-cicero"
},
"keywords": [
"accord-project",
"markdown",
"markdown-it",
"commonmark"
],
"insert_license": false,
"license_formats": {
"js|njk|pegjs|cto|acl|qry": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
"author": "accordproject.org",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/accordproject/markdown-transform/issues"
},
"homepage": "https://github.com/accordproject/markdown-transform",
"devDependencies": {
"eslint": "8.57.1",
"jest": "^29.7.0",
"jest-diff": "^29.7.0",
"jsdoc": "4.0.4",
"license-check-and-add": "2.3.6",
"typescript": "5.7.2"
},
"dependencies": {
"@accordproject/concerto-core": "3.25.7",
"@accordproject/markdown-common": "*",
"@accordproject/markdown-it-cicero": "*",
"markdown-it": "^14.1.0",
"semver": "7.6.3",
"winston": "3.17.0"
},
"license-check-and-add-config": {
"folder": "./lib",
"license": "header.txt",
"exact_paths_method": "EXCLUDE",
"exact_paths": [
"externalModels/.npmignore",
"externalModels/.gitignore",
"coverage",
"index.d.ts",
"./system",
"LICENSE",
"node_modules",
".nyc-output",
"out",
".tern-project"
],
"file_type_method": "EXCLUDE",
"file_types": [
".yml",
".yaml",
".zip",
".tgz",
".snap"
],
"insert_license": false,
"license_formats": {
"js|njk|pegjs|cto|acl|qry": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
}
},
"npmrc|editorconfig|txt": {
"eachLine": {
"prepend": "# "
}
},
"md": {
"file": "header.md"
}
}
},
"npmrc|editorconfig|txt": {
"eachLine": {
"prepend": "# "
}
},
"md": {
"file": "header.md"
}
},
"nyc": {
"produce-source-map": "true",
"sourceMap": "inline",
"reporter": [
"lcov",
"text",
"text-summary",
"html",
"json"
],
"include": [
"lib/**/*.js"
],
"exclude": [
"scripts/**/*.js"
],
"all": true,
"check-coverage": true,
"statements": 90,
"branches": 71,
"functions": 88,
"lines": 90
}
},
"nyc": {
"produce-source-map": "true",
"sourceMap": "inline",
"reporter": [
"lcov",
"text",
"text-summary",
"html",
"json"
],
"include": [
"lib/**/*.js"
],
"exclude": [
"scripts/**/*.js"
],
"all": true,
"check-coverage": true,
"statements": 90,
"branches": 71,
"functions": 88,
"lines": 90
}
}
4 changes: 4 additions & 0 deletions packages/markdown-cicero/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const CiceroMarkTransformer: typeof import("./lib/CiceroMarkTransformer");
export const FromCiceroEditVisitor: typeof import("./lib/FromCiceroEditVisitor");
export const ToCommonMarkVisitor: typeof import("./lib/ToCommonMarkVisitor");
export const Decorators: typeof import("./lib/Decorators");
107 changes: 107 additions & 0 deletions packages/markdown-cicero/types/lib/CiceroMarkTransformer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
export = CiceroMarkTransformer;
/**
* Converts a CiceroMark DOM to/from a
* CommonMark DOM.
*
* Converts a CiceroMark DOM to/from a markdown string.
*/
declare class CiceroMarkTransformer {
commonMark: import("@accordproject/markdown-common/types/lib/CommonMarkTransformer");
modelManager: ModelManager;
serializer: Serializer;
/**
* Obtain the Clause text for a Clause node
* @param {*} input CiceroMark DOM
* @returns {*} markdown_cicero string
*/
getClauseText(input: any): any;
/**
* Retrieve the serializer used by the parser
*
* @returns {*} a serializer capable of dealing with the Concerto
* object returns by parse
*/
getSerializer(): any;
/**
* Converts a CiceroEdit string to a CiceroMark DOM
* @param {*} input - ciceroedit string
* @returns {*} CiceroMark DOM
*/
fromCiceroEdit(input: any): any;
/**
* Converts a CiceroMark DOM to a CiceroMark Unwrapped DOM
* @param {object} input - CiceroMark DOM (JSON)
* @param {object} [options] configuration options
* @param {boolean} [options.unquoteVariables] if true variable quotations are removed
* @returns {*} CiceroMark DOM
*/
toCiceroMarkUnwrapped(input: object, options?: {
unquoteVariables?: boolean;
}): any;
/**
* Converts a CommonMark DOM to a CiceroMark DOM
* @param {*} input - CommonMark DOM (in JSON)
* @returns {*} CiceroMark DOM
*/
fromCommonMark(input: any): any;
/**
* Converts a markdown string to a CiceroMark DOM
* @param {string} markdown a markdown string
* @returns {object} ciceromark object (JSON)
*/
fromMarkdown(markdown: string): object;
/**
* Converts a CiceroMark DOM to a markdown string
* @param {*} input CiceroMark DOM
* @param {object} [options] configuration options
* @returns {*} markdown string
*/
toMarkdown(input: any, options?: object): any;
/**
* Converts a cicero markdown string to a CiceroMark DOM
* @param {string} markdown a cicero markdown string
* @param {object} [options] configuration options
* @returns {object} ciceromark object (JSON)
*/
fromMarkdownCicero(markdown: string, options?: object): object;
/**
* Converts a CiceroMark DOM to a cicero markdown string
* @param {object} input CiceroMark DOM
* @returns {string} json commonmark object
*/
toMarkdownCicero(input: object): string;
/**
* Converts a CiceroMark DOM to a CommonMark DOM
* @param {*} input CiceroMark DOM
* @param {object} [options] configuration options
* @param {boolean} [options.removeFormatting] if true the formatting nodes are removed
* @param {boolean} [options.unquoteVariables] if true variable quotations are removed
* @returns {*} json commonmark object
*/
toCommonMark(input: any, options?: {
removeFormatting?: boolean;
unquoteVariables?: boolean;
}): any;
/**
* Unquotes a CiceroMark DOM
* @param {object} input CiceroMark DOM
* @returns {object} unquoted CiceroMark DOM
*/
unquote(input: object): object;
/**
* Converts a ciceromark string into a token stream
*
* @param {string} input the string to parse
* @returns {*} a markdown-it token stream
*/
toTokens(input: string): any;
/**
* Converts a token stream into a CiceroMark DOM object.
*
* @param {object} tokenStream the token stream
* @returns {*} the CiceroMark DOM (JSON)
*/
fromTokens(tokenStream: object): any;
}
import { ModelManager } from "@accordproject/concerto-core";
import { Serializer } from "@accordproject/concerto-core";
Loading
Loading