diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ba1e667b449..d22383b48e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3554,6 +3554,8 @@ importers: specifier: 6.0.1 version: 6.0.1(webpack@5.105.2) + projects/packages/podcast: {} + projects/packages/post-list: dependencies: '@wordpress/i18n': diff --git a/projects/packages/podcast/.gitattributes b/projects/packages/podcast/.gitattributes new file mode 100644 index 00000000000..b3028ba45f0 --- /dev/null +++ b/projects/packages/podcast/.gitattributes @@ -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 diff --git a/projects/packages/podcast/.gitignore b/projects/packages/podcast/.gitignore new file mode 100644 index 00000000000..8424444d750 --- /dev/null +++ b/projects/packages/podcast/.gitignore @@ -0,0 +1,4 @@ +vendor/ +node_modules/ +.cache/ +composer.lock diff --git a/projects/packages/podcast/.phan/config.php b/projects/packages/podcast/.phan/config.php new file mode 100644 index 00000000000..86a515290b9 --- /dev/null +++ b/projects/packages/podcast/.phan/config.php @@ -0,0 +1,13 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/packages/podcast/AGENTS.md b/projects/packages/podcast/AGENTS.md new file mode 100644 index 00000000000..dc305d585cc --- /dev/null +++ b/projects/packages/podcast/AGENTS.md @@ -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. diff --git a/projects/packages/podcast/CHANGELOG.md b/projects/packages/podcast/CHANGELOG.md new file mode 100644 index 00000000000..03a962f457f --- /dev/null +++ b/projects/packages/podcast/CHANGELOG.md @@ -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). diff --git a/projects/packages/podcast/README.md b/projects/packages/podcast/README.md new file mode 100644 index 00000000000..f5d95aaa308 --- /dev/null +++ b/projects/packages/podcast/README.md @@ -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. diff --git a/projects/packages/podcast/changelog/.gitkeep b/projects/packages/podcast/changelog/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/projects/packages/podcast/changelog/add-podcast-package b/projects/packages/podcast/changelog/add-podcast-package new file mode 100644 index 00000000000..c8cda5a6d4a --- /dev/null +++ b/projects/packages/podcast/changelog/add-podcast-package @@ -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. diff --git a/projects/packages/podcast/composer.json b/projects/packages/podcast/composer.json new file mode 100644 index 00000000000..9b758835a39 --- /dev/null +++ b/projects/packages/podcast/composer.json @@ -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 + } + } +} diff --git a/projects/packages/podcast/eslint.config.mjs b/projects/packages/podcast/eslint.config.mjs new file mode 100644 index 00000000000..afb1e892b4d --- /dev/null +++ b/projects/packages/podcast/eslint.config.mjs @@ -0,0 +1,3 @@ +import { makeBaseConfig } from 'jetpack-js-tools/eslintrc/base.mjs'; + +export default makeBaseConfig( import.meta.url ); diff --git a/projects/packages/podcast/package.json b/projects/packages/podcast/package.json new file mode 100644 index 00000000000..51bdce16ea0 --- /dev/null +++ b/projects/packages/podcast/package.json @@ -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" +} diff --git a/projects/packages/podcast/phpunit.11.xml.dist b/projects/packages/podcast/phpunit.11.xml.dist new file mode 100644 index 00000000000..f7418373829 --- /dev/null +++ b/projects/packages/podcast/phpunit.11.xml.dist @@ -0,0 +1,36 @@ + + + + + tests/php + + + + + + + + src + + + + + diff --git a/projects/packages/podcast/phpunit.12.xml.dist b/projects/packages/podcast/phpunit.12.xml.dist new file mode 100644 index 00000000000..f7418373829 --- /dev/null +++ b/projects/packages/podcast/phpunit.12.xml.dist @@ -0,0 +1,36 @@ + + + + + tests/php + + + + + + + + src + + + + + diff --git a/projects/packages/podcast/phpunit.8.xml.dist b/projects/packages/podcast/phpunit.8.xml.dist new file mode 100644 index 00000000000..3965963c485 --- /dev/null +++ b/projects/packages/podcast/phpunit.8.xml.dist @@ -0,0 +1,17 @@ + + + + + tests/php + + + diff --git a/projects/packages/podcast/phpunit.9.xml.dist b/projects/packages/podcast/phpunit.9.xml.dist new file mode 100644 index 00000000000..3965963c485 --- /dev/null +++ b/projects/packages/podcast/phpunit.9.xml.dist @@ -0,0 +1,17 @@ + + + + + tests/php + + + diff --git a/projects/packages/podcast/src/class-podcast.php b/projects/packages/podcast/src/class-podcast.php new file mode 100644 index 00000000000..528ef1dc3f4 --- /dev/null +++ b/projects/packages/podcast/src/class-podcast.php @@ -0,0 +1,67 @@ +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. + } +} diff --git a/projects/packages/podcast/tests/.phpcs.dir.xml b/projects/packages/podcast/tests/.phpcs.dir.xml new file mode 100644 index 00000000000..46951fe77b3 --- /dev/null +++ b/projects/packages/podcast/tests/.phpcs.dir.xml @@ -0,0 +1,4 @@ + + + + diff --git a/projects/packages/podcast/tests/php/Podcast_Test.php b/projects/packages/podcast/tests/php/Podcast_Test.php new file mode 100644 index 00000000000..bc1de52fa07 --- /dev/null +++ b/projects/packages/podcast/tests/php/Podcast_Test.php @@ -0,0 +1,38 @@ +expectNotToPerformAssertions(); + } + + /** + * `PACKAGE_VERSION` is exposed for the changelogger version-constants + * mapping declared in `composer.json`. + */ + public function test_package_version_constant_is_defined() { + $this->assertNotEmpty( Podcast::PACKAGE_VERSION ); + } +} diff --git a/projects/packages/podcast/tests/php/bootstrap.php b/projects/packages/podcast/tests/php/bootstrap.php new file mode 100644 index 00000000000..fe7ccf4c45a --- /dev/null +++ b/projects/packages/podcast/tests/php/bootstrap.php @@ -0,0 +1,12 @@ +=7.2" + }, + "require-dev": { + "automattic/jetpack-test-environment": "@dev", + "automattic/phpunit-select-config": "@dev", + "yoast/phpunit-polyfills": "^4.0.0" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "type": "jetpack-library", + "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}" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "phpunit-select-config phpunit.#.xml.dist --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "license": [ + "GPL-2.0-or-later" + ], + "description": "Jetpack Podcast functionality (Simple and Atomic only).", + "transport-options": { + "relative": true + } + }, { "name": "automattic/jetpack-post-list", "version": "dev-trunk", @@ -5855,6 +5914,7 @@ "automattic/jetpack-newsletter": 20, "automattic/jetpack-paypal-payments": 20, "automattic/jetpack-plugins-installer": 20, + "automattic/jetpack-podcast": 20, "automattic/jetpack-post-list": 20, "automattic/jetpack-post-media": 20, "automattic/jetpack-publicize": 20,