You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.pq files). 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.pq file, 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 compile the above-specified subdirectory.
makePQX compile would:
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.pq files], should not be in the /src subfolder).
Validate that exactly one .pq extension 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?)
Disable the “Evaluate this file” action when a file in the /src directory is selected.
When creating new projects, the default template used should include/src and /tests directories.
Technically, though, the user can put their test files in any directory other than the source directory (including in multiple directories, e.g. /tests-quick and /tests-longrunning), as “Evaluate this file” would work on any .pq file that is outside of the source directory.
This discussion was converted from issue #163 on October 16, 2022 11:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
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:
.test.pq
files). 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..test.pq
file, 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:
Would it make sense to encourage PQ extension projects towards a more structured project layout?
Possible Implementation
An implementation of this might look like:
/src
, or maybe something like/extension
).makePQX compile
the above-specified subdirectory.makePQX compile
would:.query.pq
files], should not be in the/src
subfolder)..pq
extension file is present. Error if not true./src
directory is selected./src
and/tests
directories./tests-quick
and/tests-longrunning
), as “Evaluate this file” would work on any.pq
file that is outside of the source directory.Beta Was this translation helpful? Give feedback.
All reactions