Skip to content
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

Packages: Add Account Protection #40923

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
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
17 changes: 17 additions & 0 deletions projects/packages/account-protection/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.
# /src/js/example.min.js 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
phpunit.xml.dist production-exclude
.phpcs.dir.xml production-exclude
tests/** production-exclude
.phpcsignore production-exclude
2 changes: 2 additions & 0 deletions projects/packages/account-protection/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
node_modules/
12 changes: 12 additions & 0 deletions projects/packages/account-protection/.phan/baseline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

Check failure on line 1 in projects/packages/account-protection/.phan/baseline.php

View workflow job for this annotation

GitHub Actions / Static analysis

This Phan baseline is now empty (good job!). You may remove it, or if you want to keep it (e.g. if you expect new unfixed issues to be added in the future) you can run `jetpack phan --update-baseline packages/account-protection` to update it.
/**
* This is an automatically generated baseline for Phan issues.
*
* Use `jetpack phan --update-baseline` to update this file.
*/
return [
// 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/account-protection/.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-account-protection
*/

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

return make_phan_config( dirname( __DIR__ ) );
24 changes: 24 additions & 0 deletions projects/packages/account-protection/.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-account-protection" />
</property>
</properties>
</rule>
<rule ref="Jetpack.Functions.I18n">
<properties>
<property name="text_domain" value="jetpack-account-protection" />
</properties>
</rule>

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

</ruleset>
7 changes: 7 additions & 0 deletions projects/packages/account-protection/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).

24 changes: 24 additions & 0 deletions projects/packages/account-protection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# account-protection

Account protection

## How to install account-protection

### Installation From Git Repo

## Contribute

## Get Help

## 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

account-protection is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

Empty file.
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/account-protection/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "automattic/jetpack-account-protection",
"description": "Account protection",
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-changelogger": "@dev",
"automattic/wordbless": "dev-master"
},
"autoload": {
"classmap": [
"src/"
]
},
"scripts": {
"build-development": "echo 'Add your build step to composer.json, please!'",
"build-production": "echo 'Add your build step to composer.json, please!'",
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --colors=always"
],
"post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy",
"post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy",
"test-coverage": [
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\""
],
"test-php": [
"@composer phpunit"
]
},
"repositories": [
{
"type": "path",
"url": "../../packages/*",
"options": {
"monorepo": true
}
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"roots/wordpress-core-installer": true
}
},
"extra": {
"autotagger": true,
"branch-alias": {
"dev-trunk": "0.1.x-dev"
},
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-account-protection/compare/v${old}...v${new}"
},
"mirror-repo": "Automattic/jetpack-account-protection",
"textdomain": "jetpack-account-protection",
"version-constants": {
"::PACKAGE_VERSION": "src/class-account-protection.php"
}
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
}
}
25 changes: 25 additions & 0 deletions projects/packages/account-protection/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"private": true,
"name": "@automattic/jetpack-account-protection",
"version": "0.1.0-alpha",
"description": "Account protection",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/account-protection/#readme",
"bugs": {
"url": "https://github.com/Automattic/jetpack/labels/[Package] Account Protection"
},
"repository": {
"type": "git",
"url": "https://github.com/Automattic/jetpack.git",
"directory": "projects/packages/account-protection"
},
"license": "GPL-2.0-or-later",
"author": "Automattic",
"scripts": {
"build": "echo 'Not implemented.'",
"build-js": "echo 'Not implemented.'",
"build-production": "echo 'Not implemented.'",
"build-production-js": "echo 'Not implemented.'",
"clean": "true"
},
"devDependencies": {}
}
14 changes: 14 additions & 0 deletions projects/packages/account-protection/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<phpunit bootstrap="tests/php/bootstrap.php" backupGlobals="false" colors="true" convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="main">
<directory prefix="test" suffix=".php">tests/php</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="false">
<!-- 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>
</whitelist>
</filter>
</phpunit>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Package description here
*
* @package automattic/jetpack-account-protection
*/

namespace Automattic\Jetpack;

/**
* Class description.
*/
class Account_Protection {

const PACKAGE_VERSION = '1.0.0-alpha';

Check failure on line 15 in projects/packages/account-protection/src/class-account-protection.php

View workflow job for this annotation

GitHub Actions / Changelogger validity

Version mismatch, expected 0.1.0-alpha but found 1.0.0-alpha! Before you can merge your PR, please run `tools/fixup-project-versions.sh`, commit, and push the generated changes to your branch to fix this.
}
4 changes: 4 additions & 0 deletions projects/packages/account-protection/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>
11 changes: 11 additions & 0 deletions projects/packages/account-protection/tests/php/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Bootstrap.
*
* @package automattic/
*/

/**
* Include the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';
Loading