Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Podcast: initialize the jetpack-podcast package from jetpack-mu-wpcom (so Simple sites pick it up where load-jetpack.php doesn't run), and when the `jetpack_podcast_untangle` filter is on, register the new in-admin "Jetpack > Podcast" page in place of the legacy Calypso "Podcasting" link. Default behavior (filter off) is unchanged.
1 change: 1 addition & 0 deletions projects/packages/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"automattic/jetpack-google-analytics": "@dev",
"automattic/jetpack-masterbar": "@dev",
"automattic/jetpack-newsletter": "@dev",
"automattic/jetpack-podcast": "@dev",
"automattic/jetpack-redirect": "@dev",
"automattic/jetpack-rtc": "@dev",
"automattic/jetpack-stats-admin": "@dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ public static function load_wpcom_user_features() {
// are registered on Simple sites (where load-jetpack.php doesn't run).
\Automattic\Jetpack\Newsletter\Settings::init();

// Initialize the Podcast package on Simple sites (where late_initialization
// in class.jetpack.php doesn't run). Gated by `jetpack_podcast_untangle`
// inside Podcast::init() so the legacy podcasting code keeps running
// until the flag flips.
\Automattic\Jetpack\Podcast\Podcast::init();

// Only load the Masterbar features on WoA sites.
if ( class_exists( '\Automattic\Jetpack\Status\Host' ) && ( new \Automattic\Jetpack\Status\Host() )->is_woa_site() ) {
// This is temporary. After we cleanup Masterbar on WPCOM we should load Masterbar for Simple sites too.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Automattic\Jetpack\Newsletter\Settings as Newsletter_Settings;
use Automattic\Jetpack\Podcast\Admin_Page as Podcast_Admin_Page;
use Automattic\Jetpack\Redirect;
use Automattic\Jetpack\Subscribers_Dashboard\Dashboard as Subscribers_Dashboard;

Expand Down Expand Up @@ -401,15 +402,21 @@ function () {
$subscribers_dashboard->add_wp_admin_submenu();
}

// Jetpack > Podcasting
add_submenu_page(
'jetpack',
__( 'Podcasting', 'jetpack-mu-wpcom' ),
__( 'Podcasting', 'jetpack-mu-wpcom' ),
'manage_options',
'https://wordpress.com/settings/podcasting/' . $domain,
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
);
// When the `jetpack_podcast_untangle` filter is on, register the new
// "Jetpack > Podcast" in-admin page from the jetpack-podcast package.
// Otherwise keep the legacy "Jetpack > Podcasting" Calypso link unchanged.
if ( apply_filters( 'jetpack_podcast_untangle', false ) ) {
Podcast_Admin_Page::add_wp_admin_submenu();
} else {
add_submenu_page(
'jetpack',
__( 'Podcasting', 'jetpack-mu-wpcom' ),
__( 'Podcasting', 'jetpack-mu-wpcom' ),
Comment thread
arcangelini marked this conversation as resolved.
'manage_options',
'https://wordpress.com/settings/podcasting/' . $domain,
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
);
}

if ( $is_simple_site ) {
// Jetpack > Newsletter.
Expand Down Expand Up @@ -459,6 +466,7 @@ function () {
'search',
'subscribers',
'newsletter',
'jetpack-podcast',
'podcasting',
'traffic',
'jetpack#/settings',
Expand Down
5 changes: 5 additions & 0 deletions projects/packages/podcast/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
.github/ export-ignore
package.json export-ignore

# Files to include in the mirror repo, but excluded via gitignore
# Remember to end all directories with `/**` to properly tag every file.
/build/** production-include

# Files to exclude from the mirror repo, but included in the monorepo.
# Remember to end all directories with `/**` to properly tag every file.
.gitignore production-exclude
changelog/** production-exclude
.phpcs.dir.xml production-exclude
tests/** production-exclude
.phpcsignore production-exclude
routes/**/*.tsx production-exclude
1 change: 1 addition & 0 deletions projects/packages/podcast/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
vendor/
node_modules/
.cache/
build/
composer.lock
1 change: 1 addition & 0 deletions projects/packages/podcast/.phpcsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
4 changes: 4 additions & 0 deletions projects/packages/podcast/changelog/add-wp-build-scaffold
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Add an empty wp-build dashboard scaffold and the "Jetpack > Podcast" wp-admin entry, gated behind the `jetpack_podcast_untangle` filter. With the filter off (default), nothing changes; with it on, a placeholder Podcast page renders inside the standard wp-admin chrome.
13 changes: 8 additions & 5 deletions projects/packages/podcast/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-autoloader": "@dev",
"automattic/jetpack-composer-plugin": "@dev",
"automattic/jetpack-status": "@dev"
"automattic/jetpack-status": "@dev",
"automattic/jetpack-wp-build-polyfills": "@dev"
},
"require-dev": {
"yoast/phpunit-polyfills": "^4.0.0",
Expand All @@ -23,6 +22,12 @@
]
},
"scripts": {
"build-development": "pnpm run build",
"build-production": "pnpm run build-production",
"watch": [
"Composer\\Config::disableProcessTimeout",
"pnpm run watch"
],
"phpunit": [
"phpunit-select-config phpunit.#.xml.dist --colors=always"
],
Expand Down Expand Up @@ -58,8 +63,6 @@
},
"config": {
"allow-plugins": {
"automattic/jetpack-autoloader": true,
"automattic/jetpack-composer-plugin": true,
"roots/wordpress-core-installer": true
}
}
Expand Down
38 changes: 37 additions & 1 deletion projects/packages/podcast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,41 @@
"directory": "projects/packages/podcast"
},
"license": "GPL-2.0-or-later",
"author": "Automattic"
"author": "Automattic",
"type": "module",
"scripts": {
"build": "pnpm run clean && pnpm run build:wp-build && pnpm run build:boot-asset",
"build:boot-asset": "provide-boot-asset-file",
"build:wp-build": "wp-build",
"build-production": "pnpm run clean && pnpm run build:wp-build && pnpm run build:boot-asset",
"clean": "rm -rf build/",
"watch": "wp-build --watch"
},
"browserslist": [
"extends @wordpress/browserslist-config"
],
"devDependencies": {
"@automattic/jetpack-wp-build-polyfills": "workspace:*",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would expect polyfills in composer file instead as "automattic/jetpack-wp-build-polyfills": "@dev" — it's a PHP package and does all the heavy lifting for using WP build in Jetpack so that Podcast package doesn't need to :-)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This I believe it's a hybrid. The Composer side ships the WP_Build_Polyfills PHP class; the npm side ships the boot-asset build-time binary. Both are needed.

I tried to remove this and tests started breaking. Maybe I am missing something though.

sh: 1: provide-boot-asset-file: not found
> @automattic/jetpack-podcast@0.1.0-alpha build:boot-asset ...
> provide-boot-asset-file
ELIFECYCLE  Command failed.

"@babel/core": "7.29.0",
"@babel/runtime": "7.29.2",
"@types/react": "18.3.28",
"@wordpress/browserslist-config": "6.44.0",
"@wordpress/build": "0.13.0",
"@wordpress/element": "6.44.0",
"@wordpress/i18n": "6.17.0",
"browserslist": "^4.24.0"
},
"optionalDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
},
"wpPlugin": {
"name": "jetpack_podcast",
"scriptGlobal": "jetpackPodcast",
"packageNamespace": "jetpack-podcast",
"handlePrefix": "jetpack-podcast",
"pages": [
"jetpack-podcast-dashboard"
]
}
}
14 changes: 14 additions & 0 deletions projects/packages/podcast/routes/dashboard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "_@jetpack-podcast/dashboard-route",
"version": "1.0.0",
"private": true,
"dependencies": {
"@types/react": "18.3.28",
"@wordpress/element": "6.44.0",
"@wordpress/i18n": "6.17.0"
},
"route": {
"path": "/",
"page": "jetpack-podcast-dashboard"
}
}
1 change: 1 addition & 0 deletions projects/packages/podcast/routes/dashboard/route.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const route = {};
6 changes: 6 additions & 0 deletions projects/packages/podcast/routes/dashboard/stage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const Stage = () => {
// "Podcast" is a product name, do not translate.
return <h1>Podcast</h1>;
};

export { Stage as stage };
Loading
Loading