Giter Club home page Giter Club logo

extendit's People

Contributors

forman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

anaruescas

extendit's Issues

Contribution points with type guards

Is your feature request related to a problem? Please describe.

  • We currently can only validate JSON entries against a given schema, but we cannot perform any integrity checks.
  • We currently cannot perform any validity/type checking on a code contribution c when registering it using registerCodeContribution<T>(c). We must rely on the user that c is valid and of type T.

Describe the solution you'd like

Allow for optional validators isEntryValid and isContributionValid to ManifestContributionInfo and CodeContributionInfo when defining a new ContributionPoint:

export interface ManifestContributionInfo<TM = unknown, TS = TM> {
  schema: JsonTypedSchema<TM> | JsonSchema;
  processEntry?: (entry: TM) => TS;
  isEntryValid(entry: unknown)?: entry is TM;  /* NEW */
}

export interface CodeContributionInfo<TS = unknown> {
  idKey?: KeyOfObjOrArrayItem<TS>;
  activationEvent?: string;
  isContributionValid<TC = unknown>(contrib: unknown)?: contrib is TC;  /* NEW */
}

Function `registerCodeContribution()` should be reactive

Describe the bug

Function registerCodeContribution() should be reactive but is not.
Calling it from extensions does will only cause the framework store to fire for the first contribution registered for the same point. Subsequent registrations for the same point do not fire.

Version: 0.1.0

Modify JSON contributions dynamically

Is your feature request related to a problem? Please describe.

In my app, I'm using contribution point menus from the contrib module to let extensions contribute menu items.
Menu items must currently provided by JSON entries in the extension's package.json.
I have a top-level menu "View" with a submenu "Tool Views... >".
This submenu should be filled from the contributions to another contribution point, namely toolViews.
Therefore I need to programmatically add (or replace) JSON entries to (or in) the menus contribution point.

Describe the solution you'd like

Possible options

  • (1) Support an auto-fill marker in the specific submenus contribution point so the framework can generate the menu entries from contributions of another referenced contribution point.
  • (2) Support adding JSON contributions programmatically, e.g., provide a new registerJsonContribution or the like similar to registerCodeContribution .

(1) is more pragmatic and applies to that specific contrib point only
(2) is more generic and flexible

And (2) does not exclude (1).

Log levels may also be given as strings

Is your feature request related to a problem? Please describe.

Currently, log levels must be passed as LogLevel instances, e.g. log.LogLevel.INFO or log.LogLevel.get(levelName), which is verbose.

Describe the solution you'd like

In all API, where log level is expected allow also passing a string, e.g., log level "INFO".

Make log level a configuration parameter

Is your feature request related to a problem? Please describe.

Log level can be changed only programmatically by a host app:

import { log } from "@forman2/extendit/util"

log.Logger.setGlobalLevel(log.LogLevel.INFO);

Describe the solution you'd like

updateFrameworkConfig({ logLevel: "INFO" });

Type parameter name `Data` is misleading

Is your feature request related to a problem? Please describe.

The type parameter name Data is used for code contributions and in this context the name is misleading, because of Code vs. Data.

Describe the solution you'd like

The name Value is more appropriate and equally generic.

Describe alternatives you've considered

The name Code is not entirely correct, because the contribution value can be data as well.

Address all eslint warnings

Is your feature request related to a problem? Please describe.

We still have >15 eslint warnings of the form

  14:35  warning  Invalid type "unknown" of template literal expression  @typescript-eslint/restrict-template-expressions

Describe the solution you'd like

Address all current eslint warnings. After fixing, turn them into errors. Let CI do linting too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.