Skip to content

Make configuration files more accessible #261

Closed

Description

@RubenVerborgh

Some of our dependency injection configuration files look a bit more difficult than they need to.

Take for instance https://github.com/solid/community-server/blob/0644f8d24517b88018f85941d5b74b94c3a443f3/config/presets/ldp/permissions-extractor.json#L7-L14.

It could be a bit easier if one-line objects were just one line:

{
  "CompositeAsyncHandler:_handlers": [
    { "@type": "MethodPermissionsExtractor" },
    { "@type": "SparqlPatchPermissionsExtractor" }
  ]
}

Also, we might want to add some aliases to get rid of the @ keywords, so we can just write id and type.
Could we avoid @graph?

Plus, let's introduce a prefix for urn:solid-server:default: (perhaps css or default?) to remove verbosity.

Also, perhaps we should lint our JSON files to enforce some of these?

Tasks

  • make simple objects one-liners
  • add aliases for @ keywords
  • add prefix for urn:solid-server:default:
  • check if we can get rid of @graph
  • set up linting
  • organize/group imports

Activity

  1. ianconsolata commented on Dec 18, 2020

    @ianconsolata
    Contributor

    I would love to work on this one. I have a weird passion for well-written configs and have a vested interest in making sure it's easy to configure using Kubernetes. Can you provide more context or documentation on how the current config process works, and what files I should check out?

  2. ianconsolata commented on Dec 18, 2020

    @ianconsolata
    Contributor

    Sorry, I meant specifically in the codebase. For example, what is a RegexRouterRule or a MemoryResourceStore? Where can I learn what all these different dependency injection values mean?

    It seems like this dependency injection framework is super powerful, but it makes it difficult for me as a new contributor to have any sense of what these config values do or even how to configure and launch the app. Have you given any thought to how to simplify things and lower the barrier to entry for new developers? It might be as simple as just writing documentation for all the different config values, or wrapping the configs in a layer of syntactic sugar that can be circumvented by advanced users.

  3. ianconsolata commented on Dec 19, 2020

    @ianconsolata
    Contributor

    Looks like #295 covers the documentation part, so I guess that doesn't exist yet. :D

  4. RubenVerborgh commented on Dec 19, 2020

    @RubenVerborgh
    MemberAuthor

    I guess that doesn't exist yet. :D

    It does—#295 discusses documenting the configuration files themselves, not the components they use.

    I meant specifically in the codebase. For example, what is a RegexRouterRule or a MemoryResourceStore? Where can I learn what all these different dependency injection values mean?

    They are components in the codebase:

    We can generate TSdoc for them (#434), which will make them easier to find and use.
    Update: now live at https://solid.github.io/community-server/docs/

  5. RubenVerborgh commented on Dec 20, 2020

    @RubenVerborgh
    MemberAuthor

    Variables can also be useful here: #296 (comment) / LinkedSoftwareDependencies/Components.js#23

  6. ianconsolata commented on Dec 21, 2020

    @ianconsolata
    Contributor

    Awesome, this is amazing context thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions