Document fully qualified worlds in generate!#1299
Document fully qualified worlds in generate!#1299Xe wants to merge 1 commit intobytecodealliance:mainfrom
Conversation
This nudge would have saved me some time in trying to figure out how to share .wit interfaces between components in a monorepo. Signed-off-by: Xe Iaso <[email protected]>
| /// // This would read from your `my-world.wit` file in | ||
| /// // `wit/deps/example:test/my-world`. |
There was a problem hiding this comment.
To clarify this slightly, the names of folders within wit/deps are insignificant and are only used for deduplicating packages. The package example:test can be within wit/deps/test or wit/deps/example equally. It's the contents of the *.wit files within that folder which dictate the package name.
Additionally the name my-world doesn't have to match the name of the WIT file itself, for example you could have world my-world { ... } in wit/deps/test/test.wit. You could even go further with a single-file package and have wit/deps/test.wit which contains package example:test; and world my-world { .. }.
Mostly would you ok relaxing the filename recommendation here? The wording currently reads as if it's required to be in such a location which may cause confusion.
There was a problem hiding this comment.
I'm okay with it. I wasn't aware that things were so relaxed. I've been naming things after the worlds to be safe.
There was a problem hiding this comment.
To confirm, you do not wish to change the wording here? If so I can incorporate this change in a separate PR but personally I won't merge this until the wording no longer implies that such filesystem naming is required.
There was a problem hiding this comment.
I'm okay with changing the wording. I'll think about it overnight and file a suggestion in this thread.
This nudge would have saved me some time in trying to figure out how to share .wit interfaces between components in a monorepo.