-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Introduce the snippet
target type
#3694
Conversation
Note: Color support was for convenience, happy to put that elsewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @bitjammer. This looks great, just a couple of smaller points to discuss.
@@ -0,0 +1,35 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if some of the UI for snippets should be in a distinct module from Commands
. I could see that this would be something we may want to expose via libSwiftPM at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking the same thing actually. Before committing to that, what do you say we keep it here for now while we refine it some more? I think it will probably change a bit in the coming months.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I think that's fine.
@swift-ci please smoke test |
I think we probably have to update the CMake build in some way. BTW, you can probably locally reproduce this by running |
Ah thank you. I didn't realize this project also had to work with cmake. Looks like |
Oh, heh. I suppose I should add the source files actually... |
Snippets are small, focused pieces of example code for packages. They are meant for current and potential package clients to read and try when exploring a package. Snippets build with the rest of a package so they don't get stale and can run as an executable target with hidden "demo code" to illustrate and prove that the snippets work (this does not mean that snippets are tests!). Summary of changes: - Add a `.snippet` product and target type - Add the `Snippet` and `SnippetGroup` model to PackageModel - When building a package in `PackageBuilder`, look for snippets in the `Snippets` subdirectory. - Add the "card stack" terminal UIs for browsing a package's snippets - "Top" card: The top level menu that displays products and snippet groups - "Snippet Group" card: The menu that shows the snippets in a group - "Snippet" card: Displays a snippet's presentation code and offers to build and run the snippet.
17b1d29
to
515a808
Compare
@swift-ci please smoke test |
Snippets are small, focused pieces of example code for packages. They are meant for current and potential package clients to read and try when exploring a package. Snippets build with the rest of a package so they don't get stale and can run as an executable target with hidden "demo code" to illustrate and prove that the snippets work (this does not mean that snippets are tests!). Summary of changes: - Add a `.snippet` product and target type - Add the `Snippet` and `SnippetGroup` model to PackageModel - When building a package in `PackageBuilder`, look for snippets in the `Snippets` subdirectory. - Add the "card stack" terminal UIs for browsing a package's snippets - "Top" card: The top level menu that displays products and snippet groups - "Snippet Group" card: The menu that shows the snippets in a group - "Snippet" card: Displays a snippet's presentation code and offers to build and run the snippet.
Snippets are small, focused pieces of example code for packages. They are meant
for current and potential package clients to read and try when exploring a
package.
Snippets build with the rest of a package so they don't get stale and
can run as an executable target with hidden "demo code" to illustrate and prove
that the snippets work (this does not mean that snippets are tests!).
Summary of changes:
.snippet
product and target typeSnippet
andSnippetGroup
model to PackageModelPackageBuilder
, look for snippets in theSnippets
subdirectory.to build and run the snippet.
[One line description of your change]
Motivation:
[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]
Modifications:
[Describe the modifications you've done.]
Result:
[After your change, what will change.]