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

Add ZAP templates to src/app #3638

Merged
merged 11 commits into from
Nov 10, 2020

Conversation

jepenven-silabs
Copy link
Contributor

Problem

PR #3464 is huge. Break down into multiples small PR to facilitate review.

Summary of Changes

Add Zap Templates in the CHIP repo

Partial Fix of #1733

Copy link
Contributor

@vivien-apple vivien-apple left a comment

Choose a reason for hiding this comment

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

Looks pretty good. A few minor comments/nits mostly related to style consistency.

My biggest concerns would be that I would really prefer those templates to live inside examples. It would make it extra clear that they are used to generate the examples and are basically glued to them.

third_party/zap/templates/README.md Outdated Show resolved Hide resolved
third_party/zap/templates/README.md Outdated Show resolved Hide resolved
third_party/zap/templates/README.md Outdated Show resolved Hide resolved
third_party/zap/templates/README.md Outdated Show resolved Hide resolved
third_party/zap/templates/README.md Outdated Show resolved Hide resolved
third_party/zap/templates/endpoint_config.zapt Outdated Show resolved Hide resolved
third_party/zap/templates/gen_config.zapt Outdated Show resolved Hide resolved
third_party/zap/templates/helper-chip.js Outdated Show resolved Hide resolved
third_party/zap/templates/helper-chip.js Outdated Show resolved Hide resolved
third_party/zap/templates/print-cluster.zapt Outdated Show resolved Hide resolved
@vivien-apple
Copy link
Contributor

@woody-apple Restyled seems to fail because of the Javascript file included in this PR (third_party/repo/templates/helper-chip.js). Do you know what is the proper way to fix it ?

@jepenven-silabs
Copy link
Contributor Author

Looks pretty good. A few minor comments/nits mostly related to style consistency.

My biggest concerns would be that I would really prefer those templates to live inside examples. It would make it extra clear that they are used to generate the examples and are basically glued to them.

My point of view is that templates are an extension of ZAP. By themselves, they're useless. Moving them elsewhere would give the impression that they can be "standalone". And yes, as for now only the examples use them, but when people will start using CHIP for their own project, having the templates hidden under /examples won't make that much sense anymore.

@rwalker-apple
Copy link
Contributor

Looks pretty good. A few minor comments/nits mostly related to style consistency.
My biggest concerns would be that I would really prefer those templates to live inside examples. It would make it extra clear that they are used to generate the examples and are basically glued to them.

My point of view is that templates are an extension of ZAP. By themselves, they're useless. Moving them elsewhere would give the impression that they can be "standalone". And yes, as for now only the examples use them, but when people will start using CHIP for their own project, having the templates hidden under /examples won't make that much sense anymore.

I think these belong under src/app, as they are part of CHIP, they're effectively libraries/source files for CHIP's interaction with ZAP.

Copy link
Contributor

@rwalker-apple rwalker-apple left a comment

Choose a reason for hiding this comment

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

please move to src/app/zapt/xxx.zapt ?

@jepenven-silabs
Copy link
Contributor Author

please move to src/app/zapt/xxx.zapt ?
@rwalker-apple

Only the templates files or everything that is under third_party/zap/templates/ ?

@mspang
Copy link
Contributor

mspang commented Nov 5, 2020

Looks pretty good. A few minor comments/nits mostly related to style consistency.
My biggest concerns would be that I would really prefer those templates to live inside examples. It would make it extra clear that they are used to generate the examples and are basically glued to them.

My point of view is that templates are an extension of ZAP. By themselves, they're useless. Moving them elsewhere would give the impression that they can be "standalone". And yes, as for now only the examples use them, but when people will start using CHIP for their own project, having the templates hidden under /examples won't make that much sense anymore.

I think these belong under src/app, as they are part of CHIP, they're effectively libraries/source files for CHIP's interaction with ZAP.

Looks pretty good. A few minor comments/nits mostly related to style consistency.
My biggest concerns would be that I would really prefer those templates to live inside examples. It would make it extra clear that they are used to generate the examples and are basically glued to them.

My point of view is that templates are an extension of ZAP. By themselves, they're useless. Moving them elsewhere would give the impression that they can be "standalone". And yes, as for now only the examples use them, but when people will start using CHIP for their own project, having the templates hidden under /examples won't make that much sense anymore.

I think these belong under src/app, as they are part of CHIP, they're effectively libraries/source files for CHIP's interaction with ZAP.

I agree with moving them.

IMO, the things that belongs in third_party/X are

  • additions that could be upstream (like adding a build file for a different build system)
  • dependency readme and other administrivia (scripts to update it, etc)

For projects that add tools supporting a domain specific language such as ZAP, the sources in that language don't go in third_party. They are go in the regular directory structure of CHIP.

src/app/docs/README.md Outdated Show resolved Hide resolved
src/app/zap/gen_config.zapt Outdated Show resolved Hide resolved
@vivien-apple
Copy link
Contributor

@woody-apple Restyled seems to fail because of the Javascript file included in this PR (third_party/repo/templates/helper-chip.js). Do you know what is the proper way to fix it ?

I opened #3708 for that. The issue being that clang-format is trying to parse helper-chip.js but .clang-format does not contain any rules about JS files...

@vivien-apple vivien-apple changed the title Moved templates out of PR #3464 Add ZAP templates to src/app Nov 6, 2020
src/app/zap-templates/af-structs.zapt Outdated Show resolved Hide resolved
Copy link
Contributor

@rwalker-apple rwalker-apple left a comment

Choose a reason for hiding this comment

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

didn't want to use the name src/app/zapt?

@jepenven-silabs
Copy link
Contributor Author

didn't want to use the name src/app/zapt?

If the folder was named zapt one could expect to only find *.zapt file inside. Also @vivien-apple requested the zap-templates.

@vivien-apple
Copy link
Contributor

didn't want to use the name src/app/zapt?

If the folder was named zapt one could expect to only find *.zapt file inside. Also @vivien-apple requested the zap-templates.

This is exactly why I asked for zap-templates instead of zapt.

@jepenven-silabs
Copy link
Contributor Author

@mspang @andy31415 so we can merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants