Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client/BpmnEditor): allow passing linting configurations via plugin #1374

Closed
wants to merge 6 commits into from

Conversation

pinussilvestrus
Copy link
Contributor

This allows parsing linting configuration to the Camunda Modeler.

Reference: https://github.com/bpmn-io/bpmn-js-bpmnlint#usage

Related by camunda/camunda-modeler-linter-plugin#5

@nikku
Copy link
Member

nikku commented Jun 4, 2019

@pinussilvestrus Let's have a quick chat regarding this tomorrow.

I'll meet you in our favorite chat tool.

@pinussilvestrus
Copy link
Contributor Author

pinussilvestrus commented Jun 4, 2019

👍 I'll create an appointment for this (+ Chat invitation)

@nikku
Copy link
Member

nikku commented Jun 5, 2019

Let's not merge this as is but consider a way how to create a generic extension point for the BPMN editor (and the others).

The idea would be that a plugin is simply a function of (options) => newOptions.

SKETCH:

// BpmnEditor.js


    const linterExtension = function(options) {

      return {
        ...options,
        linter: {

        }
      };
    };

    const additionalModulesExtension = function(options) {

      const additionalModules = options.additionalModules || [];

      return {
        ...options,
        additionalModules: [
          ...additionalModules,
          getPlugins('bpmn.modeler.additionalModules') || []
        ]
      };
    };

    const middlewares = [
      linterExtension,
      additionalModulesExtension

      // ...
    ];

    const modeler = new CamundaBpmnModeler(loadConfiguration(middlewares, {
      exporter: {
        name,
        version
      },
      moddleExtensions,
      position: 'absolute'
    }));

Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a proper generic extension point instead (cf. this comment).

@nikku nikku added ready Ready to be worked on and removed needs review Review pending labels Jun 11, 2019 — with bpmn-io-tasks
@nikku nikku added this to the M30 milestone Jun 17, 2019
@nikku nikku added backlog Queued in backlog and removed ready Ready to be worked on labels Jun 17, 2019
nikku added a commit that referenced this pull request Jul 23, 2019
This adds the bpmn.modeler.configure extension point.

The extension point allows users to provide a middleware
options => newOptions that can be used to apply
arbitrary configuration updates before the editor gets
created.

This also builds existing entry points onto the new pattern
and adds a distinct utility to carry out the configuration.

Supersedes #1374
@nikku nikku mentioned this pull request Jul 23, 2019
nikku added a commit that referenced this pull request Jul 23, 2019
This adds the bpmn.modeler.configure extension point.

The extension point allows users to provide a middleware
options => newOptions that can be used to apply
arbitrary configuration updates before the editor gets
created.

This also builds existing entry points onto the new pattern
and adds a distinct utility to carry out the configuration.

Supersedes #1374
@nikku
Copy link
Member

nikku commented Jul 23, 2019

Closing in favor of #1434.

@nikku nikku closed this Jul 23, 2019
@bpmn-io-tasks bpmn-io-tasks bot removed the backlog Queued in backlog label Jul 23, 2019
nikku added a commit that referenced this pull request Jul 30, 2019
This adds the bpmn.modeler.configure extension point.

The extension point allows users to provide a middleware
options => newOptions that can be used to apply
arbitrary configuration updates before the editor gets
created.

This also builds existing entry points onto the new pattern
and adds a distinct utility to carry out the configuration.

Supersedes #1374
merge-me bot pushed a commit that referenced this pull request Jul 30, 2019
This adds the bpmn.modeler.configure extension point.

The extension point allows users to provide a middleware
options => newOptions that can be used to apply
arbitrary configuration updates before the editor gets
created.

This also builds existing entry points onto the new pattern
and adds a distinct utility to carry out the configuration.

Supersedes #1374
@nikku nikku deleted the slack-time-linting branch October 28, 2019 08:04
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.

2 participants