Skip to content
Open
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
68 changes: 68 additions & 0 deletions pnpm-lock.yaml

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

9 changes: 9 additions & 0 deletions projects/packages/newsletter/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
["@babel/preset-env", {
"targets": {
"node": "current"
}
}]
]
}
20 changes: 20 additions & 0 deletions projects/packages/newsletter/.gitattributes
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
4 changes: 4 additions & 0 deletions projects/packages/newsletter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/
node_modules/
.cache/
build/
17 changes: 17 additions & 0 deletions projects/packages/newsletter/.phan/baseline.php
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)
];
13 changes: 13 additions & 0 deletions projects/packages/newsletter/.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-newsletter
*/

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

return make_phan_config( dirname( __DIR__ ) );
24 changes: 24 additions & 0 deletions projects/packages/newsletter/.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-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>
7 changes: 7 additions & 0 deletions projects/packages/newsletter/CHANGELOG.md
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).

15 changes: 15 additions & 0 deletions projects/packages/newsletter/README.md
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.
4 changes: 4 additions & 0 deletions projects/packages/newsletter/changelog/initial-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Initial version.
67 changes: 67 additions & 0 deletions projects/packages/newsletter/composer.json
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}"
}
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
}
}
60 changes: 60 additions & 0 deletions projects/packages/newsletter/package.json
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"
}
}
36 changes: 36 additions & 0 deletions projects/packages/newsletter/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="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>
1 change: 1 addition & 0 deletions projects/packages/newsletter/phpunit.12.xml.dist
1 change: 1 addition & 0 deletions projects/packages/newsletter/phpunit.8.xml.dist
17 changes: 17 additions & 0 deletions projects/packages/newsletter/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>
Loading
Loading