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
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

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

12 changes: 12 additions & 0 deletions projects/packages/podcast/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Files not needed to be distributed in the package.
.gitattributes export-ignore
.github/ export-ignore
package.json export-ignore

# 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
4 changes: 4 additions & 0 deletions projects/packages/podcast/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/
node_modules/
.cache/
composer.lock
13 changes: 13 additions & 0 deletions projects/packages/podcast/.phan/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
/**
* This configuration will be read and overlaid on top of the
* default configuration. Command-line arguments will be applied
* after this file is read.
*
* @package automattic/jetpack-podcast
*/

// Require base config.
require __DIR__ . '/../../../../.phan/config.base.php';

return make_phan_config( dirname( __DIR__ ) );
24 changes: 24 additions & 0 deletions projects/packages/podcast/.phpcs.dir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="jetpack-podcast" />
</property>
</properties>
</rule>
<rule ref="Jetpack.Functions.I18n">
<properties>
<property name="text_domain" value="jetpack-podcast" />
</properties>
</rule>

<rule ref="WordPress.Utils.I18nTextDomainFixer">
<properties>
<property name="old_text_domain" type="array" />
<property name="new_text_domain" value="jetpack-podcast" />
</properties>
</rule>

</ruleset>
26 changes: 26 additions & 0 deletions projects/packages/podcast/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Podcast

The wp-admin Podcast experience for the Jetpack plugin. Currently an
empty package gated behind the `jetpack_podcast_untangle` filter
(default off); follow-up PRs in the untangle train layer the SPA, REST
settings, and RSS feed customization on top of this gate.

## UI primitives

When adding React UI in this package, prefer the WordPress Design System
packages in this order:

1. **`@wordpress/ui`** — foundational primitives. Check each component's
Storybook "Status" badge (anything other than "stable" is still in
flux); avoid experimental APIs here.
2. **`@wordpress/components`** — general-purpose legacy library.
Predates the design system. Use only when `@wordpress/ui` doesn't
have a stable equivalent, and still check Status in Storybook.
3. **`@wordpress/dataviews`** — higher-level data presentation (tables,
lists, grids).
4. **`@wordpress/admin-ui`** — page layout primitives, accessed via
`AdminPage` from `@automattic/jetpack-components` (which wraps
admin-ui's `Page`).

Rationale: WordPress is moving new work to `@wordpress/ui`;
`@wordpress/components` is being kept as a legacy fallback.
6 changes: 6 additions & 0 deletions projects/packages/podcast/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5 changes: 5 additions & 0 deletions projects/packages/podcast/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Podcast for Jetpack

Hosts the wp-admin Podcast experience for the Jetpack plugin (Simple and Atomic only).

The package is gated behind the `jetpack_podcast_untangle` filter (default off). Until the filter is flipped on, the package contributes nothing — the legacy podcasting code (`Automattic_Podcasting` in the wpcom mu-plugin and the `at-pressable-podcasting` bridge plugin) keeps running unchanged. Subsequent PRs in the untangle train layer the new wp-admin SPA, REST integration, and feed customization on top of this gate.
Empty file.
4 changes: 4 additions & 0 deletions projects/packages/podcast/changelog/add-podcast-package
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Initial scaffolding for the Jetpack Podcast package. Loads on Simple and Atomic only, gated behind the `jetpack_podcast_untangle` filter (default off) so it stays inert while the legacy podcasting code keeps running.
66 changes: 66 additions & 0 deletions projects/packages/podcast/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "automattic/jetpack-podcast",
"description": "Jetpack Podcast functionality (Simple and Atomic only).",
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-autoloader": "@dev",
"automattic/jetpack-composer-plugin": "@dev",
"automattic/jetpack-status": "@dev"
},
"require-dev": {
"yoast/phpunit-polyfills": "^4.0.0",
"automattic/jetpack-test-environment": "@dev",
"automattic/phpunit-select-config": "@dev"
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
},
"autoload": {
"classmap": [
"src/"
]
},
"scripts": {
"phpunit": [
"phpunit-select-config phpunit.#.xml.dist --colors=always"
],
"test-php": [
"@composer phpunit"
]
},
"repositories": [
{
"type": "path",
"url": "../*",
"options": {
"monorepo": true
}
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"autorelease": true,
"autotagger": true,
"mirror-repo": "Automattic/jetpack-podcast",
"branch-alias": {
"dev-trunk": "0.1.x-dev"
},
"textdomain": "jetpack-podcast",
"version-constants": {
"::PACKAGE_VERSION": "src/class-podcast.php"
},
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-podcast/compare/v${old}...v${new}"
}
},
"config": {
"allow-plugins": {
"automattic/jetpack-autoloader": true,
"automattic/jetpack-composer-plugin": true,
"roots/wordpress-core-installer": true
}
}
}
3 changes: 3 additions & 0 deletions projects/packages/podcast/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { makeBaseConfig } from 'jetpack-js-tools/eslintrc/base.mjs';

export default makeBaseConfig( import.meta.url );
17 changes: 17 additions & 0 deletions projects/packages/podcast/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@automattic/jetpack-podcast",
"version": "0.1.0-alpha",
"private": true,
"description": "Jetpack Podcast functionality (Simple and Atomic only).",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/podcast/#readme",
"bugs": {
"url": "https://github.com/Automattic/jetpack/labels/[Package] Podcast"
},
"repository": {
"type": "git",
"url": "https://github.com/Automattic/jetpack.git",
"directory": "projects/packages/podcast"
},
"license": "GPL-2.0-or-later",
"author": "Automattic"
}
36 changes: 36 additions & 0 deletions projects/packages/podcast/phpunit.11.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/php/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends"
beStrictAboutOutputDuringTests="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="true"
failOnEmptyTestSuite="true"
failOnPhpunitDeprecation="true"
failOnNotice="true"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="main">
<directory suffix="Test.php">tests/php</directory>
</testsuite>
</testsuites>

<source>
<include>
<!-- Better to only include "src" than to add "." and then exclude "tests", "vendor", and so on, as PHPUnit still scans the excluded directories. -->
<!-- Add additional lines for any files or directories outside of src/ that need coverage. -->
<directory suffix=".php">src</directory>
</include>
</source>
<coverage ignoreDeprecatedCodeUnits="true">
</coverage>
</phpunit>
36 changes: 36 additions & 0 deletions projects/packages/podcast/phpunit.12.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/php/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends"
beStrictAboutOutputDuringTests="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="true"
failOnEmptyTestSuite="true"
failOnPhpunitDeprecation="true"
failOnNotice="true"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="main">
<directory suffix="Test.php">tests/php</directory>
</testsuite>
</testsuites>

<source>
<include>
<!-- Better to only include "src" than to add "." and then exclude "tests", "vendor", and so on, as PHPUnit still scans the excluded directories. -->
<!-- Add additional lines for any files or directories outside of src/ that need coverage. -->
<directory suffix=".php">src</directory>
</include>
</source>
<coverage ignoreDeprecatedCodeUnits="true">
</coverage>
</phpunit>
17 changes: 17 additions & 0 deletions projects/packages/podcast/phpunit.8.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="tests/php/bootstrap.php"
cacheResultFile=".phpunit.cache/test-results"
colors="true"
executionOrder="depends"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="main">
<directory suffix="Test.php">tests/php</directory>
</testsuite>
</testsuites>
</phpunit>
17 changes: 17 additions & 0 deletions projects/packages/podcast/phpunit.9.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="tests/php/bootstrap.php"
cacheResultFile=".phpunit.cache/test-results"
colors="true"
executionOrder="depends"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="main">
<directory suffix="Test.php">tests/php</directory>
</testsuite>
</testsuites>
</phpunit>
67 changes: 67 additions & 0 deletions projects/packages/podcast/src/class-podcast.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
/**
* Main loader for the Jetpack Podcast package.
*
* @package automattic/jetpack-podcast
*/

namespace Automattic\Jetpack\Podcast;

use Automattic\Jetpack\Status\Host;

/**
* Loads Jetpack Podcast on Simple and Atomic sites, gated behind the
* `jetpack_podcast_untangle` feature filter.
*
* Until the filter returns true, `init()` is a no-op so the legacy podcasting
* code (`Automattic_Podcasting` from the wpcom mu-plugin and the
* at-pressable-podcasting bridge plugin) keeps running unchanged. Subsequent
* PRs in the untangle train fill this in.
*/
class Podcast {

const PACKAGE_VERSION = '0.1.0-alpha';

/**
* Whether the class has been initialized.
*
* @var bool
*/
private static $initialized = false;

/**
* Initialize the package.
*
* Bails on hosts other than Simple and Atomic, and again unless the
* `jetpack_podcast_untangle` filter returns true.
*/
public static function init() {
if ( self::$initialized ) {
return;
}
self::$initialized = true;

$host = new Host();
if ( ! $host->is_wpcom_simple() && ! $host->is_woa_site() ) {
return;
}

/**
* Master switch for the Podcast untangle.
*
* While the legacy podcasting code is still the source of truth on
* Simple and Atomic sites, this filter stays false. Subsequent PRs
* layer the new wp-admin SPA, REST integration, and feed
* customization on top of this gate.
*
* @since 0.1.0
*
* @param bool $enabled Whether to enable the new Podcast package.
*/
if ( ! apply_filters( 'jetpack_podcast_untangle', false ) ) {
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.

Would be good to have a new Jetpack module for podcasting, which we can use to enable/disable Podcasting for Jetpack sites but also use it to enable/disable things on simple and Atomic, similar to how we do with some other modules like subscriptions and contact-form.

return;
}

// Subsequent PRs in the untangle train wire the new package up here.
}
}
4 changes: 4 additions & 0 deletions projects/packages/podcast/tests/.phpcs.dir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="Jetpack-Tests" />
</ruleset>
Loading
Loading