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

Activate wporg-learn plugin at env setup #2503

Conversation

freibergergarcia
Copy link
Contributor

@freibergergarcia freibergergarcia commented Jun 5, 2024

Activate the wporg-learn plugin at the environment setup, as it's a theme's dependency.

Fix the import content command by removing double quotes.

Fixes #2495

WordPress#2495 add wporg-learn to the list of plugins that need to be activated during the environment setup
WordPress#2495 remove double quotes from the import content command
@adamwoodnz adamwoodnz added [Component] Environment Website development issues related to Learn's local environment, or needs Meta team involvement. [Dev] Needs Review Pull request needing a review. [Dev] Needs Testing Website development issues needing testing. labels Jun 5, 2024
@adamwoodnz adamwoodnz added this to the Learning Pathways launch milestone Jun 5, 2024
@adamwoodnz adamwoodnz self-requested a review June 5, 2024 09:49
Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

Thanks for this!

I've tested and activating the plugin works, but the plugin also needs to be built.

In package.json we need to replace these lines:

"build": "yarn workspaces run build",
"create": "composer install && yarn setup:tools && yarn workspace wporg-learn-2024 run build && yarn run install:env",
"create:old": "composer install && yarn setup:tools && yarn workspaces run build && yarn run install:env:old",

with

"build": "yarn workspace wporg-learn-2024 run build && yarn workspace wporg-learn-plugin run build",
"build:old": "yarn workspace wporg-learn-theme run build && yarn workspace wporg-learn-plugin run build",
"create": "composer install && yarn setup:tools && yarn build && yarn run install:env",
"create:old": "composer install && yarn setup:tools && yarn build:old && yarn run install:env:old",

Could you please try that?

bin/index.sh Outdated
@@ -27,4 +27,4 @@ npm run wp-env run cli wp theme activate pub/wporg-learn-2024
npm run wp-env run cli wp rewrite structure '/%postname%/'

# Import content
# npm run wp-env run cli "php bin/import-test-content.php"
# npm run wp-env run cli php bin/import-test-content.php
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is commented out. When I uncomment it the import works now without the quotes. Did you intend to comment it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought that it was intentionally left uncommented. I made the changes to the build process and uncommented the import command.

I'm new to the project, so I'm unsure, but it looks like the build didn't work as expected.

The courses have been imported to the local database, I can see Tutorials and Lesson Plans, but the front end looks like this:

localhost:8888
Screenshot 2024-06-06 at 7 26 46 AM

localhost:8888/tutorials
Screenshot 2024-06-06 at 7 47 49 AM

I suppose it should match: https://learn.wordpress.org/tutorials/?

I also looked at the build workflow and tried it out but had no luck. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

No that's pretty much as expected. The theme is very much a work in progress; the 'No learning pathways found' message needs aligning, and there will be no Tutorials moving forward, so that is the default archive template you're seeing there. We can update the content import at some point to drop the out of date content and add some Lessons and Courses.

Thanks again for your help, I'll do a final test and get this merged.

@adamwoodnz adamwoodnz requested a review from renintw June 6, 2024 02:08
@adamwoodnz adamwoodnz added Dev and removed [Dev] Needs Review Pull request needing a review. [Dev] Needs Testing Website development issues needing testing. labels Jun 6, 2024
@adamwoodnz adamwoodnz merged commit 380e12c into WordPress:trunk Jun 6, 2024
1 check passed
adamwoodnz added a commit that referenced this pull request Jun 6, 2024
We split the build command for the old and new themes in #2503

See #2495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Environment Website development issues related to Learn's local environment, or needs Meta team involvement. Dev
2 participants