Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bpmn-io/bpmnlint-generate-docs-images

Package Overview
Dependencies
Maintainers
9
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bpmn-io/bpmnlint-generate-docs-images - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

34

cmd.js

@@ -18,4 +18,4 @@ #!/usr/bin/env node

const rollupResolve = require('rollup-plugin-node-resolve');
const rollupCommonjs = require('rollup-plugin-commonjs');
const rollupResolve = require('@rollup/plugin-node-resolve');
const rollupCommonjs = require('@rollup/plugin-commonjs');

@@ -150,3 +150,4 @@ function fail(...args) {

'forgiving': false,
'verbose': false
'verbose': false,
'cleanup': true
}

@@ -171,4 +172,8 @@ });

const cleanup = args['cleanup'];
const forgiving = args['forgiving'];
verbose && console.log('Executing in %s', path.resolve(pluginDirectory));
if (!fs.existsSync(pluginDirectory)) {

@@ -244,3 +249,3 @@ return fail('Directory %s does not exist', pluginDirectory);

if (verbose) {
console.log('Found %s documented rules: \n %s\n', rulesWithExamples.length, rulesWithExamples.map(r => r.name).join('\n '));
console.log('Found %s documented rules: \n %s', rulesWithExamples.length, rulesWithExamples.map(r => r.name).join('\n '));
} else {

@@ -266,3 +271,3 @@ console.log('Found %s documented rules', rulesWithExamples.length);

const workingDirectory = path.join(__dirname, 'tmp');
const workingDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'bpmnlint-generate-docs-images'));

@@ -290,14 +295,21 @@ verbose && console.debug('Using working directory %s', workingDirectory);

for (const lib of [ 'bpmn-js', 'bpmn-js-bpmnlint' ]) {
fs.symlinkSync(path.dirname(require.resolve(`${lib}/package.json`)), path.join(workingDirectory, 'node_modules', lib));
}
verbose && console.log('Compiling builder script');
await pack(script);
console.log('Generating images');
await generateImages(workingDirectory, rulesWithExamples);
} finally {
fs.unlinkSync(path.join(workingDirectory, 'node_modules', pluginName));
cleanup && verbose && console.log('Cleaning up %s', workingDirectory);
cleanup && fs.rmSync(workingDirectory, { recursive: true, force: true });
}
console.log('Generating images');
await generateImages(workingDirectory, rulesWithExamples);
console.log('\nDone.');
console.log('Done');
}

@@ -304,0 +316,0 @@

{
"name": "@bpmn-io/bpmnlint-generate-docs-images",
"version": "0.3.0",
"version": "0.3.1",
"description": "Generate documentation images for bpmnlint rules",

@@ -9,4 +9,4 @@ "scripts": {

"test": "run-s test:*",
"test:bpmnlint": "(cd tmp && npx degit github:bpmn-io/bpmnlint bpmnlint --force && node ../cmd.js bpmnlint --verbose)",
"test:example": "(cd tmp && npx degit github:bpmn-io/bpmnlint-plugin-example example --force && node ../cmd.js example --verbose)"
"test:bpmnlint": "(cd tmp && npx degit github:bpmn-io/bpmnlint bpmnlint --force && cd bpmnlint && node ../../cmd.js . --verbose)",
"test:example": "(cd tmp && npx degit github:bpmn-io/bpmnlint-plugin-example example --force && node ../cmd.js example)"
},

@@ -27,4 +27,6 @@ "bin": "cmd.js",

"dependencies": {
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"bpmn-js": "^11.3.1",
"bpmn-js-bpmnlint": "^0.20.0",
"bpmn-js-bpmnlint": "^0.20.1",
"bpmnlint": "^8.1.1",

@@ -34,5 +36,3 @@ "mri": "^1.1.4",

"rollup": "^3.15.0",
"rollup-plugin-bpmnlint": "^0.3.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-bpmnlint": "^0.4.1",
"tiny-glob": "^0.2.6"

@@ -39,0 +39,0 @@ },

# bpmnlint-generate-docs-images
[![Build Status](https://travis-ci.com/bpmn-io/bpmnlint-generate-docs-images.svg?branch=master)](https://travis-ci.com/bpmn-io/bpmnlint-generate-docs-images)
[![CI](https://github.com/bpmn-io/bpmnlint-generate-docs-images/actions/workflows/CI.yml/badge.svg)](https://github.com/bpmn-io/bpmnlint-generate-docs-images/actions/workflows/CI.yml)

@@ -20,2 +20,2 @@ Generate documentation images for your bpmnlint rules.

MIT
MIT

@@ -48,29 +48,20 @@ import bpmnlintConfig from '.bpmnlintrc';

function renderDiagram(diagramXML) {
async function renderDiagram(diagramXML) {
return new Promise((resolve, reject) => {
linting.toggle(false);
linting.toggle(false);
instance.importXML(diagramXML, function(err) {
await instance.importXML(diagramXML);
if (err) {
return reject(err);
}
const { inner } = canvas.viewbox();
const { inner } = canvas.viewbox();
const delta = {
x: - Math.round(inner.x) + 210,
y: - Math.round(inner.y) + 25
};
const delta = {
x: - Math.round(inner.x) + 210,
y: - Math.round(inner.y) + 25
};
modeling.moveElements(canvas.getRootElement().children, delta);
modeling.moveElements(canvas.getRootElement().children, delta);
const viewbox = canvas.viewbox();
const viewbox = canvas.viewbox();
resolve(viewbox.inner);
});
});
return viewbox.inner;
}

@@ -80,5 +71,6 @@

return new Promise((resolve) => {
return new Promise(resolve => {
eventBus.once('linting.completed', 100, (event) => {
return resolve(Object.keys(event.issues).length);
setTimeout(() => resolve(Object.keys(event.issues).length), 100);
});

@@ -85,0 +77,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc