-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
Both the legacy and current SDK expect an extension project's assets to be contained in a single directory (a flat structure; no subdirectories).
While this works, it brings with it some potential downsides, such as:
- The compile process excludes certain files from the mez it outputs based on file extension (principally
.test.pqfiles). Otherwise, it seems to bundle up everything into the mez. This can inadvertently lead to unexpected/unneeded files (such as the project’s readme) being packaged into the extension. - The flat structure limits the ability to organize files into related groupings (such as putting all test files together). While legacy SDK projects support only one
.test.pqfile, the new SDK allows multiple—which means more files can end up lumped into a single directory.
In contrast, many programming projects use a more structured project layout, where subfolders are used to group related files. For example:
/src -> contains code to build for distribution
/tests -> contains tests
{other files go here, as desired, such as a readme or license file}
Would it make sense to encourage PQ extension projects towards a more structured project layout?
Possible Implementation
An implementation of this might look like:
- Have a configurable project setting specifying the subdirectory containing the extension’s actual code (default to:
/src, or maybe something like/extension). - When the SDK triggers the build process, it passes
makePQX compilethe above-specified subdirectory. makePQX compilewould:- Assume that everything in the specified directory should go into the extension (so no more excluding files based on their extension; exclusions shouldn’t be needed as non-extension files [like
.query.pqfiles], should not be in the/srcsubfolder). - Validate that exactly one
.pqextension file is present. Error if not true. - Validate that no subdirectories are present. Error if not true. (Or should subdirectories be allowed in mez files?)
- Assume that everything in the specified directory should go into the extension (so no more excluding files based on their extension; exclusions shouldn’t be needed as non-extension files [like
- Disable the “Evaluate this file” action when a file in the
/srcdirectory is selected. - When creating new projects, the default template used should include
/srcand/testsdirectories.- Technically, though, the user can put their test files in any directory other than the source directory (including in multiple directories, e.g.
/tests-quickand/tests-longrunning), as “Evaluate this file” would work on any.pqfile that is outside of the source directory.
- Technically, though, the user can put their test files in any directory other than the source directory (including in multiple directories, e.g.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels