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

[script] Add script to create a new module #8918

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Oct 16, 2023

This adds a helper script to reduce the boilerplate of creating a new module.

It creates the module structure and stubs for all the files/directories in the module expected by LORIS, including README, help, and basic tests/test plan. The script takes a directory path as an argument, verifies that it doesn't already exist and can be written to, deduces the module name from the last part of the path, and then creates all necessary files doing the minimum of what needs to be done.

The module contains a root page and a single endpoint named "some_api" as an example.

If the --tsx option is specified, a stub tsx index is created as well.

Note: SQL is contained in the new module's directory rather than the LORIS SQL directory because the script doesn't know if it's a project or LORIS module being created (and if project, where SQL is tracked.)

This adds a helper script to reduce the boilerplate of
creating a new module.

It creates the module structure and stubs for all necessary
files/directories in the module. The script takes a directory
path as an argument, verifies that it doesn't already exist and
can be written to, deduces the module name from the last part of
the path, and then creates all necessary files doing the minimum
of what needs to be done.

The module contains a root page and single endpoint named "some_api"
as an example.

If the --tsx option is specified, a stub tsx index is created as
well.

Note: SQL is contained in the module's directory rather than the
LORIS SQL directory because the script doesn't know if it's a
project or LORIS module being created (and if project, where SQL
is tracked.)
Copy link
Contributor

@kongtiaowang kongtiaowang left a comment

Choose a reason for hiding this comment

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

LGTM

@kongtiaowang kongtiaowang added the Passed manual tests PR has been successfully tested by at least one peer label Oct 19, 2023
@driusan driusan merged commit d288866 into aces:main Nov 7, 2023
19 checks passed
@ridz1208 ridz1208 added this to the 26.0.0 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed manual tests PR has been successfully tested by at least one peer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants