-
Notifications
You must be signed in to change notification settings - Fork 843
Jetpack newsletter settings skeleton #46049
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
Open
dsas
wants to merge
24
commits into
trunk
Choose a base branch
from
dotcom-14314-untangling-jetpack-newsletter
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d63982c
Auto-generated bootstrap
dsas a35bc52
Add some more infra I think we will need
dsas 501e9f6
Add proof that this works
dsas 6fc9198
changelog
dsas 925b038
Make phpcs happy
dsas 0837967
update jetpack composer with newsletter composer
dsas d1c5dbf
Remove inline comments
dsas 33a9b35
phpcs: Alpha-sort use statements
dsas 9252a95
Rename the Jetpack Newsletter Settings package to Jetpack Newsletter
dsas 19c9634
misc infra bits and bobs
dsas 81e9d76
fix test-coverage command
dsas eac7025
Use admin_url from status package as it is already required
dsas 70d75e9
Update monorepo deps
dsas 6a24d29
Update phan baseline
dsas 0bfd24a
No tests yet, just the infra in place - allow tests to pass
dsas 79d1595
fix path to settings file for versioning
dsas 0d7b3a1
tidyup readme
dsas 65f8ade
Update monorepo composer lock
dsas 2c13514
Update newsletter namespace
dsas 3472754
Update .gitattributes to not ship tsx and scss to mirror repo
dsas ad4f7a1
Remove redundant asset enqueuing
dsas b45a8bb
Move files ready for other screens
dsas 5721d8f
Add changelogger entry
dsas c1d689a
Update composer.lock
dsas 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,9 @@ | ||
| { | ||
| "presets": [ | ||
| ["@babel/preset-env", { | ||
| "targets": { | ||
| "node": "current" | ||
| } | ||
| }] | ||
| ] | ||
| } |
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,20 @@ | ||
| # Files not needed to be distributed in the package. | ||
| .gitattributes export-ignore | ||
| .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 | ||
| tsconfig.json production-exclude | ||
| global.d.ts production-exclude | ||
| src/**/*.scss production-exclude | ||
| src/**/*.tsx 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/ | ||
| build/ |
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 @@ | ||
| <?php | ||
| /** | ||
| * This is an automatically generated baseline for Phan issues. | ||
| * When Phan is invoked with --load-baseline=path/to/baseline.php, | ||
| * The pre-existing issues listed in this file won't be emitted. | ||
| * | ||
| * This file can be updated by invoking Phan with --save-baseline=path/to/baseline.php | ||
| * (can be combined with --load-baseline) | ||
| */ | ||
| return [ | ||
| // This baseline has no suppressions | ||
| // Currently, file_suppressions and directory_suppressions are the only supported suppressions | ||
| 'file_suppressions' => [ | ||
| ], | ||
| // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. | ||
| // (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) | ||
| ]; |
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-newsletter | ||
| */ | ||
|
|
||
| // 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-newsletter" /> | ||
| </property> | ||
| </properties> | ||
| </rule> | ||
| <rule ref="Jetpack.Functions.I18n"> | ||
| <properties> | ||
| <property name="text_domain" value="jetpack-newsletter" /> | ||
| </properties> | ||
| </rule> | ||
|
|
||
| <rule ref="WordPress.Utils.I18nTextDomainFixer"> | ||
| <properties> | ||
| <property name="old_text_domain" type="array" /> | ||
| <property name="new_text_domain" value="jetpack-newsletter" /> | ||
| </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,7 @@ | ||
| # 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,15 @@ | ||
| # Jetpack Newsletter | ||
|
|
||
| This package will hold the implementation for Jetpack's newsletter functionality - dashboard, blocks and more. | ||
|
|
||
| ## Using this package in your WordPress plugin | ||
|
|
||
| If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well. | ||
|
|
||
| ## Security | ||
|
|
||
| Need to report a security vulnerability? Go to [https://automattic.com/security/](https://automattic.com/security/) or directly to our security bug bounty site [https://hackerone.com/automattic](https://hackerone.com/automattic). | ||
|
|
||
| ## License | ||
|
|
||
| Jetpack Newsletter is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt) |
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: patch | ||
| Type: added | ||
|
|
||
| Initial version. |
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 @@ | ||
| { | ||
| "name": "automattic/jetpack-newsletter", | ||
| "description": "Jetpack Newsletter functionality", | ||
| "type": "jetpack-library", | ||
| "license": "GPL-2.0-or-later", | ||
| "require": { | ||
| "php": ">=7.2", | ||
| "automattic/jetpack-admin-ui": "@dev", | ||
| "automattic/jetpack-assets": "@dev", | ||
| "automattic/jetpack-status": "@dev" | ||
| }, | ||
| "require-dev": { | ||
| "yoast/phpunit-polyfills": "^4.0.0", | ||
| "automattic/jetpack-changelogger": "@dev", | ||
| "automattic/phpunit-select-config": "@dev" | ||
| }, | ||
| "autoload": { | ||
| "classmap": [ | ||
| "src/" | ||
| ] | ||
| }, | ||
| "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" | ||
| ], | ||
| "test-coverage": "pnpm concurrently --names php,js 'php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"' 'pnpm:test-coverage'", | ||
| "test-php": [ | ||
| "@composer phpunit" | ||
| ], | ||
| "typecheck": "pnpm run typecheck" | ||
| }, | ||
| "repositories": [ | ||
| { | ||
| "type": "path", | ||
| "url": "../../packages/*", | ||
| "options": { | ||
| "monorepo": true | ||
| } | ||
| } | ||
| ], | ||
| "minimum-stability": "dev", | ||
| "prefer-stable": true, | ||
| "extra": { | ||
| "autorelease": true, | ||
| "autotagger": true, | ||
| "mirror-repo": "Automattic/jetpack-newsletter", | ||
| "branch-alias": { | ||
| "dev-trunk": "0.1.x-dev" | ||
| }, | ||
| "textdomain": "jetpack-newsletter", | ||
| "version-constants": { | ||
| "::PACKAGE_VERSION": "src/class-settings.php" | ||
| }, | ||
| "changelogger": { | ||
| "link-template": "https://github.com/Automattic/jetpack-newsletter/compare/v${old}...v${new}" | ||
| } | ||
dsas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| "suggest": { | ||
| "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." | ||
| } | ||
| } | ||
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,60 @@ | ||
| { | ||
| "name": "@automattic/jetpack-newsletter", | ||
| "version": "0.1.0-alpha", | ||
| "private": true, | ||
| "description": "Jetpack Newsletter functionality", | ||
| "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/newsletter/#readme", | ||
| "bugs": { | ||
| "url": "https://github.com/Automattic/jetpack/labels/[Package] Newsletter" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Automattic/jetpack.git", | ||
| "directory": "projects/packages/newsletter" | ||
| }, | ||
| "license": "GPL-2.0-or-later", | ||
| "author": "Automattic", | ||
| "type": "module", | ||
| "scripts": { | ||
| "build": "pnpm run clean && pnpm run build-client", | ||
| "build-client": "pnpm webpack --config webpack.config.js", | ||
| "build-js": "webpack --config webpack.config.js", | ||
| "build-production": "pnpm run clean && pnpm run build-production-js && pnpm run validate", | ||
| "build-production-js": "NODE_ENV=production BABEL_ENV=production pnpm run build-js", | ||
| "clean": "rm -rf build/", | ||
| "test": "jest --config=tests/jest.config.js --passWithNoTests", | ||
| "test-coverage": "pnpm run test --coverage", | ||
| "typecheck": "tsc --noEmit", | ||
| "validate": "pnpm exec validate-es build/", | ||
| "watch": "pnpm run build && pnpm webpack watch" | ||
| }, | ||
| "browserslist": [ | ||
| "extends @wordpress/browserslist-config" | ||
| ], | ||
| "dependencies": { | ||
| "@wordpress/dataviews": "10.2.0", | ||
| "@wordpress/element": "6.35.0", | ||
| "@wordpress/i18n": "6.8.0", | ||
| "debug": "4.4.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@automattic/babel-plugin-replace-textdomain": "workspace:*", | ||
| "@automattic/jetpack-webpack-config": "workspace:*", | ||
| "@babel/core": "7.28.4", | ||
| "@babel/runtime": "7.28.4", | ||
| "@types/react": "18.3.26", | ||
| "@types/react-dom": "18.3.7", | ||
| "@wordpress/browserslist-config": "6.35.0", | ||
| "concurrently": "9.2.1", | ||
| "jest": "30.2.0", | ||
| "sass-embedded": "1.87.0", | ||
| "sass-loader": "16.0.5", | ||
| "typescript": "5.9.3", | ||
| "webpack": "5.101.3", | ||
| "webpack-cli": "6.0.1" | ||
| }, | ||
| "optionalDependencies": { | ||
| "react": "18.3.1", | ||
| "react-dom": "18.3.1" | ||
| } | ||
| } |
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="false" | ||
| 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 @@ | ||
| phpunit.11.xml.dist |
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 @@ | ||
| phpunit.9.xml.dist |
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> |
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.
Uh oh!
There was an error while loading. Please reload this page.