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

Directly require() PrairieLib files instead of using it as a package #4411

Merged
merged 3 commits into from Jun 24, 2021

Conversation

mwest1066
Copy link
Member

@mwest1066 mwest1066 commented Jun 23, 2021

Now that PrairieLib is directly in the monorepo, this PR changes all files to directly require() files from ./prairielib/ rather than using them via the @prairielearn/prairielib package.

The conversion here is done by creating the script tools/replace_prairielib_paths.py and then running it. The script itself does all the conversions to other files.

The advantage of using PrairieLib files directly is that:

  1. The full test-suite checks any changes to PrairieLib.
  2. We can make a simultaneous change to PrairieLib and PrairieLearn and test both changes together. This is used in PR Use separate PostgreSQL schemas for sprocs #4412, which changes how SQL stored procedures are run.

Add exclusions to replace_paths.py

Restrict replacements to .js files

Handle special cases for prairielib require()

Fix up bare relative path in server.js

Rename to tools/replace_prairielib_paths.py

Make script executable
Copy link
Contributor

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

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

Time is a flat circle 😛 it's only a matter of time before this all ends up back in /lib!

Took a quick skim through, this all looks correct, and the passing CI gives me confidence to approve.

@mwest1066
Copy link
Member Author

Time is a flat circle 😛 it's only a matter of time before this all ends up back in /lib!

It's the external monolith/micro-services tradeoff!

Took a quick skim through, this all looks correct, and the passing CI gives me confidence to approve.

Thanks!

@mwest1066 mwest1066 merged commit 350e1cf into master Jun 24, 2021
@mwest1066 mwest1066 deleted the prairielib-direct-paths branch June 24, 2021 21:03
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants