-
Notifications
You must be signed in to change notification settings - Fork 875
Podcast: scaffold empty package + module behind feature flag (1/4) #48556
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a929fb8
Podcast: scaffold empty package + module behind jetpack_podcast_untan…
arcangelini d547a51
Podcast: drop empty phan baseline
arcangelini 8500ac6
Podcast: align scaffold with Scan — README/AGENTS/eslint, late_initia…
arcangelini c6e5ae5
Podcast: clarify init test docblock; broaden composer repositories url
arcangelini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| vendor/ | ||
| node_modules/ | ||
| .cache/ | ||
| composer.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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__ ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ) ) { | ||
| return; | ||
| } | ||
|
|
||
| // Subsequent PRs in the untangle train wire the new package up here. | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0"?> | ||
| <ruleset> | ||
| <rule ref="Jetpack-Tests" /> | ||
| </ruleset> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
subscriptionsandcontact-form.