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

Project structure and package name #3

Closed
relu91 opened this issue Nov 3, 2023 · 11 comments
Closed

Project structure and package name #3

relu91 opened this issue Nov 3, 2023 · 11 comments

Comments

@relu91
Copy link
Member

relu91 commented Nov 3, 2023

We have to decide:

  • the npm root name and the subprojects.
  • README already mentions a list of possible projects but what is the directory structure?
  • Is gitsubmodules still an option? or npm workspaces?
  • Understand dependencies between tools
@egekorkan
Copy link
Member

egekorkan commented Nov 9, 2023

  • Unless we observe a lot of dependency between different tools, we do not need something like npm workspaces or something similar.
    • We should allow tools to even have different versions if there is no tight dependency between them.
  • We do not need gitsubmodules since we want to copy everything here
  • For the folder structure, I have a couple of ideas I can list below:
    1. We have a top level folder that has programming language in the name, e.g. node-packages, python-packages . We do not have multiple languages at the moment but it is good to have stable links for the future.
    2. Same as above but without programming language. Only after going into the tool folder, one understand the language. The end user never sees a difference if we distribute executables anyways.
    3. We categorize the tools based on their purpose, i.e. if there is one validator in Node.js and in Python, there can be a validators folder and then node and python folders within them.
  • Dependencies between tools:
    • Playground
      • core (validation component) depends on node-wot thing model helpers (see here)
      • TD Default add/remove depends on core for tests so it is a dev dependency here
      • JSON Spell Checker: no dependencies.
      • TD to AsyncAPI: dependency to defaults so that the unknown fields are added before conversion. This can be left to the developer so the dependency can be removed.
      • TD to OpenAPI: no dependency but similar situation to above
    • node-wot td-tools:
      • aid tools: No dependency to others in this list, only dependency are some util-like tools under td-tools. When we move to td-tools, node-wot/td-tools can be a dependency.
      • thing-model-helpers: No dependency to others in this list but if better TM validation is needed, there might be dependencies to core/validator package of playground. When we move to td-tools, node-wot/td-tools can be a dependency.
      • In this case, we need to find a way to remove td-tools from node-wot as a package but keep the functionality in other places.

@egekorkan
Copy link
Member

@danielpeintner will detail what the other scripts within node-wot/td-tools do

@danielpeintner
Copy link
Member

Please find below a proposal how to restructure "td-tools" related code:

  • eclipse-thingweb/node-wot
    • remove folder eclipse-thingweb/node-wot/packages/td-tools entirely
    • eclipse-thingweb/node-wot/packages/core should link to eclipse-thingweb/td-tools/node/foundation (see newly created package below)
  • eclipse-thingweb/td-tools
    • create project eclipse-thingweb/td-tools/node/foundation (all open for a better name) with
    • create project eclipse-thingweb/td-tools/node/thing-model with
    • create project eclipse-thingweb/td-tools/node/aid with
    • create other projects w.r.t. validation etc from playground ...

Any opinions/suggestions?

@egekorkan
Copy link
Member

I quite like the proposal. The main confusing part is how to explain what the "foundation" package offers to outsiders so I am not able to provide an alternative name :/

@egekorkan
Copy link
Member

  • npm packages variations:
    • @eclipse-thingweb/td-tools/thing-model-helpers
    • @thingweb/td-tools/thing-model-helpers -> may not be allowed
    • @thingweb/td-tools-thing-model-helpers
    • @thingweb/thing-model-helpers
    • @thingweb/tm-helpers
    • @thingweb/node-wot-binding-http
    • @thingweb/node-wot-contrib-binding-x
    • Note: @ is not governed or restricted but we should check

Decision on renaming: we will have @thingweb/TOOL_NAME

@sebastiankb
Copy link

When will the new structure be applied?

@egekorkan
Copy link
Member

When will the new structure be applied?

  • I can move playground tools in one PR with renaming before January. For node-wot "foundation" package we need more discussion.
  • thing-model should be called tm-helpers, foundation can be td-helpers if we want to.
  • The goal is having one package that does "parsing", i.e. canonicalization by adding all needed defaults. This needed before consuming. It is validation + adding defaults imo.
    • There is a refactoring need. In node-wot, there are multiple places where validation and defaults happen. (parser, init exposed thing, bindings for protocol defaults)

@egekorkan
Copy link
Member

In the meantime, @relu91 or @danielpeintner, could you document here or in node-wot how the td-tools are used within it? I think we need better understanding before committing to a direction.

@danielpeintner
Copy link
Member

I sketched how I "see" the best way forward in #3 (comment)
We (I) can try to describe next year ;-) the relations and it current usage...

@egekorkan
Copy link
Member

egekorkan commented Jan 12, 2024

node-wot td parser:
Consuming:

  • It corrects user inputs (if readonly is not boolean, it is corrected to boolean)
  • Fills defaults

For the future, the core package can do this, meaning td-parser is not necessary for an outsider as a tool

@egekorkan
Copy link
Member

The overall structure is now applied. I will open new issues for default handling and validation

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

No branches or pull requests

4 participants